Branch Coverage

lib/Graph/Easy/Layout/Scout.pm
Criterion Covered Total %
branch 281 382 73.5


line true false branch
81 2 57 if $edge->undirected
90 24 204 if $d == 0
94 98 106 if $d == -1
99 6 198 if $edge->{'bidirectional'}
105 57 171 if $i == 4
118 31 874 if ($src == $dst)
121 31 0 unless scalar @$rc == 0
126 77 742 if $src->is_multicelled or $dst->is_multicelled or $edge->has_ports
141 0 742 if $self->{'debug'}
143 679 63 if ($dx == 0 or $dy == 0) { }
147 0 679 if $self->{'debug'}
154 579 100 if (abs $dx1 == 2 or abs $dy1 == 2)
156 567 12 unless (exists $$cells{"$x,$y"})
161 5 562 if ($edge->bidirectional) { }
13 549 elsif ($edge->undirected) { }
163 4 1 if $dy == 0
164 1 4 if $dx == 0
168 7 6 if $dy == 0
169 6 7 if $dx == 0
173 266 283 if $dx == 1 and $dy == 0
174 176 373 if $dx == 0 and $dy == 1
175 66 483 if $dx == -1 and $dy == 0
176 41 508 if $dx == 0 and $dy == -1
180 4 563 if (($edge->{'to'}->attribute('shape') || '') eq 'edge')
183 3 1 if ($dx > 0) { }
0 1 elsif ($dx < 0) { }
192 3 564 if (($edge->{'from'}->attribute('shape') || '') eq 'edge')
201 51 61 if $dx == 0
208 101 181 if exists $$cells{"$x,$y"}
211 22 159 if $label_done++ == 0
215 11 170 if $x == $x1 and $y == $y1
218 11 101 if ($done == 0)
220 0 11 if $self->{'debug'}
241 0 63 if $self->{'debug'}
247 63 0 if ref $edge and ($edge->label || '') eq ''
251 16 51 if exists $$cells{"$x,$y"}
252 0 51 if $self->{'debug'}
253 0 51 if $label++ == 0
259 36 27 if exists $$cells{"$x,$y"}
261 27 36 if ($done == 0)
266 0 27 if $self->{'debug'}
271 0 19 if exists $$cells{"$x,$y"}
272 0 19 if $self->{'debug'}
278 36 27 if ($done != 0)
282 0 36 if $self->{'debug'}
289 8 59 if exists $$cells{"$x,$y"}
290 0 59 if $self->{'debug'}
296 11 25 if exists $$cells{"$x,$y"}
298 25 11 if ($done == 0)
303 0 25 if $self->{'debug'}
306 25 0 if $edge->label eq ''
310 4 27 if exists $$cells{"$x,$y"}
311 0 27 if $self->{'debug'}
312 0 27 if $label++ == 0
319 48 15 if ($done == 0)
321 0 48 if $self->{'debug'}
326 0 15 if $self->{'debug'}
338 0 31 if $self->{'debug'}
366 3 28 if $flow == 270
374 2 29 if $flow == 0
382 7 24 if $flow == 180
394 0 114 if $self->{'debug'}
395 83 31 unless $places[$idx + 2] == $this_try
400 0 31 if $self->{'debug'}
402 0 31 unless $self->_path_is_clear(\@rc)
404 0 31 if $self->{'debug'}
440 1262 5892 if (@$heap == 0) { }
1522 4370 elsif ($elem->[0] < $heap->[0][0]) { }
838 3532 elsif ($elem->[0] > $heap->[-1][0]) { }
462 1910 1622 if (scalar @$heap < 10) { }
467 862 4946 if ($e->[0] > $el)
485 5040 2510 if ($heap->[$m][0] <= $el) { }
496 1438 2513 if ($heap->[$l][0] > $el)
531 0 0 if ($e->[1] == $x and $e->[2] == $y)
564 6564 0 if (defined $x1)
569 299 6265 if ref $cells->{$xy} and $cells->{$xy}->isa('Graph::Easy::Edge')
572 6563 1 if (defined $px)
581 3247 3316 unless $dx1 == $dx2 or $dy1 == $dy2
595 16665 4195 if $dx != 0 and $dy != 0
636 7 1212 if $dx2 == 0 and $dy2 == 0
638 0 1219 if $dx1 == 0 and $dy1 == 0
641 0 1219 unless $$edge_type{"$dx1,$dy1,$dx2,$dy2"}
661 331 2871 if exists $$cells{"$nx,$ny"}
662 258 2944 if ($type == 1) { }
71 2873 elsif ($type == 2) { }
686 0 12150 if $self->{'debug'} > 2
689 745 10839 if $x < $min_x or $x > $max_x or $y < $min_y or $y > $max_y
692 0 10839 if $self->{'debug'} > 2
694 3882 6957 if exists $closed->{$p}
696 956 752 if (exists $cells->{$p} and ref $cells->{$p} and $cells->{$p}->isa('Graph::Easy::Edge'))
702 417 539 if $type == 1 or $type == 2
705 752 5249 if exists $cells->{$p}
722 240 2 if defined $cache->{'min_x'}
736 2 2 if $x < $min_x
737 2 2 if $y < $min_y
738 4 0 if $x > $max_x
739 3 1 if $y > $max_y
742 0 2 if $self->{'debug'}
792 16 94 unless exists $next_fields->{$type}
799 33 61 if $type == 1 || $type == 2 and $c->{'type'} & $mask
811 6 116 if exists $cells->{$sxsy}
854 19 12 if $end or $edge->{'bidirectional'}
865 95 13 unless exists $$cells{"$x,$y"}
868 5 8 unless $cell->isa('Graph::Easy::Edge::Cell')
872 0 8 unless $cell_type == 1 or $cell_type == 2
876 2 6 unless scalar grep({$e == $_;} @$shared)
900 0 248 if $self->{'debug'}
917 0 248 if ($edge->{'to'}->attribute('shape') eq 'edge')
921 0 248 if ($edge->{'from'}->attribute('shape') eq 'edge')
942 28 220 if defined $e_p and @ee_p == 1
948 28 56 if @{$s->{'cells'};} > 0
952 18 230 if (@shared > 0) { }
958 0 18 if $self->{'debug'}
963 6 12 if $path
973 16 214 if defined $e_p
979 0 242 unless scalar @B > 0
985 20 222 if defined $s_p and @ss_p == 1
991 21 41 if @{$s->{'cells'};} > 0
994 13 229 if (@shared > 0) { }
1000 0 13 if $self->{'debug'}
1005 0 13 if $path
1017 18 211 if $edge->{'bidirectional'}
1021 36 193 if defined $s_p
1024 0 229 unless @start > 0
1033 602 510 if ($sy < $src->{'y'} or $sy >= $src->{'y'} + $src->{'cy'}) { }
1035 230 372 if $sy < $src->{'y'}
1036 372 230 if $sy > $src->{'y'}
1040 253 257 if $sx < $src->{'x'}
1041 257 253 if $sx > $src->{'x'}
1053 13 229 if (@$path > 0 and keys %$start_cells > 0)
1064 12 230 if (@$path > 0 and keys %$end_cells > 0)
1120 11 1161 if $rcell and not $rcell =~ /::Edge/
1122 298 863 if $rcell =~ /::Edge/
1123 266 32 if $t != 0 and $t != 1 and $t != 2
1132 1104 2114 if $dist < $lowest
1133 1104 2114 if $dist < $lowest
1138 32 863 if $t != 0
1144 0 895 if $self->{'debug'} > 1
1165 0 3442 if $self->{'debug'}
1168 0 3442 if ($tries++ > $max_tries)
1175 0 3442 if $self->{'debug'} > 1
1188 240 13590 if ($x == $stop[$i] and $y == $stop[$i + 1])
1190 228 12 if defined $stop[$i + 2]
1192 12 228 if ($per_field > 3) { }
0 228 elsif ($self->{'debug'} > 1) { }
1196 0 12 if $self->{'debug'} > 1
1205 0 3202 unless defined $x and defined $y
1216 0 5666 unless (defined $nx and defined $ny)
1222 5666 0 if defined $px and defined $py
1227 1566 4100 if exists $open_by_pos->{$n}
1245 3300 9344 if $d < $lowest_distance
1248 0 4100 if $self->{'debug'} > 1
1263 2 240 unless (defined $elem)
1265 0 2 if $self->{'debug'}
1284 0 1155 unless exists $$closed{"$cx,$cy"}
1292 1155 0 if ($edge_type == 0)
1297 0 1155 unless (defined $px)
1308 0 0 if ($edge_flags & 512) != 0
1309 0 0 if ($edge_flags & 2048) != 0
1311 0 0 if ($edge_flags & 256) != 0
1312 0 0 if ($edge_flags & 1024) != 0
1317 240 915 unless (defined $lx)
1324 228 927 unless (defined $lx)
1338 77 151 if ($edge_flags & 128) != 0
1339 39 189 if ($edge_flags & 32) != 0
1341 79 149 if ($edge_flags & 64) != 0
1342 40 188 if ($edge_flags & 16) != 0
1350 0 1155 if $self->{'debug'} > 1
1352 0 0 if ($px == $lx and $py == $ly and $cx != $lx || $cy != $ly)
1356 0 0 if $self->{'debug'}
1360 0 1155 if ($type & 15) == 0
1367 239 117 if ($label_cell == 0 and not exists $$cells{"$cx,$cy"} and $t == 1 || $t == 2)
1373 155 898 if $type == 5 or $t == 6 or $t == 3 or $t == 4
1378 240 915 if $$closed{"$cx,$cy"}[5]
1386 0 8 if @bends >= 3 and $self->{'debug'}
1389 8 232 if @bends >= 3
1391 0 240 if wantarray
1475 0 0 if $a->[0] != $pattern->[0] or $b->[0] != $pattern->[1] or $c->[0] != $pattern->[2] or $dx != $pattern->[3] or $dy != $pattern->[4]
1490 0 0 if $pattern->[5] == 2
1492 0 0 if exists $$cells{"$cx,$cy"}
1501 0 0 if $x == $cx and $y == $cy
1508 0 0 if exists $$cells{"$x,$y"}
1522 0 0 if exists $$cells{"$x,$y"}
1527 0 0 if $x == $cx and $y == $cy
1539 0 0 $a->[3] - $c->[3] ? :
1625 0 0 if exists $cells->{$xy} and ref($cells->{$xy}) =~ /Node/
1627 0 0 if exists $cells->{$xy} and not exists $path->{$xy}
1631 0 0 unless exists $closed->{$xy} or exists $open->{$xy}
1634 0 0 if (exists $closed->{$xy}) { }
0 0 elsif (exists $open->{$xy}) { }
1648 0 0 if exists $path->{$xy}