Perl/Lint/Policy/ClassHierarchies/ProhibitAutoloading.pm

filter: Statementstmt 59.2% 16 / 27 Branchbran 0.0% 0 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 83.3% 5 / 6 Podpod 0.0% 0 / 1 totaltotal 52.5% 21 / 40 CC 4 SCAR 22.5
CC
4
Cov
48%
evaluate
20.0
BEGIN
1.0
BEGIN
1.0
CRAP 9.4
« Perl/Lint/Policy/ValuesAndExpressions/RequireUpperCaseHeredocTerminator.pm ↑ Summary Perl/Lint/Policy/InputOutput/ProhibitInteractiveTest.pm »
1 package Perl::Lint::Policy::ClassHierarchies::ProhibitAutoloading;
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 => 'AUTOLOAD method declared',
9 EXPL => [393],
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 0 my $token_num = scalar @$tokens;
17 0 ▶ for (my $i = 0; $i < $token_num; $i++) {
Branch: 1 branch
BranchTrueFalseTotal
if ($i < $token_num) 0 0 0
18 0 my $token = $tokens->[$i];
19 0 my $token_type = $token->{type};
20 0 ▶ if ($token_type == FUNCTION_DECL) {
Branch: 1 branch
BranchTrueFalseTotal
if ($token_type == 63) 0 0 0
21 0 ▶ if ($tokens->[++$i]->{data} eq 'AUTOLOAD') {
Branch: 1 branch
BranchTrueFalseTotal
if ($$tokens[++$i]{"data"} eq "AUTOLOAD") 0 0 0
22 push @violations, {
23 filename => $file,
24 line => $token->{line},
25 0 description => DESC,
26 explanation => EXPL,
27 policy => __PACKAGE__,
28 };
29 0 next;
30 }
31 }
32 }
33  
34 0 return \@violations;
35 }
36  
37 2 1;
38  
« Perl/Lint/Policy/ValuesAndExpressions/RequireUpperCaseHeredocTerminator.pm ↑ Summary Perl/Lint/Policy/InputOutput/ProhibitInteractiveTest.pm »