lib/Mail/Decency/Helper/IP.pm

filter: Statementstmt 88.2% 15 / 17 Branchbran n/a Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 80.0% 4 / 5 Podpod 0.0% 0 / 1 totaltotal 67.8% 19 / 28 CC 2 SCAR 9.8
CC
2
Cov
75%
is_local_host
6.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.7
« lib/Mail/Decency/Helper/Database.pm ↑ Summary lib/Mail/Decency/ContentFilter/Razor.pm »
1 package Mail::Decency::Helper::IP;
2  
3 11 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 11 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 11 ▶use version 0.74; our $VERSION = qv( "v0.1.4" );
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 11 ▶use base qw/ Exporter /;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 11 our @EXPORT_OK = qw/
10 is_local_host
11 /;
12  
13 =head1 NAME
14  
15 Mail::Decency::Helper::IP
16  
17 =head1 DESCRIPTION
18  
19 Helper for everything about ips ..
20  
21 =cut
22  
23 0 ▶sub is_local_host {
Subroutine is_local_host: not called CC=2 SCAR=17.9
Pod undocumented
24 0 my ( $ip ) = @_;
25 0 ▶ return index( $ip, '127.' ) == 0 || $ip eq '::1';
Condition0%0/3
index($ip, '127.') == 0 || $ip eq '::1'
l!l&&r!l&&!r
000
MC/DC0%0/2
index($ip, '127.') == 0 || $ip eq '::1'
index($ip, '127.') == 0 $ip eq '::1'
Truth table0%0/3
A || B
A= index($ip, '127.') == 0B= $ip eq '::1'
ABresult
1X1
011
000
26 }
27  
28 =head1 AUTHOR
29  
30 Ulrich Kautz <uk@fortrabbit.de>
31  
32 =head1 COPYRIGHT
33  
34 Copyright (c) 2010 the L</AUTHOR> as listed above
35  
36 =head1 LICENCSE
37  
38 This library is free software and may be distributed under the same terms as perl itself.
39  
40 =cut
41  
42  
43 11 1;
« lib/Mail/Decency/Helper/Database.pm ↑ Summary lib/Mail/Decency/ContentFilter/Razor.pm »