« Perl/Lint/Policy/ClassHierarchies/ProhibitAutoloading.pm
↑ Summary
Perl/Lint/Policy/Modules/ProhibitMultiplePackages.pm »
| 1 | package Perl::Lint::Policy::InputOutput::ProhibitInteractiveTest; | ||||||||||||||||||||||||||||
| 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 => 'Use IO::Interactive::is_interactive() instead of -t', | |||||||||||||||||||||||||||
| 9 | EXPL => [218], | ||||||||||||||||||||||||||||
| 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 = $tokens->[$i]; $i++) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 17 | 0 | my $token_type = $token->{type}; | |||||||||||||||||||||||||||
| 18 | 0 | my $token_data = $token->{data}; | |||||||||||||||||||||||||||
| 19 | 0 | ▶ | if ($token_type == HANDLE && $token_data eq '-t') { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$token_type == 89 and $token_data eq "-t"
MC/DC0%0/2
$token_type == 89 and $token_data eq "-t"
$token_type == 89
$token_data eq "-t"
Truth table0%0/3
A and B
A= $token_type == 89B= $token_data eq "-t"
| |||||||||||||||||||||||||||||
| 20 | push @violations, { | ||||||||||||||||||||||||||||
| 21 | filename => $file, | ||||||||||||||||||||||||||||
| 22 | line => $token->{line}, | ||||||||||||||||||||||||||||
| 23 | 0 | description => DESC, | |||||||||||||||||||||||||||
| 24 | explanation => EXPL, | ||||||||||||||||||||||||||||
| 25 | policy => __PACKAGE__, | ||||||||||||||||||||||||||||
| 26 | }; | ||||||||||||||||||||||||||||
| 27 | } | ||||||||||||||||||||||||||||
| 28 | } | ||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||
| 30 | 0 | return \@violations; | |||||||||||||||||||||||||||
| 31 | } | ||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||
| 33 | 2 | 1; | |||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||