line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Perl::Lint::Policy::InputOutput::ProhibitInteractiveTest; |
2
|
133
|
|
|
133
|
|
69267
|
use strict; |
|
133
|
|
|
|
|
201
|
|
|
133
|
|
|
|
|
3348
|
|
3
|
133
|
|
|
133
|
|
460
|
use warnings; |
|
133
|
|
|
|
|
173
|
|
|
133
|
|
|
|
|
2591
|
|
4
|
133
|
|
|
133
|
|
797
|
use Perl::Lint::Constants::Type; |
|
133
|
|
|
|
|
174
|
|
|
133
|
|
|
|
|
61719
|
|
5
|
133
|
|
|
133
|
|
584
|
use parent "Perl::Lint::Policy"; |
|
133
|
|
|
|
|
194
|
|
|
133
|
|
|
|
|
622
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
use constant { |
8
|
133
|
|
|
|
|
19794
|
DESC => 'Use IO::Interactive::is_interactive() instead of -t', |
9
|
|
|
|
|
|
|
EXPL => [218], |
10
|
133
|
|
|
133
|
|
6923
|
}; |
|
133
|
|
|
|
|
182
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub evaluate { |
13
|
3
|
|
|
3
|
0
|
6
|
my ($class, $file, $tokens, $src, $args) = @_; |
14
|
|
|
|
|
|
|
|
15
|
3
|
|
|
|
|
3
|
my @violations; |
16
|
3
|
|
|
|
|
12
|
for (my $i = 0; my $token = $tokens->[$i]; $i++) { |
17
|
23
|
|
|
|
|
15
|
my $token_type = $token->{type}; |
18
|
23
|
|
|
|
|
19
|
my $token_data = $token->{data}; |
19
|
23
|
100
|
100
|
|
|
58
|
if ($token_type == HANDLE && $token_data eq '-t') { |
20
|
|
|
|
|
|
|
push @violations, { |
21
|
|
|
|
|
|
|
filename => $file, |
22
|
|
|
|
|
|
|
line => $token->{line}, |
23
|
7
|
|
|
|
|
27
|
description => DESC, |
24
|
|
|
|
|
|
|
explanation => EXPL, |
25
|
|
|
|
|
|
|
policy => __PACKAGE__, |
26
|
|
|
|
|
|
|
}; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
3
|
|
|
|
|
9
|
return \@violations; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
1; |
34
|
|
|
|
|
|
|
|