File/FindStrings/Boilerplate.pm

filter: Statementstmt 76.3% 42 / 55 Branchbran 50.0% 4 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 8 / 8 Podpod n/a totaltotal 76.0% 54 / 71 CC 6 SCAR 15.0
CC
6
Cov
73%
import
8.6
BEGIN
1.0
BEGIN
1.0
CRAP 4.5
↑ Summary File/FindStrings.pm »
1 #
2 # Copyright (C) 2015,2016,2017 Joelle Maslak
3 # All Rights Reserved - See License
4 #
5  
6 package File::FindStrings::Boilerplate;
7 # ABSTRACT: Default Boilerplate for Perl::Critic::Policy::BadStrings
8 3 $File::FindStrings::Boilerplate::VERSION = '1.000';
9  
10 3 ▶use v5.22;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 3 ▶use feature 'signatures';
Subroutine BEGIN: called CC=1 SCAR=0.0
14 3 ▶no warnings 'experimental::signatures';
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 3 ▶use English;
Subroutine BEGIN: called CC=1 SCAR=0.0
17 3 ▶use Import::Into;
Subroutine BEGIN: called CC=1 SCAR=0.0
18 3 ▶use Smart::Comments;
Subroutine BEGIN: called CC=1 SCAR=0.0
19  
20 7 ▶sub import ( $self, $type = 'script' ) {
Subroutine import: called CC=6 SCAR=21.5
21 0 ▶ ### assert: ($type =~ m/^(?:class|role|script)$/ms)
Branch: 1 branch
BranchTrueFalseTotal
unless ($type =~ /^(?:class|role|script)$/msu) 0 7 7
22  
23 7 my $target = caller;
24  
25 7 strict->import::into($target);
26 7 warnings->import::into($target);
27 7 autodie->import::into($target);
28  
29 7 feature->import::into( $target, ':5.22' );
30  
31 7 utf8->import::into($target); # Allow UTF-8 Source
32  
33 7 ▶ if ( $type eq 'class' ) {
Branch: 2 branches
BranchTrueFalseTotal
if ($type eq 'class') { } 0 7 7
elsif ($type eq 'role') { } 0 7 7
34 0 Moose->import::into($target);
35 0 Moose::Util::TypeConstraints->import::into($target);
36 0 MooseX::StrictConstructor->import::into($target);
37 0 namespace::autoclean->import::into($target);
38 } elsif ( $type eq 'role' ) {
39 0 Moose::Role->import::into($target);
40 0 Moose::Util::TypeConstraints->import::into($target);
41 0 MooseX::StrictConstructor->import::into($target);
42 0 namespace::autoclean->import::into($target);
43 }
44  
45 7 Carp->import::into($target);
46 7 English->import::into($target);
47 7 Smart::Comments->import::into( $target, '-ENV', '###' );
48  
49 7 feature->import::into( $target, 'postderef' ); # Not needed if feature budle >= 5.23.1
50  
51 # We haven't been using this
52 # feature->import::into($target, 'refaliasing');
53 7 feature->import::into( $target, 'signatures' );
54  
55 7 feature->import::into( $target, 'switch' );
56 7 feature->import::into( $target, 'unicode_strings' );
57 # warnings->unimport::out_of($target, 'experimental::refaliasing');
58 7 warnings->unimport::out_of( $target, 'experimental::signatures' );
59  
60 7 ▶ if ( $PERL_VERSION lt v5.24.0 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($File::FindStrings::Boilerplate::PERL_VERSION lt v5.24.0) 0 7 7
61 0 warnings->unimport::out_of( $target, 'experimental::postderef' );
62 }
63  
64 # For "switch" feature
65 7 warnings->unimport::out_of( $target, 'experimental::smartmatch' );
66  
67 7 return;
68 }
69  
70 3 1;
71  
72 __END__
↑ Summary File/FindStrings.pm »