Branch Coverage

blib/lib/Perl/Critic/Policy/RegularExpressions/ProhibitCaptureWithoutTest.pm
Criterion Covered Total %
branch 1 90 1.1


line true false branch
42 15 0 unless $elem =~ /\A \$[1-9] \z/msx
43 0 0 if _is_in_conditional_expression($elem)
44 0 0 if $self->_is_in_conditional_structure($elem)
55 0 0 if ($psib->isa("PPI::Token::Operator"))
57 0 0 if ($CONDITIONAL_OPERATOR{$op})
60 0 0 if $psib->isa("PPI::Token::Regexp::Match")
61 0 0 if $psib->isa("PPI::Token::Regexp::Substitute")
81 0 0 unless $stmt
86 0 0 if ($psib->isa("PPI::Node") and my $match = _find_exposed_match_or_substitute($psib))
97 0 0 if ($parent->isa('PPI::Statement::Compound') or $parent->isa('PPI::Statement::When')) { }
0 0 elsif ($parent->isa('PPI::Structure')) { }
103 0 0 if _is_in_conditional_expression($parent)
104 0 0 if $self->_is_in_conditional_structure($parent)
122 0 0 unless my $prev = $match->sprevious_sibling
125 0 0 unless $prev = $prev->sprevious_sibling
130 0 0 unless my $parent = $prev->parent
131 0 0 unless my $first = $parent->schild(0)
132 0 0 if (my $method = _get_method_name($first))
147 0 0 unless my $oper = $match->snext_sibling
151 0 0 unless "or" eq $oper_content or "||" eq $oper_content
154 0 0 unless my $next = $oper->snext_sibling
155 0 0 if (my $method = _get_method_name($next))
173 0 0 unless $elem->find(sub {
176 0 0 if $parent->isa("PPI::Structure::Block")
178 0 0 unless $parent = $parent->parent
192 0 0 unless $elem
194 0 0 unless $elem->isa("PPI::Token::Symbol") and "\$" eq $elem->raw_type or $elem->isa("PPI::Token::Word") and $elem->content =~ / \A [\w:]+ \z /msx
202 0 0 unless my $next = $elem->snext_sibling
207 0 0 unless $next = $next->snext_sibling
210 0 0 unless $prior and $prior->isa("PPI::Token::Operator") and "->" eq $prior->content
216 0 0 unless $next->isa("PPI::Token::Word")
231 0 0 if $UNAMBIGUOUS_CONTROL_TRANSFER{$content}
235 0 0 if "goto" eq $content
251 0 0 unless my $target = $xfer->snext_sibling
254 0 0 if $target->isa("PPI::Token::Symbol") and "&" eq $target->raw_type
261 0 0 if ($target->isa("PPI::Token::Word"))
268 0 0 if $container->isa("PPI::Structure::Block")
278 0 0 unless $xfer->location
279 0 0 unless defined $start_line
280 0 0 unless $elem->location
282 0 0 unless $container->find("PPI::Token::Label")
284 0 0 unless $label->content =~ /$looking_for/msx
285 0 0 unless $label->location
286 0 0 if $line < $start_line or $line == $start_line and $char < $start_char
289 0 0 if $line > $end_line or $line == $end_line and $char > $end_char