lib/Module/Install/MakeMaker.pm

filter: Statementstmt 80.5% 29 / 36 Branchbran 42.8% 6 / 14 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 7 / 7 Podpod 0.0% 0 / 1 totaltotal 68.2% 43 / 63 CC 10 SCAR 25.8
CC
10
Cov
68%
WriteMakefile
22.4
END
2.0
BEGIN
1.0
CRAP 13.1
« lib/Module/Install/WriteAll.pm ↑ Summary lib/Module/Install/Win32.pm »
1 package Module::Install::MakeMaker;
2  
3 46 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 46 ▶use ExtUtils::MakeMaker ();
Subroutine BEGIN: called CC=1 SCAR=0.0
5 46 ▶use Module::Install::Base ();
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 46 ▶use vars qw{$VERSION @ISA $ISCORE};
Subroutine BEGIN: called CC=1 SCAR=0.0
8 46 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
9 46 $VERSION = '1.21';
10 46 @ISA = 'Module::Install::Base';
11 46 $ISCORE = 1;
12 }
13  
14 46 my $makefile = undef;
15  
16 1 ▶sub WriteMakefile {
Subroutine WriteMakefile: called CC=9 SCAR=31.1
Pod undocumented
17 1 my ($self, %args) = @_;
18 1 $makefile = $self->load('Makefile');
19  
20 # mapping between MakeMaker and META.yml keys
21 1 $args{MODULE_NAME} = $args{NAME};
22 1 ▶ unless ( $args{NAME} = $args{DISTNAME} or ! $args{MODULE_NAME} ) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($args{"NAME"} = $args{"DISTNAME"} or not $args{"MODULE_NAME"}) 0 1 1
Condition33%1/3
$args{"NAME"} = $args{"DISTNAME"} or not $args{"MODULE_NAME"}
l!l&&r!l&&!r
010
MC/DC0%0/2
$args{"NAME"} = $args{"DISTNAME"} or not $args{"MODULE_NAME"}
$args{"NAME"} = $args{"DISTNAME"} not $args{"MODULE_NAME"}
Truth table33%1/3
A or not(B)
A= $args{"NAME"} = $args{"DISTNAME"}B= not $args{"MODULE_NAME"}
ABresult
1X1
011
000
23 0 $args{NAME} = $args{MODULE_NAME};
24 0 $args{NAME} =~ s/::/-/g;
25 }
26  
27 1 foreach my $key ( qw{name module_name version version_from abstract author installdirs} ) {
28 7 ▶ my $value = delete($args{uc($key)}) or next;
Branch: 1 branch
BranchTrueFalseTotal
my $value = delete $args{uc $key} or next 0 7 7
29 0 $self->$key($value);
30 }
31  
32 1 ▶ if (my $prereq = delete($args{PREREQ_PM})) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $prereq = delete $args{"PREREQ_PM"}) 0 1 1
33 0 ▶ while (my($k,$v) = each %$prereq) {
Branch: 1 branch
BranchTrueFalseTotal
if (() = each %$prereq) 0 0 0
34 0 $self->requires($k,$v);
35 }
36 }
37  
38 1 ▶ if (my $prereq = delete($args{BUILD_REQUIRES})) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $prereq = delete $args{"BUILD_REQUIRES"}) 0 1 1
39 0 ▶ while (my($k,$v) = each %$prereq) {
Branch: 1 branch
BranchTrueFalseTotal
if (() = each %$prereq) 0 0 0
40 0 $self->build_requires($k,$v);
41 }
42 }
43  
44 # put the remaining args to makemaker_args
45 1 $self->makemaker_args(%args);
46 }
47  
48 46 ▶END {
Subroutine END: called CC=2 SCAR=6.9
49 46 ▶ if ( $makefile ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($makefile) 1 45 46
50 1 $makefile->write;
51 1 $makefile->Meta->write;
52 }
53 }
54  
55 46 1;
« lib/Module/Install/WriteAll.pm ↑ Summary lib/Module/Install/Win32.pm »