line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Perl::Lint::Policy::ClassHierarchies::ProhibitExplicitISA; |
2
|
133
|
|
|
133
|
|
68558
|
use strict; |
|
133
|
|
|
|
|
202
|
|
|
133
|
|
|
|
|
3186
|
|
3
|
133
|
|
|
133
|
|
415
|
use warnings; |
|
133
|
|
|
|
|
158
|
|
|
133
|
|
|
|
|
2429
|
|
4
|
133
|
|
|
133
|
|
773
|
use Perl::Lint::Constants::Type; |
|
133
|
|
|
|
|
158
|
|
|
133
|
|
|
|
|
61063
|
|
5
|
133
|
|
|
133
|
|
572
|
use parent "Perl::Lint::Policy"; |
|
133
|
|
|
|
|
186
|
|
|
133
|
|
|
|
|
590
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
use constant { |
8
|
133
|
|
|
|
|
21137
|
DESC => '@ISA used instead of "use base"', |
9
|
|
|
|
|
|
|
EXPL => [360], |
10
|
133
|
|
|
133
|
|
7085
|
}; |
|
133
|
|
|
|
|
203
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub evaluate { |
13
|
3
|
|
|
3
|
0
|
4
|
my ($class, $file, $tokens, $args) = @_; |
14
|
|
|
|
|
|
|
|
15
|
3
|
|
|
|
|
3
|
my @violations; |
16
|
3
|
|
|
|
|
3
|
my $token_num = scalar @$tokens; |
17
|
3
|
|
|
|
|
10
|
for (my $i = 0; $i < $token_num; $i++) { |
18
|
68
|
|
|
|
|
49
|
my $token = $tokens->[$i]; |
19
|
68
|
|
|
|
|
41
|
my $token_type = $token->{type}; |
20
|
68
|
|
|
|
|
49
|
my $token_data = $token->{data}; |
21
|
68
|
100
|
100
|
|
|
221
|
if (($token_type == ARRAY_VAR || $token_type == GLOBAL_ARRAY_VAR) && $token_data eq '@ISA') { |
|
|
|
100
|
|
|
|
|
22
|
|
|
|
|
|
|
push @violations, { |
23
|
|
|
|
|
|
|
filename => $file, |
24
|
|
|
|
|
|
|
line => $token->{line}, |
25
|
8
|
|
|
|
|
60
|
description => DESC, |
26
|
|
|
|
|
|
|
explanation => EXPL, |
27
|
|
|
|
|
|
|
policy => __PACKAGE__, |
28
|
|
|
|
|
|
|
}; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
3
|
|
|
|
|
11
|
return \@violations; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
1; |
36
|
|
|
|
|
|
|
|