blib/lib/Dist/Zilla/MVP/Reader/Perl.pm

filter: Statementstmt 96.8% 31 / 32 Branchbran 61.1% 11 / 18 Conditioncond 66.6% 2 / 3 MC/DCmcdc 50.0% 1 / 2 Subroutinesub 100% 5 / 5 Podpod 50.0% 1 / 2 totaltotal 82.2% 51 / 62 CC 11 SCAR 22.4
CC
11
Cov
83%
read_into_assembler
12.5
BEGIN
1.0
BEGIN
1.0
CRAP 9.4
« blib/lib/Dist/Zilla/PluginBundle/Filter.pm ↑ Summary blib/lib/Dist/Zilla/App/Command/run.pm »
1 package Dist::Zilla::MVP::Reader::Perl 6.040;
2 # ABSTRACT: the reader for dist.pl files
3  
4 51 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 51 extends 'Config::MVP::Reader';
6 51 with qw(Config::MVP::Reader::Findable::ByExtension);
7  
8 51 ▶use Dist::Zilla::Pragmas;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 51 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 #pod =head1 DESCRIPTION
13 #pod
14 #pod Dist::Zilla::Config reads in the F<dist.pl> file for a distribution.
15 #pod
16 #pod =cut
17  
18 200 ▶sub default_extension { 'pl' }
Subroutine default_extension: called CC=1 SCAR=0.0
Pod undocumented
19  
20 1 ▶sub read_into_assembler {
Subroutine read_into_assembler: called CC=11 SCAR=25.2
Pod documented
21 1 my ($self, $location, $asm) = @_;
22  
23 1 my @input = do File::Spec->rel2abs($location);
24 1 ▶ while (@input and ! ref $input[0]) {
Branch: 1 branch
BranchTrueFalseTotal
if (@input and not ref $input[0]) 5 1 6
Condition66%2/3
@input and not ref $input[0]
!ll&&!rl&&r
015
MC/DC50%1/2
@input and not ref $input[0]
@input not ref $input[0]
Truth table66%2/3
A and not(B)
A= @inputB= not ref $input[0]
ABresult
0X0
100
111
25 5 my ($key, $value) = (shift(@input), shift(@input));
26 5 $asm->add_value($key => $value);
27 }
28  
29 1 my $plugins = shift @input;
30  
31 1 ▶ confess "too much input" if @input;
Branch: 1 branch
BranchTrueFalseTotal
if @input 0 1 1
32  
33 1 ▶ while (my ($ident, $arg) = splice @$plugins, 0, 2) {
Branch: 1 branch
BranchTrueFalseTotal
if (() = splice(@$plugins, 0, 2)) 1 1 2
34 1 ▶ unless (ref $arg) {
Branch: 1 branch
BranchTrueFalseTotal
unless (ref $arg) 1 0 1
35 1 ▶ unshift @$plugins, $arg if defined $arg;
Branch: 1 branch
BranchTrueFalseTotal
if defined $arg 0 1 1
36 1 $arg = [];
37 }
38  
39 1 ▶ my ($moniker, $name) = ref $ident ? @$ident : (($ident) x 2);
Branch: 1 branch
BranchTrueFalseTotal
ref $ident ? : 0 1 1
40 1 $asm->change_section($moniker, $name);
41 1 ▶ my @to_iter = ref $arg eq 'HASH' ? %$arg : @$arg;
Branch: 1 branch
BranchTrueFalseTotal
ref $arg eq 'HASH' ? : 0 1 1
42 1 ▶ while (my ($key, $value) = splice @to_iter, 0, 2) {
Branch: 1 branch
BranchTrueFalseTotal
if (() = splice(@to_iter, 0, 2)) 0 1 1
43 0 $asm->add_value($key, $value);
44 }
45 }
46  
47 # should be done ... elsewhere? -- rjbs, 2009-08-24
48 1 ▶ $asm->end_section if $asm->current_section;
Branch: 1 branch
BranchTrueFalseTotal
if $asm->current_section 1 0 1
49  
50 1 return $asm->sequence;
51 }
52  
53 51 __PACKAGE__->meta->make_immutable;
54 51 1;
55  
56 __END__
« blib/lib/Dist/Zilla/PluginBundle/Filter.pm ↑ Summary blib/lib/Dist/Zilla/App/Command/run.pm »