Branch Coverage

blib/lib/Data/Validate/IP.pm
Criterion Covered Total %
branch 343 382 89.7


line true false branch
44 1 1 if ($HAS_SOCKET) { }
65 7 7 if ref $_[0]
68 0 14 unless defined $value
69 10 4 $value =~ /:/ ? :
73 14 32 if ref $_[0]
76 23 23 unless _fast_is_ipv4_packed($value)
86 0 796 unless defined $value
87 18 778 if $value =~ /\0/
92 7 7 if ref $_[0]
99 14 792 if ref $_[0]
102 0 806 unless defined $value
105 319 487 unless @octets == 4
107 18 1786 if $_ < 0 or $_ > 255
108 36 1750 if $_ =~ /^0\d{1,2}$/
115 28 38 if ref $_[0]
118 30 36 unless _fast_is_ipv6_packed($value)
128 0 1392 unless defined $value
129 26 1366 if $value =~ /\0/
130 24 1342 if $value =~ /0[[:xdigit:]]{4}/
141 28 1366 if ref $_[0]
144 0 1394 unless defined $value
146 2 1392 if $value eq '::'
147 368 1024 unless $value =~ /^$ipv6_re$/
162 0 28 if ref $_[0]
166 0 28 unless defined $value
169 2 26 unless defined $ip
173 10 16 if ($network eq 'default' or $network =~ /^$ip_re$/ or $network =~ m[^$ip_re/\d\d?$]) { }
16 0 elsif (not &blessed($network) && $network->isa('NetAddr::IP')) { }
177 0 10 unless $network = 'NetAddr::IP'->new($network)
181 4 12 if ($network =~ /^($ip_re)[:\-]($ip_re)$/) { }
2 10 elsif ($network =~ /^($ip_re)\#($ip_re)$/) { }
4 6 elsif ($network =~ m[^($partial_ip_re)/(\d\d?)$]) { }
6 0 elsif ($network =~ /^$partial_ip_re$/) { }
184 0 4 unless my $bits = _netmask_to_bits($netmask)
192 0 2 unless my $bits = _hostmask_to_bits($hostmask)
214 6 0 if ($octets < 4)
220 16 0 if ($orig ne $network)
226 0 16 unless $network = 'NetAddr::IP'->new($network)
229 0 26 unless my $netaddr_ip = 'NetAddr::IP'->new($ip)
231 24 2 if $network->contains($netaddr_ip)
329 14 2 if $warned_at{$warning}{$caller_info}++
412 1 1 $ip_number == 4 ? :
413 1 1 $ip_number == 4 ? :
423 3 14 ref $networks->{$type}{'networks'} ? :
428 15 2 unless ($networks->{$type}{'subnet_of'})
435 75 75 if ref $_[0]
0 150 unless defined $value
40 110 unless defined $ip
16 94 if $net->contains($netaddr_ip)
49 49 if ref $_[0]
0 98 unless defined $value
24 74 unless defined $ip
6 68 if $net->contains($netaddr_ip)
75 75 if ref $_[0]
0 150 unless defined $value
40 110 unless defined $ip
4 106 if $net->contains($netaddr_ip)
49 49 if ref $_[0]
0 98 unless defined $value
24 74 unless defined $ip
6 68 if $net->contains($netaddr_ip)
57 57 if ref $_[0]
0 114 unless defined $value
56 58 unless defined $ip
12 150 if $net->contains($netaddr_ip)
49 49 if ref $_[0]
0 98 unless defined $value
24 74 unless defined $ip
6 68 if $net->contains($netaddr_ip)
49 49 if ref $_[0]
0 98 unless defined $value
24 74 unless defined $ip
8 66 if $net->contains($netaddr_ip)
30 30 if ref $_[0]
0 60 unless defined $value
20 40 unless defined $ip
6 108 if $net->contains($netaddr_ip)
49 49 if ref $_[0]
0 98 unless defined $value
24 74 unless defined $ip
18 56 if $net->contains($netaddr_ip)
47 47 if ref $_[0]
0 94 unless defined $value
24 70 unless defined $ip
6 64 if $net->contains($netaddr_ip)
30 30 if ref $_[0]
0 60 unless defined $value
20 40 unless defined $ip
2 38 if $net->contains($netaddr_ip)
57 57 if ref $_[0]
0 114 unless defined $value
56 58 unless defined $ip
4 54 if $net->contains($netaddr_ip)
30 30 if ref $_[0]
0 60 unless defined $value
20 40 unless defined $ip
14 166 if $net->contains($netaddr_ip)
75 75 if ref $_[0]
0 150 unless defined $value
40 110 unless defined $ip
12 98 if $net->contains($netaddr_ip)
73 73 if ref $_[0]
0 146 unless defined $value
36 110 unless defined $ip
16 94 if $net->contains($netaddr_ip)
57 57 if ref $_[0]
0 114 unless defined $value
56 58 unless defined $ip
4 54 if $net->contains($netaddr_ip)
57 57 if ref $_[0]
0 114 unless defined $value
56 58 unless defined $ip
4 54 if $net->contains($netaddr_ip)
452 0 17 if $@
462 73 73 if ref $_[0]
0 146 unless defined $value
36 110 unless defined $ip
86 458 if $net->contains($netaddr_ip)
57 57 if ref $_[0]
0 114 unless defined $value
56 58 unless defined $ip
46 536 if $net->contains($netaddr_ip)
480 0 2 if $@
494 1 1 $ip_number == 4 ? :
504 3 14 ref $networks->{$type}{'networks'} ? :
509 15 2 unless ($networks->{$type}{'subnet_of'})
516 57 57 if ref $_[0]
56 58 unless defined $ip
12 150 if (($net->[1] & $ip) eq $net->[0])
73 73 if ref $_[0]
36 110 unless defined $ip
16 94 if (($net->[1] & $ip) eq $net->[0])
30 30 if ref $_[0]
20 40 unless defined $ip
2 38 if (($net->[1] & $ip) eq $net->[0])
49 49 if ref $_[0]
24 74 unless defined $ip
6 68 if (($net->[1] & $ip) eq $net->[0])
49 49 if ref $_[0]
24 74 unless defined $ip
6 68 if (($net->[1] & $ip) eq $net->[0])
30 30 if ref $_[0]
20 40 unless defined $ip
14 166 if (($net->[1] & $ip) eq $net->[0])
57 57 if ref $_[0]
56 58 unless defined $ip
4 54 if (($net->[1] & $ip) eq $net->[0])
57 57 if ref $_[0]
56 58 unless defined $ip
4 54 if (($net->[1] & $ip) eq $net->[0])
75 75 if ref $_[0]
40 110 unless defined $ip
16 94 if (($net->[1] & $ip) eq $net->[0])
49 49 if ref $_[0]
24 74 unless defined $ip
6 68 if (($net->[1] & $ip) eq $net->[0])
49 49 if ref $_[0]
24 74 unless defined $ip
8 66 if (($net->[1] & $ip) eq $net->[0])
49 49 if ref $_[0]
24 74 unless defined $ip
18 56 if (($net->[1] & $ip) eq $net->[0])
47 47 if ref $_[0]
24 70 unless defined $ip
6 64 if (($net->[1] & $ip) eq $net->[0])
75 75 if ref $_[0]
40 110 unless defined $ip
4 106 if (($net->[1] & $ip) eq $net->[0])
75 75 if ref $_[0]
40 110 unless defined $ip
12 98 if (($net->[1] & $ip) eq $net->[0])
57 57 if ref $_[0]
56 58 unless defined $ip
4 54 if (($net->[1] & $ip) eq $net->[0])
30 30 if ref $_[0]
20 40 unless defined $ip
6 108 if (($net->[1] & $ip) eq $net->[0])
534 0 17 if $@
544 73 73 if ref $_[0]
36 110 unless defined $ip
86 536 if ($net->[1] & $ip) eq $net->[0]
57 57 if ref $_[0]
56 58 unless defined $ip
46 466 if ($net->[1] & $ip) eq $net->[0]
561 0 2 if $@
587 15 10 $family == 2 ? :
599 104 4 unless is_loopback_ipv4(@_)
100 8 unless is_public_ipv4(@_)
100 8 unless is_multicast_ipv4(@_)
96 12 unless is_private_ipv4(@_)
104 4 unless is_linklocal_ipv4(@_)