Branch Coverage

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

line%coveragebranch
166100TFif (not defined $class) { }
100TFelsif (ref $class) { }
194100TFif $towns
336100TFif (not ref $self) { }
100TFelsif (ref $self eq 'HASH') { }
337100TFif (scalar @_) { }
100TFelsif (not defined $self) { }
100TFelsif ($self eq __PACKAGE__) { }
354100TFunless my $location = $params{'location'}
361100TFif exists $self->{'cache'}{$lc}
363100TFif exists $self->{'index'}{$lc}
368100TFif $self->_missed($lc)
371100TFunless $location =~ /,.+,/
374100TFif ($location =~ /USA?$/ or $location =~ /United States$/) { }
100TFelsif ($location =~ /(England|Scotland|Wales|Northern Ireland|UK|GB)$/i) { }
100TFelsif ($location =~ /Canada$/) { }
100TFelsif ($location =~ /Australia$/) { }
390100TFif ($ap)
394100TFif ($ap->parse($l) == 0)
39850TFif (my $street = $c{'street_name'})
39950TFif (my $type = $c{'street_type'})
40350TFif $c{'street_direction_suffix'}
409100TFif (length $c{'subcountry'} == 2) { }
41350TFif ($country_raw =~ /Canada/i) { }
50TFelsif ($country_raw =~ /^(United States|USA|US)$/i) { }
50TFelsif ($country_raw) { }
42150TFif $c{'subcountry'}
427100TFif (my $rc = $self->_search(\%addr, ("number", "road", "city", "state", "country")))
430100TFif ($addr{'number'})
43150TFif (my $rc = $self->_search(\%addr, ("road", "city", "state", "country")))
438100TFunless (defined $addr{'country'})
43950TF$l =~ /(United States|USA|US)$/i ? :
448100TFunless $self->{'region_index'}{$rk}
452100TFif ($location =~ /^(.+?)[,\s]+(United States|USA|US)$/i)
45850TFunless ($location =~ /\sCounty,/i)
46250TFif ($href)
46350TFif (my $state = $href->{'state'})
46450TFif length $state > 2
46650TFif (my $street = $href->{'street'})
467100TFif ($href->{'type'})
470100TFif $href->{'suffix'}
471100TFif $href->{'prefix'}
47950TFif ($href->{'number'})
4800TFif (my $rc = $self->_search(\%addr, ("number", "road", "city", "state", "country")))
485100TFif (my $rc = $self->_search(\%addr, ("road", "city", "state", "country")))
49050TFif ($street and not $href->{'number'})
49250TFif (my $rc = $self->_search(\%addr, ("name", "city", "state", "country")))
504100TFif (scalar @parts == 5)
50650TFif (length $state == 2)
50850TFif (not $parts[0] =~ /^\d/) { }
51050TFif ($parts[1] =~ /^(\d+)\s+(.+)/) { }
51350TFif (my $rc = $self->_search(\%addr, ("name", "number", "road", "city", "state", "country")))
5190TFif (my $rc = $self->_search(\%addr, ("name", "road", "city", "state", "country")))
5270TFif (my $rc = $self->_search(\%addr, ("number", "road", "city", "state", "country")))
537100TFif ($location =~ /[^,]+,[^,]+,.*England$/ and not $location =~ /[^,]+,[^,]+,[^,]+,.*England$/)
54250TFunless ("Geo::Address::Parser"->can("parse"))
54550TFif ("Geo::Address::Parser"->can("parse"))
5470TFif (my $fields = $addr_parser->parse($location))
5500TFif (my $rc = $self->_search($fields, keys %{$fields;}))
558100TFif ($libpostal_is_installed == 0)
55950TFif (eval {         do {         require Geo::libpostal; 1 } }) { }
56750TFif ($libpostal_is_installed == 1)
5690TFif (%addr)
5710TFif $addr{'house_number'} and not $addr{'number'}
5720TFif $addr{'house'} and not $addr{'name'}
5750TFif (my $street = $addr{'road'})
5800TFif (defined $addr{'state'} and not defined $addr{'country'} and $addr{'state'} eq "england")
5860TFif ($addr{'country'} and $addr{'state'} || $addr{'state_district'})
5870TFif ($addr{'country'} =~ /Canada/i) { }
0TFelsif ($addr{'country'} =~ /^(United States|USA|US)$/i) { }
5900TFif $addr{'state'} and length $addr{'state'} > 2
5940TFif $addr{'state'} and length $addr{'state'} > 2
5970TFif ($addr{'state_district'})
5990TFif (my $rc = $self->_search(\%addr, ("number", "road", "city", "state_district", "state", "country")))
6030TFif (my $rc = $self->_search(\%addr, ("number", "road", "city", "state", "country")))
6060TFif ($addr{'number'})
6070TFif (my $rc = $self->_search(\%addr, ("road", "city", "state", "country")))
616100TFif ($location =~ /^(.+?),\s*([\s\w]+),\s*([\s\w]+),\s*([\w\s]+)$/)
626100TFif ($addr{'road'} =~ /([\w\s]+),*\s+(.+)/)
630100TFif ($addr{'road'} =~ /^(\d+)\s+(.+)/) { }
100TFelsif (my $rc = $self->_search(\%addr, ('name', 'road', 'city', 'state', 'country'))) { }
63350TFif (my $rc = $self->_search(\%addr, ("name", "number", "road", "city", "state", "country")))
639100TFif ($addr{'name'} and not defined $addr{'number'})
64050TFif (my $rc = $self->_search(\%addr, ("name", "road", "city", "state", "country")))
649100TFunless $location =~ /$left/
652100TFif (my $rc = $self->geocode(\%params))
655100TFif ($mapped =~ /(.+), (England|UK)$/i)
657100TFif (my $rc = $self->geocode(\%params))
695100TFif (not ref $self) { }
50TFelsif (ref $self eq 'HASH') { }
696100TFif (scalar @_) { }
100TFelsif (not defined $self) { }
50TFelsif ($self eq __PACKAGE__) { }
714100TFif (my $latlng = $params{'latlng'}) { }
721100TFunless (defined $latitude and defined $longitude)
72750TFunless defined $row->{'latitude'} and defined $row->{'longitude'}
729100TFunless _equal($row->{'latitude'}, $latitude, 4) and _equal($row->{'longitude'}, $longitude, 4)
734100TFif (wantarray) { }
741100TFif ($location =~ /$right/)
787100TFif ref $args[0] eq "HASH"
788100TFif ref $args[0]
789100TFif @args and @args % 2 == 0
790100TFif @args == 1
793100TFif @args
819100TFif not defined $state or length $state <= 2
821100TFif ($country =~ /^(United States|USA|US)$/i) { }
100TFelsif ($country =~ /Canada/i) { }
851100TFif (defined $data->{$column}) { }
100TFelsif (exists $data->{$column}) { }
852100TFunless defined $row->{$column}
853100TFif uc $row->{$column} ne uc $data->{$column}
865100TFif $matched < 3
868100TF$matched >= 4 ? :
100TF$matched == scalar @columns ? :
925100TFunless defined $row->{'latitude'} and defined $row->{'longitude'}
926100TFunless $row->{'latitude'} =~ /^-?\d+\.?\d*$/
927100TFunless $row->{'longitude'} =~ /^-?\d+\.?\d*$/
938100TFif @{$locs;} < 3
955100TF@centres ? :