Branch Coverage

blib/lib/Perl/Lint/Policy/ControlStructures/ProhibitMutatingListFunctions.pm
Criterion Covered Total %
branch 114 142 80.2


line true false branch
58 3 14 if (my $this_policies_arg = $args->{'prohibit_mutating_list_functions'})
59 2 1 if (my $list_funcs = $this_policies_arg->{'list_funcs'})
64 1 2 if (my $add_list_funcs = $this_policies_arg->{'add_list_funcs'})
75 108 577 if ($token_type == 70 or $token_type == 122)
76 106 2 if ($target_functions{$token_data})
77 0 106 unless $token = $$tokens[++$i]
78 0 106 if ($token->{'type'} != 109)
87 1 194 if ($token_type == 109) { }
9 185 elsif ($token_type == 110) { }
44 141 elsif ($token_type == 137 and $token_data eq '$_') { }
2 139 elsif ($token_type == 45 or $token_type == 46) { }
41 98 elsif ($reg_replace_token_types{$token_type}) { }
21 77 elsif ($token_type == 122 or $token_type == 70 or $token_type == 207) { }
91 9 0 if --$lbnum <= 0
94 0 44 unless $token = $$tokens[++$i]
97 2 42 if ($token_type == 110)
98 2 0 if --$lbnum <= 0
102 2 21 if ($assigner{$token_type} or $token_type == 45 or $token_type == 46)
117 19 2 if ($token_type == 35)
118 0 19 unless $token = $$tokens[++$i]
121 19 0 if ($reg_replace_token_types{$token_type})
129 19 57 if ($token_type == 156) { }
19 38 elsif ($token_type == 157) { }
134 8 11 if ($replace_to eq '') { }
8 3 elsif ($replace_to eq $replace_from) { }
146 19 0 if ($token = $$tokens[++$i])
147 12 7 if ($token->{'type'} == 144 and my(@opts) = $token->{'data'} =~ /([cdrs])/g)
150 0 12 if ($opts{'r'}) { }
154 4 8 if ($opts{'c'})
158 4 8 if ($opts{'d'})
162 4 8 if ($opts{'s'})
169 8 11 unless ($is_replaced)
185 0 2 unless $token = $$tokens[++$i]
186 2 0 if ($token->{'type'} == 137 and $token->{'data'} eq '$_')
198 0 41 unless my $before_token = $$tokens[$i - 1]
199 41 0 if ($before_token->{'type'} != 35)
207 41 123 if ($token_type == 156) { }
41 82 elsif ($token_type == 157) { }
212 16 25 if ($replace_to eq '') { }
16 9 elsif ($replace_to eq $replace_from) { }
224 41 0 if ($token = $$tokens[++$i])
225 27 14 if ($token->{'type'} == 144 and my(@opts) = $token->{'data'} =~ /([cdrs])/g)
228 3 24 if ($opts{'r'}) { }
232 8 16 if ($opts{'c'})
236 8 16 if ($opts{'d'})
240 8 16 if ($opts{'s'})
247 19 22 unless ($is_replaced)
262 13 8 if ($token_data eq 'chop' or $token_data eq 'chomp') { }
6 2 elsif ($token_data eq 'undef') { }
1 1 elsif ($token_data eq 'substr') { }
263 0 13 unless $token = $$tokens[++$i]
266 2 11 if ($token_type == 106 or $token_type == 110) { }
4 7 elsif ($token_type == 137 and $token_data eq '$_') { }
6 1 elsif ($token_type == 107) { }
287 0 6 unless $token = $$tokens[++$i]
288 2 4 if ($token->{'type'} == 108)
303 0 4 if ($token_type == 107) { }
0 4 elsif ($token_type == 108) { }
4 0 elsif ($token_type == 137 and $token->{'data'} eq '$_') { }
307 0 0 if --$lpnum <= 0
323 0 6 unless $token = $$tokens[++$i]
326 2 4 if ($token_type == 137 and $token_data eq '$_') { }
3 1 elsif ($token_type == 107) { }
341 3 6 if ($token_type == 107) { }
1 5 elsif ($token_type == 108) { }
2 6 elsif ($token_type == 137 and $token->{'data'} eq '$_') { }
345 0 1 if --$lpnum <= 0
361 0 1 unless $token = $$tokens[++$i]
363 0 1 if ($token_type == 107)
364 0 0 unless $token = $$tokens[++$i]
367 1 0 if ($token->{'type'} == 137 and $token->{'data'} eq '$_')