Branch Coverage

File:blib/lib/Geo/Coder/Free/MaxMind.pm
Coverage:26.9%

line%coveragebranch
14950TFif (not defined $class) { }
50TFelsif (&Scalar::Util::blessed($class)) { }
16450TFunless (-d $directory)
27350TFif (not ref $self) { }
50TFelsif (ref $self eq 'HASH') { }
100TFelsif (ref $_[0] eq 'HASH') { }
50TFelsif (ref $_[0]) { }
50TFelsif (scalar @_ and scalar(@_) % 2 == 0) { }
2740TFif (scalar @_) { }
0TFelsif (not defined $self) { }
0TFelsif ($self eq __PACKAGE__) { }
29750TFunless my $location = $params{"location"}
302100TFunless (_valid_location($location))
30650TFif ($location =~ /^(.+),\s*Washington\s*DC,(.+)$/)
310100TFif (my $rc = $known_locations{$location})
327100TFunless $location =~ /,/ or $params{"region"}
33150TFif $cached_result
33950TFif "Geo::Coder::Free::MissCache"->missed($miss_scope, $miss_key)
34850TFif ($location =~ /^([\w\s\-]+),([\w\s]+),([\w\s]+)?$/) { }
0TFelsif ($location =~ /^([\w\s\-]+),([\w\s]+),([\w\s]+),\s*(Canada|United States|USA|US)?$/) { }
0TFelsif ($location =~ /^[\w\s-],[\w\s-]/) { }
0TFelsif ($location =~ /^[\w\s-]+$/ and my $region = $params{'region'}) { }
0TFelsif ($location =~ /^([\w\s-]+),\s*(\w+)$/) { }
35850TFif ($location =~ /^St\.? (.+)/)
36150TFif ($country =~ /^(Canada|United States|USA|US)$/)
39950TFif ($country)
40050TFif (defined $country and $country eq 'UK' || $country eq 'United Kingdom' || $country eq 'England')
40850TFif ($state and $admin1cache{$state}) { }
50TFelsif ($admin1cache{$country} and not defined $state) { }
41350TFunless $$self{"admin1"} //= "Geo::Coder::Free::DB::MaxMind::admin1"->new("no_entry", 1)
41650TFif (my $admin1 = $$self{'admin1'}->fetchrow_hashref('asciiname', $country)) { }
50TFelsif ($state) { }
50TFelsif ($countrycode) { }
0TFelsif (Locale::Country::code2country($country)) { }
4210TFif ($state =~ /^[A-Z]{2}$/) { }
4280TFif ($$admin1{"concatenated_codes"} =~ /^\Q$concatenated_codes\E\./i)
44450TFunless (defined $concatenated_codes)
45250TFif ($country =~ /^(United States|USA|US)$/) { }
50TFelsif ($country eq 'Canada' and $state and length $state > 2) { }
4530TFif ($county and length $county > 2)
4540TFif (my $twoletterstate = ($_locale_us //= "Locale::US"->new)->{"state2code"}{uc $county})
4580TFif ($state and length $state > 2)
4590TFif (my $twoletterstate = ($_locale_us //= "Locale::US"->new)->{"state2code"}{uc $state})
4640TFif (($_locale_ca //= "Locale::CA"->new)->{"province2code"}{uc $state})
4660TFunless (defined $location)
47350TFunless $$self{"admin2"} //= "Geo::Coder::Free::DB::MaxMind::admin2"->new("no_entry", 1)
47550TFif (defined $county and $county =~ /^[A-Z]{2}$/ and $country =~ /^(United States|USA|US)$/) { }
50TFelsif ($county and $admin1cache{$county}) { }
50TFelsif ($county and $admin2cache{$county}) { }
50TFelsif (defined $state and $admin2cache{$state} and not defined $county) { }
48550TFif (defined $county and $county eq 'London') { }
50TFelsif (defined $county) { }
4930TFif ($$admin2{"concatenated_codes"} =~ /$concatenated_codes/)
4950TFif ($region =~ /^[A-Z]{2}\.([A-Z]{2})\./) { }
4970TFif (defined $state and $state =~ /^[A-Z]{2}$/) { }
4980TFif ($state eq $rc)
51250TFif ($state and not defined $region)
5130TFif ($state =~ /^[A-Z]{2}$/) { }
5200TFif ($$admin2{"concatenated_codes"} =~ /$concatenated_codes/)
52950TFif (scalar @regions == 0 and not defined $region)
53450TFif (scalar @admin2s == 0 and $country =~ /^(Canada|United States|USA|US)$/ and not $location =~ /\sCounty/i)
53950TFif (scalar @admin2s and defined $admin2s[0]{'concatenated_codes'}) { }
50TFelsif (defined $county) { }
5420TFif ($concat =~ /^CA\.(\d\d)\./) { }
0TFelsif ($concat =~ /$concatenated_codes/) { }
55350TFunless (defined $$self{"admin1"})
5540TFunless $$self{"admin1"} = "Geo::Coder::Free::DB::MaxMind::admin1"->new("no_entry", 1)
5590TFif ($$admin1{"concatenated_codes"} =~ /^\Q$concatenated_codes\E\./i)
5610TFif (scalar @admin1s == 1)
57050TFunless (defined $$self{"cities"})
57850TFif (defined $county and $county =~ /^[A-Z]{2}$/ and $country =~ /^(United States|USA|US)$/) { }
58150TFif ($region_only) { }
58850TFif ($region)
5910TFif ($country_code)
5960TFif (scalar @admin2s == 1)
5970TFif ($state) { }
0TFelsif ($county) { }
60850TFif (my $c = $params{'region'}) { }
50TFelsif ($countrycode) { }
68950TFunless (defined $city)
6920TFif ($country =~ /^(United States|USA|US)$/)
6930TFunless $region =~ /^[A-Z]{2}$/
6980TFif defined $city
70250TFif (defined $city and defined $$city{"Latitude"})
70450TFif defined $$city{"Region"} and $$city{"Region"} =~ /^[A-Z]\d$/
70550TFif defined $$city{"Population"} and length $$city{"Population"} == 0
71350TF$$options{'City'} ? :
7570TFif (not ref $self) { }
0TFelsif (ref $self eq 'HASH') { }
0TFelsif (ref $_[0] eq 'HASH') { }
0TFelsif (ref $_[0]) { }
0TFelsif (scalar @_ and scalar(@_) % 2 == 0) { }
7580TFif (scalar @_) { }
0TFelsif (not defined $self) { }
0TFelsif ($self eq __PACKAGE__) { }
7850TFif ($latlng) { }
7930TFunless (defined $latitude and defined $longitude)
7970TFunless (defined $$self{"cities"})
8070TFunless defined $c and $c =~ /^-?\d+\.?\d*$/
8110TFif (wantarray)
8310TFif ($rc)
8420TFif (my $region = $$loc{"Region"})
8470TFif ($county) { }
8500TFunless $$self{"admin2"} //= "Geo::Coder::Free::DB::MaxMind::admin2"->new("no_entry", 1)
8590TFif ($_country =~ /^[A-Z]{2}$/ and $_reg =~ /^[A-Z0-9]{1,10}$/)
8630TFif (ref $row and $$row{"name"})