Branch Coverage

File:blib/lib/Geo/Coder/List.pm
Coverage:93.8%

line%coveragebranch
357100TFif (not defined $class) { }
100TFelsif (&blessed($class)) { }
358100TFif (scalar keys %{$params;} > 0)
374100TFref $_ eq 'HASH' ? :
466100TFunless defined $geocoder
483100TFunless (defined $HAVE_RULE)
48450TFeval {         do {         require Geo::Location::Predicate; 'Geo::Location::Predicate'->can('_valid_location') ? 1 : 0 } } ? :
48650TF'Geo::Location::Predicate'->can('_valid_location') ? :
493100TFGeo::Location::Predicate::_valid_location($location) ? :
50TFif $HAVE_RULE
4950TFif ref $location
4960TFunless defined $location and length $location
60650TFunless (defined $params)
617100TFif ref $location eq "SCALAR"
620100TFif (not defined $location or length $location == 0)
629100TFunless (ref $location)
638100TFunless (_could_be_a_location($location))
639100TFref $location ? :
661100TFif (defined $cached and not ref $cached)
665100TFif (defined $cached)
667100TFref $cached eq 'ARRAY' ? :
67350TFunless ref $r
674100TFif ref $r eq "HASH"
679100TFunless (wantarray)
707100TFif (ref $r eq 'HASH') { }
50TFelsif (ref $r eq 'Geo::Location::Point') { }
708100TFif defined $r->{'geometry'}{'location'}{'lat'}
713100TFif $allempty
719100TFif (exists $self->{'locations'}{$location})
72150TFif (ref $stored and ref $stored eq "Geo::Coder::List::_NotFound")
723100TFwantarray ? :
733100TFif (ref $geocoder eq "HASH")
737100TFif (my $regex = $geocoder->{'regex'})
739100TFunless ($location =~ /$regex/)
745100TFif (exists $geocoder->{'limit'} and defined(my $limit = $geocoder->{'limit'}))
747100TFif ($limit <= 0)
764100TFif (ref $geocoder eq 'Geo::GeoNames') { }
766100TFunless defined $geocoder->username
773100TFif ($@)
791100TFif (ref $geocoder eq "Geo::Coder::US::Census" and not defined $rc[0]{'result'}{'addressMatches'}[0]{'coordinates'}{'y'})
808100TFref $_ eq 'ARRAY' ? :
811100TFif (scalar @rc == 0 or ref $rc[0] eq "HASH" and scalar keys %{$rc[0];} == 0)
833100TFif (not defined $l or $l eq "")
848100TFunless ref $l
854100TFif $self->{'debug'} >= 2
859100TFif (ref $l eq "Geo::Location::Point")
863100TFif (not defined $l->{'geometry'}{'location'}{'lat'} and defined $l->{'lat'})
88650TFif ref $l ne "HASH"
888100TFif ($l->{'error'}) { }
902100TFunless (defined $l->{'geometry'}{'location'}{'lat'})
905100TFif (defined $l->{'lat'} and defined $l->{'lon'}) { }
100TFelsif ($l->{'BestLocation'}) { }
100TFelsif ($l->{'point'}) { }
100TFelsif (defined $l->{'latt'}) { }
100TFelsif (defined $l->{'latitude'}) { }
100TFelsif (defined $l->{'properties'}{'geoLatitude'}) { }
100TFelsif ($l->{'results'}[0]{'geometry'}) { }
100TFelsif ($l->{'RESULTS'}) { }
100TFelsif (defined $l->{'result'}{'addressMatches'}[0]{'coordinates'}{'y'}) { }
100TFelsif (defined $l->{'lat'}) { }
100TFelsif ($l->{'features'}) { }
929100TFif (my $type = $l->{'local_type'})
940100TFif ($l->{'results'}[0]{'geometry'}{'location'}) { }
967100TFif ($l->{'features'}[0]{'center'}) { }
100TFelsif ($l->{'features'}[0]{'geometry'}{'coordinates'}) { }
985100TFif (defined $lat and defined $long) { }
1000100TFif ($l->{'standard'}{'countryname'})
1008100TFif (defined $l->{'geometry'}{'location'}{'lat'})
1015100TFif (defined $l->{'geometry'}{'location'}{'lat'} and defined $l->{'geometry'}{'location'}{'lng'})
1043100TFunless defined $good_result
1048100TFif ($self->{'debug'} >= 2)
105650TFunless (defined $good_result->{'lat'} and defined $good_result->{'lng'})
1061100TFif (wantarray)
1079100TFwantarray ? :
1136100TFunless $ua
1140100TFref $g eq 'HASH' ? :
1142100TFunless defined $geocoder
1151100TFif ($ua->can('clone') and $ua->can('agent')) { }
1155100TF$version ? :
1244100TFunless my $latlng = $params->{'latlng'}
1248100TFif ref $latlng or not $latlng =~ /$LATLNG_RE/
1259100TFif (defined(my $rc = $self->_cache($latlng)))
1260100TFif (ref $rc eq "ARRAY")
1261100TFwantarray ? :
1272100TFif (ref $geocoder eq "HASH")
1273100TFif (exists $geocoder->{'limit'} and defined(my $limit = $geocoder->{'limit'}))
1275100TFif ($limit <= 0)
1285100TFif (wantarray) { }
1296100TFif ($@ =~ /Unknown parameter.*latlng|latlng.*[Uu]nknown/s)
1303100TFif ($@)
131650TFif $self->{'debug'} >= 2
1319100TFunless defined $loc
1323100TFunless (ref $loc)
1324100TFif length $loc
1327100TFunless &reftype($loc) eq "HASH"
1329100TFif (my $name = $loc->{'display_name'}) { }
100TFelsif ($loc->{'city'}) { }
50TFelsif ($loc->{'features'}) { }
1354100TFunless scalar @rc
1365100TFif ($@ =~ /Unknown parameter.*latlng|latlng.*[Uu]nknown/s)
1372100TFif ($@)
1386100TFunless defined $rc
1387100TFunless (ref $rc)
1399100TFif $self->{'debug'} >= 2
1401100TFif (my $name = $rc->{'display_name'})
1414100TFif ($rc->{'city'})
142850TFif ($rc->{'features'})
1578100TFif (my $usa = $loc->{'usa'}) { }
1582100TF$name ? :
100TFif $usa->{'usstaddress'}
1584100TF$name ? :
100TFif $usa->{'uscity'}
158550TF$name ? :
100TFif $usa->{'state'}
158750TF$name ? :
1592100TF$name ? :
100TFif $loc->{'staddress'}
1593100TF$name ? :
100TFif $loc->{'city'}
159450TF$name ? :
100TFif $loc->{'prov'}
1636100TFif (scalar @_)
1640100TFdefined $value ? :
1645100TFif ($self->{'cache'})
1652100TFif (ref $value eq 'ARRAY') { }
100TFelsif (ref $value eq 'HASH') { }
1656100TFunless ref $item eq "HASH"
1658100TFunless (_has_lat($item))
1663100TFdefined $item->{'geometry'} ? :
1674100TFif (_has_lat($l2value)) { }
100TFelsif (defined $l2value->{'geometry'}) { }
1692100TFif $self->{'debug'}
1695100TFif (not defined $value) { }
100TFelsif (ref $self->{'cache'} eq 'HASH') { }
1703100TFunless eval {         do {         $self->{'cache'}->set($key, $l2value, $duration); 1 } }
1717100TFif (not defined $rc and $self->{'cache'})
1718100TFif (ref $self->{'cache'} eq 'HASH') { }
1725100TFif $@
1729100TFunless defined $rc
1732100TFif ref $rc and ref $rc eq "Geo::Coder::List::_NotFound"
1735100TFif (ref $rc eq "HASH")
1736100TFunless defined $rc->{'geometry'}{'location'}{'lat'}
1752100TFunless ref $item and &reftype($item) eq "HASH"
1755100TFif &blessed($item)
1757100TFif ref $copy->{'geocoder'}
1760100TFunless ($keep_all or &blessed($item))
1772100TFunless ref $item->{'geometry'} eq "HASH"
1773100TFunless ref $item->{'geometry'}{'location'} eq "HASH"
1774100TFdefined $item->{'geometry'}{'location'}{'lat'} ? :
1784100TFunless $message =~ /\n\z/
1786100TFif (my $logger = $self->{'logger'})
1790100TFif ($self->{'debug'})
1799100TFif (my $logger = $self->{'logger'}) { }
1810100TFif (my $logger = $self->{'logger'}) { }