| 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
| |||||||||||
| 22 | |||||||||||
| 23 | 6 | ▶ | return if is_method_call( $elem ); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 24 | 6 | ▶ | return if is_hash_key( $elem ); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 25 | 6 | ▶ | return if is_subroutine_name( $elem ); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 26 | |||||||||||
| 27 | 6 | return $self->violation( $DESCRIPTION, $EXPLANATION, $elem ); | |||||||||
| 28 | } | ||||||||||
| 29 | |||||||||||
| 30 | 1 | 1; | |||||||||
| 31 | |||||||||||
| 32 | __END__ | ||||||||||