Policy/ValuesAndExpressions/ProhibitFiletest_f.pm

filter: Statementstmt 100% 34 / 34 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 11 / 11 Podpod 100% 1 / 1 totaltotal 100% 48 / 48 CC 2 SCAR 1.5
CC
2
Cov
100%
violates
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« Policy/Documentation/ProhibitParagraphTwoDots.pm ↑ Summary Pulp.pm »
1 # Copyright 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Kevin Ryde
2  
3 # Perl-Critic-Pulp is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by the
5 # Free Software Foundation; either version 3, or (at your option) any later
6 # version.
7 #
8 # Perl-Critic-Pulp is distributed in the hope that it will be useful, but
9 # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
10 # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
11 # for more details.
12 #
13 # You should have received a copy of the GNU General Public License along
14 # with Perl-Critic-Pulp. If not, see <http://www.gnu.org/licenses/>.
15  
16  
17 package Perl::Critic::Policy::ValuesAndExpressions::ProhibitFiletest_f;
18 40 ▶use 5.006;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 40 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
20 40 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
21  
22 40 ▶use base 'Perl::Critic::Policy';
Subroutine BEGIN: called CC=1 SCAR=0.0
23 40 ▶use Perl::Critic::Utils;
Subroutine BEGIN: called CC=1 SCAR=0.0
24 40 ▶use Perl::Critic::Pulp;
Subroutine BEGIN: called CC=1 SCAR=0.0
25  
26 40 our $VERSION = 100;
27  
28 40 ▶use constant supported_parameters => ();
Subroutine BEGIN: called CC=1 SCAR=0.0
29 40 ▶use constant default_severity => $Perl::Critic::Utils::SEVERITY_MEDIUM;
Subroutine BEGIN: called CC=1 SCAR=0.0
30 40 ▶use constant default_themes => qw(pulp bugs);
Subroutine BEGIN: called CC=1 SCAR=0.0
31 40 ▶use constant applies_to => 'PPI::Token::Operator';
Subroutine BEGIN: called CC=1 SCAR=0.0
32  
33 12 ▶sub violates {
Subroutine violates: called CC=2 SCAR=6.9
Pod documented
34 12 my ($self, $elem, $document) = @_;
35  
36 12 ▶ return if ($elem->content ne '-f');
Branch: 1 branch
BranchTrueFalseTotal
if $elem->content ne "-f" 6 6 12
37 6 return $self->violation ("Don't use the -f file test", '', $elem);
38 }
39  
40 40 1;
41 __END__
« Policy/Documentation/ProhibitParagraphTwoDots.pm ↑ Summary Pulp.pm »