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   89999 use strict;
  134         253  
  134         4857  
3 134     134   635 use warnings;
  134         355  
  134         3168  
4 134     134   1036 use Perl::Lint::Constants::Type;
  134         333  
  134         82423  
5 134     134   942 use parent "Perl::Lint::Policy";
  134         267  
  134         796  
6              
7             use constant {
8 134         24058 DESC => q{Unrestricted '## no critic' annotation},
9             EXPL => 'Only disable the Policies you really need to disable',
10 134     134   18489 };
  134         268  
11              
12             sub evaluate {
13 6     6 0 15 my ($class, $file, $tokens, $src, $args, $no_lint_lines) = @_;
14              
15 6         8 my @violations;
16             my $no_lint;
17 6         24 for my $line (keys %$no_lint_lines) {
18 25         28 $no_lint = $no_lint_lines->{$line};
19              
20 25 100       55 if (keys %$no_lint == 0) {
21 13         50 push @violations, {
22             filename => $file,
23             line => $line,
24             description => DESC,
25             explanation => EXPL,
26             policy => __PACKAGE__,
27             };
28             }
29             }
30              
31 6         27 return \@violations;
32             }
33              
34             1;
35