Branch Coverage

blib/lib/Perl/Critic/Policy/ControlStructures/ProhibitMutatingListFunctions.pm
Criterion Covered Total %
branch 63 68 92.6


line true false branch
93 385 84 unless $self->{'_all_list_funcs'}{$elem}
94 3 81 unless is_function_call($elem)
97 0 81 unless my $first_arg = first_arg($elem)
98 0 81 unless $first_arg->isa("PPI::Structure::Block")
99 33 48 unless $self->_has_topic_side_effect($first_arg, $doc)
114 115 204 unless $elem->significant
115 9 195 if _is_assignment_to_topic($elem)
116 33 162 if $self->_is_topic_mutating_regex($elem, $doc)
117 5 157 if _is_topic_mutating_func($elem)
118 1 156 if _is_topic_mutating_substr($elem)
127 172 32 unless _is_topic($elem)
130 27 5 if ($sib and $sib->isa("PPI::Token::Operator"))
131 7 20 if _is_assignment_operator($sib)
135 3 22 if ($psib and $psib->isa("PPI::Token::Operator"))
136 2 1 if _is_increment_operator($psib)
146 135 60 unless $elem->isa("PPI::Token::Regexp::Substitute") or $elem->isa("PPI::Token::Regexp::Transliterate")
158 56 4 if ($elem->isa("PPI::Token::Regexp::Transliterate"))
161 2 54 if $mods{'r'}
162 24 30 if ($Perl::Critic::Policy::ControlStructures::ProhibitMutatingListFunctions::EMPTY eq $subs) { }
24 6 elsif ($elem->get_match_string eq $subs) { }
163 12 6 unless $mods{'d'} or $mods{'s'}
165 12 6 unless $mods{'c'} or $mods{'s'}
174 4 30 if ($elem->isa("PPI::Token::Regexp::Substitute"))
175 0 4 unless my $re = $doc->ppix_regexp_from_element($elem)
177 1 3 if $re->modifier_asserted("r")
184 11 22 unless $prevsib
188 11 11 unless _is_binding_operator($prevsib)
200 134 28 unless $elem->isa("PPI::Token::Word")
202 21 7 unless &any(sub {
203 0 7 unless is_function_call($elem)
208 3 4 unless (defined $first_arg)
210 1 2 if $elem->content eq "undef"
222 156 1 if $elem->content ne "substr"
223 0 1 unless is_function_call($elem)