Branch Coverage

blib/lib/Geo/Coordinates/OSGB/Grid.pm
Criterion Covered Total %
branch 75 96 78.1


line true false branch
51 7 1 if ($s =~ /\A\d+\Z/imosx)
56 2 0 if (@preferred_sheets) { }
77 2 0 if get_ostn02_shift_pair($easting, $northing) and get_ostn02_shift_pair($easting, $northing + $margin) and get_ostn02_shift_pair($easting, $northing - $margin) and get_ostn02_shift_pair($easting + $margin, $northing) and get_ostn02_shift_pair($easting - $margin, $northing) and 0 != _winding_number($easting, $northing, $map->{'polygon'})
85 89 137 exists $options->{'form'} ? :
86 60 166 exists $options->{'maps'} ? :
87 8 218 exists $options->{'series'} ? :
90 0 226 unless ($sq)
97 59 167 if ($with_maps)
99 5705 61142 if index($map_keys, substr($k, 0, 1)) == -1
100 209 3768 if ($m->{'bbox'}[0][0] <= $easting and $easting < $m->{'bbox'}[1][0] and $m->{'bbox'}[0][1] <= $northing and $northing < $m->{'bbox'}[1][1])
103 200 9 if ($w != 0)
112 2 224 if ($form eq 'TRAD') { }
48 176 elsif ($form eq 'GPS') { }
1 175 elsif ($form eq 'SS') { }
122 225 0 if (my($space_a, $e_spec, $space_b, $n_spec) = $form =~ / \A S{1,2}(\s*)(E{1,5})(\s*)(N{1,5}) \Z /imosx)
128 49 176 if (wantarray)
135 12 164 if ($with_maps) { }
136 12 0 if (@sheets) { }
163 2 10 if (defined $options) { }
181 3 1 if wantarray
183 0 1 unless (@sheets)
184 1 0 if (@sheets == 1)
185 0 0 if (@sheets == 2)
197 0 226 unless 0 <= $e and $e < 2500000 and 0 <= $n and $n < 2500000
210 0 117 if length $s < 2
213 8 109 if 0 > $a
216 54 55 if 0 > $b
232 0 112 if $len == 0
233 0 112 if $len % 2
234 0 112 if $len > 10
244 42 75 'HASH' eq ref $_[-1] ? :
246 42 75 exists $options->{'figs'} ? :
250 62 55 @_ < 3 ? :
253 55 62 if (my($E, $N) = _get_grid_square_offsets($s))
254 53 2 length $s > 2 ? :
256 37 18 wantarray ? :
263 62 0 if (defined $sheet)
265 8 54 unless (defined $prefix)
268 61 1 unless (defined $suffix)
273 62 0 if (exists $Geo::Coordinates::OSGB::Grid::maps{$sheet})
276 59 3 if (defined $numbers)
282 0 59 if ($w == 0)
286 49 13 wantarray ? :
291 0 0 if (@out = $s =~ /\A (\d+(?:\.\d+)?) \s+ (\d+(?:\.\d+)?) \Z/imosx)
292 0 0 wantarray ? :
314 1838 2356 if ($poly->[$i][1] <= $y) { }
315 267 1571 if ($$poly[$i + 1][1] > $y and _is_left($x, $y, $poly->[$i], $$poly[$i + 1]) > 0)
320 6 2350 if ($$poly[$i + 1][1] <= $y and _is_left($x, $y, $poly->[$i], $$poly[$i + 1]) < 0)