Branch Coverage

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


line true false branch
174 1 0 unless ($ip =~ /\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/ or $ip =~ /^$Net::Whois::IP::IPv6_re$/)
177 17 1 unless (defined $reg)
188 1 17 wantarray ? :
195 0 0 $state ? :
218 0 27 unless exists $whois_servers{$registrar}
234 12 15 if ($new_ip ne $ip or $new_registrar ne $registrar) { }
248 0 15 if ($raw_flag and $raw_flag ne "")
252 15 0 if (%{$whois_response_hash;}) { }
256 0 387 if (not defined $value) { }
0 387 elsif (ref $value eq 'ARRAY') { }
387 0 elsif (not ref $value) { }
261 0 0 unless defined $item and $item =~ /\S/
262 0 0 defined $item ? :
278 0 15 if (@arin_summary_records)
308 0 0 unless defined $rec->{$src_key}
315 0 0 if (defined $rec->{'start'} and defined $rec->{'end'})
347 0 27 if ($#response < 0) { }
349 0 0 if ($i <= 3) { }
363 1341 652 if ($line =~ /^(.+):\s+(.+)$/)
364 0 1341 if ($multiple_flag and $multiple_flag ne '') { }
387 0 0 if (ref $search_options eq "ARRAY" and defined $search_options->[0] and $search_options->[0] ne "")
395 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 $_ =~ /.+\:.+/) { }
402 21 6 if (exists $whois_servers{$val})
409 0 15 if ($1 ne "" and not defined $hash_response->{$pattern1} and not defined $hash_response->{$pattern2})
419 0 0 if (/^(.+?)\s+(\S+)\s+\((NET-[^)]+)\)\s+ (\d+\.\d+\.\d+\.\d+)\s+-\s+ (\d+\.\d+\.\d+\.\d+)\s*$/x)
436 0 0 if ($origIp =~ /! NET-(\d{1,3}\-\d{1,3}\-\d{1,3}\-\d{1,3})/)
438 0 0 if ($ip =~ /! NET-(\d{1,3}\-\d{1,3}\-\d{1,3}\-\d{1,3})/)
440 0 0 if (pack("C4", split(/\-/, $orIP, 0)) ge pack("C4", split(/\-/, $nwIP, 0)))
445 0 0 unless ($ip =~ /\d{1,3}\-\d{1,3}\-\d{1,3}\-\d{1,3}/)
467 0 27 unless ($sock)
475 0 0 unless ($sock)
485 0 0 unless defined $ip
486 0 0 unless $ip =~ /\A(\d+)\.(\d+)\.(\d+)\.(\d+)\z/
492 0 0 if $octet < 0 or $octet > 255
505 0 0 if $start > $end
512 0 0 if ($start == 0 and $end == 4294967295)
519 0 0 $start ? :
542 0 0 if not defined $n or $n <= 0
551 0 0 unless defined $n
552 0 0 if $n < 0 or $n > 4294967295
570 14 13 defined $last ? :
574 3 24 if (not defined $last and $registrar eq $whois_servers{'ARIN'})
578 15 12 if ($wait > 0)
587 660 0 unless $do_debugging
596 0 0 unless ($did_warn)
601 0 0 unless open my $debug_fh, ">>", $outdebug
603 0 0 unless $debug_fh
616 27 0 unless $do_debugging
627 0 0 if $line =~ /^\s*$/
628 0 0 if $line =~ /^#/
629 0 0 if $line =~ /^%/
631 0 0 if ($line =~ /^(NetRange|CIDR|NetName|NetHandle|Parent|OrgName|Country):\s*(.+)$/i)
636 0 0 if ($line =~ /^(.+?)\s+(\S+)\s+\((NET-[^)]+)\)\s+(\d+\.\d+\.\d+\.\d+)\s+-\s+(\d+\.\d+\.\d+\.\d+)\s*$/)
641 0 0 if $line =~ /^(Comment|Remarks|RegDate|Updated|Created|Last-Modified):/i
642 0 0 if $line =~ /^(OrgAbuse|OrgTech|OrgNOC|RTech|RNOC|RAbuse)/i
653 0 0 if (@interesting) { }
660 0 0 if (@unknown) { }
672 15 0 unless $do_debugging
683 0 0 if (ref $response ne "HASH")
684 0 0 defined $response ? :
691 0 0 if (ref $value eq 'ARRAY') { }
0 0 elsif (ref $value) { }
694 0 0 defined $item ? :
699 0 0 defined $value ? :