Branch Coverage

blib/lib/Net/Whois/IANA.pm
Criterion Covered Total %
branch 100 160 62.5


line true false branch
46 0 26 unless ref $self
47 0 26 unless $self->{'QUERY'}
71 17 2 if ref $host
88 19 0 if eval { do { $sock = "IO::Socket::INET"->new("PeerAddr", $host, "PeerPort", $port, "Timeout", $timeout); 1 } }
99 0 0 unless $iter == $retries
119 0 0 if $ip =~ /^:[^:]/ or $ip =~ /[^:]:$/
124 0 0 if $seg[0] eq ""
125 0 0 if $seg[-1] eq ""
128 0 0 if ($seg[-1] =~ tr/.//)
129 0 0 unless &is_valid_ipv4(pop @seg)
135 0 0 if ($seg eq "")
138 0 0 if $cmp
142 0 0 if $seg =~ /[^0-9a-fA-F]/
143 0 0 if length $seg == 0 or length $seg > 4
145 0 0 if ($cmp)
159 1 22 unless defined $ip
160 0 22 index($ip, ':') != -1 ? :
168 2 14 unless $source
169 2 14 unless $source
170 14 0 unless (ref $source)
171 13 1 if ($IANA{$source})
179 0 0 if ref $_ and ref $_ eq "ARRAY" and @{$_;} and ref $_->[0] and ref $_->[0] eq "ARRAY" and @{$_->[0];}
0 0 unless ref $source eq "HASH" and scalar grep({$_->[0][0] if ref $_ and ref $_ eq "ARRAY" and @{$_;} and ref $_->[0] and ref $_->[0] eq "ARRAY" and @{$_->[0];};} values %{$source;} == scalar keys %{$source;})
189 3 16 unless (&is_valid_ip($param{'-ip'}))
201 1 15 if ($set_source == 1) { }
0 15 elsif ($set_source == 2) { }
226 17 0 if (my $sock = &whois_connect($server_ref))
228 17 0 $query_code && ref $query_code eq 'CODE' ? :
241 264 0 if defined $query{$qkey}
243 2 262 if $qkey =~ /abuse/i and $query{$qkey} =~ /\@/
245 12 2 unless ($query{'abuse'})
246 9 3 if ($query{'fullinfo'} and $query{'fullinfo'} =~ /(\S*abuse\S*\@\S+)/m) { }
1 2 elsif ($query{'email'} or $query{'e-mail'} or $query{'orgtechemail'}) { }
254 2 12 unless (ref $query{'cidr'})
255 0 2 if (defined $query{'cidr'} and $query{'cidr'} =~ /\,/) { }
273 0 64 if $params{'-debug'}
278 3 14 unless keys %query
280 0 14 if ($query{'permission'} and $query{'permission'} eq "denied")
303 0 171 if /ERROR:201/
304 83 88 if /^(\%|\#)/ or not /\:/
308 28 60 $query{lc $field} ? :
318 0 4 if (defined $query{'remarks'} and $query{'remarks'} =~ /The country is really world wide/ or defined $query{'netname'} and $query{'netname'} =~ /IANA-BLK/ or defined $query{'netname'} and $query{'netname'} =~ /AFRINIC-NET-TRANSFERRED/ or defined $query{'country'} and $query{'country'} =~ /world wide/) { }
0 4 elsif (not $query{'inet6num'} || $query{'inetnum'}) { }
343 0 4 unless defined $query{'country'}
356 0 190 if /^\%201/
357 32 158 if (/^\%/)
362 0 32 if (/^\%.*0\.0\.0\.0\s+/)
369 0 158 if $skip_block
370 42 116 unless /\:/
374 6 110 if ($field =~ /^inet6?num$/)
375 0 6 if $value =~ /0\.0\.0\.0\s+/
381 1 115 if $lc_field eq "country" and defined $query{$lc_field}
382 30 85 $query{$lc_field} ? :
386 3 14 unless defined $query{$_}
394 0 3 if (defined $query{'remarks'} and $query{'remarks'} =~ /address range is not administered by APNIC|This network in not allocated/ or defined $query{'descr'} and $query{'descr'} =~ /not allocated to|by APNIC|placeholder reference/i) { }
0 3 elsif (not $query{'inet6num'} || $query{'inetnum'}) { }
428 0 271 if /^\#201/
429 0 271 if /no match found for/i
430 118 153 if /^\#/ or not /\:/
434 3 150 if ($field eq "OrgName" or $field eq "CustName")
440 39 114 $query{lc $field} ? :
444 0 3 if defined $query{'custname'}
447 25 14 unless defined $query{$_}
457 1 2 if $query{'orgid'} and $query{'orgid'} =~ /^\s*RIPE|LACNIC|APNIC|AFRINIC\s*$/
465 1 1 if (defined $query{'cidr'} and $query{'cidr'} =~ /\,/) { }
492 0 170 if /^\%201/ or /^\% Query rate limit exceeded/ or /^\% Not assigned to LACNIC/ or /\% Permission denied/
495 2 168 if (/^\% (\S+) resource:/)
497 0 2 unless $srv =~ /lacnic|brazil/i
499 61 109 if /^\%/ or not /\:/
503 4 2 if $field eq "country" and $query{'country'}
504 46 59 $query{lc $field} ? :
517 3 0 if ($query{'inetnum'})
521 1 2 unless ($query{'country'})
522 0 1 if ($query{'nserver'} and $query{'nserver'} =~ /\.(\w\w)$/) { }
0 1 elsif ($query{'descr'} and $query{'descr'} =~ /\s(\w\w)$/) { }
550 0 2 if defined $query{'remarks'} and $query{'remarks'} =~ /country is really worldwide/ or defined $query{'descr'} and $query{'descr'} =~ /Here for in-addr\.arpa authentication/
552 0 2 unless ($query{'inet6num'} or $query{'inetnum'})
573 0 4 unless &is_valid_ip($ip)
574 2 2 unless (scalar @cidr)
576 2 0 if ref $out