Branch Coverage

blib/lib/Geo/IPfree.pm
Criterion Covered Total %
branch 49 64 76.5


line true false branch
51 0 3 unless (defined $_[0] and $_[0] =~ /^[\w:]+$/)
58 3 0 unless (defined $db_file)
83 3 15 if -e $file
91 0 3 if (-d $db_file)
93 0 3 unless (-s $db_file)
98 0 3 unless open my $handler, "<", $db_file
103 0 3 if $this->{'pos'}
106 3 51057 if ($buffer =~ /##headers##(\d+)##$/s) { }
3 51054 elsif ($buffer =~ /##start##$/s) { }
126 6 12 if ($#_ == 0) { }
127 1 5 unless ($THIS)
134 0 18 if index($ip, "..") > -1
135 0 18 if substr($ip, 0, 1) eq "."
136 0 18 if substr($ip, -1) eq "."
138 3 15 unless ($ip =~ /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/)
142 3 15 unless length $ip
148 0 15 if ($this->{'cache'} and $this->{'CACHE'}{$ip_class})
157 15 2016 if ($ipnb <= $Key)
163 5 10 if ($this->{'FASTER'}) { }
166 5 1646 if ($ipnb >= ($$base_cache{$basex2 = substr($this->{'DB'}, $buf_pos + 2, 5)} ||= baseX2dec($basex2)))
176 0 10 if $] < "5.006001"
180 10 3292 if ($ipnb >= baseX2dec(substr($buffer, 2)))
187 15 0 if ($this->{'cache'})
188 0 15 if ($this->{'CACHE_COUNT'} > $cache_expire) { }
228 3 3 unless @ip or $last_lookup
247 0 1 if $input > 0
263 1 85 if $dec > 0
278 4957 86 $length > 4 ? :
4957 86 $length > 3 ? :
4957 86 $length > 2 ? :
4957 86 $length > 1 ? :
5043 0 $length ? :