Condition Coverage

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

line%coveragecondition
12433
ABdec
000
011
1X1
ref $proto || $proto
13067
ABdec
0X0
100
111
-d $openaddr and -r $openaddr
18333
ABdec
0X0
100
111
@_ == 1 && !ref($_[0])
2140
ABdec
0X0
100
111
$l = $self->geocode("location", $words[$offset]) and ref $l
2250
ABdec
0X0
100
111
$region and $region ne "US"
2260
ABdec
0X0
100
111
$l = $self->geocode("location", "$addr, US") and ref $l
2340
ABdec
0X0
100
111
$region and $region ne "CA"
2350
ABdec
0X0
100
111
$l = $self->geocode("location", "$addr, Canada") and ref $l
2430
ABdec
0X0
100
111
$region and $region ne "US"
2440
ABdec
0X0
100
111
$l = $self->geocode("location", "$addr, US") and ref $l
2540
ABdec
0X0
100
111
$region and $region ne "CA"
2550
ABdec
0X0
100
111
$l = $self->geocode("location", "$addr, Canada") and ref $l
2650
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
2760
ABdec
0X0
100
111
$l = $self->geocode("location", $addr) and ref $l
36833
ABdec
000
011
1X1
$location =~ /USA$/ or $location =~ /United States$/
3690
ABdec
000
011
1X1
$$self{"ap"}{"us"} // "Lingua::EN::AddressParse"->new("country", "US", "auto_clean", 1, "force_case", 1, "force_post_code", 0)
3720
ABdec
000
011
1X1
$$self{"ap"}{"gb"} // "Lingua::EN::AddressParse"->new("country", "GB", "auto_clean", 1, "force_case", 1, "force_post_code", 0)
3750
ABdec
000
011
1X1
$$self{"ap"}{"ca"} // "Lingua::EN::AddressParse"->new("country", "CA", "auto_clean", 1, "force_case", 1, "force_post_code", 0)
3780
ABdec
000
011
1X1
$$self{"ap"}{"au"} // "Lingua::EN::AddressParse"->new("country", "AU", "auto_clean", 1, "force_case", 1, "force_post_code", 0)
4090
ABdec
000
011
1X1
$_locale_ca //= "Locale::CA"->new
4140
ABdec
000
011
1X1
$_locale_us //= "Locale::US"->new
4310
ABdec
0X0
100
111
$addr{"house_number"} and $$param{"exact"}
4470
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)
4500
ABdec
000
011
1X1
$_locale_us //= "Locale::US"->new
4590
ABdec
0X0
100
111
$$href{"type"} and my $type = _abbreviate($$href{"type"})
4870
ABdec
000
011
1X1
$_locale_us //= "Locale::US"->new
52325
ABCdec
0000
0011
01X1
1XX1
uc $country eq "ENGLAND" or uc $country eq "SCOTLAND" or uc $country eq "WALES"
5340
ABdec
000
011
1X1
$_locale_us //= "Locale::US"->new
5600
ABdec
000
011
1X1
$_locale_us //= "Locale::US"->new
6180
ABdec
000
011
1X1
'Geo::StreetAddress::US'->parse_address($lookup) || 'Geo::StreetAddress::US'->parse_location($lookup)
6290
ABdec
000
011
1X1
$_locale_us //= "Locale::US"->new
7200
ABdec
000
011
1X1
$_locale_ca //= "Locale::CA"->new
7370
ABdec
000
011
1X1
$_locale_ca //= "Locale::CA"->new
8050
ABdec
0X0
100
111
$c eq "au" and length $state > 3
8370
ABdec
0X0
100
111
$street and $$param{"exact"}
8590
ABdec
000
011
1X1
$_locale_ca //= "Locale::CA"->new
8660
ABdec
000
011
1X1
$_locale_us //= "Locale::US"->new
8780
ABdec
0X0
100
111
require Geo::Address::Parser and "Geo::Address::Parser"->import
9060
ABdec
0X0
100
111
$libpostal_is_installed == 1 and my(%addr) = Geo::libpostal::parse_address($location)
9070
ABCdec
0XX0
10X0
1100
1111
$addr{"country"} and $addr{"state"} and $addr{"country"} =~ /^(Canada|United States|USA|US)$/i
9150
ABdec
000
011
1X1
$_locale_ca //= "Locale::CA"->new
9220
ABdec
000
011
1X1
$_locale_us //= "Locale::US"->new
10050
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)
10100
ABdec
000
011
1X1
$$self{"geo_hash"} ||= "Geo::Hash"->new