Branch Coverage

blib/lib/Perl/Critic/Policy/ValuesAndExpressions/ProhibitDuplicateHashKeys.pm
Criterion Covered Total %
branch 40 54 74.0


line true false branch
53 9 54 if ($elem->isa('PPI::Structure::Constructor')) { }
11 43 elsif ($elem->isa('PPI::Structure::Block')) { }
55 0 9 unless ($elem->start eq "{")
62 6 5 if (Perl::Critic::Policy::CodeLayout::RequireFinalSemicolon::_block_is_hash_constructor($elem) == 1) { }
70 4 39 unless _elem_is_assigned_to_hash($elem)
74 53 0 if ($elem->isa("PPI::Statement"))
93 2 226 unless (@arg)
102 2 224 if ($elem->isa("PPI::Token::Cast") and $elem eq "%")
108 3 209 if (@arg == 1 and $elem->isa("PPI::Token::Symbol") and $elem->raw_type eq "%")
116 5 216 if ($state eq "unknown" and $comma eq "=>")
120 111 110 if ($state eq 'key') { }
106 4 elsif ($state eq 'value') { }
123 5 106 if ($elem->isa('Perl::Critic::Pulp::ProhibitDuplicateHashKeys::Qword')) { }
133 40 71 if (defined $str and not $any_vars and $seen_key{$str}++)
142 5 106 if ($any_vars >= 2) { }
150 0 106 if ($comma eq '=>') { }
165 416 3 unless ($elem->isa("PPI::Token::QuoteLike::Words"))
183 9 416 if ($elem->isa("Perl::Critic::Pulp::ProhibitDuplicateHashKeys::Qword"))
187 171 245 if (elem_is_comma_operator($elem))
207 4 39 unless $elem->isa("PPI::Token::Operator") and $elem eq "="
214 0 39 if ($elem->isa("PPI::Structure::Block"))
220 39 0 if ($elem->isa("PPI::Token::Symbol"))
221 39 0 if ($elem->symbol_type eq "%")
225 0 0 if ($elem->symbol_type eq "\$")
231 0 0 if ($elem->isa('PPI::Token::Magic')) { }
0 0 elsif ($elem->isa('PPI::Token::Cast')) { }
234 0 0 if ($elem ne "\$")