Branch Coverage

lib/Geo/Coder/Free.pm
Criterion Covered Total %
branch 62 84 73.8


line true false branch
50 1 2 unless $class
78 0 15 if (@_ % 2 == 0) { }
85 0 15 unless my $location = $param{'location'}
93 8 7 if ($location =~ /^([\w\s\-]+)?,([\w\s]+),([\w\s]+)?$/) { }
5 2 elsif ($location =~ /^([\w\s\-]+)?,([\w\s]+),([\w\s]+),\s*(Canada|United States|USA|US)?$/) { }
103 1 7 if ($location =~ /^St\.? (.+)/)
106 0 8 if ($country eq 'UK' or $country eq 'United Kingdom')
126 13 0 if ($country)
127 1 12 unless (defined $self->{'admin1'})
128 0 1 unless $self->{'admin1'} = 'Geo::Coder::Free::DB::admin1'->new
130 5 8 if (my $admin1 = $self->{'admin1'}->fetchrow_hashref('asciiname', $country)) { }
134 5 3 if ($state) { }
135 3 2 if ($state =~ /^[A-Z]{2}$/) { }
140 2 0 if ($state)
143 2 2 if ($admin1->{'concatenated_codes'} =~ /^$concatenated_codes\./i)
155 0 13 unless defined $concatenated_codes
157 1 12 unless (defined $self->{'admin2'})
158 0 1 unless $self->{'admin2'} = 'Geo::Coder::Free::DB::admin2'->new
163 1 12 if ($county =~ /^[A-Z]{2}/) { }
169 9 44 if ($admin2->{'concatenated_codes'} =~ /$concatenated_codes/)
171 3 6 if ($region =~ /^[A-Z]{2}\.([A-Z]{2})\./) { }
173 1 2 if ($state =~ /^[A-Z]{2}$/) { }
174 1 0 if ($state eq $rc)
187 2 10 if ($state and not defined $region)
188 2 0 if ($state =~ /^[A-Z]{2}$/) { }
193 0 0 if ($admin2->{'concatenated_codes'} =~ /$concatenated_codes/)
202 3 10 if (scalar @regions == 0 and not defined $region)
205 1 2 if (scalar @admin2s and defined $admin2s[0]{'concatenated_codes'}) { }
207 1 0 if ($admin2->{'concatenated_codes'} =~ /$concatenated_codes/)
216 2 1 if ($admin1->{'concatenated_codes'} =~ /^$concatenated_codes\./i)
224 1 12 unless (defined $self->{'cities'})
229 13 0 if ($region)
230 9 4 if ($region =~ /^.+\.(.+)$/)
234 2 11 if ($country_code)
240 0 13 if (wantarray)
243 0 0 if ($city->{'Latitude'})
251 4 9 unless (defined $city)
253 3 2 if ($region =~ /^.+\.(.+)$/)
258 3 2 if defined $city
262 0 12 if (defined $city and $city->{'Latitude'})
292 0 0 if (@_ % 2 == 0) { }
299 0 0 unless my $latlng = $param{'latlng'}