Condition Coverage

File:blib/lib/Geo/Coder/Free/OpenAddresses.pm
Coverage:11.6%

line%coveragecondition
15333
ABdec
000
011
1X1
ref $proto || $proto
15967
ABdec
0X0
100
111
-d $openaddr and -r $openaddr
164100
Adec
00
11
$param{"libpostal"} // 1
19650
Adec
00
11
$$self{"reads"} // 0
25367
ABdec
0X0
100
111
@_ == 1 && !ref($_[0])
2840
ABdec
0X0
100
111
$l = $self->geocode("location", $words[$offset]) and ref $l
2950
ABdec
0X0
100
111
$region and $region ne "US"
2960
ABdec
0X0
100
111
$l = $self->geocode("location", "$addr, US") and ref $l
3040
ABdec
0X0
100
111
$region and $region ne "CA"
3050
ABdec
0X0
100
111
$l = $self->geocode("location", "$addr, Canada") and ref $l
3130
ABdec
0X0
100
111
$region and $region ne "US"
3140
ABdec
0X0
100
111
$l = $self->geocode("location", "$addr, US") and ref $l
3240
ABdec
0X0
100
111
$region and $region ne "CA"
3250
ABdec
0X0
100
111
$l = $self->geocode("location", "$addr, Canada") and ref $l
3350
ABdec
0X0
100
111
not $region and ($l = $self->geocode("location", $addr) and ref $l)
0
ABdec
0X0
100
111
$l = $self->geocode("location", "$addr, $region") and ref $l
0
ABdec
0X0
100
111
$region and ($l = $self->geocode("location", "$addr, $region") and ref $l)
0
ABdec
0X0
100
111
$l = $self->geocode("location", $addr) and ref $l
3460
ABdec
0X0
100
111
$l = $self->geocode("location", $addr) and ref $l
44433
ABdec
000
011
1X1
$location =~ /USA$/ or $location =~ /United States$/
4450
ABdec
000
011
1X1
$$self{"ap"}{"us"} // "Lingua::EN::AddressParse"->new("country", "US", "auto_clean", 1, "force_case", 1, "force_post_code", 0)
4480
ABdec
000
011
1X1
$$self{"ap"}{"gb"} // "Lingua::EN::AddressParse"->new("country", "GB", "auto_clean", 1, "force_case", 1, "force_post_code", 0)
4510
ABdec
000
011
1X1
$$self{"ap"}{"ca"} // "Lingua::EN::AddressParse"->new("country", "CA", "auto_clean", 1, "force_case", 1, "force_post_code", 0)
4540
ABdec
000
011
1X1
$$self{"ap"}{"au"} // "Lingua::EN::AddressParse"->new("country", "AU", "auto_clean", 1, "force_case", 1, "force_post_code", 0)
4850
ABdec
000
011
1X1
$_locale_ca //= "Locale::CA"->new
4900
ABdec
000
011
1X1
$_locale_us //= "Locale::US"->new
5070
ABdec
0X0
100
111
$addr{"house_number"} and $$param{"exact"}
5230
ABdec
0X0
100
111
not $location =~ /\sCounty,/i and my $href = 'Geo::StreetAddress::US'->parse_location($l) || 'Geo::StreetAddress::US'->parse_address($l)
0
ABdec
000
011
1X1
'Geo::StreetAddress::US'->parse_location($l) || 'Geo::StreetAddress::US'->parse_address($l)
5260
ABdec
000
011
1X1
$_locale_us //= "Locale::US"->new
5350
ABdec
0X0
100
111
$$href{"type"} and my $type = _abbreviate($$href{"type"})
5630
ABdec
000
011
1X1
$_locale_us //= "Locale::US"->new
59925
ABCdec
0000
0011
01X1
1XX1
uc $country eq "ENGLAND" or uc $country eq "SCOTLAND" or uc $country eq "WALES"
6100
ABdec
000
011
1X1
$_locale_us //= "Locale::US"->new
6360
ABdec
000
011
1X1
$_locale_us //= "Locale::US"->new
6940
ABdec
000
011
1X1
'Geo::StreetAddress::US'->parse_address($lookup) || 'Geo::StreetAddress::US'->parse_location($lookup)
7050
ABdec
000
011
1X1
$_locale_us //= "Locale::US"->new
7960
ABdec
000
011
1X1
$_locale_ca //= "Locale::CA"->new
8130
ABdec
000
011
1X1
$_locale_ca //= "Locale::CA"->new
8810
ABdec
0X0
100
111
$c eq "au" and length $state > 3
9130
ABdec
0X0
100
111
$street and $$param{"exact"}
9350
ABdec
000
011
1X1
$_locale_ca //= "Locale::CA"->new
9420
ABdec
000
011
1X1
$_locale_us //= "Locale::US"->new
95933
ABdec
0X0
100
111
$country eq "US" and "Geo::Address::Parser"->can("parse")
97450
Adec
00
11
$$self{"libpostal"} // 1
97533
ABdec
0X0
100
111
$use_libpostal and $libpostal_is_installed == 0
98625
ABCdec
0XX0
10X0
1100
1111
$use_libpostal and $libpostal_is_installed == 1 and my(%addr) = Geo::libpostal::parse_address($location)
9870
ABCdec
0XX0
10X0
1100
1111
$addr{"country"} and $addr{"state"} and $addr{"country"} =~ /^(Canada|United States|USA|US)$/i
9950
ABdec
000
011
1X1
$_locale_ca //= "Locale::CA"->new
10020
ABdec
000
011
1X1
$_locale_us //= "Locale::US"->new
104950
Adec
00
11
$$self{"openaddr"} // ""
109333
ABdec
000
011
1X1
$$self{'openaddr_db'} || 'Geo::Coder::Free::DB::openaddresses'->new('cache', $$self{'cache'} || 'CHI'->new('driver', 'Memory', 'datastore', {}), 'directory', $$self{'openaddr'}, 'id', 'md5', 'no_entry', 1)
109933
ABdec
000
011
1X1
$$self{"geo_hash"} ||= "Geo::Hash"->new