« Perl/Lint/Policy/Modules/ProhibitMultiplePackages.pm
↑ Summary
Perl/Lint/Policy/Miscellanea/ProhibitFormats.pm »
| 1 | package Perl::Lint::Policy::Variables::ProtectPrivateVars; | ||||||||||||||||||||||||||||
| 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 => 'Private variable used', | |||||||||||||||||||||||||||
| 9 | EXPL => 'Use published APIs', | ||||||||||||||||||||||||||||
| 10 | 2 | }; | |||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | 0 | ▶ | sub evaluate { | ||||||||||||||||||||||||||
|
Subroutine
evaluate: not called CC=4 SCAR=30.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 13 | 0 | my ($class, $file, $tokens, $src, $args) = @_; | |||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||
| 15 | 0 | my @violations; | |||||||||||||||||||||||||||
| 16 | 0 | ▶ | for (my $i = 0, my $token_type, my $token_data; my $token = $tokens->[$i]; $i++) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 17 | 0 | $token_type = $token->{type}; | |||||||||||||||||||||||||||
| 18 | 0 | $token_data = $token->{data}; | |||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | 0 | ▶ | if ($token_type == NAMESPACE && $token_data =~ /\A_/) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$token_type == 127 and $token_data =~ /\A_/
MC/DC0%0/2
$token_type == 127 and $token_data =~ /\A_/
$token_type == 127
$token_data =~ /\A_/
Truth table0%0/3
A and B
A= $token_type == 127B= $token_data =~ /\A_/
| |||||||||||||||||||||||||||||
| 21 | push @violations, { | ||||||||||||||||||||||||||||
| 22 | filename => $file, | ||||||||||||||||||||||||||||
| 23 | line => $token->{line}, | ||||||||||||||||||||||||||||
| 24 | 0 | description => DESC, | |||||||||||||||||||||||||||
| 25 | explanation => EXPL, | ||||||||||||||||||||||||||||
| 26 | policy => __PACKAGE__, | ||||||||||||||||||||||||||||
| 27 | }; | ||||||||||||||||||||||||||||
| 28 | } | ||||||||||||||||||||||||||||
| 29 | } | ||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||
| 31 | 0 | return \@violations; | |||||||||||||||||||||||||||
| 32 | } | ||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||
| 34 | 2 | 1; | |||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||