« lib/Perl/Critic/Policy/Subroutines/ProhibitManyArgs.pm
↑ Summary
lib/Perl/Critic/Policy/References/ProhibitDoubleSigils.pm »
| 1 | package Perl::Critic::Policy::TestingAndDebugging::ProhibitProlongedStrictureOverride; | ||||||||||||||||||||||||||||||||||||||||||
| 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 $DESC => q{Don't turn off strict for large blocks of code}; | |||||||||||||||||||||||||||||||||||||||||
| 16 | 40 | Readonly::Scalar my $EXPL => [ 433 ]; | |||||||||||||||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||||||||||||||||
| 18 | #----------------------------------------------------------------------------- | ||||||||||||||||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||||||||||||||||
| 20 | 91 | ▶ | sub supported_parameters { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
supported_parameters: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||
| 21 | return ( | ||||||||||||||||||||||||||||||||||||||||||
| 22 | { | ||||||||||||||||||||||||||||||||||||||||||
| 23 | 91 | name => 'statements', | |||||||||||||||||||||||||||||||||||||||||
| 24 | description => 'The maximum number of statements in a no strict block.', | ||||||||||||||||||||||||||||||||||||||||||
| 25 | default_string => '3', | ||||||||||||||||||||||||||||||||||||||||||
| 26 | behavior => 'integer', | ||||||||||||||||||||||||||||||||||||||||||
| 27 | integer_minimum => 1, | ||||||||||||||||||||||||||||||||||||||||||
| 28 | }, | ||||||||||||||||||||||||||||||||||||||||||
| 29 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 30 | } | ||||||||||||||||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||||||||||||||||
| 32 | 74 | ▶ | sub default_severity { return $SEVERITY_HIGH } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
default_severity: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 33 | 91 | ▶ | sub default_themes { return qw( core pbp bugs certrec ) } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
default_themes: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 34 | 33 | ▶ | sub applies_to { return 'PPI::Statement::Include' } | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
applies_to: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||||||||||||||||
| 36 | #----------------------------------------------------------------------------- | ||||||||||||||||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||||||||||||||||
| 38 | 61 | ▶ | sub violates { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
violates: called CC=8 SCAR=39.6
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 39 | 61 | my ($self, $elem, undef) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||||||||||||||||
| 41 | 61 | ▶ | return if $elem->type ne 'no'; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 42 | 0 | ▶ | return if $elem->module ne 'strict'; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||||||||||||||||
| 44 | 0 | my $sib = $elem->snext_sibling; | |||||||||||||||||||||||||||||||||||||||||
| 45 | 0 | my $nstatements = 0; | |||||||||||||||||||||||||||||||||||||||||
| 46 | 0 | ▶ | while ($nstatements++ <= $self->{_statements}) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 47 | 0 | ▶ | return if !$sib; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 48 | 0 | ▶ | return if $sib->isa('PPI::Statement::Include') && | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
$sib->isa("PPI::Statement::Include") and $sib->type eq "use" and $sib->module eq "strict"
$sib->isa("PPI::Statement::Include") and $sib->type eq "use"
MC/DC0%0/3
$sib->isa("PPI::Statement::Include") and $sib->type eq "use" and $sib->module eq "strict"
$sib->isa("PPI::Statement::Include")
$sib->type eq "use"
$sib->module eq "strict"
Truth table0%0/4
A and B and C
A= $sib->isa("PPI::Statement::Include")B= $sib->type eq "use"C= $sib->module eq "strict"
| |||||||||||||||||||||||||||||||||||||||||||
| 49 | $sib->type eq 'use' && | ||||||||||||||||||||||||||||||||||||||||||
| 50 | $sib->module eq 'strict'; | ||||||||||||||||||||||||||||||||||||||||||
| 51 | 0 | $sib = $sib->snext_sibling; | |||||||||||||||||||||||||||||||||||||||||
| 52 | } | ||||||||||||||||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||||||||||||||||
| 54 | 0 | return $self->violation( $DESC, $EXPL, $elem ); | |||||||||||||||||||||||||||||||||||||||||
| 55 | } | ||||||||||||||||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||||||||||||||||
| 57 | 40 | 1; | |||||||||||||||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||||||||||||||||
| 59 | #----------------------------------------------------------------------------- | ||||||||||||||||||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||||||||||||||||||
| 61 | __END__ | ||||||||||||||||||||||||||||||||||||||||||