line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Perl::Lint::Policy::ClassHierarchies::ProhibitAutoloading; |
2
|
133
|
|
|
133
|
|
69158
|
use strict; |
|
133
|
|
|
|
|
191
|
|
|
133
|
|
|
|
|
3211
|
|
3
|
133
|
|
|
133
|
|
415
|
use warnings; |
|
133
|
|
|
|
|
158
|
|
|
133
|
|
|
|
|
2512
|
|
4
|
133
|
|
|
133
|
|
848
|
use Perl::Lint::Constants::Type; |
|
133
|
|
|
|
|
186
|
|
|
133
|
|
|
|
|
61908
|
|
5
|
133
|
|
|
133
|
|
588
|
use parent "Perl::Lint::Policy"; |
|
133
|
|
|
|
|
178
|
|
|
133
|
|
|
|
|
611
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
use constant { |
8
|
133
|
|
|
|
|
21157
|
DESC => 'AUTOLOAD method declared', |
9
|
|
|
|
|
|
|
EXPL => [393], |
10
|
133
|
|
|
133
|
|
7224
|
}; |
|
133
|
|
|
|
|
179
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub evaluate { |
13
|
4
|
|
|
4
|
0
|
5
|
my ($class, $file, $tokens, $args) = @_; |
14
|
|
|
|
|
|
|
|
15
|
4
|
|
|
|
|
5
|
my @violations; |
16
|
4
|
|
|
|
|
4
|
my $token_num = scalar @$tokens; |
17
|
4
|
|
|
|
|
10
|
for (my $i = 0; $i < $token_num; $i++) { |
18
|
91
|
|
|
|
|
60
|
my $token = $tokens->[$i]; |
19
|
91
|
|
|
|
|
57
|
my $token_type = $token->{type}; |
20
|
91
|
100
|
|
|
|
146
|
if ($token_type == FUNCTION_DECL) { |
21
|
8
|
100
|
|
|
|
15
|
if ($tokens->[++$i]->{data} eq 'AUTOLOAD') { |
22
|
|
|
|
|
|
|
push @violations, { |
23
|
|
|
|
|
|
|
filename => $file, |
24
|
|
|
|
|
|
|
line => $token->{line}, |
25
|
7
|
|
|
|
|
24
|
description => DESC, |
26
|
|
|
|
|
|
|
explanation => EXPL, |
27
|
|
|
|
|
|
|
policy => __PACKAGE__, |
28
|
|
|
|
|
|
|
}; |
29
|
7
|
|
|
|
|
11
|
next; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
4
|
|
|
|
|
11
|
return \@violations; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |
38
|
|
|
|
|
|
|
|