Branch Coverage

blib/lib/PPIx/Utils/Traversal.pm
Criterion Covered Total %
branch 67 106 63.2


line true false branch
35 0 7 unless $sib
37 2 5 if ($sib->isa('PPI::Structure::List'))
40 1 1 unless $expr
41 1 0 $expr->isa('PPI::Statement') ? :
50 0 11 unless $sib
52 3 8 if ($sib->isa('PPI::Structure::List')) { }
56 0 3 unless @list_contents
60 3 0 if (is_ppi_expression_or_generic_statement($item)) { }
81 8 11 if $iter->isa('PPI::Token::Structure') and $iter eq ';'
82 0 11 if $iter->isa('PPI::Token::Operator') and $MIN_PRECEDENCE_TO_TERMINATE_PARENLESS_ARG_LIST <= precedence_of($iter)
97 8 18 if ($node->isa('PPI::Token::Operator') and $node eq ',' || $node eq '=>') { }
7 11 elsif ($node->isa('PPI::Token::QuoteLike::Words')) { }
101 8 0 if (@node_stacks)
123 0 0 unless my $element = shift()
130 0 0 if $next = $element->snext_sibling
138 0 0 unless my $element = shift()
140 0 0 unless $element->location
143 0 0 unless $element = $element->parent
147 0 0 unless $element->location
0 0 unless (@{[] unless $element->location;})[0] == $line
148 0 0 if $element->isa('PPI::Statement::Include')
162 0 4 unless $element
163 0 4 unless $element->isa('PPI::Statement')
165 4 0 if ($element->isa('PPI::Statement::Include')) { }
0 0 elsif (not $element->specialized and $element->schildren > 2) { }
167 4 0 if ($pragma = $element->pragma and $pragma eq 'constant')
174 0 0 if ($supposed_constant_function eq 'const' || $supposed_constant_function =~ / \A Readonly \b /x and $declaring_scope eq 'our' || $declaring_scope eq 'my')
191 0 4 unless my(@arguments) = $include->arguments
194 0 4 unless defined $follower
196 1 3 if ($follower->isa('PPI::Token::Operator') and $follower->content eq '+')
198 0 1 unless defined $follower
206 3 1 if ($follower->isa('PPI::Structure::Constructor') or $follower->isa('PPI::Structure::Block')) { }
210 0 3 unless my $statement = $follower->schild(0)
211 0 3 unless $statement->isa('PPI::Statement')
216 10 7 unless ($inx % 2)
220 7 10 if ($IS_COMMA{$child->content})
229 5 2 $_ && @{$_;} == 2 && '=>' eq $_->[1]->content && $_->[0]->isa('PPI::Token::Word') ? :
256 2 8 if (my $single_namespace = _split_ppi_node_by_namespace_single($node))
274 1 9 unless ($package_statements and @{$package_statements;})
278 6 3 if (@{$package_statements;} == 1)
284 1 5 if ($package_address == &refaddr($node) or $first_child and $package_address == &refaddr($first_child))
306 10 8 if ($initial_fragment)
311 20 131 if ($child->isa('PPI::Statement::Package')) { }
10 121 elsif ($child->isa('PPI::Statement::Compound') or $child->isa('PPI::Statement::Given') or $child->isa('PPI::Statement::When')) { }
312 19 1 if ($fragment)
327 10 34 if ($component->isa('PPI::Structure::Block'))
332 10 0 if ($block)
333 1 9 unless ($fragment)
351 125 26 if ($initial_fragment_address != &refaddr($fragment))
354 0 125 unless $child->remove
355 0 125 unless $fragment->add_element($child)
366 22 130 unless ($fragment = $scope_fragments_by_namespace->{$namespace})
383 22 19 if (not @{$nodes;} or &refaddr($nodes->[-1]) != &refaddr($fragment))