Branch Coverage

blib/lib/Perl/Critic/Policy/Subroutines/RequireArgUnpacking.pm
Criterion Covered Total %
branch 7 108 6.4


line true false branch
72 0 5 unless $elem->block
77 0 5 unless @statements
84 0 5 if $self->{'_short_subroutine_statements'} >= @statements
99 0 0 if _is_size_check($magic)
101 0 0 if ("unpacking" eq $state)
102 0 0 if ($self->_is_unpack($magic))
111 0 0 if _is_cast_of_array($magic) and _is_postfix_foreach($magic)
116 0 0 if _is_cast_of_scalar($magic)
120 0 0 if $self->_is_delegation($magic)
125 7 0 unless ($saw_unpack)
140 0 0 if ($next and $next->isa("PPI::Structure::Subscript"))
141 0 0 unless $self->{'_allow_subscripts'}
145 0 0 if $prev and $prev->isa("PPI::Token::Operator") and is_assignment_operator($prev->content) and !$next || $next->isa('PPI::Token::Structure') && $Perl::Critic::Policy::Subroutines::RequireArgUnpacking::SCOLON eq $next->content
161 0 0 unless $AT eq $magic->raw_type
166 0 0 if ($prev or $next)
168 0 0 if _legal_before_size_check($prev) and _legal_after_size_check($next)
175 0 0 unless $parent = $parent->parent
179 0 0 unless $prev or $next
184 0 0 if $parent->isa("PPI::Structure::Condition")
200 0 0 unless $next
204 0 0 if $next->isa("PPI::Token::Operator")
207 0 0 if $next->isa("PPI::Token::Structure")
224 0 0 unless $prev
228 0 0 if $prev->isa("PPI::Token::Operator")
231 0 0 if $prev->isa("PPI::Token::Word")
243 0 0 if $sibling->isa("PPI::Token::Word") and $sibling =~ / \A for (?:each)? \z /msx
256 0 0 if $prev and $prev->content eq $AT and $prev->isa("PPI::Token::Cast")
284 0 0 unless $AT_ARG eq $magic->content
285 0 0 unless my $parent = $magic->parent
287 0 0 unless $parent->isa("PPI::Statement::Expression")
289 0 0 unless 1 == $parent->schildren
291 0 0 unless $parent = $parent->parent
293 0 0 unless $parent->isa("PPI::Structure::List")
295 0 0 unless 1 == $parent->schildren
297 0 0 unless my $subroutine_name = $parent->sprevious_sibling
299 0 0 if ($subroutine_name->isa('PPI::Token::Word')) { }
0 0 elsif ($self->{'_allow_closures'} and _is_dereference_operator($subroutine_name)) { }
300 0 0 if $self->{'_allow_delegation_to'}{$subroutine_name}
302 0 0 unless my($subroutine_namespace) = $subroutine_name =~ / \A ( .* ::) \w+ \z /msx
309 0 0 unless $prev_sib = $prev_sib->sprevious_sibling
311 0 0 if $prev_sib->isa("PPI::Structure::Subscript")
322 0 0 unless $elem
324 0 0 unless $elem->isa("PPI::Token::Operator")
333 7 0 unless $statement->find(\&Perl::Critic::Policy::Subroutines::RequireArgUnpacking::_magic_finder)
339 0 39 if $elem->isa("PPI::Token::Magic")
341 0 39 if ($elem->isa("PPI::Structure::Block"))
343 0 0 if $elem->statement->isa("PPI::Statement::Sub")
346 0 0 if _is_anon_sub($elem)
359 0 0 unless my $prev = $elem->sprevious_sibling
363 0 0 if $prev->isa("PPI::Token::Word") and "sub" eq $prev->content
378 0 0 unless $prev = $prev->sprevious_sibling
383 0 0 if $prev->isa("PPI::Token::Label") and $prev->content =~ / \A sub \s* : \z /msx
388 0 0 if $prev->isa("PPI::Token::Prototype") and not $prev = $prev->sprevious_sibling
392 0 0 if $prev->isa("PPI::Token::Word") and "sub" eq $prev->content