| line | % | coverage | branch |
| 105 | 50 | T | F | unless $class |
| 107 | 50 | T | F | if (my $openaddr = $param{"openaddr"}) |
| 108 | 100 | T | F | unless -d $openaddr and -r $openaddr |
| 146 | 0 | T | F | if (ref $_[0] eq 'HASH') { } |
| 0 | T | F | elsif (ref $_[0]) { } |
| 0 | T | F | elsif (scalar(@_) % 2 == 0) { } |
| 157 | 0 | T | F | if ($param{"ignore_words"}) |
| 161 | 0 | T | F | if (my $scantext = $param{"scantext"}) |
| 162 | 0 | T | F | if length $scantext < 6 |
| 170 | 0 | T | F | if ($region) |
| 174 | 0 | T | F | if (length $words[$offset] < 2) |
| 178 | 0 | T | F | if (exists $ignore_words{lc $words[$offset]}) |
| 183 | 0 | T | F | if ($l = $self->geocode("location", $words[$offset]) and ref $l) |
| 186 | 0 | T | F | if ($offset < $count - 1) |
| 188 | 0 | T | F | if (length $addr == 0) |
| 193 | 0 | T | F | if ($addr =~ /\s+(\d{2,5}\s+)(?![a|p]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+)(?![a|p]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+]{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)/i) { } |
| 0 | T | F | elsif ($addr =~ /([a-zA-Z|\s+]{1,30}){1,2}([\s|\,|.]+)?\b(AB|BC|MB|NB|NL|NT|NS|ON|PE|QC|SK|YT)/i) { } |
| 194 | 0 | T | F | unless ($region and $region ne "US") |
| 195 | 0 | T | F | if ($l = $self->geocode("location", "$addr, US") and ref $l) |
| 203 | 0 | T | F | unless ($region and $region ne "CA") |
| 204 | 0 | T | F | if ($l = $self->geocode("location", "$addr, Canada") and ref $l) |
| 212 | 0 | T | F | unless ($region and $region ne "US") |
| 213 | 0 | T | F | if ($l = $self->geocode("location", "$addr, US") and ref $l) |
| 223 | 0 | T | F | unless ($region and $region ne "CA") |
| 224 | 0 | T | F | if ($l = $self->geocode("location", "$addr, Canada") and ref $l) |
| 234 | 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)) { } |
| 245 | 0 | T | F | if ($offset < $count - 2) |
| 247 | 0 | T | F | if ($l = $self->geocode("location", $addr) and ref $l) |
| 268 | 0 | T | F | unless my $location = $param{"location"} |
| 274 | 0 | T | F | if ($location =~ /^,\s*(.+)/) |
| 279 | 0 | T | F | unless ($location =~ /\D/) |
| 283 | 0 | T | F | if length $location <= 1 |
| 285 | 0 | T | F | if ($location =~ /^(.+),?\s*Washington\s*DC$/i) { } |
| 0 | T | F | elsif ($location =~ /^(.*),?\s*Saint Louis, (Missouri|MO)(.*)$/) { } |
| 292 | 0 | T | F | if (my $rc = $known_locations{$location}) |
| 312 | 0 | T | F | unless ($location =~ /,/) |
| 313 | 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) { } |
| 315 | 0 | T | F | if (my $rc = $self->_get($l, "US")) |
| 320 | 0 | T | F | if (my $rc = $self->_get($l, "US")) |
| 327 | 0 | T | F | if (my $rc = $self->_get($l, "GB")) |
| 334 | 0 | T | F | if (my $rc = $self->_get($l, "CA")) |
| 341 | 0 | T | F | if ($location =~ /USA$/ or $location =~ /United States$/) { } |
| 0 | T | F | elsif ($location =~ /(England|Scotland|Wales|Northern Ireland|UK|GB)$/i) { } |
| 0 | T | F | elsif ($location =~ /Canada$/) { } |
| 0 | T | F | elsif ($location =~ /Australia$/) { } |
| 354 | 0 | T | F | if ($ap) |
| 356 | 0 | T | F | if ($l =~ /(.+), (England|UK)$/i) |
| 359 | 0 | T | F | if ($ap->parse($l)) { } |
| 367 | 0 | T | F | if (my $type = $c{"street_type"}) |
| 368 | 0 | T | F | if (my $a = &Geo::Coder::Free::_abbreviate($type)) { } |
| 373 | 0 | T | F | if (my $suffix = $c{"street_direction_suffix"}) |
| 379 | 0 | T | F | if (length $c{'subcountry'} == 2) { } |
| 382 | 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'}) { } |
| 384 | 0 | T | F | if (my $twoletterstate = "Locale::CA"->new->{"province2code"}{uc $c{"subcountry"}}) |
| 389 | 0 | T | F | if (my $twoletterstate = "Locale::US"->new->{"state2code"}{uc $c{"subcountry"}}) |
| 394 | 0 | T | F | if ($c{"subcountry"}) |
| 402 | 0 | T | F | if ($addr{"house_number"}) |
| 403 | 0 | T | F | if (my $rc = $self->_search(\%addr, ("house_number", "road", "city", "state", "country"))) |
| 407 | 0 | T | F | unless ($addr{"house_number"} and $param{"exact"}) |
| 408 | 0 | T | F | if (my $rc = $self->_search(\%addr, ("road", "city", "state", "country"))) |
| 415 | 0 | T | F | if ($location =~ /^(.+?)[,\s]+(United States|USA|US)$/i) |
| 423 | 0 | T | F | if (not $location =~ /\sCounty,/i and my $href = 'Geo::StreetAddress::US'->parse_location($l) || 'Geo::StreetAddress::US'->parse_address($l)) |
| 425 | 0 | T | F | if ($state = $$href{"state"}) |
| 426 | 0 | T | F | if (length $state > 2) |
| 427 | 0 | T | F | if (my $twoletterstate = "Locale::US"->new->{"state2code"}{uc $state}) |
| 432 | 0 | T | F | if ($$href{"city"}) |
| 435 | 0 | T | F | if ($street = $$href{"street"}) |
| 436 | 0 | T | F | if ($$href{"type"} and my $type = &Geo::Coder::Free::_abbreviate($$href{"type"})) |
| 439 | 0 | T | F | if ($$href{"suffix"}) |
| 442 | 0 | T | F | if (my $prefix = $$href{"prefix"}) |
| 445 | 0 | T | F | if ($$href{"number"}) |
| 446 | 0 | T | F | if (my $rc = $self->_get($$href{"number"}, "$street$city$state", "US")) |
| 451 | 0 | T | F | if (my $rc = $self->_get("$street$city$state", "US")) |
| 461 | 0 | T | F | if (scalar @addr == 5) |
| 464 | 0 | T | F | if (length $state > 2) |
| 465 | 0 | T | F | if (my $twoletterstate = "Locale::US"->new->{"state2code"}{uc $state}) |
| 469 | 0 | T | F | if (length $state == 2) |
| 472 | 0 | T | F | if (my $rc = $self->_get($addr[0], $addr[1], $addr[2], $state, "US")) |
| 479 | 0 | T | F | if (length $state == 2) |
| 483 | 0 | T | F | if (my $rc = $self->_get($addr[0], $addr[1], $addr[2], $state, "US")) |
| 488 | 0 | T | F | if (my $rc = $self->_get($addr[0], $addr[1], $state, "US")) |
| 497 | 0 | 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) { } |
| 506 | 0 | T | F | if (uc $country eq 'ENGLAND' or uc $country eq 'SCOTLAND' or uc $country eq 'WALES') { } |
| 514 | 0 | T | F | if ($c) |
| 515 | 0 | T | F | if ($c eq 'us') { } |
| 0 | T | F | elsif ($c eq 'ca') { } |
| 516 | 0 | T | F | if (length $state > 2) |
| 517 | 0 | T | F | if (my $twoletterstate = "Locale::US"->new->{"state2code"}{uc $state}) |
| 523 | 0 | T | F | if (not $city =~ /,/) { } |
| 0 | T | F | elsif (my $href = 'Geo::StreetAddress::US'->parse_address("$city, $state")) { } |
| 525 | 0 | T | F | if ($city =~ /^(.+)\sCOUNTY$/) { } |
| 527 | 0 | T | F | if ($rc = $self->_get("$1$state", "US")) |
| 533 | 0 | T | F | if ($rc = $self->_get("$city$state", "US")) |
| 545 | 0 | T | F | if (length $state > 2) |
| 546 | 0 | T | F | if (my $twoletterstate = "Locale::US"->new->{"state2code"}{uc $state}) |
| 550 | 0 | T | F | if ($$href{"city"}) |
| 556 | 0 | T | F | if ($street = $fullstreet) |
| 559 | 0 | T | F | if (my $type = &Geo::Coder::Free::_abbreviate($$href{"type"})) |
| 562 | 0 | T | F | if ($$href{"suffix"}) |
| 567 | 0 | T | F | if ($street) |
| 569 | 0 | T | F | if (my $prefix = $$href{"prefix"}) |
| 573 | 0 | T | F | if ($$href{"number"}) |
| 575 | 0 | T | F | if ($rc = $self->_get($$href{"number"}, "$street$city$state", "US")) |
| 579 | 0 | T | F | if ($rc = $self->_get($$href{"number"}, "$fullstreet$city$state", "US")) |
| 586 | 0 | T | F | if ($rc = $self->_get("$street$city$state", "US")) |
| 591 | 0 | T | F | if ($rc = $self->_get("$street$city$state", "US")) |
| 597 | 0 | T | F | if ($rc = $self->_get("$fullstreet$city$state", "US")) |
| 605 | 0 | T | F | if ($city =~ /^(\d.+),\s*([\w\s]+),\s*([\w\s]+)/) { } |
| 0 | T | F | elsif ($city =~ /^(\w[\w\s]+),\s*([\w\s]+)/) { } |
| 607 | 0 | T | F | if (my $href = 'Geo::StreetAddress::US'->parse_address($lookup) || 'Geo::StreetAddress::US'->parse_location($lookup)) |
| 613 | 0 | T | F | if ($$href{'state'}) { } |
| 618 | 0 | T | F | if (length $state > 2) |
| 619 | 0 | T | F | if (my $twoletterstate = "Locale::US"->new->{"state2code"}{uc $state}) |
| 624 | 0 | T | F | if ($$href{"city"}) |
| 627 | 0 | T | F | if ($$href{"number"}) |
| 630 | 0 | T | F | if ($street = $$href{"street"}) |
| 631 | 0 | T | F | if (my $type = &Geo::Coder::Free::_abbreviate($$href{"type"})) |
| 634 | 0 | T | F | if ($$href{"suffix"}) |
| 637 | 0 | T | F | if (my $prefix = $$href{"prefix"}) |
| 641 | 0 | T | F | if ($$href{"number"}) |
| 642 | 0 | T | F | if ($county) |
| 643 | 0 | T | F | if ($rc = $self->_get($$href{"number"}, "$street$city$county$state", "US")) |
| 648 | 0 | T | F | if ($rc = $self->_get($$href{"number"}, "$street$city$state", "US")) |
| 652 | 0 | T | F | if ($county) |
| 653 | 0 | T | F | if ($rc = $self->_get("$street$city$county$state", "US")) |
| 658 | 0 | T | F | if ($rc = $self->_get("$street$city$state", "US")) |
| 672 | 0 | T | F | if ($second =~ /(\d+)\s+(.+)/) |
| 675 | 0 | T | F | if ($rc = $self->_get("$first$second$state", "US")) |
| 682 | 0 | T | F | if ($rc = $self->_get("$first$second$state", "US")) |
| 687 | 0 | T | F | if ($rc = $self->_get("$first$state", "US")) |
| 695 | 0 | T | F | if ($rc = $self->_get($copy, "US")) |
| 699 | 0 | T | F | if ($copy =~ s/(\d+)\s+/$1/) |
| 700 | 0 | T | F | if ($rc = $self->_get($copy, "US")) |
| 709 | 0 | T | F | if (length $state > 2) |
| 710 | 0 | T | F | if (my $twoletterstate = "Locale::CA"->new->{"province2code"}{uc $state}) |
| 715 | 0 | T | F | if (not $city =~ /,/) { } |
| 0 | T | F | elsif (my $href = 0) { } |
| 718 | 0 | T | F | if ($rc = $self->_get("$city$state", "CA")) |
| 726 | 0 | T | F | if (length $state > 2) |
| 727 | 0 | T | F | if (my $twoletterstate = "Locale::CA"->new->{"province2code"}{uc $state}) |
| 732 | 0 | T | F | if ($$href{"city"}) |
| 735 | 0 | T | F | if ($$href{"number"}) |
| 738 | 0 | T | F | if ($street = $$href{"street"}) |
| 739 | 0 | T | F | if (my $type = &Geo::Coder::Free::_abbreviate($$href{"type"})) |
| 742 | 0 | T | F | if ($$href{"suffix"}) |
| 746 | 0 | T | F | if ($street) |
| 747 | 0 | T | F | if (my $prefix = $$href{"prefix"}) |
| 754 | 0 | T | F | if ($city =~ /^(\w[\w\s]+),\s*([\w\s]+)/) |
| 759 | 0 | T | F | if ($rc = $self->_get("$first$second$state", "CA")) |
| 766 | 0 | T | F | if ($rc = $self->_get("$first$second$state", "CA")) |
| 771 | 0 | T | F | if ($rc = $self->_get("$first$state", "CA")) |
| 779 | 0 | T | F | if ($rc = $self->_get($copy, "CA")) |
| 783 | 0 | T | F | if ($copy =~ s/(\d+)\s+/$1/) |
| 784 | 0 | T | F | if ($rc = $self->_get($copy, "CA")) |
| 795 | 0 | T | F | if ($c eq "au" and length $state > 3) |
| 796 | 0 | T | F | if (my $abbrev = "Locale::SubCountry"->new("AU")->code(ucfirst lc $state)) |
| 797 | 0 | T | F | if ($abbrev ne "unknown") |
| 802 | 0 | T | F | if ($city =~ /^(\w[\w\s]+),\s*([,\w\s]+)/) |
| 807 | 0 | T | F | if ($street =~ /^(\d+)\s+(.+)/) |
| 813 | 0 | T | F | if ($city eq "MINSTER, THANET") |
| 817 | 0 | T | F | if ($number) |
| 818 | 0 | T | F | if (my $rc = $self->_get("$number$street$city$state$c")) |
| 823 | 0 | T | F | if (my $rc = $self->_get("$street$city$state$c")) |
| 827 | 0 | T | F | unless ($street and $param{"exact"}) |
| 828 | 0 | T | F | if (my $rc = $self->_get("$city$state$c")) |
| 846 | 0 | T | F | if ($country =~ /Canada/i) { } |
| 848 | 0 | T | F | if (length $state > 2) |
| 849 | 0 | T | F | if (my $twoletterstate = "Locale::CA"->new->{"province2code"}{uc $state}) |
| 855 | 0 | T | F | if (length $state > 2) |
| 856 | 0 | T | F | if (my $twoletterstate = "Locale::US"->new->{"state2code"}{uc $state}) |
| 861 | 0 | T | F | if (my $rc = $self->_get("$state$country")) |
| 867 | 0 | T | F | if ($country) |
| 868 | 0 | T | F | unless "Geo::Address::Parser"->can("parse") |
| 870 | 0 | T | F | if ($country eq "US") |
| 872 | 0 | T | F | if (my $fields = $addr_parser->parse($location)) |
| 874 | 0 | T | F | unless defined $$fields{$key} |
| 876 | 0 | T | F | if (my $rc = $self->_search($fields, keys %{$fields;})) |
| 886 | 0 | T | F | if ($libpostal_is_installed == 0) |
| 887 | 0 | T | F | if (eval {
do {
require Geo::libpostal
}
}) { } |
| 898 | 0 | T | F | if ($libpostal_is_installed == 1 and my(%addr) = Geo::libpostal::parse_address($location)) |
| 900 | 0 | T | F | if ($addr{"country"} and $addr{"state"} and $addr{"country"} =~ /^(Canada|United States|USA|US)$/i) |
| 901 | 0 | T | F | if ($street = $addr{"road"}) |
| 905 | 0 | T | F | if ($addr{'country'} =~ /Canada/i) { } |
| 907 | 0 | T | F | if (length $addr{"state"} > 2) |
| 908 | 0 | T | F | if (my $twoletterstate = "Locale::CA"->new->{"province2code"}{uc $addr{"state"}}) |
| 914 | 0 | T | F | if (length $addr{"state"} > 2) |
| 915 | 0 | T | F | if (my $twoletterstate = "Locale::US"->new->{"state2code"}{uc $addr{"state"}}) |
| 920 | 0 | T | F | if ($addr{"state_district"}) |
| 922 | 0 | T | F | if (my $rc = $self->_search(\%addr, ("house_number", "road", "city", "state_district", "state", "country"))) |
| 926 | 0 | T | F | if (my $rc = $self->_search(\%addr, ("house_number", "road", "city", "state", "country"))) |
| 929 | 0 | T | F | if ($addr{"house_number"}) |
| 930 | 0 | T | F | if (my $rc = $self->_search(\%addr, ("road", "city", "state", "country"))) |
| 936 | 0 | T | F | if ($location =~ s/,//g) |
| 949 | 0 | T | F | if ($$data{$column}) |
| 953 | 0 | T | F | if ($location) |
| 972 | 0 | T | F | if (length $location <= 16) { } |
| 984 | 0 | T | F | if (defined $unknown_locations{$digest}) |
| 992 | 0 | T | F | if (my $cache = $$self{"cache"}) |
| 993 | 0 | T | F | if (my $rc = $cache->get_object($digest)) |
| 1006 | 0 | T | F | if (my $geohash = $openaddr_db->geohash("md5", $digest)) |
| 1018 | 0 | T | F | if (my $cache = $$self{"cache"}) |