Branch Coverage

File:blib/lib/Database/BI/Model/Geocode.pm
Coverage:89.5%

line%coveragebranch
155100TF@args ? :
162100TFif (my $i18n = $self->{'_i18n'})
631100TFif &blessed($cache) and not $cache->can('get') && $cache->can('set')
639100TFunless (defined $cache)
646100TFdefined $args->{'config'} ? :
100TFdefined $args->{'model_dir'} && length $args->{'model_dir'} ? :
648100TFif defined $cache_dir
654100TFif defined $online_max and not $online_max =~ /\A\d+\z/ && $online_max > 0
661100TF$args->{'online'} ? :
667100TFif (my $geocoder = $args->{'geocoder'})
683100TFif $geocoder->can($method)
708100TFunless ($ok)
711100TFdefined $Geo::Coder::Free::VERSION ? :
100TF$error =~ /Can't locate/ ? :
725100TFunless ($have_list)
7290TFdefined $Geo::Coder::List::VERSION ? :
50TF$error =~ /Can't locate/ ? :
73850TF$self->{'openaddr'} ? :
741100TFunless ($local)
75650TFif ($self->{'online'})
75750TFif (my $online = _online_geocoder()) { }
80250TFunless $ok and nominatim_ua()
8380TFif $online_ua
8450TFunless $ok
866100TF$geocoder->can('valid_location') ? :
875100TFunless (exists $self->{'_geocoder'})
892100TFunless ref $point and ref $point ne "ARRAY"
89450TFif (&blessed($point) and $point->can("latitude") and $point->can("longitude"))
89850TFif (ref $point eq "HASH")
915100TFunless ref $point and ref $point ne "ARRAY"
918100TF&blessed($point) && $point->can($key) ? :
91950TFif &blessed($value)
92050TFif defined $value and $value eq "cache"
92150TFif defined $value and length $value and not ref $value
934100TFunless ref $entry eq "ARRAY" and @{$entry;} >= 2
936100TFdefined $entry->[0] && defined $entry->[1] ? :
966100TFdefined $value && !ref($value) ? :
967100TFif $seen{$key}++
972100TFif (not defined $value or ref $value or not length $key)
979100TFif (exists $cache{$key})
980100TFif (_has_position($cache{$key})) { }
1000100TFunless ($geocoder)
1009100TFunless ($self->_judge($geocoder)->valid_location($key))
1023100TFif ($wanted > $max)
1035100TFunless ($opts->{'lookup'} // 1)
1051100TFif (@attempt)
105350TF$self->{'_local_chain'} ? :
50TF$self->{'_online'} ? :
106350TFif $lookup->{'spent'} and @{$lookup->{'held'};}
1069100TFif (defined $lat and defined $lon) { }
1077100TFdefined $backend ? :
1082100TFif defined $backend
110350TFdefined $reason ? :
100TFunless $available
1106100TFif $capped
111050TFif defined $lookup->{'failed'} and @{$lookup->{'held'};}
1115100TFif @attempt and not $self->{'openaddr'} and not $self->{'_online'}
111850TFif $unresolved and $self->{'_online_missing'}
1131100TF$available ? :
100TF@names ? :
1157100TFdefined $region ? :
1167100TFref $batch eq 'HASH' ? :
100TFref $batch eq 'HASH' && defined $batch->{'lookups'} ? :
1191100TFdefined $region ? :
1194100TFunless grep {($_->{'geocoder'} // "") eq "cache";} @log
1196100TFif (not $point and grep {defined $_->{'error'};} @log)
1241100TFif (defined $failed or defined $budget and $asked >= $budget)
125250TFunless grep {($_->{'geocoder'} // "") eq "cache";} @log
125550TFif (@went)
1261100TFif (not $point and defined $thrown || !$response || !$response->is_success)
1265100TF$response ? :
100TFdefined $thrown ? :
127350TFif defined $_->{'error'}
50TFif (not $point and grep {($_->{'geocoder'} // "") ne $class if defined $_->{'error'};} @log)
1281100TFif (@rest)
1290100TFif (defined $lat and defined $lon) { }
1299100TF!defined($failed) && @rest ? :
1325100TFif (defined $args->{'max'})
1331100TFunless $args->{'max'} =~ /\A\d+\z/ and $args->{'max'} > 0
1340100TF$args->{'lookup'} ? :
1426100TFdefined $values ? :
100TFunless ref $values eq "ARRAY"
1445100TFdefined $rows ? :
100TFunless ref $rows eq "ARRAY"
1448100TFunless defined $column and length $column
1459100TFif (ref $row eq "HASH")
1460100TFif exists $row->{$column}
1468100TFif @{$rows;} and not $found
1477100TFdefined $cells[$index] && !ref($cells[$index]) ? :
1480100TFunless exists $first_row{$key}
1503100TFif ($plotted < $rows_total)
1509100TFdefined $value && !ref($value) ? :
1510100TFlength $key ? :
1570100TFif $self->_geocoder
1573100TFif ($self->{'_unavailable_key'} // "") eq "error_map_geocoder_list_missing"
1618100TFdefined $dir ? :
100TFunless defined $dir and not ref $dir and -d $dir
1700100TFdefined $rows ? :
100TFunless ref $rows eq "ARRAY"
1703100TFif defined $_ and not ref $_
1704100TFref $columns eq 'ARRAY' ? :
1705100TFunless @columns
1708100TFdefined $text && !ref($text) ? :
1709100TFif @columns == 1 and not length $text
1715100TFref $row eq 'HASH' ? :
1716100TFdefined $cell && !ref($cell) ? :
1719100TFif defined $place and length $place and length $text
1720100TFdefined $place ? :
1760100TFunless defined $value
1761100TFif ref $value or $value =~ /[\x00-\x1f\x7f]/
1764100TFif length $text > $PLACE_TEXT_MAX
1810100TFref $models eq 'HASH' ? :
1812100TFunless ref $entry eq "HASH" and ref $entry->{'places'} eq "HASH"
1880100TFref $models eq 'HASH' ? :
1885100TFif defined $meta{$key}
1888100TFref $models eq 'HASH' ? :
1938100TFref $models eq 'HASH' ? :
1939100TFref $geo eq 'HASH' ? :
1941100TFunless ref $entry eq "HASH" and ref $entry->{'places'} eq "HASH"
2010100TFref $cache eq 'HASH' ? :
2014100TFref $models eq 'HASH' && ref $models->{'geo'} eq 'HASH' ? :
2016100TFref $entry eq 'HASH' ? :
2021100TFif defined $meta{$key}
2024100TFref $models eq 'HASH' ? :