| line | % | coverage | branch |
| 127 | 50 | T | F | unless $class |
| 129 | 100 | T | F | if (my $openaddr = $param{"openaddr"}) |
| 130 | 100 | T | F | unless -d $openaddr and -r $openaddr |
| 183 | 50 | T | F | @_ == 1 && !ref($_[0]) ? : |
| 188 | 50 | T | F | if ($$param{"ignore_words"}) |
| 192 | 100 | T | F | if (my $scantext = $$param{"scantext"}) |
| 193 | 50 | T | F | if length $scantext < 6 |
| 201 | 0 | T | F | if ($region) |
| 205 | 0 | T | F | if (length $words[$offset] < 2) |
| 209 | 0 | T | F | if (exists $ignore_words{lc $words[$offset]}) |
| 214 | 0 | T | F | if ($l = $self->geocode("location", $words[$offset]) and ref $l) |
| 217 | 0 | T | F | if ($offset < $count - 1) |
| 219 | 0 | T | F | if (length $addr == 0) |
| 224 | 0 | T | F | if ($addr =~ /\s+(?:\d{2,5}\s+)(?![ap]m\b)(?:(?:[a-zA-Z\s]{1,5}){1,2})?(?:[\s,.]+)?(?:(?:[a-zA-Z\s]{1,30}){1,4})(?:court|ct|street|st|drive|dr|lane|ln|road|rd|blvd)(?:[\s,.;]+)?(?:(?:[a-zA-Z\s]{1,30}){1,2})(?:[\s,.]+)?\b(?:AK|AL|AR|AZ|CA|CO|CT|DC|DE|FL|GA|GU|HI|IA|ID|IL|IN|KS|KY|LA|MA|MD|ME|MI|MN|MO|MS|MT|NC|ND|NE|NH|NJ|NM|NV|NY|OH|OK|OR|PA|RI|SC|SD|TN|TX|UT|VA|VI|VT|WA|WI|WV|WY)(?:[\s,.]+)?(?:\s+\d{5})?(?:[\s,.]+)/i) { } |
| 0 | T | F | elsif ($addr =~ /\s+(?:\d{2,5}\s+)(?![ap]m\b)(?:(?:[a-zA-Z\s]{1,5}){1,2})?(?:[\s,.]+)?(?:(?:[a-zA-Z\s]{1,30}){1,4})(?:court|ct|street|st|drive|dr|lane|ln|road|rd|blvd)(?:[\s,.;]+)?(?:(?:[a-zA-Z\s]{1,30}){1,2})(?:[\s,.]+)?\b(?:AB|BC|MB|NB|NL|NT|NS|ON|PE|QC|SK|YT)(?:[\s,.]+)?(?:\s+\d{5})?(?:[\s,.]+)/i) { } |
| 0 | T | F | elsif ($addr =~ /([A-Za-z]+(?:\s+[A-Za-z]+)*)([\s,.]+)?\b(AK|AL|AR|AZ|CA|CO|CT|DC|DE|FL|GA|GU|HI|IA|ID|IL|IN|KS|KY|LA|MA|MD|ME|MI|MN|MO|MS|MT|NC|ND|NE|NH|NJ|NM|NV|NY|OH|OK|OR|PA|RI|SC|SD|TN|TX|UT|VA|VI|VT|WA|WI|WV|WY)/i) { } |
| 0 | T | F | elsif ($addr =~ /([A-Za-z]+(?:\s+[A-Za-z]+)*)([\s,.]+)?\b(AB|BC|MB|NB|NL|NT|NS|ON|PE|QC|SK|YT)/i) { } |
| 225 | 0 | T | F | unless ($region and $region ne "US") |
| 226 | 0 | T | F | if ($l = $self->geocode("location", "$addr, US") and ref $l) |
| 234 | 0 | T | F | unless ($region and $region ne "CA") |
| 235 | 0 | T | F | if ($l = $self->geocode("location", "$addr, Canada") and ref $l) |
| 243 | 0 | T | F | unless ($region and $region ne "US") |
| 244 | 0 | T | F | if ($l = $self->geocode("location", "$addr, US") and ref $l) |
| 254 | 0 | T | F | unless ($region and $region ne "CA") |
| 255 | 0 | T | F | if ($l = $self->geocode("location", "$addr, Canada") and ref $l) |
| 265 | 0 | T | F | if ($region and ($l = $self->geocode('location', "$addr, $region") and ref $l)) { } |
| 0 | T | F | elsif (not $region and ($l = $self->geocode('location', $addr) and ref $l)) { } |
| 274 | 0 | T | F | if ($offset < $count - 2) |
| 276 | 0 | T | F | if ($l = $self->geocode("location", $addr) and ref $l) |
| 296 | 100 | T | F | unless my $location = $$param{"location"} |
| 301 | 50 | T | F | if ($location =~ /^,\s*(.+)/) |
| 306 | 100 | T | F | unless ($location =~ /\D/) |
| 310 | 50 | T | F | if length $location <= 1 |
| 312 | 50 | T | F | if ($location =~ /^(.+),?\s*Washington\s*DC$/i) { } |
| 50 | T | F | elsif ($location =~ /^(.*),?\s*Saint Louis, (Missouri|MO)(.*)$/) { } |
| 319 | 100 | T | F | if (my $rc = $known_locations{$location}) |
| 339 | 50 | T | F | unless ($location =~ /,/) |
| 340 | 0 | T | F | if ($location =~ /^(.+?)\s+(United States|USA|US)$/i) { } |
| 0 | T | F | elsif ($location =~ /^(.+?)\s+(England|Scotland|Wales|Northern Ireland|UK|GB)$/i) { } |
| 0 | T | F | elsif ($location =~ /^(.+?)\s+Canada$/i) { } |
| 342 | 0 | T | F | if (my $rc = $self->_get($l, "US")) |
| 347 | 0 | T | F | if (my $rc = $self->_get($l, "US")) |
| 354 | 0 | T | F | if (my $rc = $self->_get($l, "GB")) |
| 361 | 0 | T | F | if (my $rc = $self->_get($l, "CA")) |
| 368 | 50 | T | F | if ($location =~ /USA$/ or $location =~ /United States$/) { } |
| 50 | T | F | elsif ($location =~ /(England|Scotland|Wales|Northern Ireland|UK|GB)$/i) { } |
| 50 | T | F | elsif ($location =~ /Canada$/) { } |
| 50 | T | F | elsif ($location =~ /Australia$/) { } |
| 381 | 50 | T | F | if ($ap) |
| 383 | 0 | T | F | if ($l =~ /(.+), (England|UK)$/i) |
| 386 | 0 | T | F | if ($ap->parse($l)) { } |
| 392 | 0 | T | F | if (my $type = $c{"street_type"}) |
| 393 | 0 | T | F | if (my $a = _abbreviate($type)) { } |
| 398 | 0 | T | F | if (my $suffix = $c{"street_direction_suffix"}) |
| 404 | 0 | T | F | if (length $c{'subcountry'} == 2) { } |
| 407 | 0 | T | F | if ($c{'country'} =~ /Canada/i) { } |
| 0 | T | F | elsif ($c{'country'} =~ /^(United States|USA|US)$/i) { } |
| 0 | T | F | elsif ($c{'country'}) { } |
| 409 | 0 | T | F | if (my $twoletterstate = ($_locale_ca //= "Locale::CA"->new)->{"province2code"}{uc $c{"subcountry"}}) |
| 414 | 0 | T | F | if (my $twoletterstate = ($_locale_us //= "Locale::US"->new)->{"state2code"}{uc $c{"subcountry"}}) |
| 419 | 0 | T | F | if ($c{"subcountry"}) |
| 426 | 0 | T | F | if ($addr{"house_number"}) |
| 427 | 0 | T | F | if (my $rc = $self->_search(\%addr, ("house_number", "road", "city", "state", "country"))) |
| 431 | 0 | T | F | unless ($addr{"house_number"} and $$param{"exact"}) |
| 432 | 0 | T | F | if (my $rc = $self->_search(\%addr, ("road", "city", "state", "country"))) |
| 439 | 50 | T | F | if ($location =~ /^(.+?)[,\s]+(United States|USA|US)$/i) |
| 447 | 0 | T | F | if (not $location =~ /\sCounty,/i and my $href = 'Geo::StreetAddress::US'->parse_location($l) || 'Geo::StreetAddress::US'->parse_address($l)) |
| 448 | 0 | T | F | if ($state = $$href{"state"}) |
| 449 | 0 | T | F | if (length $state > 2) |
| 450 | 0 | T | F | if (my $twoletterstate = ($_locale_us //= "Locale::US"->new)->{"state2code"}{uc $state}) |
| 455 | 0 | T | F | if ($$href{"city"}) |
| 458 | 0 | T | F | if ($street = $$href{"street"}) |
| 459 | 0 | T | F | if ($$href{"type"} and my $type = _abbreviate($$href{"type"})) |
| 462 | 0 | T | F | if ($$href{"suffix"}) |
| 465 | 0 | T | F | if (my $prefix = $$href{"prefix"}) |
| 468 | 0 | T | F | if ($$href{"number"}) |
| 469 | 0 | T | F | if (my $rc = $self->_get($$href{"number"}, "$street$city$state", "US")) |
| 474 | 0 | T | F | if (my $rc = $self->_get("$street$city$state", "US")) |
| 484 | 0 | T | F | if (scalar @addr == 5) |
| 486 | 0 | T | F | if (length $state > 2) |
| 487 | 0 | T | F | if (my $twoletterstate = ($_locale_us //= "Locale::US"->new)->{"state2code"}{uc $state}) |
| 491 | 0 | T | F | if (length $state == 2) |
| 493 | 0 | T | F | if (my $rc = $self->_get($addr[0], $addr[1], $addr[2], $state, "US")) |
| 499 | 0 | T | F | if (length $state == 2) |
| 502 | 0 | T | F | if (my $rc = $self->_get($addr[0], $addr[1], $addr[2], $state, "US")) |
| 506 | 0 | T | F | if (my $rc = $self->_get($addr[0], $addr[1], $state, "US")) |
| 514 | 50 | T | F | if ($location =~ /(.+),\s*([\s\w]+),\s*([\w\s]+)$/) { } |
| 0 | T | F | elsif ($location =~ /([a-z\s]+),?\s*(United States|USA|US|Canada)$/i) { } |
| 523 | 50 | T | F | if (uc $country eq 'ENGLAND' or uc $country eq 'SCOTLAND' or uc $country eq 'WALES') { } |
| 531 | 50 | T | F | if ($c) |
| 532 | 0 | T | F | if ($c eq 'us') { } |
| 0 | T | F | elsif ($c eq 'ca') { } |
| 533 | 0 | T | F | if (length $state > 2) |
| 534 | 0 | T | F | if (my $twoletterstate = ($_locale_us //= "Locale::US"->new)->{"state2code"}{uc $state}) |
| 540 | 0 | T | F | if (not $city =~ /,/) { } |
| 0 | T | F | elsif (my $href = 'Geo::StreetAddress::US'->parse_address("$city, $state")) { } |
| 542 | 0 | T | F | if ($city =~ /^(.+)\sCOUNTY$/) { } |
| 544 | 0 | T | F | if ($rc = $self->_get("$1$state", "US")) |
| 550 | 0 | T | F | if ($rc = $self->_get("$city$state", "US")) |
| 559 | 0 | T | F | if (length $state > 2) |
| 560 | 0 | T | F | if (my $twoletterstate = ($_locale_us //= "Locale::US"->new)->{"state2code"}{uc $state}) |
| 564 | 0 | T | F | if ($$href{"city"}) |
| 570 | 0 | T | F | if ($street = $fullstreet) |
| 573 | 0 | T | F | if (my $type = _abbreviate($$href{"type"})) |
| 576 | 0 | T | F | if ($$href{"suffix"}) |
| 581 | 0 | T | F | if ($street) |
| 583 | 0 | T | F | if (my $prefix = $$href{"prefix"}) |
| 587 | 0 | T | F | if ($$href{"number"}) |
| 588 | 0 | T | F | if ($rc = $self->_get($$href{"number"}, "$street$city$state", "US")) |
| 592 | 0 | T | F | if ($rc = $self->_get($$href{"number"}, "$fullstreet$city$state", "US")) |
| 598 | 0 | T | F | if ($rc = $self->_get("$street$city$state", "US")) |
| 603 | 0 | T | F | if ($rc = $self->_get("$street$city$state", "US")) |
| 608 | 0 | T | F | if ($rc = $self->_get("$fullstreet$city$state", "US")) |
| 616 | 0 | T | F | if ($city =~ /^(\d.+),\s*([\w\s]+),\s*([\w\s]+)/) { } |
| 0 | T | F | elsif ($city =~ /^(\w[\w\s]+),\s*([\w\s]+)/) { } |
| 618 | 0 | T | F | if (my $href = 'Geo::StreetAddress::US'->parse_address($lookup) || 'Geo::StreetAddress::US'->parse_location($lookup)) |
| 623 | 0 | T | F | if ($$href{'state'}) { } |
| 628 | 0 | T | F | if (length $state > 2) |
| 629 | 0 | T | F | if (my $twoletterstate = ($_locale_us //= "Locale::US"->new)->{"state2code"}{uc $state}) |
| 634 | 0 | T | F | if ($$href{"city"}) |
| 637 | 0 | T | F | if ($$href{"number"}) |
| 640 | 0 | T | F | if ($street = $$href{"street"}) |
| 641 | 0 | T | F | if (my $type = _abbreviate($$href{"type"})) |
| 644 | 0 | T | F | if ($$href{"suffix"}) |
| 647 | 0 | T | F | if (my $prefix = $$href{"prefix"}) |
| 651 | 0 | T | F | if ($$href{"number"}) |
| 652 | 0 | T | F | if ($county) |
| 653 | 0 | T | F | if ($rc = $self->_get($$href{"number"}, "$street$city$county$state", "US")) |
| 658 | 0 | T | F | if ($rc = $self->_get($$href{"number"}, "$street$city$state", "US")) |
| 662 | 0 | T | F | if ($county) |
| 663 | 0 | T | F | if ($rc = $self->_get("$street$city$county$state", "US")) |
| 668 | 0 | T | F | if ($rc = $self->_get("$street$city$state", "US")) |
| 682 | 0 | T | F | if ($second =~ /(\d+)\s+(.+)/) |
| 685 | 0 | T | F | if ($rc = $self->_get("$first$second$state", "US")) |
| 692 | 0 | T | F | if ($rc = $self->_get("$first$second$state", "US")) |
| 697 | 0 | T | F | if ($rc = $self->_get("$first$state", "US")) |
| 705 | 0 | T | F | if ($rc = $self->_get($copy, "US")) |
| 709 | 0 | T | F | if ($copy =~ s/(\d+)\s+/$1/) |
| 710 | 0 | T | F | if ($rc = $self->_get($copy, "US")) |
| 719 | 0 | T | F | if (length $state > 2) |
| 720 | 0 | T | F | if (my $twoletterstate = ($_locale_ca //= "Locale::CA"->new)->{"province2code"}{uc $state}) |
| 725 | 0 | T | F | if (not $city =~ /,/) { } |
| 0 | T | F | elsif (my $href = 0) { } |
| 728 | 0 | T | F | if ($rc = $self->_get("$city$state", "CA")) |
| 736 | 0 | T | F | if (length $state > 2) |
| 737 | 0 | T | F | if (my $twoletterstate = ($_locale_ca //= "Locale::CA"->new)->{"province2code"}{uc $state}) |
| 742 | 0 | T | F | if ($$href{"city"}) |
| 745 | 0 | T | F | if ($$href{"number"}) |
| 748 | 0 | T | F | if ($street = $$href{"street"}) |
| 749 | 0 | T | F | if (my $type = _abbreviate($$href{"type"})) |
| 752 | 0 | T | F | if ($$href{"suffix"}) |
| 756 | 0 | T | F | if ($street) |
| 757 | 0 | T | F | if (my $prefix = $$href{"prefix"}) |
| 764 | 0 | T | F | if ($city =~ /^(\w[\w\s]+),\s*([\w\s]+)/) |
| 769 | 0 | T | F | if ($rc = $self->_get("$first$second$state", "CA")) |
| 776 | 0 | T | F | if ($rc = $self->_get("$first$second$state", "CA")) |
| 781 | 0 | T | F | if ($rc = $self->_get("$first$state", "CA")) |
| 789 | 0 | T | F | if ($rc = $self->_get($copy, "CA")) |
| 793 | 0 | T | F | if ($copy =~ s/(\d+)\s+/$1/) |
| 794 | 0 | T | F | if ($rc = $self->_get($copy, "CA")) |
| 805 | 0 | T | F | if ($c eq "au" and length $state > 3) |
| 806 | 0 | T | F | if (my $abbrev = "Locale::SubCountry"->new("AU")->code(ucfirst lc $state)) |
| 807 | 0 | T | F | if ($abbrev ne "unknown") |
| 812 | 0 | T | F | if ($city =~ /^(\w[\w\s]+),\s*([,\w\s]+)/) |
| 817 | 0 | T | F | if ($street =~ /^(\d+)\s+(.+)/) |
| 823 | 0 | T | F | if ($city eq "MINSTER, THANET") |
| 827 | 0 | T | F | if ($number) |
| 828 | 0 | T | F | if (my $rc = $self->_get("$number$street$city$state$c")) |
| 833 | 0 | T | F | if (my $rc = $self->_get("$street$city$state$c")) |
| 837 | 0 | T | F | unless ($street and $$param{"exact"}) |
| 838 | 0 | T | F | if (my $rc = $self->_get("$city$state$c")) |
| 856 | 0 | T | F | if ($country =~ /Canada/i) { } |
| 858 | 0 | T | F | if (length $state > 2) |
| 859 | 0 | T | F | if (my $twoletterstate = ($_locale_ca //= "Locale::CA"->new)->{"province2code"}{uc $state}) |
| 865 | 0 | T | F | if (length $state > 2) |
| 866 | 0 | T | F | if (my $twoletterstate = ($_locale_us //= "Locale::US"->new)->{"state2code"}{uc $state}) |
| 871 | 0 | T | F | if (my $rc = $self->_get("$state$country")) |
| 877 | 50 | T | F | if ($country) |
| 878 | 50 | T | F | unless "Geo::Address::Parser"->can("parse") |
| 880 | 0 | T | F | if ($country eq "US") |
| 882 | 0 | T | F | if (my $fields = $addr_parser->parse($location)) |
| 884 | 0 | T | F | unless defined $$fields{$key} |
| 886 | 0 | T | F | if (my $rc = $self->_search($fields, keys %{$fields;})) |
| 895 | 0 | T | F | if ($libpostal_is_installed == 0) |
| 896 | 0 | T | F | if (eval {
do {
require Geo::libpostal
}
}) { } |
| 906 | 0 | T | F | if ($libpostal_is_installed == 1 and my(%addr) = Geo::libpostal::parse_address($location)) |
| 907 | 0 | T | F | if ($addr{"country"} and $addr{"state"} and $addr{"country"} =~ /^(Canada|United States|USA|US)$/i) |
| 908 | 0 | T | F | if ($street = $addr{"road"}) |
| 912 | 0 | T | F | if ($addr{'country'} =~ /Canada/i) { } |
| 914 | 0 | T | F | if (length $addr{"state"} > 2) |
| 915 | 0 | T | F | if (my $twoletterstate = ($_locale_ca //= "Locale::CA"->new)->{"province2code"}{uc $addr{"state"}}) |
| 921 | 0 | T | F | if (length $addr{"state"} > 2) |
| 922 | 0 | T | F | if (my $twoletterstate = ($_locale_us //= "Locale::US"->new)->{"state2code"}{uc $addr{"state"}}) |
| 927 | 0 | T | F | if ($addr{"state_district"}) |
| 929 | 0 | T | F | if (my $rc = $self->_search(\%addr, ("house_number", "road", "city", "state_district", "state", "country"))) |
| 933 | 0 | T | F | if (my $rc = $self->_search(\%addr, ("house_number", "road", "city", "state", "country"))) |
| 936 | 0 | T | F | if ($addr{"house_number"}) |
| 937 | 0 | T | F | if (my $rc = $self->_search(\%addr, ("road", "city", "state", "country"))) |
| 943 | 0 | T | F | if ($location =~ s/,//g) |
| 956 | 0 | T | F | if ($$data{$column}) |
| 960 | 0 | T | F | if ($location) |
| 978 | 0 | T | F | if (length $location <= 16) { } |
| 990 | 0 | T | F | if (defined $unknown_locations{$digest}) |
| 996 | 0 | T | F | if (my $cache = $$self{"cache"}) |
| 997 | 0 | T | F | if (my $rc = $cache->get_object($digest)) |
| 1009 | 0 | T | F | if (my $geohash = $openaddr_db->geohash("md5", $digest)) |
| 1021 | 0 | T | F | if (my $cache = $$self{"cache"}) |