Perl/Lint/Policy/Miscellanea/ProhibitFormats.pm

filter: Statementstmt 66.6% 16 / 24 Branchbran 0.0% 0 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 83.3% 5 / 6 Podpod 0.0% 0 / 1 totaltotal 56.7% 21 / 37 CC 4 SCAR 22.5
CC
4
Cov
53%
evaluate
20.0
BEGIN
1.0
BEGIN
1.0
CRAP 9.4
« Perl/Lint/Policy/Variables/ProtectPrivateVars.pm ↑ Summary Perl/Lint/Policy/ControlStructures/ProhibitCStyleForLoops.pm »
1 package Perl::Lint::Policy::Miscellanea::ProhibitFormats;
2 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use Perl::Lint::Constants::Type;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use parent "Perl::Lint::Policy";
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 2 ▶use constant {
Subroutine BEGIN: called CC=1 SCAR=0.0
8 2 DESC => 'Format used',
9 EXPL => [449],
10 2 };
11  
12 0 ▶sub evaluate {
Subroutine evaluate: not called CC=4 SCAR=30.0
Pod undocumented
13 0 my ($class, $file, $tokens, $args) = @_;
14  
15 0 my @violations;
16 my $next_token;
17 0 ▶ for (my $i = 0; my $token = $tokens->[$i]; $i++) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $token = $tokens->[$i]) 0 0 0
18 0 ▶ if ($token->{type} == FORMAT_DECL) {
Branch: 1 branch
BranchTrueFalseTotal
if ($token->{"type"} == 183) 0 0 0
19 0 $next_token = $tokens->[$i+1];
20 0 ▶ if ($next_token->{type} != ARROW) {
Branch: 1 branch
BranchTrueFalseTotal
if ($next_token->{"type"} != 124) 0 0 0
21 # XXX workaround for Compiler::Lexer
22 # ref: https://github.com/goccy/p5-Compiler-Lexer/issues/33
23 push @violations, {
24 filename => $file,
25 line => $token->{line},
26 0 description => DESC,
27 explanation => EXPL,
28 policy => __PACKAGE__,
29 };
30 }
31 }
32 }
33  
34 0 return \@violations;
35 }
36  
37 2 1;
38  
« Perl/Lint/Policy/Variables/ProtectPrivateVars.pm ↑ Summary Perl/Lint/Policy/ControlStructures/ProhibitCStyleForLoops.pm »