| line | % | coverage | branch |
| 156 | 50 | T | F | unless $class |
| 158 | 100 | T | F | if (my $openaddr = $param{"openaddr"}) |
| 159 | 100 | T | F | unless -d $openaddr and -r $openaddr |
| 253 | 100 | T | F | @_ == 1 && !ref($_[0]) ? : |
| 258 | 50 | T | F | if ($$param{"ignore_words"}) |
| 262 | 100 | T | F | if (my $scantext = $$param{"scantext"}) |
| 263 | 50 | T | F | if length $scantext < 6 |
| 271 | 0 | T | F | if ($region) |
| 275 | 0 | T | F | if (length $words[$offset] < 2) |
| 279 | 0 | T | F | if (exists $ignore_words{lc $words[$offset]}) |
| 284 | 0 | T | F | if ($l = $self->geocode("location", $words[$offset]) and ref $l) |
| 287 | 0 | T | F | if ($offset < $count - 1) |
| 289 | 0 | T | F | if (length $addr == 0) |
| 294 | 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) { } |
| 295 | 0 | T | F | unless ($region and $region ne "US") |
| 296 | 0 | T | F | if ($l = $self->geocode("location", "$addr, US") and ref $l) |
| 304 | 0 | T | F | unless ($region and $region ne "CA") |
| 305 | 0 | T | F | if ($l = $self->geocode("location", "$addr, Canada") and ref $l) |
| 313 | 0 | T | F | unless ($region and $region ne "US") |
| 314 | 0 | T | F | if ($l = $self->geocode("location", "$addr, US") and ref $l) |
| 324 | 0 | T | F | unless ($region and $region ne "CA") |
| 325 | 0 | T | F | if ($l = $self->geocode("location", "$addr, Canada") and ref $l) |
| 335 | 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)) { } |
| 344 | 0 | T | F | if ($offset < $count - 2) |
| 346 | 0 | T | F | if ($l = $self->geocode("location", $addr) and ref $l) |
| 366 | 100 | T | F | unless my $location = $$param{"location"} |
| 371 | 50 | T | F | if ($location =~ /^,\s*(.+)/) |
| 380 | 100 | T | F | unless _valid_location($location) |
| 381 | 50 | T | F | if length $location <= 1 |
| 383 | 50 | T | F | if ($location =~ /^(.+),?\s*Washington\s*DC$/i) { } |
| 50 | T | F | elsif ($location =~ /^(.*),?\s*Saint Louis, (Missouri|MO)(.*)$/) { } |
| 390 | 100 | T | F | if (my $rc = $known_locations{$location}) |
| 415 | 100 | T | F | unless ($location =~ /,/) |
| 416 | 50 | T | F | if ($location =~ /^(.+?)\s+(United States|USA|US)$/i) { } |
| 50 | T | F | elsif ($location =~ /^(.+?)\s+(England|Scotland|Wales|Northern Ireland|UK|GB)$/i) { } |
| 50 | T | F | elsif ($location =~ /^(.+?)\s+Canada$/i) { } |
| 418 | 0 | T | F | if (my $rc = $self->_get($l, "US")) |
| 423 | 0 | T | F | if (my $rc = $self->_get($l, "US")) |
| 430 | 0 | T | F | if (my $rc = $self->_get($l, "GB")) |
| 437 | 0 | T | F | if (my $rc = $self->_get($l, "CA")) |
| 444 | 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$/) { } |
| 457 | 50 | T | F | if ($ap) |
| 459 | 0 | T | F | if ($l =~ /(.+), (England|UK)$/i) |
| 462 | 0 | T | F | if ($ap->parse($l)) { } |
| 468 | 0 | T | F | if (my $type = $c{"street_type"}) |
| 469 | 0 | T | F | if (my $a = _abbreviate($type)) { } |
| 474 | 0 | T | F | if (my $suffix = $c{"street_direction_suffix"}) |
| 480 | 0 | T | F | if (length $c{'subcountry'} == 2) { } |
| 483 | 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'}) { } |
| 485 | 0 | T | F | if (my $twoletterstate = ($_locale_ca //= "Locale::CA"->new)->{"province2code"}{uc $c{"subcountry"}}) |
| 490 | 0 | T | F | if (my $twoletterstate = ($_locale_us //= "Locale::US"->new)->{"state2code"}{uc $c{"subcountry"}}) |
| 495 | 0 | T | F | if ($c{"subcountry"}) |
| 502 | 0 | T | F | if ($addr{"house_number"}) |
| 503 | 0 | T | F | if (my $rc = $self->_search(\%addr, ("house_number", "road", "city", "state", "country"))) |
| 507 | 0 | T | F | unless ($addr{"house_number"} and $$param{"exact"}) |
| 508 | 0 | T | F | if (my $rc = $self->_search(\%addr, ("road", "city", "state", "country"))) |
| 515 | 50 | T | F | if ($location =~ /^(.+?)[,\s]+(United States|USA|US)$/i) |
| 523 | 0 | T | F | if (not $location =~ /\sCounty,/i and my $href = 'Geo::StreetAddress::US'->parse_location($l) || 'Geo::StreetAddress::US'->parse_address($l)) |
| 524 | 0 | T | F | if ($state = $$href{"state"}) |
| 525 | 0 | T | F | if (length $state > 2) |
| 526 | 0 | T | F | if (my $twoletterstate = ($_locale_us //= "Locale::US"->new)->{"state2code"}{uc $state}) |
| 531 | 0 | T | F | if ($$href{"city"}) |
| 534 | 0 | T | F | if ($street = $$href{"street"}) |
| 535 | 0 | T | F | if ($$href{"type"} and my $type = _abbreviate($$href{"type"})) |
| 538 | 0 | T | F | if ($$href{"suffix"}) |
| 541 | 0 | T | F | if (my $prefix = $$href{"prefix"}) |
| 544 | 0 | T | F | if ($$href{"number"}) |
| 545 | 0 | T | F | if (my $rc = $self->_get($$href{"number"}, "$street$city$state", "US")) |
| 550 | 0 | T | F | if (my $rc = $self->_get("$street$city$state", "US")) |
| 560 | 0 | T | F | if (scalar @addr == 5) |
| 562 | 0 | T | F | if (length $state > 2) |
| 563 | 0 | T | F | if (my $twoletterstate = ($_locale_us //= "Locale::US"->new)->{"state2code"}{uc $state}) |
| 567 | 0 | T | F | if (length $state == 2) |
| 569 | 0 | T | F | if (my $rc = $self->_get($addr[0], $addr[1], $addr[2], $state, "US")) |
| 575 | 0 | T | F | if (length $state == 2) |
| 578 | 0 | T | F | if (my $rc = $self->_get($addr[0], $addr[1], $addr[2], $state, "US")) |
| 582 | 0 | T | F | if (my $rc = $self->_get($addr[0], $addr[1], $state, "US")) |
| 590 | 100 | T | F | if ($location =~ /(.+),\s*([\s\w]+),\s*([\w\s]+)$/) { } |
| 50 | T | F | elsif ($location =~ /([a-z\s]+),?\s*(United States|USA|US|Canada)$/i) { } |
| 599 | 50 | T | F | if (uc $country eq 'ENGLAND' or uc $country eq 'SCOTLAND' or uc $country eq 'WALES') { } |
| 607 | 50 | T | F | if ($c) |
| 608 | 0 | T | F | if ($c eq 'us') { } |
| 0 | T | F | elsif ($c eq 'ca') { } |
| 609 | 0 | T | F | if (length $state > 2) |
| 610 | 0 | T | F | if (my $twoletterstate = ($_locale_us //= "Locale::US"->new)->{"state2code"}{uc $state}) |
| 616 | 0 | T | F | if (not $city =~ /,/) { } |
| 0 | T | F | elsif (my $href = 'Geo::StreetAddress::US'->parse_address("$city, $state")) { } |
| 618 | 0 | T | F | if ($city =~ /^(.+)\sCOUNTY$/) { } |
| 620 | 0 | T | F | if ($rc = $self->_get("$1$state", "US")) |
| 626 | 0 | T | F | if ($rc = $self->_get("$city$state", "US")) |
| 635 | 0 | T | F | if (length $state > 2) |
| 636 | 0 | T | F | if (my $twoletterstate = ($_locale_us //= "Locale::US"->new)->{"state2code"}{uc $state}) |
| 640 | 0 | T | F | if ($$href{"city"}) |
| 646 | 0 | T | F | if ($street = $fullstreet) |
| 649 | 0 | T | F | if (my $type = _abbreviate($$href{"type"})) |
| 652 | 0 | T | F | if ($$href{"suffix"}) |
| 657 | 0 | T | F | if ($street) |
| 659 | 0 | T | F | if (my $prefix = $$href{"prefix"}) |
| 663 | 0 | T | F | if ($$href{"number"}) |
| 664 | 0 | T | F | if ($rc = $self->_get($$href{"number"}, "$street$city$state", "US")) |
| 668 | 0 | T | F | if ($rc = $self->_get($$href{"number"}, "$fullstreet$city$state", "US")) |
| 674 | 0 | T | F | if ($rc = $self->_get("$street$city$state", "US")) |
| 679 | 0 | T | F | if ($rc = $self->_get("$street$city$state", "US")) |
| 684 | 0 | T | F | if ($rc = $self->_get("$fullstreet$city$state", "US")) |
| 692 | 0 | T | F | if ($city =~ /^(\d.+),\s*([\w\s]+),\s*([\w\s]+)/) { } |
| 0 | T | F | elsif ($city =~ /^(\w[\w\s]+),\s*([\w\s]+)/) { } |
| 694 | 0 | T | F | if (my $href = 'Geo::StreetAddress::US'->parse_address($lookup) || 'Geo::StreetAddress::US'->parse_location($lookup)) |
| 699 | 0 | T | F | if ($$href{'state'}) { } |
| 704 | 0 | T | F | if (length $state > 2) |
| 705 | 0 | T | F | if (my $twoletterstate = ($_locale_us //= "Locale::US"->new)->{"state2code"}{uc $state}) |
| 710 | 0 | T | F | if ($$href{"city"}) |
| 713 | 0 | T | F | if ($$href{"number"}) |
| 716 | 0 | T | F | if ($street = $$href{"street"}) |
| 717 | 0 | T | F | if (my $type = _abbreviate($$href{"type"})) |
| 720 | 0 | T | F | if ($$href{"suffix"}) |
| 723 | 0 | T | F | if (my $prefix = $$href{"prefix"}) |
| 727 | 0 | T | F | if ($$href{"number"}) |
| 728 | 0 | T | F | if ($county) |
| 729 | 0 | T | F | if ($rc = $self->_get($$href{"number"}, "$street$city$county$state", "US")) |
| 734 | 0 | T | F | if ($rc = $self->_get($$href{"number"}, "$street$city$state", "US")) |
| 738 | 0 | T | F | if ($county) |
| 739 | 0 | T | F | if ($rc = $self->_get("$street$city$county$state", "US")) |
| 744 | 0 | T | F | if ($rc = $self->_get("$street$city$state", "US")) |
| 758 | 0 | T | F | if ($second =~ /(\d+)\s+(.+)/) |
| 761 | 0 | T | F | if ($rc = $self->_get("$first$second$state", "US")) |
| 768 | 0 | T | F | if ($rc = $self->_get("$first$second$state", "US")) |
| 773 | 0 | T | F | if ($rc = $self->_get("$first$state", "US")) |
| 781 | 0 | T | F | if ($rc = $self->_get($copy, "US")) |
| 785 | 0 | T | F | if ($copy =~ s/(\d+)\s+/$1/) |
| 786 | 0 | T | F | if ($rc = $self->_get($copy, "US")) |
| 795 | 0 | T | F | if (length $state > 2) |
| 796 | 0 | T | F | if (my $twoletterstate = ($_locale_ca //= "Locale::CA"->new)->{"province2code"}{uc $state}) |
| 801 | 0 | T | F | if (not $city =~ /,/) { } |
| 0 | T | F | elsif (my $href = 0) { } |
| 804 | 0 | T | F | if ($rc = $self->_get("$city$state", "CA")) |
| 812 | 0 | T | F | if (length $state > 2) |
| 813 | 0 | T | F | if (my $twoletterstate = ($_locale_ca //= "Locale::CA"->new)->{"province2code"}{uc $state}) |
| 818 | 0 | T | F | if ($$href{"city"}) |
| 821 | 0 | T | F | if ($$href{"number"}) |
| 824 | 0 | T | F | if ($street = $$href{"street"}) |
| 825 | 0 | T | F | if (my $type = _abbreviate($$href{"type"})) |
| 828 | 0 | T | F | if ($$href{"suffix"}) |
| 832 | 0 | T | F | if ($street) |
| 833 | 0 | T | F | if (my $prefix = $$href{"prefix"}) |
| 840 | 0 | T | F | if ($city =~ /^(\w[\w\s]+),\s*([\w\s]+)/) |
| 845 | 0 | T | F | if ($rc = $self->_get("$first$second$state", "CA")) |
| 852 | 0 | T | F | if ($rc = $self->_get("$first$second$state", "CA")) |
| 857 | 0 | T | F | if ($rc = $self->_get("$first$state", "CA")) |
| 865 | 0 | T | F | if ($rc = $self->_get($copy, "CA")) |
| 869 | 0 | T | F | if ($copy =~ s/(\d+)\s+/$1/) |
| 870 | 0 | T | F | if ($rc = $self->_get($copy, "CA")) |
| 881 | 0 | T | F | if ($c eq "au" and length $state > 3) |
| 882 | 0 | T | F | if (my $abbrev = "Locale::SubCountry"->new("AU")->code(ucfirst lc $state)) |
| 883 | 0 | T | F | if ($abbrev ne "unknown") |
| 888 | 0 | T | F | if ($city =~ /^(\w[\w\s]+),\s*([,\w\s]+)/) |
| 893 | 0 | T | F | if ($street =~ /^(\d+)\s+(.+)/) |
| 899 | 0 | T | F | if ($city eq "MINSTER, THANET") |
| 903 | 0 | T | F | if ($number) |
| 904 | 0 | T | F | if (my $rc = $self->_get("$number$street$city$state$c")) |
| 909 | 0 | T | F | if (my $rc = $self->_get("$street$city$state$c")) |
| 913 | 0 | T | F | unless ($street and $$param{"exact"}) |
| 914 | 0 | T | F | if (my $rc = $self->_get("$city$state$c")) |
| 932 | 0 | T | F | if ($country =~ /Canada/i) { } |
| 934 | 0 | T | F | if (length $state > 2) |
| 935 | 0 | T | F | if (my $twoletterstate = ($_locale_ca //= "Locale::CA"->new)->{"province2code"}{uc $state}) |
| 941 | 0 | T | F | if (length $state > 2) |
| 942 | 0 | T | F | if (my $twoletterstate = ($_locale_us //= "Locale::US"->new)->{"state2code"}{uc $state}) |
| 947 | 0 | T | F | if (my $rc = $self->_get("$state$country")) |
| 953 | 100 | T | F | if ($country) |
| 955 | 50 | T | F | unless ("Geo::Address::Parser"->can("parse")) |
| 959 | 50 | T | F | if ($country eq "US" and "Geo::Address::Parser"->can("parse")) |
| 961 | 0 | T | F | if (my $fields = $addr_parser->parse($location)) |
| 963 | 0 | T | F | unless defined $$fields{$key} |
| 965 | 0 | T | F | if (my $rc = $self->_search($fields, keys %{$fields;})) |
| 975 | 50 | T | F | if ($use_libpostal and $libpostal_is_installed == 0) |
| 976 | 0 | T | F | if (eval {
do {
require Geo::libpostal
}
}) { } |
| 986 | 0 | T | F | if ($use_libpostal and $libpostal_is_installed == 1 and my(%addr) = Geo::libpostal::parse_address($location)) |
| 987 | 0 | T | F | if ($addr{"country"} and $addr{"state"} and $addr{"country"} =~ /^(Canada|United States|USA|US)$/i) |
| 988 | 0 | T | F | if ($street = $addr{"road"}) |
| 992 | 0 | T | F | if ($addr{'country'} =~ /Canada/i) { } |
| 994 | 0 | T | F | if (length $addr{"state"} > 2) |
| 995 | 0 | T | F | if (my $twoletterstate = ($_locale_ca //= "Locale::CA"->new)->{"province2code"}{uc $addr{"state"}}) |
| 1001 | 0 | T | F | if (length $addr{"state"} > 2) |
| 1002 | 0 | T | F | if (my $twoletterstate = ($_locale_us //= "Locale::US"->new)->{"state2code"}{uc $addr{"state"}}) |
| 1007 | 0 | T | F | if ($addr{"state_district"}) |
| 1009 | 0 | T | F | if (my $rc = $self->_search(\%addr, ("house_number", "road", "city", "state_district", "state", "country"))) |
| 1013 | 0 | T | F | if (my $rc = $self->_search(\%addr, ("house_number", "road", "city", "state", "country"))) |
| 1016 | 0 | T | F | if ($addr{"house_number"}) |
| 1017 | 0 | T | F | if (my $rc = $self->_search(\%addr, ("road", "city", "state", "country"))) |
| 1023 | 100 | T | F | if ($location =~ s/,//g) |
| 1036 | 0 | T | F | if ($$data{$column}) |
| 1040 | 0 | T | F | if ($location) |
| 1064 | 100 | T | F | if (length $location <= 16) { } |
| 1079 | 100 | T | F | if (my $cache = $$self{"cache"}) |
| 1080 | 100 | T | F | if (my $rc = $cache->get_object($digest)) |
| 1088 | 100 | T | F | if "Geo::Coder::Free::MissCache"->missed($miss_scope, $digest) |
| 1098 | 100 | T | F | if (my $geohash = $openaddr_db->geohash("md5", $digest)) |
| 1115 | 100 | T | F | if (my $cache = $$self{"cache"}) |