« Perl/Lint/Policy/ValuesAndExpressions/ProhibitEmptyQuotes.pm
↑ Summary
Perl/Lint/Policy/Miscellanea/ProhibitTies.pm »
| 1 | package Perl::Lint::Policy::References::ProhibitDoubleSigils; | ||||||||||||||||||||||||||||||||||||||||||
| 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 => 'Double-sigil dereference', | |||||||||||||||||||||||||||||||||||||||||
| 9 | EXPL => [228], | ||||||||||||||||||||||||||||||||||||||||||
| 10 | 2 | }; | |||||||||||||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||||||||||||||
| 12 | 2 | ▶ | sub evaluate { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
evaluate: called CC=5 SCAR=17.6
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 13 | 2 | my ($class, $file, $tokens, $args) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||||||||||||||||
| 15 | 2 | my @violations; | |||||||||||||||||||||||||||||||||||||||||
| 16 | 2 | my $token_num = scalar @$tokens; | |||||||||||||||||||||||||||||||||||||||||
| 17 | 2 | ▶ | for (my $i = 0; $i < $token_num; $i++) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 18 | 51 | my $token = $tokens->[$i]; | |||||||||||||||||||||||||||||||||||||||||
| 19 | 51 | my $token_type = $token->{type}; | |||||||||||||||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||||||||||||||||
| 21 | 51 | ▶ | if ( | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%2/6
$token_type == 117 or $token_type == 118 or $token_type == 119
$token_type == 117 or $token_type == 118
MC/DC0%0/3
$token_type == 117 or $token_type == 118 or $token_type == 119
$token_type == 117
$token_type == 118
$token_type == 119
Truth table25%1/4
A or B or C
A= $token_type == 117B= $token_type == 118C= $token_type == 119
| |||||||||||||||||||||||||||||||||||||||||||
| 22 | $token_type == SHORT_SCALAR_DEREFERENCE || | ||||||||||||||||||||||||||||||||||||||||||
| 23 | $token_type == SHORT_ARRAY_DEREFERENCE || | ||||||||||||||||||||||||||||||||||||||||||
| 24 | $token_type == SHORT_HASH_DEREFERENCE | ||||||||||||||||||||||||||||||||||||||||||
| 25 | ) { | ||||||||||||||||||||||||||||||||||||||||||
| 26 | push @violations, { | ||||||||||||||||||||||||||||||||||||||||||
| 27 | filename => $file, | ||||||||||||||||||||||||||||||||||||||||||
| 28 | line => $token->{line}, | ||||||||||||||||||||||||||||||||||||||||||
| 29 | 0 | description => DESC, | |||||||||||||||||||||||||||||||||||||||||
| 30 | explanation => EXPL, | ||||||||||||||||||||||||||||||||||||||||||
| 31 | policy => __PACKAGE__, | ||||||||||||||||||||||||||||||||||||||||||
| 32 | }; | ||||||||||||||||||||||||||||||||||||||||||
| 33 | } | ||||||||||||||||||||||||||||||||||||||||||
| 34 | } | ||||||||||||||||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||||||||||||||||
| 36 | 2 | return \@violations; | |||||||||||||||||||||||||||||||||||||||||
| 37 | } | ||||||||||||||||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||||||||||||||||
| 39 | 2 | 1; | |||||||||||||||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||||||||||||||||