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

filter: Statementstmt 76.9% 30 / 39 Branchbran 16.6% 1 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 85.7% 12 / 14 Podpod 80.0% 4 / 5 totaltotal 73.4% 47 / 64 CC 4 SCAR 13.7
CC
4
Cov
69%
violates
12.9
__ANON__
2.0
__ANON__
2.0
CRAP 3.9
« lib/Perl/Critic/Policy/Subroutines/ProhibitBuiltinHomonyms.pm ↑ Summary lib/Perl/Critic/Policy/InputOutput/ProhibitOneArgSelect.pm »
1 package Perl::Critic::Policy::InputOutput::ProhibitJoinedReadline;
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 40 ▶use List::SomeUtils qw(any);
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 40 ▶use Perl::Critic::Utils qw{ :severities :classification parse_arg_list };
Subroutine BEGIN: called CC=1 SCAR=0.0
10 40 ▶use parent 'Perl::Critic::Policy';
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 40 our $VERSION = '1.156';
13  
14 #-----------------------------------------------------------------------------
15  
16 40 Readonly::Scalar my $DESC => q{Use "local $/ = undef" or Path::Tiny instead of joined readline}; ## no critic qw(InterpolationOfMetachars)
17 40 Readonly::Scalar my $EXPL => [213];
18  
19 #-----------------------------------------------------------------------------
20  
21 90 ▶sub supported_parameters { return () }
Subroutine supported_parameters: called CC=1 SCAR=0.0
Pod undocumented
22 74 ▶sub default_severity { return $SEVERITY_MEDIUM }
Subroutine default_severity: called CC=1 SCAR=0.0
Pod documented
23 85 ▶sub default_themes { return qw( core pbp performance ) }
Subroutine default_themes: called CC=1 SCAR=0.0
Pod documented
24 31 ▶sub applies_to { return 'PPI::Token::Word' }
Subroutine applies_to: called CC=1 SCAR=0.0
Pod documented
25  
26 #-----------------------------------------------------------------------------
27  
28 332 ▶sub violates {
Subroutine violates: called CC=4 SCAR=25.6
Pod documented
29 332 my ( $self, $elem, undef ) = @_;
30  
31 332 ▶ return if $elem->content() ne 'join';
Branch: 1 branch
BranchTrueFalseTotal
if $elem->content ne "join" 332 0 332
32 0 ▶ return if ! is_function_call($elem);
Branch: 1 branch
BranchTrueFalseTotal
unless is_function_call($elem) 0 0 0
33 0 my @args = parse_arg_list($elem);
34 0 shift @args; # ignore separator string
35  
36 0 ▶ if (any { any { $_->isa('PPI::Token::QuoteLike::Readline') } @{$_} } @args) {
Subroutine __ANON__: not called CC=1 SCAR=6.9
Subroutine __ANON__: not called CC=1 SCAR=6.9
Branch: 1 branch
BranchTrueFalseTotal
if (&any(sub { &any(sub { $_->isa("PPI::Token::QuoteLike::Readline"); } , @{$_;}); } , @args)) 0 0 0
37 0 return $self->violation( $DESC, $EXPL, $elem );
38 }
39  
40 0 return; # OK
41 }
42  
43  
44 40 1;
45  
46 __END__
« lib/Perl/Critic/Policy/Subroutines/ProhibitBuiltinHomonyms.pm ↑ Summary lib/Perl/Critic/Policy/InputOutput/ProhibitOneArgSelect.pm »