Branch Coverage

lib/Graph/Easy/Parser.pm
Criterion Covered Total %
branch 233 310 75.1


line true false branch
31 0 117 unless ($k =~ /^(debug|fatal_errors)\z/)
99 2 0 unless ref $self
104 0 2 if (ref $file) { }
106 0 0 unless binmode $file, ':utf8'
111 0 2 unless open my $PARSER_FILE, $file
112 0 2 unless binmode $PARSER_FILE, ':utf8'
125 0 4 unless $object =~ /^(node|group|graph|edge)\z/
158 27 14 if @{$$self{'stack'};} == 0
161 33 8 if ($target and $target eq 'parent')
166 33 0 if ref $stack
167 22 11 unless (defined $object)
172 22 0 if (not $stack or @$stack <= 1)
180 0 41 if $$self{'error'}
182 0 41 if (ref $$stack[-1] eq 'HASH')
193 0 41 if $$self{'debug'} and $$self{'debug'} > 1
195 1 40 if ($max_idx != 1) { }
212 2 39 if (defined $$a{'basename'})
217 2 4 if exists $$s{'autosplit_parts'}
235 0 729 if $$self{'error'}
251 0 57 unless defined $name
257 15 42 if ($name eq '') { }
259 0 15 if $$self{'debug'}
266 0 42 if $$self{'debug'}
273 2 55 if (@$group_stack > 0)
297 0 44 unless defined $end
300 35 9 if $end eq '['
301 1 43 if $end eq '('
306 8 36 if ($end eq ')') { }
310 0 8 if $$self{'debug'}
328 0 36 unless defined $group
330 0 36 if $$self{'debug'}
333 0 36 if $$self{'error'}
370 0 98 unless defined $att
395 0 63 if $$self{'error'}
400 26 37 if (defined $$self{'left_edge'})
409 2 26 if $edge_bd
410 0 28 if $edge_un
425 0 780 if @{$$self{'stack'};} == 0
432 13 68 unless defined $2 or defined $5
444 0 780 if $$self{'error'}
448 68 712 if defined $edge_label
450 68 712 if defined $edge_label
477 0 6 if @{$$self{'stack'};} == 0
483 0 0 unless defined $2 or defined $5
493 0 6 if defined $13 and $13 eq '['
494 0 6 if defined $13 and $13 eq '('
497 0 6 if $$self{'error'}
505 0 6 if $edge_label
507 0 6 if $edge_label
518 6 0 if defined $13 and $13 eq ')'
559 4 338 if ((ref $self || $self) eq 'Graph::Easy::Parser' and $txt =~ m[^(\s*|\s*/\*.*?\*/\s*)(strict)?$o_cmt(di)?graph$o_cmt("[^"]*"|[\w_]+)$o_cmt\{]im || $txt =~ m[^(\s*|\s*/\*.*?\*/\s*)(strict)?${o_cmt}digraph$o_cmt\{]im || $txt =~ m[^(\s*|\s*/\*.*?\*/\s*)strict$o_cmt(di)?graph$o_cmt\{]im)
571 40 1 if (ref $self)
578 41 0 if ref $self
581 13 427 if ((ref $self || $self) eq 'Graph::Easy::Parser' and $txt =~ m[^([\s\n\t]*|\s*/\*.*?\*/\s*)graph\s*:\s*\{]m)
589 13 0 if (ref $self)
596 13 0 if ref $self
599 8 432 unless ref $self
603 1 439 if not defined $txt or $txt =~ /^\s*\z/
610 1317 439 unless $o eq 'graph'
635 3573 2329 if (@lines > 0 and $handled == 0)
641 2019 1554 if $curline =~ /$qr_comment/
650 0 3883 if $$self{'debug'} and $$self{'debug'} > 2
651 0 3883 if $$self{'debug'} and $$self{'debug'} > 2
659 1253 18676 if $line eq ''
664 0 18676 if $$self{'debug'} and $$self{'debug'} > 3
666 2693 15983 if ($line =~ /$pattern/)
669 0 2693 if $$self{'debug'} and $$self{'debug'} > 2
671 2658 35 if defined $handler
672 2514 179 if ($rc)
674 2509 5 unless defined $replace
675 5 2509 if ref $replace
676 0 2514 if $$self{'debug'} and $$self{'debug'} > 2
678 0 2514 if $$self{'debug'} and $$self{'debug'} > 2
691 12 3871 if $handled == 0 and @lines == 0
694 0 3871 if $$self{'error'}
697 12 427 if $backbuffer ne ''
700 0 427 if not $$self{'error'} and $$self{'scope_stack'} and @{$$self{'scope_stack'};} > 0
702 0 439 if $$self{'error'} and $$self{'fatal_errors'}
706 0 439 if $$graph{'debug'}
709 439 0 if $self->can('_parser_cleanup')
727 2 784 if $ed =~ /^(= )+\z/
728 22 764 if $ed =~ /^=+\z/
729 30 756 if $ed =~ /^\.+\z/
730 7 779 if $ed =~ /^(- )+\z/
731 1 785 if $ed =~ /^(..-)+\z/
732 21 765 if $ed =~ /^(\.-)+\z/
733 4 782 if $ed =~ /^\~+\z/
734 0 786 if $ed =~ /^#+\z/
761 841 128 unless ref $e eq 'ARRAY'
765 969 128 if (ref $a) { }
773 0 128 if $$self{'error'}
779 29 940 if $edge_bd
780 23 946 if $edge_un
798 0 2286 unless defined $name
804 714 1572 unless $no_collapse
826 2 63 if (exists $$self{'clusters'}{$base_name})
831 3 2 if $$self{'cluster_id'}
832 2 3 unless exists $$self{'clusters'}{$base_try}
835 2 0 if $$self{'cluster_id'}
854 0 2 if $$node{'autosplit_basename'} eq $new_basename
862 0 6 if $$self{'debug'} > 1
886 50 15 unless defined $allow_empty
896 17 48 if exists $$att{'basename'}
905 0 65 if $$graph{'debug'}
920 45 143 if ($qr_clean)
926 2 184 if ($add == 0 and $remaining eq '' and $sep =~ /\|\|?/)
932 0 188 if $$graph{'debug'}
935 12 176 if ($allow_empty and $part eq ' ') { }
10 166 elsif ($part =~ /^[ ]{2,}\z/) { }
953 0 188 if ($$graph{'debug'})
956 0 0 if $class ne $$self{'use_class'}{'node'}
957 0 0 if $$graph{'debug'}
961 12 176 if ($class =~ /::Empty/)
964 11 1 unless (defined $node)
979 65 123 if (@rc == 1) { }
987 17 48 if defined $$att{'basename'}
997 16 107 if ($last_sep eq '||')
1016 16 172 if ($sep eq '||')
1033 0 1900 if $$graph{'debug'}
1042 22 1878 if ($name =~ /^\s*\z/) { }
50 1828 elsif (ref $self eq 'Graph::Easy::Parser' and $name =~ /[^\\]\|/) { }
1044 0 22 if $$graph{'debug'}
1068 0 1828 if ($$self{'debug'})
1070 0 0 if (not $graph->node($name)) { }
1082 0 1900 if exists $$att{'basename'} and not $autosplit
1089 94 1806 if (defined $stack)
1101 105 1888 if $group
1106 2 1898 if defined $b
1244 340 2659 if ref $object
1245 1580 1419 unless defined $class
1254 421 2578 if $self->can('_match_multi_line_comment')
1256 421 2578 if $self->can('_match_special_attribute')
1259 2333 666 if $text =~ /^\s*\z/
1261 0 666 if $$self{'debug'} > 3
1265 0 877 if $$self{'debug'} > 3
1268 262 615 if $qr_cmt
1271 1 876 if $text =~ /^\s*\z/
1277 28 4 if $done == 0 and $qr_satt and $text =~ s/^$qr_satt//
1279 4 872 if $done == 0
1283 28 844 unless defined $v
1289 0 662 if ($$self{'debug'} and $$self{'debug'} > 1)
1296 174 488 if $self->can('_remap_attributes')
1304 19 818 if defined $rc
1306 10 827 if ref $v eq 'ARRAY'
1308 818 19 if defined $v
1311 621 41 unless wantarray
1324 1 2 if $msg_nr == 1
1326 1 2 if $msg_nr == 2
1328 1 2 if $msg_nr == 3
1330 0 3 if $msg_nr == 4
1332 0 3 if $msg_nr == 5
1335 0 3 if $msg_nr == 6
1337 0 3 if $msg_nr == 7
1358 50 1076 if $$n{'autosplit'}
1359 0 1076 if $n->attribute('offset') ne '0,0' and $n->attribute('origin') eq ''