Branch Coverage

blib/lib/Math/Polygon/Tree.pm
Criterion Covered Total %
branch 100 124 80.6


line true false branch
29 0 6 unless eval "require $class"
34 0 6 if not $CLIPPER_CLASS
61 153 8264 ref $in_contours[-1] eq 'HASH' ? :
69 2 8973 if (ref $contour ne 'ARRAY')
75 8971 2 unless $points[0][0] == $points[-1][0] and $points[0][1] == $points[-1][1]
83 0 8417 unless @contours
88 7185 1232 if ($nrpoints <= $MAX_LEAF_POINTS)
92 131 7054 if ($opt{'prepare_rough'})
96 757 137 $i > 0 ? :
98 79 1 if ($$c[$h][1] == $$c[$i][1] and $$c[$k][1] == $$c[$j][1] and $$c[$i][1] == $y0 || $$c[$i][1] == $y1 and $$c[$j][1] == $y0 || $$c[$j][1] == $y1)
105 46 33 if ($$c[$i][0] == $x0 and $$c[$j][0] == $x0)
110 33 46 if ($$c[$i][0] == $x1 and $$c[$j][0] == $x1)
116 124 1 if ($$c[$h][0] == $$c[$i][0] and $$c[$k][0] == $$c[$j][0] and $$c[$i][0] == $x0 || $$c[$i][0] == $x1 and $$c[$j][0] == $x0 || $$c[$j][0] == $x1)
123 59 65 if ($$c[$i][1] == $y0 and $$c[$j][1] == $y0)
128 46 78 if ($$c[$i][1] == $y1 and $$c[$j][1] == $y1)
172 906 8510 unless (@slice_parts)
178 101 7918 if (@slice_parts == 1 and @{$slice_parts[0];} == 4 and all sub { $$_[1] == $y0 or $$_[1] == $y1 if $$_[0] == $x0 or $$_[0] == $x1; } , @{$slice_parts[0];})
180 1945 3234 if $$_[0] == $x0 or $$_[0] == $x1
187 150 8259 %opt ? :
202 0 0 unless open my $in, '<', $file
0 2 $need_to_open ? :
210 2 15062 if ($line =~ /^([\-\!]?) (\d+)/x)
211 0 2 $1 ? :
216 15052 10 if ($line =~ /^\s+([0-9.Ee+-]+)\s+([0-9.Ee+-]+)/)
222 0 10 if ($line =~ /^END/ and $pid < 0)
228 2 8 if ($line =~ /^END/ and @cur_points)
235 0 2 if $need_to_open
244 0 52 if ref $point ne 'ARRAY'
249 0 44 if $px < $xmin - $POLYGON_BORDER_WIDTH or $px > $xmax + $POLYGON_BORDER_WIDTH or $py < $ymin - $POLYGON_BORDER_WIDTH or $py > $ymax + $POLYGON_BORDER_WIDTH
256 24 20 if (exists $$self{'poly'})
266 1 19 unless ref $subpart
275 6 0 @points == 1 && ref $points[0][0] ? :
280 1 10 if defined $result and $point_result != $result
291 1 9 ref $bbox[-1] eq 'HASH' ? :
292 10 0 ref $bbox[0] ? :
294 0 10 if @$bbox != 4
300 0 9 if $x1 < $xmin or $x0 > $xmax or $y1 < $ymin or $y0 > $ymax
303 1 8 unless $x0 >= $xmin and $x1 <= $xmax and $y0 >= $ymin and $y1 <= $ymax
305 6 2 unless ($$self{'subparts'})
306 0 6 unless $$self{'filled_bboxes'}
308 3 4 if $x0 >= $fx0 and $y0 >= $fy0 and $x1 <= $fx1 and $y1 <= $fy1
311 2 1 unless $opt{'inaccurate'}
323 0 2 if $i0 != $i1
327 0 2 if $j0 != $j1
330 0 2 unless ref $subpart
338 0 8 if ref $poly ne 'ARRAY'
340 1 7 %opt ? :
355 7 8977 if @$contour <= 2
380 5 0 ref $poly[0][0] ? :
382 1 4 if @$contour < 2
395 1 4 if $tsq == 0
405 1 3 if ($sq == 0)
417 30 0 ref $poly[0][0] ? :
428 2 118 if abs $y - $py < $POLYGON_BORDER_WIDTH and abs $x - $px < $POLYGON_BORDER_WIDTH
430 3 0 if abs $y - $py < $POLYGON_BORDER_WIDTH and abs $py - $ny < $POLYGON_BORDER_WIDTH and $x >= $px || $x >= $nx and $x <= $px || $x <= $nx
435 42 73 if abs $py - $ny < $POLYGON_BORDER_WIDTH
436 21 52 if $y < $py and $y < $ny
437 14 38 if $y > $py and $y > $ny
438 14 24 if $x > $px and $x > $nx
441 9 15 if abs $x - $xx < $POLYGON_BORDER_WIDTH
443 0 15 if $y <= $py and $y <= $ny
445 14 1 if abs $px - $nx < $POLYGON_BORDER_WIDTH or $x < $xx