Branch Coverage

lib/Geo/Coder/Free.pm
Criterion Covered Total %
branch 25 82 30.4


line true false branch
59 1 2 unless $class
87 0 1 if (ref $_[0] eq 'HASH') { }
0 1 elsif (@_ % 2 == 0) { }
96 0 1 unless my $location = $param{'location'}
104 1 0 if ($location =~ /^([\w\s\-]+)?,([\w\s]+),([\w\s]+)?$/) { }
0 0 elsif ($location =~ /^([\w\s\-]+)?,([\w\s]+),([\w\s]+),\s*(Canada|United States|USA|US)?$/) { }
114 0 1 if ($location =~ /^St\.? (.+)/)
117 0 1 if ($country eq 'UK' or $country eq 'United Kingdom')
137 1 0 if ($country)
138 1 0 unless (defined $self->{'admin1'})
139 0 1 unless $self->{'admin1'} = 'Geo::Coder::Free::DB::admin1'->new
141 1 0 if (my $admin1 = $self->{'admin1'}->fetchrow_hashref('asciiname', $country)) { }
145 0 0 if ($state) { }
146 0 0 if ($state =~ /^[A-Z]{2}$/) { }
151 0 0 if ($state)
154 0 0 if ($admin1->{'concatenated_codes'} =~ /^$concatenated_codes\./i)
166 0 1 unless defined $concatenated_codes
168 1 0 unless (defined $self->{'admin2'})
169 0 1 unless $self->{'admin2'} = 'Geo::Coder::Free::DB::admin2'->new
174 0 1 if ($county =~ /^[A-Z]{2}/) { }
180 2 0 if ($admin2->{'concatenated_codes'} =~ /$concatenated_codes/)
182 0 2 if ($region =~ /^[A-Z]{2}\.([A-Z]{2})\./) { }
184 0 0 if ($state =~ /^[A-Z]{2}$/) { }
185 0 0 if ($state eq $rc)
198 0 1 if ($state and not defined $region)
199 0 0 if ($state =~ /^[A-Z]{2}$/) { }
204 0 0 if ($admin2->{'concatenated_codes'} =~ /$concatenated_codes/)
213 0 1 if (scalar @regions == 0 and not defined $region)
216 0 0 if (scalar @admin2s and defined $admin2s[0]{'concatenated_codes'}) { }
218 0 0 if ($admin2->{'concatenated_codes'} =~ /$concatenated_codes/)
227 0 0 if ($admin1->{'concatenated_codes'} =~ /^$concatenated_codes\./i)
235 1 0 unless (defined $self->{'cities'})
240 1 0 if ($region)
241 1 0 if ($region =~ /^.+\.(.+)$/)
245 0 1 if ($country_code)
251 0 1 if (wantarray)
254 0 0 if ($city->{'Latitude'})
262 0 0 unless (defined $city)
264 0 0 if ($region =~ /^.+\.(.+)$/)
269 0 0 if defined $city
273 0 0 if (defined $city and $city->{'Latitude'})