Branch Coverage

lib/Template/Stash.pm
Criterion Covered Total %
branch 98 148 66.2


line true false branch
78 1 7 if ($type =~ /^scalar|item$/) { }
3 4 elsif ($type eq 'hash') { }
4 0 elsif ($type =~ /^list|array$/) { }
113 167 0 ref $_[0] eq 'HASH' ? :
154 1 1512 if (defined $import and ref $import eq 'HASH') { }
168 1 1512 if defined $import
188 0 1513 unless $self->{'_PARENT'}
212 311 297 if (ref $ident eq 'ARRAY' or $ident =~ /\./ and $ident = [map({s/\(.*$//; $_, 0;} split(/\./, $ident, 0))]) { }
223 8 676 unless defined $result
231 407 198 defined $result ? :
259 9 500 if (ref $ident eq 'ARRAY' or $ident =~ /\./ and $ident = [map({s/\(.*$//; $_, 0;} split(/\./, $ident, 0))]) { }
271 0 11 unless defined $result
284 508 1 defined $result ? :
300 3 3 if (ref $ident eq 'ARRAY') { }
305 3 3 if $i >= $size - 2
307 0 3 unless defined($root = $self->_dotop($root, $item, $args))
314 6 0 if (defined $root) { }
315 8 3 unless $args
339 1 1319 if (defined $import and ref $import eq 'HASH')
358 11 1445 if ($self->{'_STRICT'}) { }
367 11 0 if $self->{'_STRICT'}
378 4 7 ref $ident eq 'ARRAY' ? :
383 2 2 /^\d+$/ ? :
2 13 if $args and ref $args eq 'ARRAY'
432 0 1019 unless defined $root and defined $item
435 0 1019 if $PRIVATE and $item =~ /$PRIVATE/
437 740 279 if ($atroot or $rootref eq 'HASH') { }
149 130 elsif ($rootref eq 'ARRAY') { }
37 93 elsif (&blessed($root) and $root->can('can')) { }
92 1 elsif ($value = $Template::Stash::SCALAR_OPS->{$item} and not $lvalue) { }
1 0 elsif ($value = $Template::Stash::LIST_OPS->{$item} and not $lvalue) { }
0 0 elsif ($self->{'_DEBUG'}) { }
444 491 249 if (defined($value = $root->{$item})) { }
1 248 elsif ($lvalue) { }
40 208 elsif ($value = $Template::Stash::HASH_OPS->{$item} and not $atroot or $item eq 'import') { }
2 206 elsif (ref $item eq 'ARRAY') { }
445 474 17 unless ref $value eq 'CODE'
465 140 9 if ($value = $Template::Stash::LIST_OPS->{$item}) { }
8 1 elsif ($item =~ /^-?\d+$/) { }
1 0 elsif (ref $item eq 'ARRAY') { }
470 8 0 unless ref $value eq 'CODE'
493 12 25 if ($@)
500 1 11 if ref $@ or not $@ =~ /Can't locate object method "\Q$item\E" via package "\Q$class\E"/
503 6 5 if (&reftype($root) eq 'HASH') { }
5 0 elsif (&reftype($root) eq 'ARRAY') { }
0 0 elsif ($value = $Template::Stash::SCALAR_OPS->{$item}) { }
0 0 elsif ($value = $Template::Stash::LIST_OPS->{$item}) { }
0 0 elsif ($self->{'_DEBUG'}) { }
504 3 3 if (defined($value = $root->{$item})) { }
2 1 elsif ($value = $Template::Stash::HASH_OPS->{$item}) { }
1 0 elsif ($value = $Template::Stash::LIST_OPS->{$item}) { }
505 3 0 unless ref $value eq 'CODE'
516 3 2 if ($value = $Template::Stash::LIST_OPS->{$item}) { }
2 0 elsif ($item =~ /^-?\d+$/) { }
0 0 elsif (ref $item eq 'ARRAY') { }
521 2 0 unless ref $value eq 'CODE'
559 317 210 if (defined $result[0]) { }
0 210 elsif (defined $result[1]) { }
2 208 elsif ($self->{'_DEBUG'}) { }
561 0 317 scalar @result > 1 ? :
594 0 509 unless $root and defined $item
597 0 509 if $PRIVATE and $item =~ /$PRIVATE/
599 508 1 if ($rootref eq 'HASH' or $atroot) { }
1 0 elsif ($rootref eq 'ARRAY' and $item =~ /^-?\d+$/) { }
0 0 elsif (&blessed($root)) { }
602 508 0 unless $default and $root->{$item}
607 1 0 unless $default and $root->{$item}
612 0 0 unless $default and $root->$item
662 0 0 if $indent > 32
667 0 0 unless defined $value
668 0 0 if $key =~ /^\./
669 0 0 if (ref $value eq 'ARRAY') { }
0 0 elsif (ref $value eq 'HASH') { }
670 0 0 defined $_ ? :