« Perl/Lint/Policy/Objects/IndirectSyntax.pm
↑ Summary
Perl/Lint/Policy/Subroutines/ProhibitExplicitReturnUndef.pm »
| 1 | package Perl::Lint::Policy::ClassHierarchies::ProhibitExplicitISA; | ||||||||||||||||||||||||||||||||||||||||||||||
| 2 | 2 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 3 | 2 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 4 | 2 | ▶ | use Perl::Lint::Constants::Type; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 5 | 2 | ▶ | use parent "Perl::Lint::Policy"; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||||||||||||||||
| 7 | 2 | ▶ | use constant { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 8 | 2 | DESC => '@ISA used instead of "use base"', | |||||||||||||||||||||||||||||||||||||||||||||
| 9 | EXPL => [360], | ||||||||||||||||||||||||||||||||||||||||||||||
| 10 | 2 | }; | |||||||||||||||||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||||||||||||||||||
| 12 | 0 | ▶ | sub evaluate { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
evaluate: not called CC=5 SCAR=34.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 13 | 0 | my ($class, $file, $tokens, $args) = @_; | |||||||||||||||||||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||||||||||||||||||||
| 15 | 0 | my @violations; | |||||||||||||||||||||||||||||||||||||||||||||
| 16 | 0 | my $token_num = scalar @$tokens; | |||||||||||||||||||||||||||||||||||||||||||||
| 17 | 0 | ▶ | for (my $i = 0; $i < $token_num; $i++) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 18 | 0 | my $token = $tokens->[$i]; | |||||||||||||||||||||||||||||||||||||||||||||
| 19 | 0 | my $token_type = $token->{type}; | |||||||||||||||||||||||||||||||||||||||||||||
| 20 | 0 | my $token_data = $token->{data}; | |||||||||||||||||||||||||||||||||||||||||||||
| 21 | 0 | ▶ | if (($token_type == ARRAY_VAR || $token_type == GLOBAL_ARRAY_VAR) && $token_data eq '@ISA') { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
$token_type == 168 || $token_type == 195 and $token_data eq "\@ISA"
$token_type == 168 or $token_type == 195
MC/DC0%0/3
$token_type == 168 || $token_type == 195 and $token_data eq "\@ISA"
$token_type == 168
$token_type == 195
$token_data eq "\@ISA"
Truth table0%0/5
A or B and C
A= $token_type == 168B= $token_type == 195C= $token_data eq "\@ISA"
| |||||||||||||||||||||||||||||||||||||||||||||||
| 22 | push @violations, { | ||||||||||||||||||||||||||||||||||||||||||||||
| 23 | filename => $file, | ||||||||||||||||||||||||||||||||||||||||||||||
| 24 | line => $token->{line}, | ||||||||||||||||||||||||||||||||||||||||||||||
| 25 | 0 | description => DESC, | |||||||||||||||||||||||||||||||||||||||||||||
| 26 | explanation => EXPL, | ||||||||||||||||||||||||||||||||||||||||||||||
| 27 | policy => __PACKAGE__, | ||||||||||||||||||||||||||||||||||||||||||||||
| 28 | }; | ||||||||||||||||||||||||||||||||||||||||||||||
| 29 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 30 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||||||||||||||||||||
| 32 | 0 | return \@violations; | |||||||||||||||||||||||||||||||||||||||||||||
| 33 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||||||||||||||||||||
| 35 | 2 | 1; | |||||||||||||||||||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||||||||||||||||||||