Branch Coverage

blib/lib/Net/Whois/IP.pm
Criterion Covered Total %
branch 37 134 27.6


line true false branch
185 1 0 unless ($ip =~ /\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/ or $ip =~ /^$Net::Whois::IP::IPv6_re$/)
188 17 1 unless (defined $reg)
199 1 17 wantarray ? :
206 0 0 $state ? :
229 0 27 unless exists $whois_servers{$registrar}
245 12 15 if ($new_ip ne $ip or $new_registrar ne $registrar) { }
259 0 15 if ($raw_flag and $raw_flag ne "")
263 15 0 if (%{$whois_response_hash;}) { }
267 0 401 if (not defined $value) { }
0 401 elsif (ref $value eq 'ARRAY') { }
401 0 elsif (not ref $value) { }
272 0 0 unless defined $item and $item =~ /\S/
273 0 0 defined $item ? :
289 0 15 if (@arin_summary_records)
319 0 0 unless defined $rec->{$src_key}
326 0 0 if (defined $rec->{'start'} and defined $rec->{'end'})
358 0 27 if ($#response < 0) { }
360 0 0 if ($i <= 3) { }
374 1383 610 if ($line =~ /^([^:]+):\s*(.*)$/)
377 0 1383 if ($multiple_flag and $multiple_flag ne '') { }
400 0 0 if (ref $search_options eq "ARRAY" and defined $search_options->[0] and $search_options->[0] ne "")
408 0 1026 if (/Contact information can be found in the (\S+)\s+database/) { }
27 999 elsif (/OrgID:\s+(\S+)/i || /source:\s+(\S+)/i and not defined $hash_response->{$pattern1}) { }
15 984 elsif (/Parent:\s+(\S+)/) { }
0 984 elsif ($registrar eq 'ARIN' and /.+\((.+)\).+$/ and not $_ =~ /.+\:.+/) { }
415 21 6 if (exists $whois_servers{$val})
422 0 15 if ($1 ne "" and not defined $hash_response->{$pattern1} and not defined $hash_response->{$pattern2})
432 0 0 if (/^(.+?)\s+(\S+)\s+\((NET-[^)]+)\)\s+ (\d+\.\d+\.\d+\.\d+)\s+-\s+ (\d+\.\d+\.\d+\.\d+)\s*$/x)
449 0 0 if ($origIp =~ /! NET-(\d{1,3}\-\d{1,3}\-\d{1,3}\-\d{1,3})/)
451 0 0 if ($ip =~ /! NET-(\d{1,3}\-\d{1,3}\-\d{1,3}\-\d{1,3})/)
453 0 0 if (pack("C4", split(/\-/, $orIP, 0)) ge pack("C4", split(/\-/, $nwIP, 0)))
458 0 0 unless ($ip =~ /\d{1,3}\-\d{1,3}\-\d{1,3}\-\d{1,3}/)
480 0 27 unless ($sock)
488 0 0 unless ($sock)
498 0 0 unless defined $ip
499 0 0 unless $ip =~ /\A(\d+)\.(\d+)\.(\d+)\.(\d+)\z/
505 0 0 if $octet < 0 or $octet > 255
518 0 0 if $start > $end
525 0 0 if ($start == 0 and $end == 4294967295)
532 0 0 $start ? :
555 0 0 if not defined $n or $n <= 0
564 0 0 unless defined $n
565 0 0 if $n < 0 or $n > 4294967295
583 14 13 defined $last ? :
587 3 24 if (not defined $last and $registrar eq $whois_servers{'ARIN'})
591 15 12 if ($wait > 0)
600 674 0 unless $do_debugging
609 0 0 unless ($did_warn)
614 0 0 unless open my $debug_fh, ">>", $outdebug
616 0 0 unless $debug_fh
629 27 0 unless $do_debugging
640 0 0 if $line =~ /^\s*$/
641 0 0 if $line =~ /^#/
642 0 0 if $line =~ /^%/
644 0 0 if ($line =~ /^(NetRange|CIDR|NetName|NetHandle|Parent|OrgName|Country):\s*(.+)$/i)
649 0 0 if ($line =~ /^(.+?)\s+(\S+)\s+\((NET-[^)]+)\)\s+(\d+\.\d+\.\d+\.\d+)\s+-\s+(\d+\.\d+\.\d+\.\d+)\s*$/)
654 0 0 if $line =~ /^(Comment|Remarks|RegDate|Updated|Created|Last-Modified):/i
655 0 0 if $line =~ /^(OrgAbuse|OrgTech|OrgNOC|RTech|RNOC|RAbuse)/i
666 0 0 if (@interesting) { }
673 0 0 if (@unknown) { }
685 15 0 unless $do_debugging
696 0 0 if (ref $response ne "HASH")
697 0 0 defined $response ? :
704 0 0 if (ref $value eq 'ARRAY') { }
0 0 elsif (ref $value) { }
707 0 0 defined $item ? :
712 0 0 defined $value ? :