File Coverage

blib/lib/Perl/Lint/Policy/Miscellanea/ProhibitUnrestrictedNoLint.pm
Criterion Covered Total %
statement 22 22 100.0
branch 2 2 100.0
condition n/a
subroutine 6 6 100.0
pod 0 1 0.0
total 30 31 96.7


line stmt bran cond sub pod time code
1             package Perl::Lint::Policy::Miscellanea::ProhibitUnrestrictedNoLint;
2 134     134   68168 use strict;
  134         193  
  134         3065  
3 134     134   417 use warnings;
  134         171  
  134         2390  
4 134     134   821 use Perl::Lint::Constants::Type;
  134         148  
  134         60962  
5 134     134   573 use parent "Perl::Lint::Policy";
  134         193  
  134         602  
6              
7             use constant {
8 134         17942 DESC => q{Unrestricted '## no critic' annotation},
9             EXPL => 'Only disable the Policies you really need to disable',
10 134     134   6640 };
  134         188  
11              
12             sub evaluate {
13 6     6 0 10 my ($class, $file, $tokens, $src, $args, $no_lint_lines) = @_;
14              
15 6         5 my @violations;
16             my $no_lint;
17 6         17 for my $line (keys %$no_lint_lines) {
18 25         23 $no_lint = $no_lint_lines->{$line};
19              
20 25 100       32 if (keys %$no_lint == 0) {
21 13         32 push @violations, {
22             filename => $file,
23             line => $line,
24             description => DESC,
25             explanation => EXPL,
26             policy => __PACKAGE__,
27             };
28             }
29             }
30              
31 6         18 return \@violations;
32             }
33              
34             1;
35