« 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
| |||||||||||
| 35 | or return; | ||||||||||
| 36 | 1 | ▶ | $re->modifier_asserted( 's' ) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 37 | or return $self->violation( $DESC, $EXPL, $elem ); | ||||||||||
| 38 | |||||||||||
| 39 | 0 | return; #ok!; | |||||||||
| 40 | } | ||||||||||
| 41 | |||||||||||
| 42 | 40 | 1; | |||||||||
| 43 | |||||||||||
| 44 | __END__ | ||||||||||