Branch Coverage

blib/lib/Perl/Critic/Policy/Variables/RequireNegativeIndices.pm
Criterion Covered Total %
branch 0 80 0.0


line true false branch
30 0 0 if $elem->braces ne "[]"
32 0 0 unless $name
33 0 0 unless _is_array_name($elem, $name, $isref)
44 0 0 if @children != 1
45 0 0 unless $children[0]->isa("PPI::Statement::Expression")
49 0 0 if not @expr or @expr > $MAX_EXPRESSION_COMPLEXITY
51 0 0 unless $name
52 0 0 if not @expr and $isindex
53 0 0 unless _is_minus_number(@expr)
61 0 0 if ($expr->[0]->isa('PPI::Token::ArrayIndex')) { }
0 0 elsif ($expr->[0]->isa('PPI::Token::Cast')) { }
0 0 elsif ($expr->[0]->isa('PPI::Token::Symbol')) { }
81 0 0 if ($arrindex->content =~ /\A \$[#] (.*) \z /msx)
91 0 0 if ($cast eq "\$#" or $cast eq "\@")
92 0 0 $cast eq '$#' ? :
94 0 0 if ($arrvar->isa('PPI::Structure::Block')) { }
0 0 elsif ($arrvar->isa('PPI::Token::Symbol')) { }
97 0 0 if @blockchildren != 1
98 0 0 unless $blockchildren[0]->isa("PPI::Statement")
100 0 0 if @ggg != 1
101 0 0 unless $ggg[0]->isa("PPI::Token::Symbol")
102 0 0 if ($ggg[0] =~ /\A \$ (.*) \z/msx)
108 0 0 if ($arrvar =~ /\A \$ (.*) \z/msx)
120 0 0 if ($arrvar =~ /\A \@ (.*) \z/msx)
129 0 0 unless @expr
131 0 0 if @expr != 2
134 0 0 unless $op->isa("PPI::Token::Operator")
135 0 0 if $op ne "-"
138 0 0 unless $number->isa("PPI::Token::Number")
147 0 0 unless $sib
149 0 0 if ($sib->isa("PPI::Token::Operator") and $sib eq "->")
150 0 0 unless $isref
153 0 0 unless $sib
156 0 0 unless $sib->isa("PPI::Token::Symbol")
157 0 0 unless $sib =~ /\A \$ \Q$name\E \z/msx
160 0 0 if $isref ^ _is_dereferencer($cousin)
161 0 0 if $isref and _is_dereferencer($cousin->sprevious_sibling)
169 0 0 unless $elem
170 0 0 if $elem->isa("PPI::Token::Operator") and $elem eq "->"
171 0 0 if $elem->isa("PPI::Token::Cast")