Branch Coverage

File:blib/lib/Geo/Coder/Free/Local.pm
Coverage:55.2%

line%coveragebranch
76100TFif (not defined $class) { }
100TFelsif (ref $class) { }
15250TFif (not ref $self) { }
50TFelsif (ref $self eq 'HASH') { }
100TFelsif (ref $_[0] eq 'HASH') { }
50TFelsif (ref $_[0]) { }
100TFelsif (scalar @_ and scalar(@_) % 2 == 0) { }
1530TFif (scalar @_) { }
0TFelsif (not defined $self) { }
0TFelsif ($self eq __PACKAGE__) { }
176100TFunless my $location = $params{'location'}
17950TFunless $location =~ /,.+,/
188100TFif (exists $self->{'cache'}{$lc})
194100TFif (exists $self->{'index'}{$lc})
234100TFif ($location =~ /USA?$/ or $location =~ /United States$/) { }
100TFelsif ($location =~ /(England|Scotland|Wales|Northern Ireland|UK|GB)$/i) { }
50TFelsif ($location =~ /Canada$/) { }
50TFelsif ($location =~ /Australia$/) { }
251100TFif ($ap)
255100TFif ($l =~ /(.+), (England|UK)$/i)
262100TFif ($ap->parse($l) == 0)
26850TFif (my $type = $c{'street_type'})
26950TFif (my $a = &Geo::Coder::Free::_abbreviate($type)) { }
27450TFif (my $suffix = $c{'street_direction_suffix'})
28050TFif (length $c{'subcountry'} == 2) { }
28350TFif ($c{'country'} =~ /Canada/i) { }
50TFelsif ($c{'country'} =~ /^(United States|USA|US)$/i) { }
50TFelsif ($c{'country'}) { }
2850TFif (my $twoletterstate = "Locale::CA"->new->{'province2code'}{uc $c{'subcountry'}})
2900TFif (my $twoletterstate = "Locale::US"->new->{'state2code'}{uc $c{'subcountry'}})
29550TFif ($c{'subcountry'})
304100TFif (my $rc = $self->_search(\%addr, ("number", "road", "city", "state", "country")))
310100TFif ($addr{'number'})
31150TFif (my $rc = $self->_search(\%addr, ("road", "city", "state", "country")))
32150TFunless (defined $addr{'country'})
3220TFif ($l =~ /(United States|USA|US)$/i) { }
329100TFif (uc $row->{'state'} eq uc $addr{'state'} and uc $row->{'country'} eq uc $addr{'country'})
33550TFunless ($found)
343100TFif ($location =~ /^(.+?)[,\s]+(United States|USA|USA?)$/i)
35350TFif (not $location =~ /\sCounty,/i and my $href = 'Geo::StreetAddress::US'->parse_location($l) || 'Geo::StreetAddress::US'->parse_address($l))
35550TFif (my $state = $href->{'state'})
35650TFif (length $state > 2)
3570TFif (my $twoletterstate = "Locale::US"->new->{'state2code'}{uc $state})
36250TFif ($href->{'city'})
36550TFif (my $street = $href->{'street'})
366100TFif ($href->{'type'} and my $type = &Geo::Coder::Free::_abbreviate($href->{'type'}))
369100TFif ($href->{'suffix'})
372100TFif (my $prefix = $href->{'prefix'})
38250TFif ($href->{'number'})
3830TFif (my $rc = $self->_search(\%addr, ("number", "road", "city", "state", "country")))
392100TFif (my $rc = $self->_search(\%addr, ("road", "city", "state", "country")))
40150TFif ($street and not $href->{'number'})
40950TFif (my $rc = $self->_search(\%addr, ("name", "city", "state", "country")))
42550TFif (scalar @addr == 5)
42950TFif (length $state > 2)
43050TFif (my $twoletterstate = "Locale::US"->new->{'state2code'}{uc $state})
43450TFif (length $state == 2)
44150TFif (not $addr[0] =~ /^\d/) { }
44450TFif ($addr[1] =~ /^(\d+)\s+(.+)/) { }
44850TFif (my $rc = $self->_search(\%addr, ("name", "number", "road", "city", "state", "country")))
4590TFif (my $rc = $self->_search(\%addr, ("name", "road", "city", "state", "country")))
4720TFif (my $rc = $self->_search(\%addr, ("number", "road", "city", "state", "country")))
486100TFif ($location =~ /.+,.+,.*England$/ and not $location =~ /.+,.+,.+,.*England$/)
494100TFunless "Geo::Address::Parser"->can("parse")
49750TFif (my $fields = $addr_parser->parse($location))
49950TFunless defined $fields->{$key}
50150TFif (my $rc = $self->_search($fields, keys %{$fields;}))
513100TFif ($libpostal_is_installed == 0)
51450TFif (eval {         do {         require Geo::libpostal } }) { }
52650TFif ($libpostal_is_installed == 1 and my(%addr) = Geo::libpostal::parse_address($location))
5270TFif ($addr{'house_number'} and not $addr{'number'})
5300TFif ($addr{'house'} and not $addr{'name'})
5340TFif (my $street = $addr{'road'})
5370TFif (defined $addr{'state'} and not defined $addr{'country'} and $addr{'state'} eq "england")
5420TFif ($addr{'country'} and $addr{'state'} || $addr{'state_district'})
5430TFif ($addr{'country'} =~ /Canada/i) { }
0TFelsif ($addr{'country'} =~ /^(United States|USA|US)$/i) { }
5450TFif (length $addr{'state'} > 2)
5460TFif (my $twoletterstate = "Locale::CA"->new->{'province2code'}{uc $addr{'state'}})
5520TFif (length $addr{'state'} > 2)
5530TFif (my $twoletterstate = "Locale::US"->new->{'state2code'}{uc $addr{'state'}})
5580TFif ($addr{'state_district'})
5600TFif (my $rc = $self->_search(\%addr, ("number", "road", "city", "state_district", "state", "country")))
5680TFif (my $rc = $self->_search(\%addr, ("number", "road", "city", "state", "country")))
5760TFif ($addr{'number'})
5770TFif (my $rc = $self->_search(\%addr, ("road", "city", "state", "country")))
58750TFif ($location =~ /^(.+?),\s*([\s\w]+),\s*([\s\w]+),\s*([\w\s]+)$/)
60350TFif ($addr{'road'} =~ /([\w\s]+),*\s+(.+)/)
607100TFif ($addr{'road'} =~ /^(\d+)\s+(.+)/) { }
100TFelsif (my $rc = $self->_search(\%addr, ('name', 'road', 'city', 'state', 'country'))) { }
61150TFif (my $rc = $self->_search(\%addr, ("name", "number", "road", "city", "state", "country")))
625100TFif ($addr{'name'} and not defined $addr{'number'})
62850TFif (my $rc = $self->_search(\%addr, ("name", "road", "city", "state", "country")))
642100TFif ($location =~ /$left/)
647100TFif (my $rc = $self->geocode(\%params))
65550TFif ($location =~ /(.+), (England|UK)$/i)
657100TFif (my $rc = $self->geocode(\%params))
69250TFif (defined $data->{$column}) { }
0TFelsif (exists $data->{$column}) { }
693100TFunless (defined $row->{$column})
699100TFif (uc $row->{$column} ne uc $data->{$column})
709100TFif ($match and $number_of_columns_matched >= 3)
71150TFif ($number_of_columns_matched == scalar @columns) { }
0TFelsif ($number_of_columns_matched >= 4) { }
74350TFif (not ref $self) { }
50TFelsif (ref $self eq 'HASH') { }
100TFelsif (ref $_[0] eq 'HASH') { }
50TFelsif (ref $_[0]) { }
100TFelsif (scalar @_ and scalar(@_) % 2 == 0) { }
7440TFif (scalar @_) { }
0TFelsif (not defined $self) { }
0TFelsif ($self eq __PACKAGE__) { }
771100TFif ($latlng) { }
779100TFunless (defined $latitude and defined $longitude)
78650TFif (defined $row->{'latitude'} and defined $row->{'longitude'})
788100TFif (_equal($row->{'latitude'}, $latitude, 4) and _equal($row->{'longitude'}, $longitude, 4))
792100TFif (wantarray) { }
796100TFif ($location =~ /$right/)
857100TFif scalar @lines == 0
87050TFif $line =~ /^\s*$/
879100TFif ($char eq '"') { }
100TFelsif ($char eq ',' and not $in_quotes) { }
897100TFif ($location{'latitude'} and $location{'longitude'} and $location{'latitude'} =~ /^-?\d+\.?\d*$/ and $location{'longitude'} =~ /^-?\d+\.?\d*$/)
918100TFif (@$locations_ref >= 3)