« Perl/Lint/Policy/RegularExpressions/ProhibitSingleCharAlternation.pm
↑ Summary
Perl/Lint/Policy/Objects/IndirectSyntax.pm »
| 1 | package Perl::Lint::Policy::InputOutput::ProhibitBarewordFileHandles; | ||||||||||||||||||||||||||||
| 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 Perl::Lint::Constants::Kind; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | 2 | ▶ | use parent "Perl::Lint::Policy"; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | 2 | ▶ | use constant { | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 9 | 2 | DESC => 'Bareword file handle opened', | |||||||||||||||||||||||||||
| 10 | EXPL => [202, 204], | ||||||||||||||||||||||||||||
| 11 | 2 | }; | |||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | 0 | ▶ | sub evaluate { | ||||||||||||||||||||||||||
|
Subroutine
evaluate: not called CC=6 SCAR=37.4
Pod
undocumented
| |||||||||||||||||||||||||||||
| 14 | 0 | my ($class, $file, $tokens, $src, $args) = @_; | |||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||
| 16 | 0 | my @violations; | |||||||||||||||||||||||||||
| 17 | 0 | ▶ | for (my $i = 0; my $token = $tokens->[$i]; $i++) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 18 | 0 | my $token_type = $token->{type}; | |||||||||||||||||||||||||||
| 19 | 0 | my $token_data = $token->{data}; | |||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||
| 21 | 0 | ▶ | if ($token_type == BUILTIN_FUNC && $token_data eq 'open') { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$token_type == 70 and $token_data eq "open"
MC/DC0%0/2
$token_type == 70 and $token_data eq "open"
$token_type == 70
$token_data eq "open"
Truth table0%0/3
A and B
A= $token_type == 70B= $token_data eq "open"
| |||||||||||||||||||||||||||||
| 22 | 0 | $token = $tokens->[++$i]; | |||||||||||||||||||||||||||
| 23 | 0 | $token_type = $token->{type}; | |||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||
| 25 | 0 | ▶ | if ($token_type == LEFT_PAREN) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 26 | 0 | $token = $tokens->[++$i]; | |||||||||||||||||||||||||||
| 27 | 0 | $token_type = $token->{type}; | |||||||||||||||||||||||||||
| 28 | } | ||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||
| 30 | 0 | ▶ | if ($token_type == KEY) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 31 | push @violations, { | ||||||||||||||||||||||||||||
| 32 | filename => $file, | ||||||||||||||||||||||||||||
| 33 | line => $token->{line}, | ||||||||||||||||||||||||||||
| 34 | 0 | description => DESC, | |||||||||||||||||||||||||||
| 35 | explanation => EXPL, | ||||||||||||||||||||||||||||
| 36 | policy => __PACKAGE__, | ||||||||||||||||||||||||||||
| 37 | }; | ||||||||||||||||||||||||||||
| 38 | } | ||||||||||||||||||||||||||||
| 39 | } | ||||||||||||||||||||||||||||
| 40 | } | ||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||
| 42 | 0 | return \@violations; | |||||||||||||||||||||||||||
| 43 | } | ||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||
| 45 | 2 | 1; | |||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||