| 1 | package Perl::Critic::Policy::Variables::ProhibitPerl4PackageNames; | ||||||||||||||||||||||||||||
| 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{ :characters :severities :classification }; | ||||||||||||||||||||||||||
|
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 => | |||||||||||||||||||||||||||
| 16 | q{Use double colon (::) to separate package name components instead of single quotes (')}; | ||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||
| 18 | #----------------------------------------------------------------------------- | ||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | 90 | ▶ | sub supported_parameters { return () } | ||||||||||||||||||||||||||
|
Subroutine
supported_parameters: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 21 | 74 | ▶ | sub default_severity { return $SEVERITY_LOW } | ||||||||||||||||||||||||||
|
Subroutine
default_severity: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 22 | 73 | ▶ | sub default_themes { return qw(core maintenance certrec ) } | ||||||||||||||||||||||||||
|
Subroutine
default_themes: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 23 | 31 | ▶ | sub applies_to { return qw( PPI::Token::Word PPI::Token::Symbol ) } | ||||||||||||||||||||||||||
|
Subroutine
applies_to: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||
| 25 | #----------------------------------------------------------------------------- | ||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||
| 27 | 505 | ▶ | sub violates { | ||||||||||||||||||||||||||
|
Subroutine
violates: called CC=5 SCAR=26.7
Pod
documented
| |||||||||||||||||||||||||||||
| 28 | 505 | my ( $self, $elem, undef ) = @_; | |||||||||||||||||||||||||||
| 29 | 505 | my $content = $elem->content(); | |||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||
| 31 | 505 | ▶ | if ( (index $content, $QUOTE) < 0 ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 32 | 505 | return; | |||||||||||||||||||||||||||
| 33 | } | ||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||
| 35 | 0 | ▶ | if ( $content =~ m< \A [\$@%&*] ' \z >xms ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 36 | # We've found $POSTMATCH. | ||||||||||||||||||||||||||||
| 37 | 0 | return; | |||||||||||||||||||||||||||
| 38 | } | ||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||
| 40 | 0 | ▶ | if ( $elem->isa('PPI::Token::Word') && is_hash_key($elem) ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$elem->isa("PPI::Token::Word") and is_hash_key($elem)
MC/DC0%0/2
$elem->isa("PPI::Token::Word") and is_hash_key($elem)
$elem->isa("PPI::Token::Word")
is_hash_key($elem)
Truth table0%0/3
A and B
A= $elem->isa("PPI::Token::Word")B= is_hash_key($elem)
| |||||||||||||||||||||||||||||
| 41 | 0 | return; | |||||||||||||||||||||||||||
| 42 | } | ||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||
| 44 | return | ||||||||||||||||||||||||||||
| 45 | 0 | $self->violation( | |||||||||||||||||||||||||||
| 46 | qq{"$content" uses the obsolete single quote package separator.}, | ||||||||||||||||||||||||||||
| 47 | $EXPL, | ||||||||||||||||||||||||||||
| 48 | $elem | ||||||||||||||||||||||||||||
| 49 | ); | ||||||||||||||||||||||||||||
| 50 | } | ||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||
| 52 | #----------------------------------------------------------------------------- | ||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||
| 54 | 40 | 1; | |||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||
| 56 | __END__ | ||||||||||||||||||||||||||||