Merge/Boilerplate.pm

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