File Coverage

blib/lib/Perl/Lint/Policy/Miscellanea/ProhibitUselessNoLint.pm
Criterion Covered Total %
statement 21 21 100.0
branch 2 2 100.0
condition n/a
subroutine 6 6 100.0
pod 0 1 0.0
total 29 30 96.6


line stmt bran cond sub pod time code
1             package Perl::Lint::Policy::Miscellanea::ProhibitUselessNoLint;
2 134     134   90510 use strict;
  134         274  
  134         4807  
3 134     134   617 use warnings;
  134         214  
  134         3395  
4 134     134   1159 use Perl::Lint::Constants::Type;
  134         205  
  134         82255  
5 134     134   797 use parent "Perl::Lint::Policy";
  134         244  
  134         861  
6              
7             use constant {
8 134         22172 DESC => q{Useless '## no critic' annotation},
9             EXPL => 'This annotation can be removed',
10 134     134   8786 };
  134         258  
11              
12             sub evaluate {
13 4     4 0 10 my ($class, $file, $no_lint_lines, $used_no_lint_lines) = @_;
14              
15 4         7 my @violations;
16 4         17 for my $line (keys %$no_lint_lines) {
17 7 100       14 unless ($used_no_lint_lines->{$line}) {
18 2         9 push @violations, {
19             filename => $file,
20             line => $line,
21             description => DESC,
22             explanation => EXPL,
23             policy => __PACKAGE__,
24             };
25             }
26             }
27              
28 4         12 return \@violations;
29             }
30              
31             1;
32