« Perl/Lint/Policy/References/ProhibitDoubleSigils.pm
↑ Summary
Perl/Lint/Policy/Miscellanea/ProhibitUnrestrictedNoLint.pm »
| 1 | package Perl::Lint::Policy::Miscellanea::ProhibitTies; | ||||||||||||||||||||||||||||
| 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 => 'Tied variable used', | |||||||||||||||||||||||||||
| 9 | EXPL => [451], | ||||||||||||||||||||||||||||
| 10 | 3 | }; | |||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | 2 | ▶ | sub evaluate { | ||||||||||||||||||||||||||
|
Subroutine
evaluate: called CC=4 SCAR=14.3
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 | ▶ | if ($token->{type} == BUILTIN_FUNC && $token->{data} eq 'tie') { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$token->{"type"} == 70 and $token->{"data"} eq "tie"
MC/DC0%0/2
$token->{"type"} == 70 and $token->{"data"} eq "tie"
$token->{"type"} == 70
$token->{"data"} eq "tie"
Truth table66%2/3
A and B
A= $token->{"type"} == 70B= $token->{"data"} eq "tie"
| |||||||||||||||||||||||||||||
| 18 | push @violations, { | ||||||||||||||||||||||||||||
| 19 | filename => $file, | ||||||||||||||||||||||||||||
| 20 | line => $token->{line}, | ||||||||||||||||||||||||||||
| 21 | 0 | description => DESC, | |||||||||||||||||||||||||||
| 22 | explanation => EXPL, | ||||||||||||||||||||||||||||
| 23 | policy => __PACKAGE__, | ||||||||||||||||||||||||||||
| 24 | }; | ||||||||||||||||||||||||||||
| 25 | } | ||||||||||||||||||||||||||||
| 26 | } | ||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||
| 28 | 2 | return \@violations; | |||||||||||||||||||||||||||
| 29 | } | ||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||
| 31 | 3 | 1; | |||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||