Branch Coverage

blib/lib/Perl/Critic/Policy/Variables/ProhibitLoopOnHash.pm
Criterion Covered Total %
branch 35 38 92.1


line true false branch
27 78 59 unless &first(sub { $elem eq $_; } , 'for', 'foreach')
41 6 53 if $elem->parent and $elem->parent->isa('PPI::Statement::Expression')
45 2 51 unless ($elem->snext_sibling)
53 1 1 if ($next eq '\\')
71 1 52 if (not $elem->snext_sibling and $elem->next_token)
77 1 0 if $elem->next_token
83 15 38 if ((my $scope = $elem->snext_sibling)->isa('PPI::Token::Word'))
84 13 2 if (&first(sub { $scope eq $_; } , 'my', 'our', 'local', 'state')) { }
115 3 10 if $elem->isa('PPI::Token::Word')
125 21 32 if ((my $topical = $elem->snext_sibling)->isa('PPI::Token::Symbol'))
126 7 14 if ($topical->snext_sibling and $topical->snext_sibling->isa('PPI::Structure::List')) { }
137 13 40 if _check_symbol_or_cast($elem->snext_sibling)
141 30 10 if ((my $list = $elem->snext_sibling)->isa('PPI::Structure::List'))
143 0 30 if @children > 1
146 30 0 if ((my $statement = $children[0])->isa('PPI::Statement'))
149 13 17 if _check_symbol_or_cast($statement_args[0])
162 54 13 unless $arg->isa('PPI::Token::Symbol') and $arg =~ /^%/msx or $arg->isa('PPI::Token::Cast') and $arg eq '%'
170 9 20 if ($arg->isa('PPI::Token::Cast') and $next_op->isa('PPI::Structure::Block'))
176 3 26 if $next_op and $next_op->isa('PPI::Token::Operator')