line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Perl::Lint::Policy::BuiltinFunctions::RequireGlobFunction; |
2
|
133
|
|
|
133
|
|
67349
|
use strict; |
|
133
|
|
|
|
|
192
|
|
|
133
|
|
|
|
|
3163
|
|
3
|
133
|
|
|
133
|
|
430
|
use warnings; |
|
133
|
|
|
|
|
164
|
|
|
133
|
|
|
|
|
2490
|
|
4
|
133
|
|
|
133
|
|
847
|
use Perl::Lint::Constants::Type; |
|
133
|
|
|
|
|
207
|
|
|
133
|
|
|
|
|
59764
|
|
5
|
133
|
|
|
133
|
|
568
|
use parent "Perl::Lint::Policy"; |
|
133
|
|
|
|
|
198
|
|
|
133
|
|
|
|
|
640
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
use constant { |
8
|
133
|
|
|
|
|
23267
|
DESC => 'Glob written as <...>', |
9
|
|
|
|
|
|
|
EXPL => [167], |
10
|
133
|
|
|
133
|
|
6766
|
}; |
|
133
|
|
|
|
|
194
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub evaluate { |
13
|
5
|
|
|
5
|
0
|
9
|
my ($class, $file, $tokens, $src, $args) = @_; |
14
|
|
|
|
|
|
|
|
15
|
5
|
|
|
|
|
8
|
my @violations; |
16
|
5
|
|
|
|
|
18
|
for (my $i = 0; my $token = $tokens->[$i]; $i++) { |
17
|
81
|
|
|
|
|
58
|
my $token_type = $token->{type}; |
18
|
|
|
|
|
|
|
|
19
|
81
|
100
|
|
|
|
150
|
if ($token_type == HANDLE_DELIM) { |
20
|
10
|
|
|
|
|
19
|
for ($i++; my $token = $tokens->[$i]; $i++) { |
21
|
44
|
|
|
|
|
30
|
my $token_type = $token->{type}; |
22
|
|
|
|
|
|
|
|
23
|
44
|
100
|
|
|
|
100
|
if ($token_type == MUL) { |
|
|
100
|
|
|
|
|
|
24
|
|
|
|
|
|
|
push @violations, { |
25
|
|
|
|
|
|
|
filename => $file, |
26
|
|
|
|
|
|
|
line => $token->{line}, |
27
|
9
|
|
|
|
|
49
|
description => DESC, |
28
|
|
|
|
|
|
|
explanation => EXPL, |
29
|
|
|
|
|
|
|
policy => __PACKAGE__, |
30
|
|
|
|
|
|
|
}; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
elsif ($token_type == GREATER) { |
33
|
9
|
|
|
|
|
16
|
last; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
5
|
|
|
|
|
17
|
return \@violations; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
1; |
43
|
|
|
|
|
|
|
|