Pod/Weaver/PluginBundle/Author/CCM.pm

filter: Statementstmt 44.4% 16 / 36 Branchbran 0.0% 0 / 12 Conditioncond 0.0% 0 / 5 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 55.5% 5 / 9 Podpod 100% 2 / 2 totaltotal 34.3% 23 / 67 CC 9 SCAR 35.6
CC
9
Cov
30%
_expand_config
72.0
mvp_bundle_config
6.0
configure
2.0
CRAP 35.1
↑ Summary Dist/Zilla/PluginBundle/Author/CCM.pm »
1 package Pod::Weaver::PluginBundle::Author::CCM;
2 # ABSTRACT: A plugin bundle for pod woven by CCM
3  
4  
5 2 ▶use 5.008;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 2 our $VERSION = '0.012'; # VERSION
10  
11 2 ▶use Pod::Weaver::Config::Assembler;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 2 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14  
15 0 ▶sub configure {
Subroutine configure: not called CC=1 SCAR=6.9
Pod documented
16 return (
17 0 ['-EnsurePod5'],
18 ['-H1Nester'],
19 ['-SingleEncoding'],
20  
21 ['-Transformer' => List => {transformer => 'List'}],
22 ['-Transformer' => Verbatim => {transformer => 'Verbatim'}],
23  
24 ['Region' => 'header'],
25  
26 'Name',
27 # ['Badges' => {badge => [qw(perl travis coverage)], formats => 'html, markdown'}],
28  
29 'Version',
30  
31 ['Region' => 'prelude'],
32  
33 ['Generic' => 'SYNOPSIS'],
34 ['Generic' => 'DESCRIPTION'],
35 ['Generic' => 'OVERVIEW'],
36 ['Collect' => 'ATTRIBUTES' => {command => 'attr'}],
37 ['Collect' => 'METHODS' => {command => 'method'}],
38 ['Collect' => 'FUNCTIONS' => {command => 'func'}],
39  
40 'Leftovers',
41  
42 ['Region' => 'postlude'],
43  
44 'Bugs',
45 'Authors',
46 'Contributors',
47 'Legal',
48  
49 ['Region' => 'footer'],
50 );
51 }
52  
53  
54 0 ▶sub mvp_bundle_config {
Subroutine mvp_bundle_config: not called CC=2 SCAR=17.9
Pod documented
55 0 ▶ my $self = shift || __PACKAGE__;
Condition0%0/2
shift() || __PACKAGE__
l!l
00
MC/DC0%0/1
shift() || __PACKAGE__
shift()
Truth table0%0/2
A
A= shift()
Aresult
11
00
56  
57 0 return map { $self->_expand_config($_) } $self->configure;
58 }
59  
60 0 ▶sub _exp { Pod::Weaver::Config::Assembler->expand_package($_[0]) }
Subroutine _exp: not called CC=1 SCAR=6.9
61  
62 0 ▶sub _expand_config {
Subroutine _expand_config: not called CC=8 SCAR=42.8
63 0 my $self = shift;
64 0 my $spec = shift;
65  
66 0 my ($name, $package, $payload);
67  
68 0 ▶ if (!ref $spec) {
Branch: 3 branches
BranchTrueFalseTotal
if (not ref $spec) { } 0 0 0
elsif (@$spec == 1) { } 0 0 0
elsif (@$spec == 2) { } 0 0 0
69 0 ($name, $package, $payload) = ($spec, $spec, {});
70 }
71 elsif (@$spec == 1) {
72 0 ($name, $package, $payload) = (@$spec[0,0], {});
73 }
74 elsif (@$spec == 2) {
75 0 ▶ ($name, $package, $payload) = ref $spec->[1] ? @$spec[0,0,1] : (@$spec[1,0], {});
Branch: 1 branch
BranchTrueFalseTotal
ref $spec->[1] ? : 0 0 0
76 }
77 else {
78 0 ($package, $name, $payload) = @$spec;
79 }
80  
81 0 $name =~ s/^[@=-]//;
82 0 $package = _exp($package);
83  
84 0 ▶ if ($package eq _exp('Region')) {
Branch: 1 branch
BranchTrueFalseTotal
if ($package eq _exp("Region")) 0 0 0
85 0 $name = $spec->[1];
86 0 $payload = {region_name => $spec->[1], %$payload};
87 }
88  
89 0 ▶ $name = '@Author::CCM/' . $name if $package ne _exp('Generic') && $package ne _exp('Collect');
Branch: 1 branch
BranchTrueFalseTotal
if $package ne _exp("Generic") and $package ne _exp("Collect") 0 0 0
Condition0%0/3
$package ne _exp("Generic") and $package ne _exp("Collect")
!ll&&!rl&&r
000
MC/DC0%0/2
$package ne _exp("Generic") and $package ne _exp("Collect")
$package ne _exp("Generic") $package ne _exp("Collect")
Truth table0%0/3
A and B
A= $package ne _exp("Generic")B= $package ne _exp("Collect")
ABresult
0X0
100
111
90  
91 0 return [$name => $package => $payload];
92 }
93  
94 2 1;
95  
96 __END__
↑ Summary Dist/Zilla/PluginBundle/Author/CCM.pm »