« lib/Perl/Critic/Policy/CodeLayout/ProhibitTrailingWhitespace.pm
↑ Summary
lib/Perl/Critic/Exception/Configuration/Option.pm »
| 1 | package Perl::Critic::Policy::Modules::RequireBarewordIncludes; | ||||||||||
| 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 $EXPL => q{Use a bareword instead}; | |||||||||
| 16 | |||||||||||
| 17 | #----------------------------------------------------------------------------- | ||||||||||
| 18 | |||||||||||
| 19 | 90 | ▶ | sub supported_parameters { return () } | ||||||||
|
Subroutine
supported_parameters: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 20 | 76 | ▶ | sub default_severity { return $SEVERITY_HIGHEST } | ||||||||
|
Subroutine
default_severity: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 21 | 73 | ▶ | sub default_themes { return qw(core portability) } | ||||||||
|
Subroutine
default_themes: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 22 | 37 | ▶ | sub applies_to { return 'PPI::Statement::Include' } | ||||||||
|
Subroutine
applies_to: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 23 | |||||||||||
| 24 | #----------------------------------------------------------------------------- | ||||||||||
| 25 | |||||||||||
| 26 | 63 | ▶ | sub violates { | ||||||||
|
Subroutine
violates: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||
| 27 | 63 | my ( $self, $elem, undef ) = @_; | |||||||||
| 28 | |||||||||||
| 29 | 63 | my $child = $elem->schild(1); | |||||||||
| 30 | 63 | ▶ | return if !$child; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 31 | |||||||||||
| 32 | 63 | ▶ | if ( $child->isa('PPI::Token::Quote') ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 33 | 2 | my $type = $elem->type; | |||||||||
| 34 | 2 | my $desc = qq{"$type" statement with library name as string}; | |||||||||
| 35 | 2 | return $self->violation( $desc, $EXPL, $elem ); | |||||||||
| 36 | } | ||||||||||
| 37 | 61 | return; #ok! | |||||||||
| 38 | } | ||||||||||
| 39 | |||||||||||
| 40 | |||||||||||
| 41 | 40 | 1; | |||||||||
| 42 | |||||||||||
| 43 | __END__ | ||||||||||