| 1 | package Perl::Critic::Policy::Subroutines::ProhibitQualifiedSubDeclarations; | ||||||||||
| 2 | |||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 1 | ▶ | use base 'Perl::Critic::Policy'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 1 | ▶ | use Perl::Critic::Utils qw( :severities &is_qualified_name ); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | |||||||||||
| 9 | #----------------------------------------------------------------------------- | ||||||||||
| 10 | |||||||||||
| 11 | 1 | our $VERSION = '0.08'; | |||||||||
| 12 | |||||||||||
| 13 | #----------------------------------------------------------------------------- | ||||||||||
| 14 | |||||||||||
| 15 | 3 | ▶ | sub supported_parameters { return } | ||||||||
|
Subroutine
supported_parameters: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 16 | 4 | ▶ | sub default_severity { return $SEVERITY_MEDIUM } | ||||||||
|
Subroutine
default_severity: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 17 | 0 | ▶ | sub default_themes { return qw( strictersubs bugs ) } | ||||||||
|
Subroutine
default_themes: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 18 | 3 | ▶ | sub applies_to { return 'PPI::Statement::Sub' } | ||||||||
|
Subroutine
applies_to: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 19 | |||||||||||
| 20 | #----------------------------------------------------------------------------- | ||||||||||
| 21 | |||||||||||
| 22 | 1 | my $desc = q{Subroutine declared with a qualified name}; | |||||||||
| 23 | 1 | my $expl = q{Remove package name from sub declaration}; | |||||||||
| 24 | |||||||||||
| 25 | #----------------------------------------------------------------------------- | ||||||||||
| 26 | |||||||||||
| 27 | 8 | ▶ | sub violates { | ||||||||
|
Subroutine
violates: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||
| 28 | |||||||||||
| 29 | 8 | my ($self, $elem, undef) = @_; | |||||||||
| 30 | |||||||||||
| 31 | 8 | ▶ | if ( is_qualified_name( $elem->name() ) ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 32 | 4 | return $self->violation( $desc, $expl, $elem ); | |||||||||
| 33 | } | ||||||||||
| 34 | |||||||||||
| 35 | 4 | return; #ok! | |||||||||
| 36 | } | ||||||||||
| 37 | |||||||||||
| 38 | #----------------------------------------------------------------------------- | ||||||||||
| 39 | |||||||||||
| 40 | 1 | 1; | |||||||||
| 41 | |||||||||||
| 42 | __END__ | ||||||||||