| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Perl::Critic::Policy::ClassHierarchies::ProhibitExplicitISA; |
|
2
|
|
|
|
|
|
|
|
|
3
|
40
|
|
|
40
|
|
26514
|
use 5.010001; |
|
|
40
|
|
|
|
|
207
|
|
|
4
|
40
|
|
|
40
|
|
256
|
use strict; |
|
|
40
|
|
|
|
|
116
|
|
|
|
40
|
|
|
|
|
870
|
|
|
5
|
40
|
|
|
40
|
|
236
|
use warnings; |
|
|
40
|
|
|
|
|
130
|
|
|
|
40
|
|
|
|
|
1012
|
|
|
6
|
40
|
|
|
40
|
|
264
|
use Readonly; |
|
|
40
|
|
|
|
|
131
|
|
|
|
40
|
|
|
|
|
2020
|
|
|
7
|
|
|
|
|
|
|
|
|
8
|
40
|
|
|
40
|
|
312
|
use Perl::Critic::Utils qw{ :severities }; |
|
|
40
|
|
|
|
|
133
|
|
|
|
40
|
|
|
|
|
2053
|
|
|
9
|
40
|
|
|
40
|
|
5205
|
use parent 'Perl::Critic::Policy'; |
|
|
40
|
|
|
|
|
194
|
|
|
|
40
|
|
|
|
|
306
|
|
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $VERSION = '1.146'; |
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
|
14
|
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
Readonly::Scalar my $DESC => q{@ISA used instead of "use parent"}; ## no critic (RequireInterpolation) |
|
16
|
|
|
|
|
|
|
Readonly::Scalar my $EXPL => [ 360 ]; |
|
17
|
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
|
19
|
|
|
|
|
|
|
|
|
20
|
91
|
|
|
91
|
0
|
1616
|
sub supported_parameters { return () } |
|
21
|
77
|
|
|
77
|
1
|
360
|
sub default_severity { return $SEVERITY_MEDIUM } |
|
22
|
86
|
|
|
86
|
1
|
383
|
sub default_themes { return qw( core maintenance pbp certrec ) } |
|
23
|
32
|
|
|
32
|
1
|
105
|
sub applies_to { return 'PPI::Token::Symbol' } |
|
24
|
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
|
26
|
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub violates { |
|
28
|
176
|
|
|
176
|
1
|
364
|
my ($self, $elem, undef) = @_; |
|
29
|
|
|
|
|
|
|
|
|
30
|
176
|
100
|
|
|
|
396
|
if( $elem eq q{@ISA} ) { ## no critic (RequireInterpolation) |
|
31
|
3
|
|
|
|
|
63
|
return $self->violation( $DESC, $EXPL, $elem ); |
|
32
|
|
|
|
|
|
|
} |
|
33
|
173
|
|
|
|
|
2194
|
return; #ok! |
|
34
|
|
|
|
|
|
|
} |
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
1; |
|
37
|
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
|
39
|
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
__END__ |
|
41
|
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=pod |
|
43
|
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=head1 NAME |
|
45
|
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
Perl::Critic::Policy::ClassHierarchies::ProhibitExplicitISA - Employ C<use parent> instead of C<@ISA>. |
|
47
|
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head1 AFFILIATION |
|
50
|
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
This Policy is part of the core L<Perl::Critic|Perl::Critic> |
|
52
|
|
|
|
|
|
|
distribution. |
|
53
|
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
56
|
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
Conway recommends employing C<use parent qw(Foo)> instead of the usual |
|
58
|
|
|
|
|
|
|
C<our @ISA = qw(Foo)> because the former happens at compile time and |
|
59
|
|
|
|
|
|
|
the latter at runtime. The L<parent|parent> pragma also automatically loads |
|
60
|
|
|
|
|
|
|
C<Foo> for you so you save a line of easily-forgotten code. |
|
61
|
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
The original version of this policy recommended L<base|base> instead of |
|
63
|
|
|
|
|
|
|
L<parent|parent>, which is now obsolete. |
|
64
|
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head1 CONFIGURATION |
|
66
|
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
This Policy is not configurable except for the standard options. |
|
68
|
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=head1 AUTHOR |
|
71
|
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
Chris Dolan <cdolan@cpan.org> |
|
73
|
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=head1 COPYRIGHT |
|
76
|
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
Copyright (c) 2006-2022 Chris Dolan. |
|
78
|
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify |
|
80
|
|
|
|
|
|
|
it under the same terms as Perl itself. |
|
81
|
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=cut |
|
83
|
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
# Local Variables: |
|
85
|
|
|
|
|
|
|
# mode: cperl |
|
86
|
|
|
|
|
|
|
# cperl-indent-level: 4 |
|
87
|
|
|
|
|
|
|
# fill-column: 78 |
|
88
|
|
|
|
|
|
|
# indent-tabs-mode: nil |
|
89
|
|
|
|
|
|
|
# c-indentation-style: bsd |
|
90
|
|
|
|
|
|
|
# End: |
|
91
|
|
|
|
|
|
|
# ex: set ts=8 sts=4 sw=4 tw=78 ft=perl expandtab shiftround : |