Policy/Storable/ProhibitStoreOrFreeze.pm

filter: Statementstmt 96.0% 24 / 25 Branchbran 62.5% 5 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 87.5% 7 / 8 Podpod 100% 4 / 4 totaltotal 88.8% 40 / 45 CC 5 SCAR 10.5
CC
5
Cov
88%
violates
5.2
default_themes
2.0
BEGIN
1.0
CRAP 2.9
↑ Summary Storable.pm »
1 package Perl::Critic::Policy::Storable::ProhibitStoreOrFreeze;
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  
6 1 ▶use Perl::Critic::Utils;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use base qw( Perl::Critic::Policy );
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 1 our $VERSION = '0.01';
10  
11 1 my $DESCRIPTION = q{Use of store or freeze from Storable.pm};
12 1 my $EXPLANATION = q{Don't use store or freeze, use nstore or nfreeze instead.};
13  
14 6 ▶sub default_severity { return $SEVERITY_MEDIUM } # What do we think?
Subroutine default_severity: called CC=1 SCAR=0.0
Pod documented
15 0 ▶sub default_themes { return qw(storable) }
Subroutine default_themes: not called CC=1 SCAR=6.9
Pod documented
16 12 ▶sub applies_to { return 'PPI::Token::Word' }
Subroutine applies_to: called CC=1 SCAR=0.0
Pod documented
17  
18 12 ▶sub violates {
Subroutine violates: called CC=5 SCAR=16.6
Pod documented
19 12 my ( $self, $elem, $doc ) = @_;
20  
21 12 ▶ return if $elem !~ /^(?:Storable::)?(?:(?:lock_)?store|freeze)$/x;
Branch: 1 branch
BranchTrueFalseTotal
unless $elem =~ /^(?:Storable::)?(?:(?:lock_)?store|freeze)$/x 6 6 12
22  
23 6 ▶ return if is_method_call( $elem );
Branch: 1 branch
BranchTrueFalseTotal
if is_method_call($elem) 0 6 6
24 6 ▶ return if is_hash_key( $elem );
Branch: 1 branch
BranchTrueFalseTotal
if is_hash_key($elem) 0 6 6
25 6 ▶ return if is_subroutine_name( $elem );
Branch: 1 branch
BranchTrueFalseTotal
if is_subroutine_name($elem) 0 6 6
26  
27 6 return $self->violation( $DESCRIPTION, $EXPLANATION, $elem );
28 }
29  
30 1 1;
31  
32 __END__
↑ Summary Storable.pm »