File Coverage

blib/lib/Perl/Lint/Policy/Subroutines/ProhibitSubroutinePrototypes.pm
Criterion Covered Total %
statement 23 23 100.0
branch 2 2 100.0
condition n/a
subroutine 6 6 100.0
pod 0 1 0.0
total 31 32 96.8


line stmt bran cond sub pod time code
1             package Perl::Lint::Policy::Subroutines::ProhibitSubroutinePrototypes;
2 133     133   69476 use strict;
  133         208  
  133         3132  
3 133     133   423 use warnings;
  133         172  
  133         2505  
4 133     133   842 use Perl::Lint::Constants::Type;
  133         170  
  133         61356  
5 133     133   613 use parent "Perl::Lint::Policy";
  133         194  
  133         613  
6              
7             use constant {
8 133         18678 DESC => 'Subroutine prototypes used',
9             EXPL => [194],
10 133     133   6760 };
  133         202  
11              
12             sub evaluate {
13 3     3 0 6 my ($class, $file, $tokens, $args) = @_;
14              
15 3         3 my @violations;
16 3         12 for (my $i = 0; my $token = $tokens->[$i]; $i++) {
17 36         27 my $token_type = $token->{type};
18 36 100       61 if ($token_type == PROTOTYPE) {
19             push @violations, {
20             filename => $file,
21             line => $token->{line},
22 4         14 description => DESC,
23             explanation => EXPL,
24             policy => __PACKAGE__,
25             };
26 4         7 next;
27             }
28             }
29              
30 3         9 return \@violations;
31             }
32              
33             1;
34