Branch Coverage

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

line%coveragebranch
11350TFref $_[0] eq 'HASH' ? :
11550TFif (not defined $class) { }
50TFelsif (&Scalar::Util::blessed($class)) { }
13050TFunless (-d $directory)
17050TFif (not ref $self) { }
50TFelsif (ref $self eq 'HASH') { }
50TFelsif (ref $_[0] eq 'HASH') { }
0TFelsif (ref $_[0]) { }
0TFelsif (scalar @_ and scalar(@_) % 2 == 0) { }
1710TFif (scalar @_) { }
0TFelsif (not defined $self) { }
0TFelsif ($self eq __PACKAGE__) { }
19450TFunless my $location = $params{"location"}
19750TFunless ($location =~ /\D/)
20250TFif ($location =~ /^(.+),\s*Washington\s*DC,(.+)$/)
20650TFif (my $rc = $known_locations{$location})
21950TFunless $location =~ /,/ or $params{"region"}
2230TFif $cached_result
2320TFif ($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+)$/) { }
2420TFif ($location =~ /^St\.? (.+)/)
2450TFif ($country =~ /^(Canada|United States|USA|US)$/)
2820TFif ($country)
2830TFif (defined $country and $country eq 'UK' || $country eq 'United Kingdom' || $country eq 'England')
2930TFif ($state and $admin1cache{$state}) { }
0TFelsif ($admin1cache{$country} and not defined $state) { }
2980TFunless $$self{"admin1"} //= "Geo::Coder::Free::DB::MaxMind::admin1"->new("no_entry", 1)
3000TFif (my $admin1 = $$self{'admin1'}->fetchrow_hashref('asciiname', $country)) { }
0TFelsif ($state) { }
0TFelsif ($countrycode) { }
0TFelsif (Locale::Country::code2country($country)) { }
3050TFif ($state =~ /^[A-Z]{2}$/) { }
3110TFif ($$admin1{"concatenated_codes"} =~ /^$concatenated_codes\./i)
3270TFunless defined $concatenated_codes
3340TFif ($country =~ /^(United States|USA|US)$/) { }
0TFelsif ($country eq 'Canada' and $state and length $state > 2) { }
3350TFif ($county and length $county > 2)
3360TFif (my $twoletterstate = "Locale::US"->new->{"state2code"}{uc $county})
3410TFif ($state and length $state > 2)
3420TFif (my $twoletterstate = "Locale::US"->new->{"state2code"}{uc $state})
3490TFif ("Locale::CA"->new->{"province2code"}{uc $state})
3510TFunless defined $location
3550TFunless $$self{"admin2"} //= "Geo::Coder::Free::DB::MaxMind::admin2"->new("no_entry", 1)
3570TFif (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) { }
3710TFif (defined $county and $county eq 'London') { }
0TFelsif (defined $county) { }
3800TFif ($$admin2{"concatenated_codes"} =~ /$concatenated_codes/)
3820TFif ($region =~ /^[A-Z]{2}\.([A-Z]{2})\./) { }
3840TFif (defined $state and $state =~ /^[A-Z]{2}$/) { }
3850TFif ($state eq $rc)
3990TFif ($state and not defined $region)
4000TFif ($state =~ /^[A-Z]{2}$/) { }
4060TFif ($$admin2{"concatenated_codes"} =~ /$concatenated_codes/)
4150TFif (scalar @regions == 0 and not defined $region)
4200TFif (scalar @admin2s == 0 and $country =~ /^(Canada|United States|USA|US)$/ and not $location =~ /\sCounty/i)
4250TFif (scalar @admin2s and defined $admin2s[0]{'concatenated_codes'}) { }
0TFelsif (defined $county) { }
4280TFif ($concat =~ /^CA\.(\d\d)\./) { }
0TFelsif ($concat =~ /$concatenated_codes/) { }
4400TFunless (defined $$self{"admin1"})
4410TFunless $$self{"admin1"} = "Geo::Coder::Free::DB::MaxMind::admin1"->new("no_entry", 1)
4460TFif ($$admin1{"concatenated_codes"} =~ /^$concatenated_codes\./i)
4480TFif (scalar @admin1s == 1)
4570TFunless (defined $$self{"cities"})
4650TFif (defined $county and $county =~ /^[A-Z]{2}$/ and $country =~ /^(United States|USA|US)$/) { }
4680TFif ($region_only) { }
4750TFif ($region)
4760TFif ($region =~ /^.+\.(.+)$/)
4800TFif ($country_code)
4850TFif (scalar @admin2s == 1)
4860TFif ($state) { }
0TFelsif ($county) { }
4950TFif (my $c = $params{'region'}) { }
0TFelsif ($countrycode) { }
5810TFunless (defined $city)
5840TFif ($region =~ /^.+\.(.+)$/)
5870TFif ($country =~ /^(United States|USA|US)$/)
5880TFunless $region =~ /^[A-Z]{2}$/
5920TFif defined $city
5970TFif (defined $city and defined $$city{"Latitude"})
5990TFif defined $$city{"Region"} and $$city{"Region"} =~ /^[A-Z]\d$/
6000TFif defined $$city{"Population"} and length $$city{"Population"} == 0
6260TFif (not ref $self) { }
0TFelsif (ref $self eq 'HASH') { }
0TFelsif (ref $_[0] eq 'HASH') { }
0TFelsif (ref $_[0]) { }
0TFelsif (scalar @_ and scalar(@_) % 2 == 0) { }
6270TFif (scalar @_) { }
0TFelsif (not defined $self) { }
0TFelsif ($self eq __PACKAGE__) { }
6540TFif ($latlng) { }
6620TFunless (defined $latitude and defined $longitude)
6660TFunless (defined $$self{"cities"})
6730TFif (wantarray)
6820TFif (my $rc = $$self{"cities"}->execute("SELECT * FROM cities WHERE ((ABS(Latitude - $latitude)) < $radius) AND ((ABS(Longitude - $longitude)) < $radius) LIMIT 1"))
6940TFif (my $region = $$loc{"Region"})
6990TFif ($value eq $region)
7040TFif ($county) { }
7080TFunless $$self{"admin2"} //= "Geo::Coder::Free::DB::MaxMind::admin2"->new("no_entry", 1)
7130TFif (ref $row and $$row{"name"})