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   67523 use strict;
  133         205  
  133         3198  
3 133     133   431 use warnings;
  133         177  
  133         2456  
4 133     133   788 use Perl::Lint::Constants::Type;
  133         157  
  133         60819  
5 133     133   606 use parent "Perl::Lint::Policy";
  133         185  
  133         584  
6              
7             use constant {
8 133         18572 DESC => 'Subroutine prototypes used',
9             EXPL => [194],
10 133     133   6897 };
  133         191  
11              
12             sub evaluate {
13 3     3 0 5 my ($class, $file, $tokens, $args) = @_;
14              
15 3         3 my @violations;
16 3         11 for (my $i = 0; my $token = $tokens->[$i]; $i++) {
17 36         20 my $token_type = $token->{type};
18 36 100       67 if ($token_type == PROTOTYPE) {
19             push @violations, {
20             filename => $file,
21             line => $token->{line},
22 4         11 description => DESC,
23             explanation => EXPL,
24             policy => __PACKAGE__,
25             };
26 4         9 next;
27             }
28             }
29              
30 3         9 return \@violations;
31             }
32              
33             1;
34