Branch Coverage

blib/lib/Geo/IPfree.pm
Criterion Covered Total %
branch 52 66 78.7


line true false branch
51 0 5 unless (defined $_[0] and $_[0] =~ /^[\w:]+$/)
58 5 0 unless (defined $db_file)
83 5 25 if -e $file
91 0 5 if (-d $db_file)
93 0 5 unless (-s $db_file)
98 0 5 unless open my $handler, "<", $db_file
103 0 5 if $this->{'pos'}
106 5 85095 if ($buffer =~ /##headers##(\d+)##$/s) { }
5 85090 elsif ($buffer =~ /##start##$/s) { }
126 6 22 if ($#_ == 0) { }
127 1 5 unless ($THIS)
134 0 28 if index($ip, "..") != -1
135 0 28 if substr($ip, 0, 1) eq "."
136 0 28 if substr($ip, -1) eq "."
138 3 25 unless ($ip =~ /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/)
142 3 25 unless length $ip
147 20 5 $1 < 128 ? :
149 2 23 if ($this->{'cache'} and $this->{'CACHE'}{$ip_cache})
158 23 3376 if ($ipnb <= $Key)
164 7 16 if ($this->{'FASTER'}) { }
167 7 1791 if ($ipnb >= ($$base_cache{$basex2 = substr($this->{'DB'}, $buf_pos + 2, 5)} ||= baseX2dec($basex2)))
177 0 16 if $] < "5.006001"
181 16 3727 if ($ipnb >= baseX2dec(substr($buffer, 2)))
188 23 0 if ($this->{'cache'})
189 0 23 if ($this->{'CACHE_COUNT'} > $cache_expire) { }
229 3 3 unless @ip or $last_lookup
248 0 1 if $input > 0
264 1 85 if $dec > 0
279 5472 86 $length > 4 ? :
5472 86 $length > 3 ? :
5472 86 $length > 2 ? :
5472 86 $length > 1 ? :
5558 0 $length ? :