« Perl/Lint/Policy/BuiltinFunctions/ProhibitStringySplit.pm
↑ Summary
Perl/Lint/Policy/Modules/ProhibitAutomaticExportation.pm »
| 1 | package Perl::Lint::Policy::Modules::RequireNoMatchVarsWithUseEnglish; | ||||||||||||||||||||||||||||||||||||||||||
| 2 | 3 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 3 | 3 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 4 | 3 | ▶ | use Perl::Lint::Constants::Type; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 5 | 3 | ▶ | use parent "Perl::Lint::Policy"; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||||||||||||
| 7 | 3 | ▶ | use constant { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 8 | 3 | DESC => '"use English" without "-no_match_vars" argument', | |||||||||||||||||||||||||||||||||||||||||
| 9 | EXPL => '"use English" without the "-no_match_vars" argument degrades performance', | ||||||||||||||||||||||||||||||||||||||||||
| 10 | 3 | }; | |||||||||||||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||||||||||||||
| 12 | 2 | ▶ | sub evaluate { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
evaluate: called CC=11 SCAR=38.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 13 | 2 | my ($class, $file, $tokens, $args) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||||||||||||||||
| 15 | 2 | my @violations; | |||||||||||||||||||||||||||||||||||||||||
| 16 | 2 | ▶ | for (my $i = 0; my $token = $tokens->[$i]; $i++) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 17 | 51 | my $token_type = $token->{type}; | |||||||||||||||||||||||||||||||||||||||||
| 18 | 51 | my $token_data = $token->{data}; | |||||||||||||||||||||||||||||||||||||||||
| 19 | 51 | ▶ | if ($token_type == USED_NAME && $token_data eq 'English') { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$token_type == 94 and $token_data eq "English"
MC/DC0%0/2
$token_type == 94 and $token_data eq "English"
$token_type == 94
$token_data eq "English"
Truth table66%2/3
A and B
A= $token_type == 94B= $token_data eq "English"
| |||||||||||||||||||||||||||||||||||||||||||
| 20 | 0 | ▶ | SCANNING: for ($i++; my $token = $tokens->[$i]; $i++) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 21 | 0 | my $token_type = $token->{type}; | |||||||||||||||||||||||||||||||||||||||||
| 22 | 0 | my $token_data = $token->{data}; | |||||||||||||||||||||||||||||||||||||||||
| 23 | 0 | ▶ | if ( | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
$token_type == 172 or $token_type == 173 or $token_type == 187
$token_type == 172 or $token_type == 173
MC/DC0%0/3
$token_type == 172 or $token_type == 173 or $token_type == 187
$token_type == 172
$token_type == 173
$token_type == 187
Truth table0%0/4
A or B or C
A= $token_type == 172B= $token_type == 173C= $token_type == 187
| |||||||||||||||||||||||||||||||||||||||||||
| 24 | $token_type == STRING || | ||||||||||||||||||||||||||||||||||||||||||
| 25 | $token_type == RAW_STRING || | ||||||||||||||||||||||||||||||||||||||||||
| 26 | $token_type == REG_EXP | ||||||||||||||||||||||||||||||||||||||||||
| 27 | ) { | ||||||||||||||||||||||||||||||||||||||||||
| 28 | 0 | for my $data (split / /, $token_data) { | |||||||||||||||||||||||||||||||||||||||||
| 29 | 0 | ▶ | last SCANNING if $data =~ /\A-no_match_vars\Z/; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 30 | } | ||||||||||||||||||||||||||||||||||||||||||
| 31 | } | ||||||||||||||||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||||||||||||||||
| 33 | 0 | ▶ | if ($token_type == SEMI_COLON) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 34 | push @violations, { | ||||||||||||||||||||||||||||||||||||||||||
| 35 | filename => $file, | ||||||||||||||||||||||||||||||||||||||||||
| 36 | line => $token->{line}, | ||||||||||||||||||||||||||||||||||||||||||
| 37 | 0 | description => DESC, | |||||||||||||||||||||||||||||||||||||||||
| 38 | explanation => EXPL, | ||||||||||||||||||||||||||||||||||||||||||
| 39 | policy => __PACKAGE__, | ||||||||||||||||||||||||||||||||||||||||||
| 40 | }; | ||||||||||||||||||||||||||||||||||||||||||
| 41 | 0 | last; | |||||||||||||||||||||||||||||||||||||||||
| 42 | } | ||||||||||||||||||||||||||||||||||||||||||
| 43 | } | ||||||||||||||||||||||||||||||||||||||||||
| 44 | } | ||||||||||||||||||||||||||||||||||||||||||
| 45 | } | ||||||||||||||||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||||||||||||||||
| 47 | 2 | return \@violations; | |||||||||||||||||||||||||||||||||||||||||
| 48 | } | ||||||||||||||||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||||||||||||||||
| 50 | 3 | 1; | |||||||||||||||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||||||||||||||||