Branch Coverage

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

line%coveragebranch
161100TFif (not defined $class) { }
100TFelsif (ref $class) { }
189100TFif $towns
269100TFif (not ref $self) { }
100TFelsif (ref $self eq 'HASH') { }
270100TFif (scalar @_) { }
100TFelsif (not defined $self) { }
100TFelsif ($self eq __PACKAGE__) { }
287100TFunless my $location = $params{'location'}
291100TFunless $location =~ /,.+,/
297100TFif exists $self->{'cache'}{$lc}
299100TFif exists $self->{'index'}{$lc}
302100TFif ($location =~ /USA?$/ or $location =~ /United States$/) { }
100TFelsif ($location =~ /(England|Scotland|Wales|Northern Ireland|UK|GB)$/i) { }
100TFelsif ($location =~ /Canada$/) { }
100TFelsif ($location =~ /Australia$/) { }
318100TFif ($ap)
322100TFif ($ap->parse($l) == 0)
32650TFif (my $street = $c{'street_name'})
32750TFif (my $type = $c{'street_type'})
33150TFif $c{'street_direction_suffix'}
337100TFif (length $c{'subcountry'} == 2) { }
34150TFif ($country_raw =~ /Canada/i) { }
50TFelsif ($country_raw =~ /^(United States|USA|US)$/i) { }
50TFelsif ($country_raw) { }
34950TFif $c{'subcountry'}
355100TFif (my $rc = $self->_search(\%addr, ("number", "road", "city", "state", "country")))
358100TFif ($addr{'number'})
35950TFif (my $rc = $self->_search(\%addr, ("road", "city", "state", "country")))
366100TFunless (defined $addr{'country'})
36750TF$l =~ /(United States|USA|US)$/i ? :
376100TFunless $self->{'region_index'}{$rk}
380100TFif ($location =~ /^(.+?)[,\s]+(United States|USA|US)$/i)
38650TFunless ($location =~ /\sCounty,/i)
39050TFif ($href)
39150TFif (my $state = $href->{'state'})
39250TFif length $state > 2
39450TFif (my $street = $href->{'street'})
395100TFif ($href->{'type'})
398100TFif $href->{'suffix'}
399100TFif $href->{'prefix'}
40750TFif ($href->{'number'})
4080TFif (my $rc = $self->_search(\%addr, ("number", "road", "city", "state", "country")))
413100TFif (my $rc = $self->_search(\%addr, ("road", "city", "state", "country")))
41850TFif ($street and not $href->{'number'})
42050TFif (my $rc = $self->_search(\%addr, ("name", "city", "state", "country")))
432100TFif (scalar @parts == 5)
43450TFif (length $state == 2)
43650TFif (not $parts[0] =~ /^\d/) { }
43850TFif ($parts[1] =~ /^(\d+)\s+(.+)/) { }
44150TFif (my $rc = $self->_search(\%addr, ("name", "number", "road", "city", "state", "country")))
4470TFif (my $rc = $self->_search(\%addr, ("name", "road", "city", "state", "country")))
4550TFif (my $rc = $self->_search(\%addr, ("number", "road", "city", "state", "country")))
465100TFif ($location =~ /[^,]+,[^,]+,.*England$/ and not $location =~ /[^,]+,[^,]+,[^,]+,.*England$/)
47050TFunless ("Geo::Address::Parser"->can("parse"))
47350TFif ("Geo::Address::Parser"->can("parse"))
4750TFif (my $fields = $addr_parser->parse($location))
4780TFif (my $rc = $self->_search($fields, keys %{$fields;}))
486100TFif ($libpostal_is_installed == 0)
48750TFif (eval {         do {         require Geo::libpostal; 1 } }) { }
49550TFif ($libpostal_is_installed == 1)
4970TFif (%addr)
4990TFif $addr{'house_number'} and not $addr{'number'}
5000TFif $addr{'house'} and not $addr{'name'}
5030TFif (my $street = $addr{'road'})
5080TFif (defined $addr{'state'} and not defined $addr{'country'} and $addr{'state'} eq "england")
5140TFif ($addr{'country'} and $addr{'state'} || $addr{'state_district'})
5150TFif ($addr{'country'} =~ /Canada/i) { }
0TFelsif ($addr{'country'} =~ /^(United States|USA|US)$/i) { }
5180TFif $addr{'state'} and length $addr{'state'} > 2
5220TFif $addr{'state'} and length $addr{'state'} > 2
5250TFif ($addr{'state_district'})
5270TFif (my $rc = $self->_search(\%addr, ("number", "road", "city", "state_district", "state", "country")))
5310TFif (my $rc = $self->_search(\%addr, ("number", "road", "city", "state", "country")))
5340TFif ($addr{'number'})
5350TFif (my $rc = $self->_search(\%addr, ("road", "city", "state", "country")))
544100TFif ($location =~ /^(.+?),\s*([\s\w]+),\s*([\s\w]+),\s*([\w\s]+)$/)
554100TFif ($addr{'road'} =~ /([\w\s]+),*\s+(.+)/)
558100TFif ($addr{'road'} =~ /^(\d+)\s+(.+)/) { }
100TFelsif (my $rc = $self->_search(\%addr, ('name', 'road', 'city', 'state', 'country'))) { }
56150TFif (my $rc = $self->_search(\%addr, ("name", "number", "road", "city", "state", "country")))
567100TFif ($addr{'name'} and not defined $addr{'number'})
56850TFif (my $rc = $self->_search(\%addr, ("name", "road", "city", "state", "country")))
577100TFunless $location =~ /$left/
580100TFif (my $rc = $self->geocode(\%params))
583100TFif ($mapped =~ /(.+), (England|UK)$/i)
585100TFif (my $rc = $self->geocode(\%params))
623100TFif (not ref $self) { }
50TFelsif (ref $self eq 'HASH') { }
624100TFif (scalar @_) { }
100TFelsif (not defined $self) { }
50TFelsif ($self eq __PACKAGE__) { }
642100TFif (my $latlng = $params{'latlng'}) { }
649100TFunless (defined $latitude and defined $longitude)
65550TFunless defined $row->{'latitude'} and defined $row->{'longitude'}
657100TFunless _equal($row->{'latitude'}, $latitude, 4) and _equal($row->{'longitude'}, $longitude, 4)
662100TFif (wantarray) { }
666100TFif ($location =~ /$right/)
700100TFif ref $args[0] eq "HASH"
701100TFif ref $args[0]
702100TFif @args and @args % 2 == 0
703100TFif @args == 1
706100TFif @args
732100TFif not defined $state or length $state <= 2
734100TFif ($country =~ /^(United States|USA|US)$/i) { }
100TFelsif ($country =~ /Canada/i) { }
761100TFif (defined $data->{$column}) { }
100TFelsif (exists $data->{$column}) { }
762100TFunless defined $row->{$column}
763100TFif uc $row->{$column} ne uc $data->{$column}
770100TFif $matched < 3
773100TF$matched >= 4 ? :
100TF$matched == scalar @columns ? :
799100TFunless defined $row->{'latitude'} and defined $row->{'longitude'}
800100TFunless $row->{'latitude'} =~ /^-?\d+\.?\d*$/
801100TFunless $row->{'longitude'} =~ /^-?\d+\.?\d*$/
812100TFif @{$locs;} < 3
829100TF@centres ? :