Branch Coverage

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

line%coveragebranch
12550TFif (not defined $class) { }
50TFelsif (&Scalar::Util::blessed($class)) { }
14050TFunless (-d $directory)
18050TFif (not ref $self) { }
50TFelsif (ref $self eq 'HASH') { }
50TFelsif (ref $_[0] eq 'HASH') { }
0TFelsif (ref $_[0]) { }
0TFelsif (scalar @_ and scalar(@_) % 2 == 0) { }
1810TFif (scalar @_) { }
0TFelsif (not defined $self) { }
0TFelsif ($self eq __PACKAGE__) { }
20450TFunless my $location = $params{"location"}
20750TFunless ($location =~ /\D/)
21250TFif ($location =~ /^(.+),\s*Washington\s*DC,(.+)$/)
21650TFif (my $rc = $known_locations{$location})
22850TFunless $location =~ /,/ or $params{"region"}
2320TFif $cached_result
2410TFif ($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+)$/) { }
2510TFif ($location =~ /^St\.? (.+)/)
2540TFif ($country =~ /^(Canada|United States|USA|US)$/)
2900TFif ($country)
2910TFif (defined $country and $country eq 'UK' || $country eq 'United Kingdom' || $country eq 'England')
2990TFif ($state and $admin1cache{$state}) { }
0TFelsif ($admin1cache{$country} and not defined $state) { }
3040TFunless $$self{"admin1"} //= "Geo::Coder::Free::DB::MaxMind::admin1"->new("no_entry", 1)
3060TFif (my $admin1 = $$self{'admin1'}->fetchrow_hashref('asciiname', $country)) { }
0TFelsif ($state) { }
0TFelsif ($countrycode) { }
0TFelsif (Locale::Country::code2country($country)) { }
3110TFif ($state =~ /^[A-Z]{2}$/) { }
3170TFif ($$admin1{"concatenated_codes"} =~ /^\Q$concatenated_codes\E\./i)
3330TFunless defined $concatenated_codes
3380TFif ($country =~ /^(United States|USA|US)$/) { }
0TFelsif ($country eq 'Canada' and $state and length $state > 2) { }
3390TFif ($county and length $county > 2)
3400TFif (my $twoletterstate = ($_locale_us //= "Locale::US"->new)->{"state2code"}{uc $county})
3440TFif ($state and length $state > 2)
3450TFif (my $twoletterstate = ($_locale_us //= "Locale::US"->new)->{"state2code"}{uc $state})
3500TFif (($_locale_ca //= "Locale::CA"->new)->{"province2code"}{uc $state})
3520TFunless defined $location
3560TFunless $$self{"admin2"} //= "Geo::Coder::Free::DB::MaxMind::admin2"->new("no_entry", 1)
3580TFif (defined $county and $county =~ /^[A-Z]{2}$/ and $country =~ /^(United States|USA|US)$/) { }
0TFelsif ($county and $admin1cache{$county}) { }
0TFelsif ($county and $admin2cache{$county}) { }
0TFelsif (defined $state and $admin2cache{$state} and not defined $county) { }
3680TFif (defined $county and $county eq 'London') { }
0TFelsif (defined $county) { }
3740TFif ($$admin2{"concatenated_codes"} =~ /$concatenated_codes/)
3760TFif ($region =~ /^[A-Z]{2}\.([A-Z]{2})\./) { }
3780TFif (defined $state and $state =~ /^[A-Z]{2}$/) { }
3790TFif ($state eq $rc)
3930TFif ($state and not defined $region)
3940TFif ($state =~ /^[A-Z]{2}$/) { }
4000TFif ($$admin2{"concatenated_codes"} =~ /$concatenated_codes/)
4090TFif (scalar @regions == 0 and not defined $region)
4130TFif (scalar @admin2s == 0 and $country =~ /^(Canada|United States|USA|US)$/ and not $location =~ /\sCounty/i)
4170TFif (scalar @admin2s and defined $admin2s[0]{'concatenated_codes'}) { }
0TFelsif (defined $county) { }
4200TFif ($concat =~ /^CA\.(\d\d)\./) { }
0TFelsif ($concat =~ /$concatenated_codes/) { }
4310TFunless (defined $$self{"admin1"})
4320TFunless $$self{"admin1"} = "Geo::Coder::Free::DB::MaxMind::admin1"->new("no_entry", 1)
4360TFif ($$admin1{"concatenated_codes"} =~ /^\Q$concatenated_codes\E\./i)
4380TFif (scalar @admin1s == 1)
4470TFunless (defined $$self{"cities"})
4550TFif (defined $county and $county =~ /^[A-Z]{2}$/ and $country =~ /^(United States|USA|US)$/) { }
4580TFif ($region_only) { }
4650TFif ($region)
4680TFif ($country_code)
4730TFif (scalar @admin2s == 1)
4740TFif ($state) { }
0TFelsif ($county) { }
4850TFif (my $c = $params{'region'}) { }
0TFelsif ($countrycode) { }
5650TFunless (defined $city)
5680TFif ($country =~ /^(United States|USA|US)$/)
5690TFunless $region =~ /^[A-Z]{2}$/
5730TFif defined $city
5770TFif (defined $city and defined $$city{"Latitude"})
5790TFif defined $$city{"Region"} and $$city{"Region"} =~ /^[A-Z]\d$/
5800TFif defined $$city{"Population"} and length $$city{"Population"} == 0
6060TFif (not ref $self) { }
0TFelsif (ref $self eq 'HASH') { }
0TFelsif (ref $_[0] eq 'HASH') { }
0TFelsif (ref $_[0]) { }
0TFelsif (scalar @_ and scalar(@_) % 2 == 0) { }
6070TFif (scalar @_) { }
0TFelsif (not defined $self) { }
0TFelsif ($self eq __PACKAGE__) { }
6340TFif ($latlng) { }
6420TFunless (defined $latitude and defined $longitude)
6460TFunless (defined $$self{"cities"})
6560TFunless defined $c and $c =~ /^-?\d+\.?\d*$/
6600TFif (wantarray)
6780TFif ($rc)
6890TFif (my $region = $$loc{"Region"})
6940TFif ($county) { }
6970TFunless $$self{"admin2"} //= "Geo::Coder::Free::DB::MaxMind::admin2"->new("no_entry", 1)
7060TFif ($_country =~ /^[A-Z]{2}$/ and $_reg =~ /^[A-Z0-9]{1,10}$/)
7090TFif (ref $row and $$row{"name"})