Branch Coverage

blib/lib/Perl/Lint/Policy/NamingConventions/Capitalization.pm
Criterion Covered Total %
branch 138 160 86.2


line true false branch
67 854 79 if (my $this_policies_rule = $args->{'capitalization'})
91 681 7359 if ($var_declare_token_types{$token_type})
98 288 393 if ($local_var_declare_token_types{$token_type}) { }
99 272 16 if (my $condition = $class->_choose_condition_dispenser($local_lexical_variables_rule))
106 321 72 if (my $condition = $class->_choose_condition_dispenser($global_variables_rule))
114 0 681 unless $token = $$tokens[++$i]
118 3 678 if ($token_type == 107)
122 0 12 if ($token_type == 107) { }
3 9 elsif ($token_type == 108) { }
6 3 elsif ($var_token_types{$token_type}) { }
126 3 0 if --$lpnum <= 0
132 0 6 if ($next_token->{'type'} and $next_token->{'type'} == 126)
138 0 2 if ($is_global_var and $globals{$token_data})
144 0 6 if ($token_data =~ /\A$exemptions\Z/)
148 0 6 if (ref $checker ne 'CODE')
149 0 0 if ($token_data =~ /\A$checker\Z/)
164 2 4 unless (&$checker($part))
184 36 642 if ($next_token->{'type'} and $next_token->{'type'} == 126)
190 105 251 if ($is_global_var and $globals{$token_data})
196 104 433 if ($token_data =~ /\A$exemptions\Z/)
200 45 388 if (ref $checker ne 'CODE')
201 25 20 if ($token_data =~ /\A$checker\Z/)
216 139 1079 unless (&$checker($part))
231 211 7148 if ($token_type == 63)
232 0 211 unless $token = $$tokens[++$i]
235 34 177 if ($token_type == 127) { }
0 177 elsif ($token_type != 203) { }
241 68 102 if ($token_type == 127) { }
34 68 elsif ($token_type != 126) { }
257 204 7 if (my $condition = $class->_choose_condition_dispenser($subroutines_rule))
264 34 177 if ($token_data =~ /\A$subroutine_exemptions\Z/)
268 6 171 if (ref $checker ne 'CODE')
269 4 2 if ($token_data =~ /\A$checker\Z/)
284 26 387 unless (&$checker($part))
300 111 7037 if ($token_type == 128)
301 0 111 unless $token = $$tokens[++$i]
306 1 110 if ($token_type == 129 and $token_data eq 'main')
310 34 76 if ($package_exemptions and $token_data =~ /\A$package_exemptions\Z/)
316 68 8 if (my $condition = $class->_choose_condition_dispenser($packages_rule))
322 70 6 if (ref $checker eq 'CODE') { }
3 3 elsif ($token_type == 129) { }
324 13 188 unless (&$checker($part))
338 2 1 if ($package_full_name =~ /\A$checker\Z/)
352 38 22 if ($token_type == 127)
353 3 35 if (ref $checker ne 'CODE')
357 6 3 if ($token_type == 127 or $token_type == 126) { }
364 2 1 if ($package_full_name =~ /\A$checker\Z/)
381 34 58 if ($token_type == 127) { }
23 35 elsif ($token_type != 126) { }
383 12 92 unless (&$checker($part))
409 3 7034 if ($token_type == 127 and $token_data eq 'Readonly') { }
2 13859 elsif ($token_type == 122 and $token_data eq 'const') { }
411 0 3 unless $token = $tokens->[$i]
412 3 0 if ($token->{'type'} == 127 and $token->{'data'} eq 'Scalar')
420 5 7032 if ($is_const_decl)
421 0 5 unless $token = $$tokens[++$i]
422 5 0 unless ($var_token_types{$token->{'type'}})
423 0 5 unless $token = $$tokens[++$i]
426 5 0 if ($var_token_types{$token->{'type'}})
428 3 2 if (uc $token_data ne $token_data)
445 9 7028 if ($token_type == 93)
446 0 9 unless $token = $$tokens[++$i]
447 8 1 if ($token->{'type'} != 94 or $token->{'data'} ne 'constant')
452 30 6 if ($token->{'type'} != 124)
457 0 6 if (uc $key ne $key)
472 207 6821 if ($token_type == 122)
473 0 207 unless my $next_token = $$tokens[$i + 1]
474 139 68 if ($next_token->{'type'} != 105)
478 34 34 if ($token_data =~ /\A$label_exemptions\Z/)
484 34 0 if (my $condition = $class->_choose_condition_dispenser($labels_rule))
489 3 31 if (ref $checker ne 'CODE')
490 2 1 if ($token_data =~ /\A$checker\Z/)
504 11 20 unless (&$checker($token_data))
525 115 887 if ($rule eq ':single_case') { }
221 666 elsif ($rule eq ':all_lower') { }
115 551 elsif ($rule eq ':all_upper') { }
115 436 elsif ($rule eq ':starts_with_lower') { }
115 321 elsif ($rule eq ':starts_with_upper') { }
138 183 elsif ($rule eq ':no_restriction') { }
80 103 elsif ($rule) { }