Perl/Lint/Policy/InputOutput/ProhibitInteractiveTest.pm

filter: Statementstmt 66.6% 16 / 24 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 83.3% 5 / 6 Podpod 0.0% 0 / 1 totaltotal 52.5% 21 / 40 CC 4 SCAR 22.5
CC
4
Cov
52%
evaluate
20.0
BEGIN
1.0
BEGIN
1.0
CRAP 9.4
« 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
BranchTrueFalseTotal
if (my $token = $tokens->[$i]) 0 0 0
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
BranchTrueFalseTotal
if ($token_type == 89 and $token_data eq "-t") 0 0 0
Condition0%0/3
$token_type == 89 and $token_data eq "-t"
!ll&&!rl&&r
000
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"
ABresult
0X0
100
111
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  
« Perl/Lint/Policy/ClassHierarchies/ProhibitAutoloading.pm ↑ Summary Perl/Lint/Policy/Modules/ProhibitMultiplePackages.pm »