Branch Coverage

blib/lib/Geo/IP2Proxy.pm
Criterion Covered Total %
branch 69 322 21.4


line true false branch
96 0 2 unless (@_ > 1 and $_[1])
103 0 2 unless (CORE::open $handle, "$db_file")
110 0 2 if ($obj->{'productcode'} == 2) { }
112 2 0 if ($obj->{'databaseyear'} <= 20 and $obj->{'productcode'} == 0) { }
125 0 0 if (CORE::close $class->{'filehandle'}) { }
177 3 3 if ($ipv == 4) { }
180 3 0 if ($ipv == 6) { }
192 0 0 if ($ipv == 4) { }
195 0 0 if ($ipv == 6) { }
207 0 0 if ($ipv == 4) { }
210 0 0 if ($ipv == 6) { }
222 0 0 if ($ipv == 4) { }
225 0 0 if ($ipv == 6) { }
237 0 0 if ($ipv == 4) { }
240 0 0 if ($ipv == 6) { }
252 0 0 if ($ipv == 4) { }
255 0 0 if ($ipv == 6) { }
267 0 0 if ($ipv == 4) { }
270 0 0 if ($ipv == 6) { }
282 0 0 if ($ipv == 4) { }
285 0 0 if ($ipv == 6) { }
297 0 0 if ($ipv == 4) { }
300 0 0 if ($ipv == 6) { }
312 0 0 if ($ipv == 4) { }
315 0 0 if ($ipv == 6) { }
327 0 0 if ($ipv == 4) { }
330 0 0 if ($ipv == 6) { }
342 0 0 if ($ipv == 4) { }
345 0 0 if ($ipv == 6) { }
357 0 0 if ($ipv == 4) { }
360 0 0 if ($ipv == 6) { }
372 0 0 if ($ipv == 4) { }
375 0 0 if ($ipv == 6) { }
387 0 0 if ($ipv == 4) { }
390 0 0 if ($ipv == 6) { }
404 0 3 if ($ipnum eq "")
405 0 0 if ($mode == 100) { }
408 0 0 if ($mode == 7) { }
416 0 3 if ($mode == 1 and $IPV6_COUNTRY_POSITION[$dbtype] == 0)
419 0 3 if ($mode == 2 and $IPV6_COUNTRY_POSITION[$dbtype] == 0)
422 0 3 if ($mode == 3 and $IPV6_REGION_POSITION[$dbtype] == 0)
425 0 3 if ($mode == 4 and $IPV6_CITY_POSITION[$dbtype] == 0)
428 0 3 if ($mode == 5 and $IPV6_ISP_POSITION[$dbtype] == 0)
431 0 3 if ($mode == 6 and $IPV6_PROXYTYPE_POSITION[$dbtype] == 0)
434 0 3 if ($mode == 8 and $IPV6_DOMAIN_POSITION[$dbtype] == 0)
437 0 3 if ($mode == 9 and $IPV6_USAGETYPE_POSITION[$dbtype] == 0)
440 0 3 if ($mode == 10 and $IPV6_ASN_POSITION[$dbtype] == 0)
443 0 3 if ($mode == 11 and $IPV6_AS_POSITION[$dbtype] == 0)
446 0 3 if ($mode == 12 and $IPV6_LASTSEEN_POSITION[$dbtype] == 0)
449 0 3 if ($mode == 13 and $IPV6_THREAT_POSITION[$dbtype] == 0)
452 0 3 if ($mode == 14 and $IPV6_PROVIDER_POSITION[$dbtype] == 0)
463 0 3 if ($dbcount == 0)
464 0 0 if ($mode == 100) { }
478 3 0 if ($indexbaseaddr > 0)
488 0 3 if ($realipno == "340282366920938463463374607431768211455")
498 3 1 if ($ipno >= $ipfrom and $ipno < $ipto) { }
501 0 3 if ($mode == 100)
517 0 0 if ($IPV6_COUNTRY_POSITION[$dbtype] != 0)
521 0 0 if ($IPV6_REGION_POSITION[$dbtype] != 0)
524 0 0 if ($IPV6_CITY_POSITION[$dbtype] != 0)
527 0 0 if ($IPV6_ISP_POSITION[$dbtype] != 0)
530 0 0 if ($IPV6_PROXYTYPE_POSITION[$dbtype] != 0)
533 0 0 if ($IPV6_DOMAIN_POSITION[$dbtype] != 0)
536 0 0 if ($IPV6_USAGETYPE_POSITION[$dbtype] != 0)
539 0 0 if ($IPV6_ASN_POSITION[$dbtype] != 0)
542 0 0 if ($IPV6_AS_POSITION[$dbtype] != 0)
545 0 0 if ($IPV6_LASTSEEN_POSITION[$dbtype] != 0)
548 0 0 if ($IPV6_THREAT_POSITION[$dbtype] != 0)
551 0 0 if ($IPV6_PROVIDER_POSITION[$dbtype] != 0)
555 0 0 if ($countryshort eq '-' or $proxytype eq '-') { }
558 0 0 if ($proxytype eq 'DCH' or $proxytype eq 'SES') { }
566 3 0 if ($mode == 1)
569 0 0 if ($mode == 2)
572 0 0 if ($mode == 3)
575 0 0 if ($mode == 4)
578 0 0 if ($mode == 5)
581 0 0 if ($mode == 6)
584 0 0 if ($mode == 8)
587 0 0 if ($mode == 9)
590 0 0 if ($mode == 10)
593 0 0 if ($mode == 11)
596 0 0 if ($mode == 12)
599 0 0 if ($mode == 13)
602 0 0 if ($mode == 14)
606 0 0 if ($mode == 7)
610 0 0 if ($IPV6_PROXYTYPE_POSITION[$dbtype] == 0) { }
616 0 0 if ($countryshort eq '-' or $proxytype eq '-') { }
619 0 0 if ($proxytype eq 'DCH' or $proxytype eq 'SES') { }
628 1 0 if ($ipno < $ipfrom) { }
635 0 0 if ($mode == 100) { }
638 0 0 if ($mode == 7) { }
652 0 3 if ($ipnum eq "")
653 0 0 if ($mode == 100) { }
656 0 0 if ($mode == 7) { }
664 0 3 if ($mode == 1 and $IPV4_COUNTRY_POSITION[$dbtype] == 0)
667 0 3 if ($mode == 2 and $IPV4_COUNTRY_POSITION[$dbtype] == 0)
670 0 3 if ($mode == 3 and $IPV4_REGION_POSITION[$dbtype] == 0)
673 0 3 if ($mode == 4 and $IPV4_CITY_POSITION[$dbtype] == 0)
676 0 3 if ($mode == 5 and $IPV4_ISP_POSITION[$dbtype] == 0)
679 0 3 if ($mode == 6 and $IPV4_PROXYTYPE_POSITION[$dbtype] == 0)
682 0 3 if ($mode == 8 and $IPV4_DOMAIN_POSITION[$dbtype] == 0)
685 0 3 if ($mode == 9 and $IPV4_USAGETYPE_POSITION[$dbtype] == 0)
688 0 3 if ($mode == 10 and $IPV4_ASN_POSITION[$dbtype] == 0)
691 0 3 if ($mode == 11 and $IPV4_AS_POSITION[$dbtype] == 0)
694 0 3 if ($mode == 12 and $IPV4_LASTSEEN_POSITION[$dbtype] == 0)
697 0 3 if ($mode == 13 and $IPV4_THREAT_POSITION[$dbtype] == 0)
700 0 3 if ($mode == 14 and $IPV4_PROVIDER_POSITION[$dbtype] == 0)
716 3 0 if ($indexbaseaddr > 0)
724 0 3 if ($realipno == 4294967295) { }
736 3 12 if ($ipno >= $ipfrom and $ipno < $ipto) { }
737 0 3 if ($mode == 100)
753 0 0 if ($IPV4_COUNTRY_POSITION[$dbtype] != 0)
758 0 0 if ($IPV4_REGION_POSITION[$dbtype] != 0)
761 0 0 if ($IPV4_CITY_POSITION[$dbtype] != 0)
764 0 0 if ($IPV4_ISP_POSITION[$dbtype] != 0)
767 0 0 if ($IPV4_PROXYTYPE_POSITION[$dbtype] != 0)
770 0 0 if ($IPV4_DOMAIN_POSITION[$dbtype] != 0)
773 0 0 if ($IPV4_USAGETYPE_POSITION[$dbtype] != 0)
776 0 0 if ($IPV4_ASN_POSITION[$dbtype] != 0)
779 0 0 if ($IPV4_AS_POSITION[$dbtype] != 0)
782 0 0 if ($IPV4_LASTSEEN_POSITION[$dbtype] != 0)
785 0 0 if ($IPV4_THREAT_POSITION[$dbtype] != 0)
788 0 0 if ($IPV4_PROVIDER_POSITION[$dbtype] != 0)
791 0 0 if ($countryshort eq '-') { }
794 0 0 if ($proxytype eq 'DCH' or $proxytype eq 'SES') { }
802 3 0 if ($mode == 1)
805 0 0 if ($mode == 2)
808 0 0 if ($mode == 3)
811 0 0 if ($mode == 4)
814 0 0 if ($mode == 5)
817 0 0 if ($mode == 6)
820 0 0 if ($mode == 8)
823 0 0 if ($mode == 9)
826 0 0 if ($mode == 10)
829 0 0 if ($mode == 11)
832 0 0 if ($mode == 12)
835 0 0 if ($mode == 13)
838 0 0 if ($mode == 14)
841 0 0 if ($mode == 7)
845 0 0 if ($IPV4_PROXYTYPE_POSITION[$dbtype] == 0) { }
851 0 0 if ($countryshort eq '-' or $proxytype eq '-') { }
854 0 0 if ($proxytype eq 'DCH' or $proxytype eq 'SES') { }
863 9 3 if ($ipno < $ipfrom) { }
870 0 0 if ($mode == 100) { }
873 0 0 if ($mode == 7) { }
968 0 0 if ($is_little_endian =~ /^1/) { }
980 0 8 if $#array != 15
1004 3 3 if ($obj->isIPv4($ip)) { }
1011 3 0 if ($obj->isIPv6($ip)) { }
1017 0 3 if ($ipnum >= '281470681743360' and $ipnum <= '281474976710655')
1022 0 3 if ($ipnum >= "4.25456804588344e+37" and $ipnum <= "4.25508727556929e+37")
1030 0 3 if ($ipnum >= "4.25404881619758e+37" and $ipnum <= "4.2540488241204e+37")
1053 0 3 if ($ip[$#ip] =~ /^(\d+)\.(\d+)\.(\d+)\.(\d+)$/)
1061 0 3 if ($#ip == 8)
1071 24 0 unless $ip[$_] eq "000Z"
1086 0 3 unless (length $hexip == 32)
1094 20 364 if $_
1118 6 0 if ($host =~ /^$IPv4_re$/ or $host =~ /^$IPv6_re$/ or $host =~ /^\:\:$/) { }
1130 3 3 if ($ip =~ /^$IPv4_re$/) { }
1133 0 12 if $octet[$i] > 255 or $octet[$i] < 0
1144 3 0 if ($ip =~ /^$IPv6_re$/ or $ip =~ /^$IPv4_re$/) { }