Branch Coverage

blib/lib/Data/Stag/StagImpl.pm
Criterion Covered Total %
branch 260 538 48.3


line true false branch
39 180 0 if (@_ == 2 or @_ == 0) { }
52 0 11 unless (ref $flist)
55 9 2 if (ref $flist eq 'HASH')
59 0 11 if (ref $flist ne 'ARRAY')
65 7 15 if (ref $v) { }
85 14 32 if (ref $v) { }
86 4 10 if (ref $v eq 'ARRAY') { }
10 0 elsif (ref $v eq 'HASH') { }
121 0 89 unless $classname
125 0 89 unless ($mod)
129 2 87 if ($main::main::{"_<$mod.pm"}) { }
146 0 17 if ($fn and $fn eq '-')
151 13 4 if (not $fmt and $fn)
152 0 13 if ($fn =~ /\.xml$/) { }
0 13 elsif ($fn =~ /\.indent$/) { }
0 13 elsif ($fn =~ /\.ind$/) { }
0 13 elsif ($fn =~ /\.xtc$/) { }
10 3 elsif ($fn =~ /\.ite?xt$/) { }
1 2 elsif ($fn =~ /\.se?xpr$/) { }
2 0 elsif ($fn =~ /\.el$/) { }
0 0 elsif ($fn =~ /\.pl$/) { }
0 0 elsif ($fn =~ /\.perl$/) { }
181 0 0 if (not $str and $fn) { }
196 1 16 if (not $fmt and $str)
197 0 1 if ($str =~ /^\s*\'/) { }
1 0 elsif ($str =~ /^\s*\(/) { }
0 0 elsif ($str =~ /^\s*\;/) { }
0 0 elsif ($str =~ /^\s*\
0 0 elsif ($str =~ /^\s*\w+\:\s/) { }
0 0 elsif ($str =~ /^\s*\#/) { }
0 0 elsif ($str =~ /^\w+/) { }
223 0 17 if (not ref $fmt and $fmt =~ /::/)
228 0 17 if (ref $fmt) { }
0 17 elsif ($fmt eq 'xml') { }
0 17 elsif ($fmt eq 'indent') { }
10 7 elsif ($fmt eq 'itext') { }
0 7 elsif ($fmt eq 'perl') { }
7 0 elsif ($fmt eq 'sxpr') { }
247 0 0 unless $parser
249 17 0 unless (ref $parser)
253 13 4 if $fn
263 9 8 unless ($tree and ref $tree)
268 12 5 unless $h
269 17 0 unless ($eh)
280 17 0 $h->can('tree') ? :
282 0 17 unless $htree
304 0 3 if ($fmt eq 'xmlstr') { }
3 0 elsif ($fmt =~ /(.*)str/) { }
0 0 elsif ($fmt eq 'xml') { }
328 0 57 unless ($fmt)
329 0 0 if (not $fn) { }
0 0 elsif ($fn =~ /\.xml$/) { }
0 0 elsif ($fn =~ /\.ite?xt$/) { }
0 0 elsif ($fn =~ /\.ind/) { }
345 0 57 if (ref $fmt) { }
45 12 elsif ($fmt =~ /xml/i) { }
1 11 elsif ($fmt =~ /itext/i) { }
0 11 elsif ($fmt =~ /indent/i) { }
11 0 elsif ($fmt =~ /sxpr/i) { }
0 0 elsif ($fmt =~ /yaml/i) { }
0 0 elsif ($fmt =~ /perl/i) { }
0 0 elsif ($fmt =~ /json/i) { }
0 0 elsif ($fmt =~ /dtd/i) { }
0 0 elsif ($fmt =~ /simple/i) { }
0 0 elsif ($fmt =~ m[xslt/(.+)]i) { }
0 0 elsif ($fmt =~ /::/) { }
0 0 elsif (not $fmt) { }
436 0 5 if (@_ == 1) { }
438 0 0 if ($module =~ /\.xsl/) { }
451 1 11 if ($_ =~ /^-(.*)/) { }
463 1 4 if ($opt_h{'notree'})
485 4 0 if (ref $_) { }
0 0 elsif (not $_) { }
486 0 4 if (ref $_ eq 'HASH') { }
508 0 2 if (ref $block and not @$block)
533 0 0 if (@path) { }
567 7 0 if (ref $subtree) { }
576 21 5 if (isterminal($subnode)) { }
585 3 23 if ($curr) { }
586 1 2 if (ref $curr and ref $curr eq 'ARRAY') { }
617 0 0 if (ref $subtree) { }
644 0 0 if (isterminal($tree)) { }
709 0 0 if (ref $subtree) { }
734 0 0 unless defined $val
753 13 24 if (ref $subtree) { }
797 0 0 unless defined $word
837 0 0 if ($c eq ')')
843 0 0 if ($c =~ /\s/)
846 0 0 if ($c eq '(') { }
858 0 0 if ($c =~ /\s/)
861 0 0 if ($c eq '(')
864 0 0 if ($c eq ')')
876 0 0 if (wantarray)
886 0 82 unless ref $tree and ref $tree eq 'ARRAY' or isastag($tree)
888 0 82 if (ref $newtree and $$newtree[0] eq '@') { }
912 0 568 unless ref $tree and ref $tree eq 'ARRAY' or isastag($tree)
914 0 568 if (@path)
921 0 568 if ($Data::Stag::StagImpl::DEBUG)
924 46 522 if (test_eq($ev, $node))
925 0 46 if ($Data::Stag::StagImpl::DEBUG)
928 0 46 if (defined $replace)
938 201 367 if (ref $subtree)
948 0 541 ref $_ && !scalar(@$_) ? :
964 0 0 unless ref $tree and ref $tree eq 'ARRAY' or isastag($tree)
966 0 0 if (@path)
972 0 0 unless ref $subtree
988 0 12 if (@path)
997 0 12 unless ref $tree and ref $tree eq 'ARRAY' or isastag($tree)
999 0 12 unless ref $subtree
1005 0 24 if (test_eq($ev, $node))
1006 0 0 if (not $is_set) { }
1021 12 0 if (not $is_set) { }
1066 0 115 if (ref $node)
1068 0 0 if ($node->isnull)
1074 2 113 if (ref $v[0] and not ref $v[0][0])
1077 0 115 unless ref $tree and ref $tree eq 'ARRAY' or isastag($tree)
1087 45 92 if (not $has_been_set and test_eq($ev, $node) and !$next_st || $$next_st[0] ne $ev)
1096 70 45 if (not $has_been_set) { }
1112 0 0 if ($nodename ne $elt)
1123 0 4 unless ref $tree and ref $tree eq 'ARRAY' or isastag($tree)
1125 1 3 if (@path)
1131 0 3 unless ref $subtree
1135 6 3 if ($ev ne $node)
1152 0 176 unless ref $tree and ref $tree eq 'ARRAY' or isastag($tree)
1155 2 174 if (@path) { }
1160 23 151 if (test_eq($ev, $node))
1162 0 23 if (defined $replace)
1163 0 0 if ($is_nt) { }
1164 0 0 unless ref $replace
1171 12 11 $is_nt ? :
1174 87 64 unless ref $subtree
1177 62 4 if (wantarray)
1189 0 135 unless ref $tree and ref $tree eq 'ARRAY' or isastag($tree)
1192 0 135 if (@path) { }
1197 12 123 if (test_eq($ev, $node))
1199 0 12 if (ref $subtree)
1203 0 0 if (@kids == 1)
1207 0 12 if (defined $replace)
1212 87 36 unless ref $subtree
1215 32 4 if (wantarray)
1231 0 2 unless ref $tree and ref $tree eq 'ARRAY' or isastag($tree)
1234 1 1 if (@path) { }
1242 0 3 unless ref $child
1244 3 0 if (test_eq($ev, $node))
1245 0 3 if (defined $replace)
1252 2 0 if (wantarray)
1264 0 825 unless (ref $$tree[1])
1269 21 804 if (@path) { }
1276 0 804 unless (ref $children)
1280 0 1782 unless ref $child
1282 813 969 if (test_eq($ev, $node))
1284 14 799 if (ref $subtree)
1287 6 807 if (defined $replace)
1289 3 3 if ($is_nt) { }
1290 0 3 unless (ref $replace)
1299 14 799 if ($is_nt) { }
1308 98 727 if (wantarray)
1321 0 40 unless ref $tree and ref $tree eq 'ARRAY' or isastag($tree)
1324 3 37 if (@path) { }
1330 0 37 unless (ref $children)
1335 61 67 if (test_eq($ev, $node))
1336 0 61 if (defined $replace)
1344 40 0 if (wantarray)
1368 0 0 unless ref $tree and ref $tree eq 'ARRAY' or isastag($tree)
1374 0 0 if ($elth{$ev})
1376 0 0 $is_nt ? :
1406 0 0 if @currv
1422 0 0 if (@v > 1)
1450 10 0 unless ($h{$v})
1480 2 2 if ($key =~ /(.*)=(.*)/)
1490 6 8 if ($ev eq $key1)
1491 0 6 if ref $st
1508 0 0 if ($next) { }
1509 0 0 if (ref $next and ref $next eq 'ARRAY')
1514 0 0 unless (@subnodes)
1561 2 1 unless ($schema)
1564 1 2 unless (isastag($schema))
1565 1 0 unless (ref $schema)
1574 2 1 if ($top)
1583 2 1 if ($cols)
1586 0 11 if (ref $_) { }
1592 11 0 if (/(\w+)\.(\w+)/) { }
1609 2 1 if ($path)
1610 0 2 if (ref $path) { }
1618 0 3 unless ($path)
1632 10 9 unless $pkey_by_groupname{$groupname}
1636 10 9 unless $cols_by_groupname{$groupname}
1705 173 148 unless ($group)
1722 0 155 unless shift()
1723 0 155 unless shift()
1724 0 155 unless shift()
1734 110 45 unless ($rec)
1743 0 110 unless ($parent_groupstruct)
1786 0 0 if (@v > 1)
1801 0 0 unless ref $tree
1803 0 0 if test_eq($ev, $node)
1804 0 0 unless ref $subtree
1807 0 0 if (defined $replace)
1812 0 0 if (wantarray)
1831 0 13 if ($replace)
1862 0 0 if $mvals[$i] ne $rvals[$i]
1874 0 0 unless ref $matchtree
1876 0 0 if ($node ne $mnode)
1877 0 0 unless ref $subtree
1884 0 0 unless (ref $subtree or ref $msubtree)
1887 0 0 if (ref $subtree and ref $msubtree)
1892 0 0 unless $x
1896 0 0 unless $ok
1927 0 0 if (defined $replace)
1944 24 258 if (name($stag) eq $node)
1945 12 12 if (&$testcode($stag))
1951 0 12 if (defined $replace)
1997 0 0 if ($p->name eq 'arg') { }
1998 0 0 if (isastag($p->children)) { }
2018 0 0 if wantarray
2110 0 0 unless scalar @v == 1
2112 0 0 unless $treeh{$val}
2113 0 0 unless $treeh{$val}
2141 0 0 unless shift()
2144 0 0 unless @elts
2152 0 0 if ($cv eq $v)
2169 0 0 if isterminal($tree)
2171 0 0 if (@attrs)
2192 0 7 if ($@)
2211 0 2 if (@$node)
2224 0 809 unless (ref $tree)
2228 0 809 unless ref $tree
2271 0 0 unless my $parser = 'Parse::RecDescent'->new($grammar)
2291 0 679 if (@_)
2295 395 284 unless (ref $kids)
2330 11 848 if (@_)
2341 20 149 if (@_)
2352 0 0 if ($$_[0] eq $from)
2367 19 12 unless defined $y
2368 0 12 unless defined $x
2369 2 10 $x < $y ? :
2374 19 12 $x > $y ? :
2387 11 9 if ($node->name =~ /(\S+)\.(\S+)/)
2398 0 0 if $$done_h{$name}
2401 0 0 if ($is_nt) { }
2405 0 0 if (@subnames < 2)
2407 0 0 unless (@subnames)
2429 0 20 if (grep {$_ eq $root;} @$path)
2440 19 1 if ($parent)
2444 0 19 unless $max
2445 2 17 if ($min == 0) { }
2446 1 1 if ($max == 1) { }
2455 13 4 if ($max == 1) { }
2464 11 9 if ($$data{$root}) { }
2502 24 12 if (isterminal($_))
2509 19 17 unless $$childh{$elt} and grep {$_ eq $se;} @{$$childh{$elt};}
2510 29 7 unless $lcard{$se}
2529 0 24 if (not $in) { }
6 18 elsif ($in =~ /^\-?\d+$/) { }
0 18 elsif ($in =~ /^\-?\d*\.\d+$/) { }
2533 6 0 if ($d eq 'INT')
2536 0 6 if ($lin > 10)
2545 0 0 if ($d eq 'INT')
2551 10 8 if ($d =~ /VARCHAR\((\d+)\)/) { }
0 8 elsif ($d =~ /TEXT/) { }
2552 0 10 if ($lin > $1) { }
2576 0 8 if ($s2 > 255)
2589 0 765 if ($name eq 'DESTROY')
2594 765 0 if ($name =~ /^([a-zA-Z]+)_(\w+)/)
2595 765 0 if ($self->can($1))
2606 36 1726 if (ref $node and ref $node eq 'ARRAY') { }
21 1705 elsif ($node =~ m[/]) { }
2619 0 3132 unless defined $ev
2620 0 3132 unless defined $node