blib/lib/Module/Setup/Flavor/SelectVC.pm

filter: Statementstmt 100% 28 / 28 Branchbran 100% 10 / 10 Conditioncond 100% 12 / 12 MC/DCmcdc 100% 7 / 7 Subroutinesub 100% 4 / 4 Podpod 0.0% 0 / 1 totaltotal 98.3% 61 / 62 CC 11 SCAR 21.8
CC
11
Cov
100%
setup_config
11.0
BEGIN
1.0
BEGIN
1.0
CRAP 8.9
« blib/lib/Module/Setup/Devel.pm ↑ Summary blib/lib/Module/Setup.pm »
1 package Module::Setup::Flavor::SelectVC;
2 18 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 18 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 18 ▶use base 'Module::Setup::Flavor';
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 sub setup_config {
7 38 ▶ my($self, $context, $config) = @_;
Subroutine setup_config: called CC=11 SCAR=24.0
Pod undocumented
8  
9 38 my %vcs = (
10 SVN => 'VC::SVN',
11 SVK => 'VC::SVK',
12 Git => 'VC::Git',
13 );
14  
15 38 for my $name (qw/ SVN SVK Git /) {
16 114 my $pkg = $vcs{$name};
17 114 ▶ next unless $context->dialog("Do you use $name? [yN]", 'n') =~ /[Yy]/;
Branch: 1 branch
BranchTrueFalseTotal
unless $context->dialog("Do you use $name? [yN]", "n") =~ /[Yy]/ 103 11 114
18 11 $context->log("You chose version control system: $name");
19  
20 next if grep {
21 18 ▶ ( ref($_) eq 'HASH' && $_->{module} eq $pkg) || $_ eq $pkg
Branch: 1 branch
BranchTrueFalseTotal
ref $_ eq "HASH" and $_->{"module"} eq $pkg or $_ eq $pkg 17 1 18
Condition100%3/3
ref $_ eq "HASH" and $_->{"module"} eq $pkg
!ll&&!rl&&r
1521
MC/DC100%2/2
ref $_ eq "HASH" and $_->{"module"} eq $pkg
ref $_ eq "HASH" $_->{"module"} eq $pkg
Truth table100%3/3
A and B
A= ref $_ eq "HASH"B= $_->{"module"} eq $pkg
ABresult
0X0
100
111
22 11 ▶ } @{ $config->{plugins} };
Branch: 1 branch
BranchTrueFalseTotal
if grep {ref $_ eq "HASH" and $_->{"module"} eq $pkg or $_ eq $pkg;} @{$$config{"plugins"};} 4 7 11
23  
24 7 push @{ $config->{plugins} }, $pkg;
25 }
26  
27 38 ▶ if(grep {
Branch: 1 branch
BranchTrueFalseTotal
if (grep {ref $_ eq "HASH" and $_->{"module"} eq "VC::SVK" or $_ eq "VC::SVK";} @{$$config{"plugins"};}) 6 32 38
28 137 ▶ ( ref($_) eq 'HASH' && $_->{module} eq 'VC::SVK') || $_ eq 'VC::SVK'
Branch: 1 branch
BranchTrueFalseTotal
ref $_ eq "HASH" and $_->{"module"} eq "VC::SVK" or $_ eq "VC::SVK" 136 1 137
Condition100%3/3
ref $_ eq "HASH" and $_->{"module"} eq "VC::SVK"
!ll&&!rl&&r
13421
MC/DC100%2/2
ref $_ eq "HASH" and $_->{"module"} eq "VC::SVK"
ref $_ eq "HASH" $_->{"module"} eq "VC::SVK"
Truth table100%3/3
A and B
A= ref $_ eq "HASH"B= $_->{"module"} eq "VC::SVK"
ABresult
0X0
100
111
29 38 } @{ $config->{plugins} }) {
30 my @plugins = grep {
31 17 ▶ !(( ref($_) eq 'HASH' && $_->{module} eq 'VC::SVN') || $_ eq 'VC::SVN')
Condition100%6/6
ref $_ eq 'HASH' && $_->{'module'} eq 'VC::SVN' || $_ eq 'VC::SVN'
l!l&&r!l&&!r
1313
ref $_ eq "HASH" and $_->{"module"} eq "VC::SVN"
!ll&&!rl&&r
1511
MC/DC100%3/3
ref $_ eq 'HASH' && $_->{'module'} eq 'VC::SVN' || $_ eq 'VC::SVN'
ref $_ eq "HASH" $_->{"module"} eq "VC::SVN" $_ eq 'VC::SVN'
Truth table80%4/5
A and B || C
A= ref $_ eq "HASH"B= $_->{"module"} eq "VC::SVN"C= $_ eq 'VC::SVN'
ABCresult
11X1
0X11
1011
0X00
1000
32 6 } @{ $config->{plugins} };
33 6 $config->{plugins} = \@plugins;
34 }
35  
36 }
37  
38 18 1;
39  
40 =head1
41  
42 Module::Setup::Flavor::SelectVC - select version control system logic
43  
44 =head1 SYNOPSIS
45  
46 package YourFlavor;
47 use base 'Module::Setup::Flavor::SelectVC';
48 1;
49
50 __DATA__
51
52 ---
53 file: foo
54 template: bar
55
56 ...
57  
58 =cut
59  
« blib/lib/Module/Setup/Devel.pm ↑ Summary blib/lib/Module/Setup.pm »