lib/Perl/Critic/Policy/Miscellanea/ProhibitUnrestrictedNoCritic.pm

filter: Statementstmt 90.9% 30 / 33 Branchbran 25.0% 1 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 11 / 11 Podpod 80.0% 4 / 5 totaltotal 86.7% 46 / 53 CC 4 SCAR 8.9
CC
4
Cov
84%
violates
6.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.4
« lib/Perl/Critic/Policy/Documentation/RequirePodAtEnd.pm ↑ Summary lib/Perl/Critic/PolicyParameter/Behavior/StringList.pm »
1 package Perl::Critic::Policy::Miscellanea::ProhibitUnrestrictedNoCritic;
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{Unrestricted '## no critic' annotation};
16 40 Readonly::Scalar my $EXPL => q{Only disable the Policies you really need to disable};
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_MEDIUM }
Subroutine default_severity: called CC=1 SCAR=0.0
Pod documented
22 73 ▶sub default_themes { return qw( core maintenance ) }
Subroutine default_themes: called CC=1 SCAR=0.0
Pod documented
23 2 ▶sub applies_to { return 'PPI::Document' }
Subroutine applies_to: called CC=1 SCAR=0.0
Pod documented
24  
25 #-----------------------------------------------------------------------------
26  
27 2 ▶sub violates {
Subroutine violates: called CC=4 SCAR=17.9
Pod documented
28 2 my ( $self, $doc, undef ) = @_;
29  
30 # If for some reason $doc is not a P::C::Document, then all bets are off
31 2 ▶ return if not $doc->isa('Perl::Critic::Document');
Branch: 1 branch
BranchTrueFalseTotal
unless $doc->isa("Perl::Critic::Document") 0 2 2
32  
33 2 my @violations;
34 2 for my $annotation ($doc->annotations()) {
35 0 ▶ if ($annotation->disables_all_policies()) {
Branch: 1 branch
BranchTrueFalseTotal
if ($annotation->disables_all_policies) 0 0 0
36 0 my $elem = $annotation->element();
37 0 push @violations, $self->violation($DESC, $EXPL, $elem);
38 }
39 }
40  
41 2 return @violations;
42 }
43  
44 #-----------------------------------------------------------------------------
45  
46 40 1;
47  
48 __END__
« lib/Perl/Critic/Policy/Documentation/RequirePodAtEnd.pm ↑ Summary lib/Perl/Critic/PolicyParameter/Behavior/StringList.pm »