Branch Coverage

blib/lib/Geo/IP2Proxy.pm
Criterion Covered Total %
branch 71 338 21.0


line true false branch
99 0 2 unless (@_ > 1 and $_[1])
106 0 2 unless (CORE::open $handle, "$db_file")
113 0 2 if ($obj->{'productcode'} == 2) { }
115 2 0 if ($obj->{'databaseyear'} <= 20 and $obj->{'productcode'} == 0) { }
128 0 0 if (CORE::close $class->{'filehandle'}) { }
180 3 3 if ($ipv == 4) { }
183 3 0 if ($ipv == 6) { }
195 0 0 if ($ipv == 4) { }
198 0 0 if ($ipv == 6) { }
210 0 0 if ($ipv == 4) { }
213 0 0 if ($ipv == 6) { }
225 0 0 if ($ipv == 4) { }
228 0 0 if ($ipv == 6) { }
240 0 0 if ($ipv == 4) { }
243 0 0 if ($ipv == 6) { }
255 0 0 if ($ipv == 4) { }
258 0 0 if ($ipv == 6) { }
270 0 0 if ($ipv == 4) { }
273 0 0 if ($ipv == 6) { }
285 0 0 if ($ipv == 4) { }
288 0 0 if ($ipv == 6) { }
300 0 0 if ($ipv == 4) { }
303 0 0 if ($ipv == 6) { }
315 0 0 if ($ipv == 4) { }
318 0 0 if ($ipv == 6) { }
330 0 0 if ($ipv == 4) { }
333 0 0 if ($ipv == 6) { }
345 0 0 if ($ipv == 4) { }
348 0 0 if ($ipv == 6) { }
360 0 0 if ($ipv == 4) { }
363 0 0 if ($ipv == 6) { }
375 0 0 if ($ipv == 4) { }
378 0 0 if ($ipv == 6) { }
390 0 0 if ($ipv == 4) { }
393 0 0 if ($ipv == 6) { }
405 0 0 if ($ipv == 4) { }
408 0 0 if ($ipv == 6) { }
422 0 3 if ($ipnum eq "")
423 0 0 if ($mode == 100) { }
426 0 0 if ($mode == 7) { }
434 0 3 if ($mode == 1 and $IPV6_COUNTRY_POSITION[$dbtype] == 0)
437 0 3 if ($mode == 2 and $IPV6_COUNTRY_POSITION[$dbtype] == 0)
440 0 3 if ($mode == 3 and $IPV6_REGION_POSITION[$dbtype] == 0)
443 0 3 if ($mode == 4 and $IPV6_CITY_POSITION[$dbtype] == 0)
446 0 3 if ($mode == 5 and $IPV6_ISP_POSITION[$dbtype] == 0)
449 0 3 if ($mode == 6 and $IPV6_PROXYTYPE_POSITION[$dbtype] == 0)
452 0 3 if ($mode == 8 and $IPV6_DOMAIN_POSITION[$dbtype] == 0)
455 0 3 if ($mode == 9 and $IPV6_USAGETYPE_POSITION[$dbtype] == 0)
458 0 3 if ($mode == 10 and $IPV6_ASN_POSITION[$dbtype] == 0)
461 0 3 if ($mode == 11 and $IPV6_AS_POSITION[$dbtype] == 0)
464 0 3 if ($mode == 12 and $IPV6_LASTSEEN_POSITION[$dbtype] == 0)
467 0 3 if ($mode == 13 and $IPV6_THREAT_POSITION[$dbtype] == 0)
470 0 3 if ($mode == 14 and $IPV6_PROVIDER_POSITION[$dbtype] == 0)
473 0 3 if ($mode == 15 and $IPV6_FRAUDSCORE_POSITION[$dbtype] == 0)
484 0 3 if ($dbcount == 0)
485 0 0 if ($mode == 100) { }
499 3 0 if ($indexbaseaddr > 0)
509 0 3 if ($realipno == "340282366920938463463374607431768211455")
519 3 1 if ($ipno >= $ipfrom and $ipno < $ipto) { }
522 0 3 if ($mode == 100)
539 0 0 if ($IPV6_COUNTRY_POSITION[$dbtype] != 0)
543 0 0 if ($IPV6_REGION_POSITION[$dbtype] != 0)
546 0 0 if ($IPV6_CITY_POSITION[$dbtype] != 0)
549 0 0 if ($IPV6_ISP_POSITION[$dbtype] != 0)
552 0 0 if ($IPV6_PROXYTYPE_POSITION[$dbtype] != 0)
555 0 0 if ($IPV6_DOMAIN_POSITION[$dbtype] != 0)
558 0 0 if ($IPV6_USAGETYPE_POSITION[$dbtype] != 0)
561 0 0 if ($IPV6_ASN_POSITION[$dbtype] != 0)
564 0 0 if ($IPV6_AS_POSITION[$dbtype] != 0)
567 0 0 if ($IPV6_LASTSEEN_POSITION[$dbtype] != 0)
570 0 0 if ($IPV6_THREAT_POSITION[$dbtype] != 0)
573 0 0 if ($IPV6_PROVIDER_POSITION[$dbtype] != 0)
576 0 0 if ($IPV6_FRAUDSCORE_POSITION[$dbtype] != 0)
580 0 0 if ($countryshort eq '-' or $proxytype eq '-') { }
583 0 0 if ($proxytype eq 'DCH' or $proxytype eq 'SES') { }
591 3 0 if ($mode == 1)
594 0 0 if ($mode == 2)
597 0 0 if ($mode == 3)
600 0 0 if ($mode == 4)
603 0 0 if ($mode == 5)
606 0 0 if ($mode == 6)
609 0 0 if ($mode == 8)
612 0 0 if ($mode == 9)
615 0 0 if ($mode == 10)
618 0 0 if ($mode == 11)
621 0 0 if ($mode == 12)
624 0 0 if ($mode == 13)
627 0 0 if ($mode == 14)
630 0 0 if ($mode == 15)
634 0 0 if ($mode == 7)
638 0 0 if ($IPV6_PROXYTYPE_POSITION[$dbtype] == 0) { }
644 0 0 if ($countryshort eq '-' or $proxytype eq '-') { }
647 0 0 if ($proxytype eq 'DCH' or $proxytype eq 'SES') { }
656 1 0 if ($ipno < $ipfrom) { }
663 0 0 if ($mode == 100) { }
666 0 0 if ($mode == 7) { }
680 0 3 if ($ipnum eq "")
681 0 0 if ($mode == 100) { }
684 0 0 if ($mode == 7) { }
692 0 3 if ($mode == 1 and $IPV4_COUNTRY_POSITION[$dbtype] == 0)
695 0 3 if ($mode == 2 and $IPV4_COUNTRY_POSITION[$dbtype] == 0)
698 0 3 if ($mode == 3 and $IPV4_REGION_POSITION[$dbtype] == 0)
701 0 3 if ($mode == 4 and $IPV4_CITY_POSITION[$dbtype] == 0)
704 0 3 if ($mode == 5 and $IPV4_ISP_POSITION[$dbtype] == 0)
707 0 3 if ($mode == 6 and $IPV4_PROXYTYPE_POSITION[$dbtype] == 0)
710 0 3 if ($mode == 8 and $IPV4_DOMAIN_POSITION[$dbtype] == 0)
713 0 3 if ($mode == 9 and $IPV4_USAGETYPE_POSITION[$dbtype] == 0)
716 0 3 if ($mode == 10 and $IPV4_ASN_POSITION[$dbtype] == 0)
719 0 3 if ($mode == 11 and $IPV4_AS_POSITION[$dbtype] == 0)
722 0 3 if ($mode == 12 and $IPV4_LASTSEEN_POSITION[$dbtype] == 0)
725 0 3 if ($mode == 13 and $IPV4_THREAT_POSITION[$dbtype] == 0)
728 0 3 if ($mode == 14 and $IPV4_PROVIDER_POSITION[$dbtype] == 0)
731 0 3 if ($mode == 15 and $IPV4_FRAUDSCORE_POSITION[$dbtype] == 0)
747 3 0 if ($indexbaseaddr > 0)
755 0 3 if ($realipno == 4294967295) { }
767 3 12 if ($ipno >= $ipfrom and $ipno < $ipto) { }
768 0 3 if ($mode == 100)
785 0 0 if ($IPV4_COUNTRY_POSITION[$dbtype] != 0)
790 0 0 if ($IPV4_REGION_POSITION[$dbtype] != 0)
793 0 0 if ($IPV4_CITY_POSITION[$dbtype] != 0)
796 0 0 if ($IPV4_ISP_POSITION[$dbtype] != 0)
799 0 0 if ($IPV4_PROXYTYPE_POSITION[$dbtype] != 0)
802 0 0 if ($IPV4_DOMAIN_POSITION[$dbtype] != 0)
805 0 0 if ($IPV4_USAGETYPE_POSITION[$dbtype] != 0)
808 0 0 if ($IPV4_ASN_POSITION[$dbtype] != 0)
811 0 0 if ($IPV4_AS_POSITION[$dbtype] != 0)
814 0 0 if ($IPV4_LASTSEEN_POSITION[$dbtype] != 0)
817 0 0 if ($IPV4_THREAT_POSITION[$dbtype] != 0)
820 0 0 if ($IPV4_PROVIDER_POSITION[$dbtype] != 0)
823 0 0 if ($IPV4_FRAUDSCORE_POSITION[$dbtype] != 0)
827 0 0 if ($countryshort eq '-') { }
830 0 0 if ($proxytype eq 'DCH' or $proxytype eq 'SES') { }
838 3 0 if ($mode == 1)
841 0 0 if ($mode == 2)
844 0 0 if ($mode == 3)
847 0 0 if ($mode == 4)
850 0 0 if ($mode == 5)
853 0 0 if ($mode == 6)
856 0 0 if ($mode == 8)
859 0 0 if ($mode == 9)
862 0 0 if ($mode == 10)
865 0 0 if ($mode == 11)
868 0 0 if ($mode == 12)
871 0 0 if ($mode == 13)
874 0 0 if ($mode == 14)
877 0 0 if ($mode == 15)
880 0 0 if ($mode == 7)
884 0 0 if ($IPV4_PROXYTYPE_POSITION[$dbtype] == 0) { }
890 0 0 if ($countryshort eq '-' or $proxytype eq '-') { }
893 0 0 if ($proxytype eq 'DCH' or $proxytype eq 'SES') { }
902 9 3 if ($ipno < $ipfrom) { }
909 0 0 if ($mode == 100) { }
912 0 0 if ($mode == 7) { }
1007 0 0 if ($is_little_endian =~ /^1/) { }
1019 0 8 if $#array != 15
1043 3 3 if ($obj->isIPv4($ip)) { }
1050 3 0 if ($obj->isIPv6($ip)) { }
1056 0 3 if ($ipnum >= '281470681743360' and $ipnum <= '281474976710655')
1061 0 3 if ($ipnum >= "4.25456804588344e+37" and $ipnum <= "4.25508727556929e+37")
1069 0 3 if ($ipnum >= "4.25404881619758e+37" and $ipnum <= "4.2540488241204e+37")
1092 0 3 if ($ip[$#ip] =~ /^(\d+)\.(\d+)\.(\d+)\.(\d+)$/)
1100 0 3 if ($#ip == 8)
1110 24 0 unless $ip[$_] eq "000Z"
1125 0 3 unless (length $hexip == 32)
1133 20 364 if $_
1157 6 0 if ($host =~ /^$IPv4_re$/ or $host =~ /^$IPv6_re$/ or $host =~ /^\:\:$/) { }
1169 3 3 if ($ip =~ /^$IPv4_re$/) { }
1172 0 12 if $octet[$i] > 255 or $octet[$i] < 0
1183 3 0 if ($ip =~ /^$IPv6_re$/ or $ip =~ /^$IPv4_re$/) { }