lib/Perl/Critic/Policy/RegularExpressions/RequireDotMatchAnything.pm

filter: Statementstmt 96.5% 28 / 29 Branchbran 50.0% 2 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 11 / 11 Podpod 80.0% 4 / 5 totaltotal 91.8% 45 / 49 CC 3 SCAR 4.5
CC
3
Cov
91%
violates
3.5
BEGIN
1.0
BEGIN
1.0
CRAP 1.6
« lib/Perl/Critic/Policy/RegularExpressions/ProhibitUnusualDelimiters.pm ↑ Summary lib/Perl/Critic/Policy/RegularExpressions/RequireLineBoundaryMatching.pm »
1 package Perl::Critic::Policy::RegularExpressions::RequireDotMatchAnything;
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  
7 40 ▶use Readonly;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 40 ▶use Perl::Critic::Utils qw{ :severities };
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 40 ▶use parent 'Perl::Critic::Policy';
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 40 our $VERSION = '1.156';
14  
15 #-----------------------------------------------------------------------------
16  
17 40 Readonly::Scalar my $DESC => q{Regular expression without "/s" flag};
18 40 Readonly::Scalar my $EXPL => [ 240, 241 ];
19  
20 #-----------------------------------------------------------------------------
21  
22 90 ▶sub supported_parameters { return () }
Subroutine supported_parameters: called CC=1 SCAR=0.0
Pod undocumented
23 75 ▶sub default_severity { return $SEVERITY_LOW }
Subroutine default_severity: called CC=1 SCAR=0.0
Pod documented
24 83 ▶sub default_themes { return qw<core pbp cosmetic> }
Subroutine default_themes: called CC=1 SCAR=0.0
Pod documented
25 31 ▶sub applies_to { return qw<PPI::Token::Regexp::Match
Subroutine applies_to: called CC=1 SCAR=0.0
Pod documented
26 PPI::Token::Regexp::Substitute
27 PPI::Token::QuoteLike::Regexp> }
28  
29 #-----------------------------------------------------------------------------
30  
31 1 ▶sub violates {
Subroutine violates: called CC=3 SCAR=12.5
Pod documented
32 1 my ( $self, $elem, $doc ) = @_;
33  
34 1 ▶ my $re = $doc->ppix_regexp_from_element( $elem )
Branch: 1 branch
BranchTrueFalseTotal
my $re = $doc->ppix_regexp_from_element($elem) or return 1 0 1
35 or return;
36 1 ▶ $re->modifier_asserted( 's' )
Branch: 1 branch
BranchTrueFalseTotal
$re->modifier_asserted("s") or return $self->violation($DESC, $EXPL, $elem) 0 1 1
37 or return $self->violation( $DESC, $EXPL, $elem );
38  
39 0 return; #ok!;
40 }
41  
42 40 1;
43  
44 __END__
« lib/Perl/Critic/Policy/RegularExpressions/ProhibitUnusualDelimiters.pm ↑ Summary lib/Perl/Critic/Policy/RegularExpressions/RequireLineBoundaryMatching.pm »