lib/Perl/Critic/Policy/InputOutput/ProhibitInteractiveTest.pm

filter: Statementstmt 96.4% 27 / 28 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 11 / 11 Podpod 80.0% 4 / 5 totaltotal 93.4% 43 / 46 CC 2 SCAR 1.9
CC
2
Cov
93%
violates
2.3
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« lib/Perl/Critic/PolicyListing.pm ↑ Summary lib/Perl/Critic/Policy/ValuesAndExpressions/ProhibitImplicitNewlines.pm »
1 package Perl::Critic::Policy::InputOutput::ProhibitInteractiveTest;
2  
3 40 ▶use 5.010001;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 40 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 40 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 40 ▶use Readonly;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 40 ▶use Perl::Critic::Utils qw{ :severities };
Subroutine BEGIN: called CC=1 SCAR=0.0
9 40 ▶use parent 'Perl::Critic::Policy';
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 40 our $VERSION = '1.156';
12  
13 #-----------------------------------------------------------------------------
14  
15 40 Readonly::Scalar my $DESC => q{Use IO::Interactive::is_interactive() instead of -t};
16 40 Readonly::Scalar my $EXPL => [ 218 ];
17  
18 #-----------------------------------------------------------------------------
19  
20 90 ▶sub supported_parameters { return () }
Subroutine supported_parameters: called CC=1 SCAR=0.0
Pod undocumented
21 74 ▶sub default_severity { return $SEVERITY_HIGHEST }
Subroutine default_severity: called CC=1 SCAR=0.0
Pod documented
22 91 ▶sub default_themes { return qw( core pbp bugs certrule ) }
Subroutine default_themes: called CC=1 SCAR=0.0
Pod documented
23 37 ▶sub applies_to { return 'PPI::Token::Operator' }
Subroutine applies_to: called CC=1 SCAR=0.0
Pod documented
24  
25 #-----------------------------------------------------------------------------
26  
27 143 ▶sub violates {
Subroutine violates: called CC=2 SCAR=8.1
Pod documented
28 143 my ($self, $elem, undef) = @_;
29 143 ▶ return if $elem->content() ne '-t';
Branch: 1 branch
BranchTrueFalseTotal
if $elem->content ne "-t" 143 0 143
30 0 return $self->violation( $DESC, $EXPL, $elem );
31 }
32  
33 40 1;
34  
35 #-----------------------------------------------------------------------------
36  
37 __END__
« lib/Perl/Critic/PolicyListing.pm ↑ Summary lib/Perl/Critic/Policy/ValuesAndExpressions/ProhibitImplicitNewlines.pm »