Condition Coverage

blib/lib/NetAddr/IP/Lite.pm
Criterion Covered Total %
condition 56 224 25.0


and 3 conditions

line !l l&&!r l&&r condition
178 0 0 0 $pkg =~ /^$other/o and exists do { $other }->{$func}
253 0 0 3 UNIVERSAL::isa($_[0], 'NetAddr::IP::Lite') and UNIVERSAL::isa($_[1], 'NetAddr::IP::Lite')
258 0 0 0 UNIVERSAL::isa($_[0], 'NetAddr::IP::Lite') and UNIVERSAL::isa($_[1], 'NetAddr::IP::Lite')
388 1 0 23 $const and $const < 2147483648
1 0 23 $const and $const < 2147483648 and $const > -2147483649
732 0 0 0 $in[1] and $in[1] =~ /^(.+)\s+(.+)$/
741 0 0 0 $in[1] and $in[1] =~ /^(.+)\s+(.+)$/
766 0 7435 0 $ip and $noctal
7435 0 0 $ip and $noctal and not $ip =~ m[(?:[^\s0123456789/. -])]
771 0 7435 0 defined $ip and $ip eq ''
774 7435 0 0 ref $ip and ref $ip eq 'Math::BigInt'
840 7394 32 0 not $ip =~ /\D/ and length $ip > 3 || $ip > 255
32 0 0 not $ip =~ /\D/ and length $ip > 3 || $ip > 255 and $try = &bcd2bin($ip)
32 0 0 not $ip =~ /\D/ and length $ip > 3 || $ip > 255 and $try = &bcd2bin($ip) and not isIPv4($try)
7040 3 383 index($ip, ':') >= 0 and $try = ipv6_aton($ip)
849 7426 0 0 ref $mask and ref $mask eq 'Math::BigInt'
857 0 0 6399 length $mask < 4 && $mask < 129
858 0 0 6230 $isCIDR and $mask < 33
861 169 0 0 $ip =~ /^(\d+)(?:|\.(\d+)(?:|\.(\d+)(?:|\.(\d+))))$/ and do { $dq1 = $1; $dq2 = $2 || 0; $dq3 = $3 || 0; $dq4 = $4 || 0; 1 }
0 0 0 $ip =~ /^(\d+)(?:|\.(\d+)(?:|\.(\d+)(?:|\.(\d+))))$/ and do { $dq1 = $1; $dq2 = $2 || 0; $dq3 = $3 || 0; $dq4 = $4 || 0; 1 } and $dq1 >= 0
0 0 0 $ip =~ /^(\d+)(?:|\.(\d+)(?:|\.(\d+)(?:|\.(\d+))))$/ and do { $dq1 = $1; $dq2 = $2 || 0; $dq3 = $3 || 0; $dq4 = $4 || 0; 1 } and $dq1 >= 0 and $dq1 < 256
0 0 0 $ip =~ /^(\d+)(?:|\.(\d+)(?:|\.(\d+)(?:|\.(\d+))))$/ and do { $dq1 = $1; $dq2 = $2 || 0; $dq3 = $3 || 0; $dq4 = $4 || 0; 1 } and $dq1 >= 0 and $dq1 < 256 and $dq2 >= 0
0 0 0 $ip =~ /^(\d+)(?:|\.(\d+)(?:|\.(\d+)(?:|\.(\d+))))$/ and do { $dq1 = $1; $dq2 = $2 || 0; $dq3 = $3 || 0; $dq4 = $4 || 0; 1 } and $dq1 >= 0 and $dq1 < 256 and $dq2 >= 0 and $dq2 < 256
0 0 0 $ip =~ /^(\d+)(?:|\.(\d+)(?:|\.(\d+)(?:|\.(\d+))))$/ and do { $dq1 = $1; $dq2 = $2 || 0; $dq3 = $3 || 0; $dq4 = $4 || 0; 1 } and $dq1 >= 0 and $dq1 < 256 and $dq2 >= 0 and $dq2 < 256 and $dq3 >= 0
0 0 0 $ip =~ /^(\d+)(?:|\.(\d+)(?:|\.(\d+)(?:|\.(\d+))))$/ and do { $dq1 = $1; $dq2 = $2 || 0; $dq3 = $3 || 0; $dq4 = $4 || 0; 1 } and $dq1 >= 0 and $dq1 < 256 and $dq2 >= 0 and $dq2 < 256 and $dq3 >= 0 and $dq3 < 256
0 0 0 $ip =~ /^(\d+)(?:|\.(\d+)(?:|\.(\d+)(?:|\.(\d+))))$/ and do { $dq1 = $1; $dq2 = $2 || 0; $dq3 = $3 || 0; $dq4 = $4 || 0; 1 } and $dq1 >= 0 and $dq1 < 256 and $dq2 >= 0 and $dq2 < 256 and $dq3 >= 0 and $dq3 < 256 and $dq4 >= 0
0 0 0 $ip =~ /^(\d+)(?:|\.(\d+)(?:|\.(\d+)(?:|\.(\d+))))$/ and do { $dq1 = $1; $dq2 = $2 || 0; $dq3 = $3 || 0; $dq4 = $4 || 0; 1 } and $dq1 >= 0 and $dq1 < 256 and $dq2 >= 0 and $dq2 < 256 and $dq3 >= 0 and $dq3 < 256 and $dq4 >= 0 and $dq4 < 256
919 214 0 800 index($ip, ':') < 0 and not $isV6
931 12 0 32 $ip =~ /^(\d+)$/ and $hasmask
12 0 32 $ip =~ /^(\d+)$/ and $hasmask and $1 >= 0
0 0 32 $ip =~ /^(\d+)$/ and $hasmask and $1 >= 0 and $1 < 256
12 0 0 $ip =~ /^0[xb]\d+$/ and $hasmask
12 0 0 $ip =~ /^0[xb]\d+$/ and $hasmask and ($tmp = eval "$ip") || 1
0 0 0 $ip =~ /^0[xb]\d+$/ and $hasmask and ($tmp = eval "$ip") || 1 and $tmp >= 0
0 0 0 $ip =~ /^0[xb]\d+$/ and $hasmask and ($tmp = eval "$ip") || 1 and $tmp >= 0 and $tmp < 256
11 0 0 $ip =~ /^(\d+)\.(\d+)-(\d+)\.?$/ and $2 <= $3
11 0 0 $ip =~ /^(\d+)\.(\d+)-(\d+)\.?$/ and $2 <= $3 and $3 < 256
0 0 4 $1 <= $2 and $2 < 256
7 4 0 $ip =~ /^(\d+)-(\d+)\.?$/ and ($1 <= $2 and $2 < 256)
5 0 1 $ip =~ /^(\d+)\.(\d+)\.(\d+)-(\d+)\.?$/ and $3 <= $4
5 0 1 $ip =~ /^(\d+)\.(\d+)\.(\d+)-(\d+)\.?$/ and $3 <= $4 and $4 < 256
4 0 0 $ip =~ /^(\d+)\.(\d+)\.(\d+)\.(\d+)-(\d+)$/ and $4 <= $5
4 0 0 $ip =~ /^(\d+)\.(\d+)\.(\d+)\.(\d+)-(\d+)$/ and $4 <= $5 and $5 < 256
0 0 4 not $NetAddr::IP::Lite::NoFQDN || $ip =~ /[^a-zA-Z0-9\._-]/ and $tmp = gethostbyname fillIPv4($ip)
0 0 4 not $NetAddr::IP::Lite::NoFQDN || $ip =~ /[^a-zA-Z0-9\._-]/ and $tmp = gethostbyname fillIPv4($ip) and $tmp ne $_v4zero
0 0 4 not $NetAddr::IP::Lite::NoFQDN || $ip =~ /[^a-zA-Z0-9\._-]/ and $tmp = gethostbyname fillIPv4($ip) and $tmp ne $_v4zero and $tmp ne $_zero
0 0 0 not $NetAddr::IP::Lite::NoFQDN || $ip =~ /[^a-zA-Z0-9\._-]/ and havegethostbyname2()
0 0 0 not $NetAddr::IP::Lite::NoFQDN || $ip =~ /[^a-zA-Z0-9\._-]/ and havegethostbyname2() and $tmp = naip_gethostbyname($ip)
0 0 0 $NetAddr::IP::Lite::Accept_Binary_IP and not $hasmask
1059 0 0 0 grep(($ip eq $_), ('default', 'any', 'loopback', 'unspecified')) and defined($ip = $fip6{$ip})
1223 0 0 0 not $_[0]{'isv6'} and isIPv4($_[0]{'addr'})
1234 0 0 0 !$_[0]{'isv6'} && isIPv4($_[0]{'addr'})
1310 0 0 0 not $_[0]{'isv6'} and isIPv4($_[0]{'addr'})
1330 0 0 0 not $_[0]{'isv6'} and isIPv4($_[0]{'addr'})
1369 66924 172104 54288 &sub128($netme, $neto) && &sub128($brdo, $brdme)
1398 0 0 0 &sub128($netme, $ip_10n) and &sub128($ip_10b, $brdme)
1399 0 0 0 &sub128($netme, $ip_192n) and &sub128($ip_192b, $brdme)
1400 0 0 0 &sub128($netme, $ip_172n) && &sub128($ip_172b, $brdme)
1509 0 0 0 $slash31 and $count != 1
1513 0 0 0 $count and $count != 1

or 2 conditions

line l !l condition
494 150298 0 ref $proto || die('reference required')
706 0 0 ref $proto || $proto || 'NetAddr::IP::Lite'
763 7435 0 ref $proto || $proto || 'NetAddr::IP::Lite'
863 0 0 $2 || 0
864 0 0 $3 || 0
865 0 0 $4 || 0
931 0 0 ($tmp = eval "$ip") || 1

or 3 conditions

line l !l&&r !l&&!r condition
787 5874 0 1023 $ip =~ m[^([a-z0-9.:-]+)(?:/|\s+)([a-z0-9.:-]+)$] or $ip =~ m(^[\[]{1}([a-z0-9.:-]+)(?:/|\s+)([a-z0-9.:-]+)[\]]{1}$)
810 0 0 538 $_[0] =~ /ipv6/i or $isV6
840 0 0 32 length $ip > 3 || $ip > 255
0 0 7426 not $ip =~ /\D/ and length $ip > 3 || $ip > 255 and $try = &bcd2bin($ip) and not isIPv4($try) or index($ip, ':') >= 0 and $try = ipv6_aton($ip)
931 0 0 4 $NetAddr::IP::Lite::NoFQDN || $ip =~ /[^a-zA-Z0-9\._-]/
0 0 0 $NetAddr::IP::Lite::NoFQDN || $ip =~ /[^a-zA-Z0-9\._-]/
1510 0 0 0 $count < 1 or $count > $self->num
1516 0 0 0 $count < 1 or $count > $self->num
1560 0 0 2304 $net[0] or $net[1]
0 0 2304 $net[0] or $net[1] or $net[2]