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'}) { }
176 3 3 if ($ipv == 4) { }
179 3 0 if ($ipv == 6) { }
191 0 0 if ($ipv == 4) { }
194 0 0 if ($ipv == 6) { }
206 0 0 if ($ipv == 4) { }
209 0 0 if ($ipv == 6) { }
221 0 0 if ($ipv == 4) { }
224 0 0 if ($ipv == 6) { }
236 0 0 if ($ipv == 4) { }
239 0 0 if ($ipv == 6) { }
251 0 0 if ($ipv == 4) { }
254 0 0 if ($ipv == 6) { }
266 0 0 if ($ipv == 4) { }
269 0 0 if ($ipv == 6) { }
281 0 0 if ($ipv == 4) { }
284 0 0 if ($ipv == 6) { }
296 0 0 if ($ipv == 4) { }
299 0 0 if ($ipv == 6) { }
311 0 0 if ($ipv == 4) { }
314 0 0 if ($ipv == 6) { }
326 0 0 if ($ipv == 4) { }
329 0 0 if ($ipv == 6) { }
341 0 0 if ($ipv == 4) { }
344 0 0 if ($ipv == 6) { }
356 0 0 if ($ipv == 4) { }
359 0 0 if ($ipv == 6) { }
371 0 0 if ($ipv == 4) { }
374 0 0 if ($ipv == 6) { }
386 0 0 if ($ipv == 4) { }
389 0 0 if ($ipv == 6) { }
403 0 3 if ($ipnum eq '')
404 0 0 if ($mode == 100) { }
407 0 0 if ($mode == 7) { }
415 0 3 if ($mode == 1 and $IPV6_COUNTRY_POSITION[$dbtype] == 0)
418 0 3 if ($mode == 2 and $IPV6_COUNTRY_POSITION[$dbtype] == 0)
421 0 3 if ($mode == 3 and $IPV6_REGION_POSITION[$dbtype] == 0)
424 0 3 if ($mode == 4 and $IPV6_CITY_POSITION[$dbtype] == 0)
427 0 3 if ($mode == 5 and $IPV6_ISP_POSITION[$dbtype] == 0)
430 0 3 if ($mode == 6 and $IPV6_PROXYTYPE_POSITION[$dbtype] == 0)
433 0 3 if ($mode == 8 and $IPV6_DOMAIN_POSITION[$dbtype] == 0)
436 0 3 if ($mode == 9 and $IPV6_USAGETYPE_POSITION[$dbtype] == 0)
439 0 3 if ($mode == 10 and $IPV6_ASN_POSITION[$dbtype] == 0)
442 0 3 if ($mode == 11 and $IPV6_AS_POSITION[$dbtype] == 0)
445 0 3 if ($mode == 12 and $IPV6_LASTSEEN_POSITION[$dbtype] == 0)
448 0 3 if ($mode == 13 and $IPV6_THREAT_POSITION[$dbtype] == 0)
451 0 3 if ($mode == 14 and $IPV6_PROVIDER_POSITION[$dbtype] == 0)
462 0 3 if ($dbcount == 0)
463 0 0 if ($mode == 100) { }
477 3 0 if ($indexbaseaddr > 0)
488 0 3 if ($realipno == '340282366920938463463374607431768211455')
496 3 1 if ($ipno >= $ipfrom and $ipno < $ipto) { }
503 0 3 if ($mode == 100)
519 0 0 if ($IPV6_COUNTRY_POSITION[$dbtype] != 0)
523 0 0 if ($IPV6_REGION_POSITION[$dbtype] != 0)
526 0 0 if ($IPV6_CITY_POSITION[$dbtype] != 0)
529 0 0 if ($IPV6_ISP_POSITION[$dbtype] != 0)
532 0 0 if ($IPV6_PROXYTYPE_POSITION[$dbtype] != 0)
535 0 0 if ($IPV6_DOMAIN_POSITION[$dbtype] != 0)
538 0 0 if ($IPV6_USAGETYPE_POSITION[$dbtype] != 0)
541 0 0 if ($IPV6_ASN_POSITION[$dbtype] != 0)
544 0 0 if ($IPV6_AS_POSITION[$dbtype] != 0)
547 0 0 if ($IPV6_LASTSEEN_POSITION[$dbtype] != 0)
550 0 0 if ($IPV6_THREAT_POSITION[$dbtype] != 0)
553 0 0 if ($IPV6_PROVIDER_POSITION[$dbtype] != 0)
557 0 0 if ($countryshort eq '-' or $proxytype eq '-') { }
560 0 0 if ($proxytype eq 'DCH' or $proxytype eq 'SES') { }
568 3 0 if ($mode == 1)
571 0 0 if ($mode == 2)
574 0 0 if ($mode == 3)
577 0 0 if ($mode == 4)
580 0 0 if ($mode == 5)
583 0 0 if ($mode == 6)
586 0 0 if ($mode == 8)
589 0 0 if ($mode == 9)
592 0 0 if ($mode == 10)
595 0 0 if ($mode == 11)
598 0 0 if ($mode == 12)
601 0 0 if ($mode == 13)
604 0 0 if ($mode == 14)
608 0 0 if ($mode == 7)
612 0 0 if ($IPV6_PROXYTYPE_POSITION[$dbtype] == 0) { }
618 0 0 if ($countryshort eq '-' or $proxytype eq '-') { }
621 0 0 if ($proxytype eq 'DCH' or $proxytype eq 'SES') { }
630 1 0 if ($ipno < $ipfrom) { }
637 0 0 if ($mode == 100) { }
640 0 0 if ($mode == 7) { }
654 0 3 if ($ipnum eq '')
655 0 0 if ($mode == 100) { }
658 0 0 if ($mode == 7) { }
666 0 3 if ($mode == 1 and $IPV4_COUNTRY_POSITION[$dbtype] == 0)
669 0 3 if ($mode == 2 and $IPV4_COUNTRY_POSITION[$dbtype] == 0)
672 0 3 if ($mode == 3 and $IPV4_REGION_POSITION[$dbtype] == 0)
675 0 3 if ($mode == 4 and $IPV4_CITY_POSITION[$dbtype] == 0)
678 0 3 if ($mode == 5 and $IPV4_ISP_POSITION[$dbtype] == 0)
681 0 3 if ($mode == 6 and $IPV4_PROXYTYPE_POSITION[$dbtype] == 0)
684 0 3 if ($mode == 8 and $IPV4_DOMAIN_POSITION[$dbtype] == 0)
687 0 3 if ($mode == 9 and $IPV4_USAGETYPE_POSITION[$dbtype] == 0)
690 0 3 if ($mode == 10 and $IPV4_ASN_POSITION[$dbtype] == 0)
693 0 3 if ($mode == 11 and $IPV4_AS_POSITION[$dbtype] == 0)
696 0 3 if ($mode == 12 and $IPV4_LASTSEEN_POSITION[$dbtype] == 0)
699 0 3 if ($mode == 13 and $IPV4_THREAT_POSITION[$dbtype] == 0)
702 0 3 if ($mode == 14 and $IPV4_PROVIDER_POSITION[$dbtype] == 0)
718 3 0 if ($indexbaseaddr > 0)
727 0 3 if ($realipno == 4294967295) { }
737 3 12 if ($ipno >= $ipfrom and $ipno < $ipto) { }
743 0 3 if ($mode == 100)
759 0 0 if ($IPV4_COUNTRY_POSITION[$dbtype] != 0)
764 0 0 if ($IPV4_REGION_POSITION[$dbtype] != 0)
767 0 0 if ($IPV4_CITY_POSITION[$dbtype] != 0)
770 0 0 if ($IPV4_ISP_POSITION[$dbtype] != 0)
773 0 0 if ($IPV4_PROXYTYPE_POSITION[$dbtype] != 0)
776 0 0 if ($IPV4_DOMAIN_POSITION[$dbtype] != 0)
779 0 0 if ($IPV4_USAGETYPE_POSITION[$dbtype] != 0)
782 0 0 if ($IPV4_ASN_POSITION[$dbtype] != 0)
785 0 0 if ($IPV4_AS_POSITION[$dbtype] != 0)
788 0 0 if ($IPV4_LASTSEEN_POSITION[$dbtype] != 0)
791 0 0 if ($IPV4_THREAT_POSITION[$dbtype] != 0)
794 0 0 if ($IPV4_PROVIDER_POSITION[$dbtype] != 0)
797 0 0 if ($countryshort eq '-') { }
800 0 0 if ($proxytype eq 'DCH' or $proxytype eq 'SES') { }
808 3 0 if ($mode == 1)
811 0 0 if ($mode == 2)
814 0 0 if ($mode == 3)
817 0 0 if ($mode == 4)
820 0 0 if ($mode == 5)
823 0 0 if ($mode == 6)
826 0 0 if ($mode == 8)
829 0 0 if ($mode == 9)
832 0 0 if ($mode == 10)
835 0 0 if ($mode == 11)
838 0 0 if ($mode == 12)
841 0 0 if ($mode == 13)
844 0 0 if ($mode == 14)
847 0 0 if ($mode == 7)
851 0 0 if ($IPV4_PROXYTYPE_POSITION[$dbtype] == 0) { }
857 0 0 if ($countryshort eq '-' or $proxytype eq '-') { }
860 0 0 if ($proxytype eq 'DCH' or $proxytype eq 'SES') { }
869 9 3 if ($ipno < $ipfrom) { }
876 0 0 if ($mode == 100) { }
879 0 0 if ($mode == 7) { }
928 0 0 if ($is_little_endian =~ /^1/) { }
940 0 8 if $#array != 15
964 3 3 if ($obj->isIPv4($ip)) { }
971 3 0 if ($obj->isIPv6($ip)) { }
977 0 3 if ($ipnum >= 281470681743360 and $ipnum <= 281474976710655)
982 0 3 if ($ipnum >= 4.2545680458834378e+37 and $ipnum <= 4.2550872755692912e+37)
990 0 3 if ($ipnum >= 4.2540488161975843e+37 and $ipnum <= 4.2540488241204e+37)
1013 0 3 if ($ip[$#ip] =~ /^(\d+)\.(\d+)\.(\d+)\.(\d+)$/)
1021 0 3 if ($#ip == 8)
1031 24 0 unless $ip[$_] eq '000Z'
1046 0 3 unless (length $hexip == 32)
1054 20 364 if $_
1078 6 0 if ($host =~ /^$IPv4_re$/ or $host =~ /^$IPv6_re$/ or $host =~ /^\:\:$/) { }
1090 3 3 if ($ip =~ /^$IPv4_re$/) { }
1093 0 12 if $octet[$i] > 255 or $octet[$i] < 0
1104 3 0 if ($ip =~ /^$IPv6_re$/ or $ip =~ /^$IPv4_re$/) { }