lib/Module/Install/AutoInstall.pm

filter: Statementstmt 26.0% 13 / 50 Branchbran 0.0% 0 / 16 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 40.0% 4 / 10 Podpod 0.0% 0 / 6 totaltotal 20.7% 17 / 82 CC 9 SCAR 38.2
CC
9
Cov
20%
auto_install
90.0
AutoInstall
2.0
run
2.0
CRAP 45.8
« lib/Module/Install/Admin/Bundle.pm ↑ Summary lib/Module/Install/Admin/Metadata.pm »
1 package Module::Install::AutoInstall;
2  
3 46 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 46 ▶use Module::Install::Base ();
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 46 ▶use vars qw{$VERSION @ISA $ISCORE};
Subroutine BEGIN: called CC=1 SCAR=0.0
7 46 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
8 46 $VERSION = '1.21';
9 46 @ISA = 'Module::Install::Base';
10 46 $ISCORE = 1;
11 }
12  
13 0 ▶sub AutoInstall { $_[0] }
Subroutine AutoInstall: not called CC=1 SCAR=6.9
Pod undocumented
14  
15 0 ▶sub run {
Subroutine run: not called CC=1 SCAR=6.9
Pod undocumented
16 0 my $self = shift;
17 0 $self->auto_install_now(@_);
18 }
19  
20 0 ▶sub write {
Subroutine write: not called CC=1 SCAR=6.9
Pod undocumented
21 0 my $self = shift;
22 0 $self->auto_install(@_);
23 }
24  
25 0 ▶sub auto_install {
Subroutine auto_install: not called CC=9 SCAR=45.0
Pod undocumented
26 0 my $self = shift;
27 0 ▶ return if $self->{done}++;
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"done"}++ 0 0 0
28  
29 # Flatten array of arrays into a single array
30 0 my @core = map @$_, map @$_, grep ref,
31 $self->build_requires, $self->requires;
32  
33 0 my @config = @_;
34  
35 # We'll need Module::AutoInstall
36 0 $self->include('Module::AutoInstall');
37 0 require Module::AutoInstall;
38  
39 0 ▶ my @features_require = Module::AutoInstall->import(
Branch: 2 branches
BranchTrueFalseTotal
@config ? : 0 0 0
@core ? : 0 0 0
40 (@config ? (-config => \@config) : ()),
41 (@core ? (-core => \@core) : ()),
42 $self->features,
43 );
44  
45 0 my %seen;
46 0 my @requires = map @$_, map @$_, grep ref, $self->requires;
47 0 ▶ while (my ($mod, $ver) = splice(@requires, 0, 2)) {
Branch: 1 branch
BranchTrueFalseTotal
if (() = splice(@requires, 0, 2)) 0 0 0
48 0 $seen{$mod}{$ver}++;
49 }
50 0 my @build_requires = map @$_, map @$_, grep ref, $self->build_requires;
51 0 ▶ while (my ($mod, $ver) = splice(@build_requires, 0, 2)) {
Branch: 1 branch
BranchTrueFalseTotal
if (() = splice(@build_requires, 0, 2)) 0 0 0
52 0 $seen{$mod}{$ver}++;
53 }
54 0 my @configure_requires = map @$_, map @$_, grep ref, $self->configure_requires;
55 0 ▶ while (my ($mod, $ver) = splice(@configure_requires, 0, 2)) {
Branch: 1 branch
BranchTrueFalseTotal
if (() = splice(@configure_requires, 0, 2)) 0 0 0
56 0 $seen{$mod}{$ver}++;
57 }
58  
59 0 my @deduped;
60 0 ▶ while (my ($mod, $ver) = splice(@features_require, 0, 2)) {
Branch: 1 branch
BranchTrueFalseTotal
if (() = splice(@features_require, 0, 2)) 0 0 0
61 0 ▶ push @deduped, $mod => $ver unless $seen{$mod}{$ver}++;
Branch: 1 branch
BranchTrueFalseTotal
unless $seen{$mod}{$ver}++ 0 0 0
62 }
63  
64 0 $self->requires(@deduped);
65  
66 0 $self->makemaker_args( Module::AutoInstall::_make_args() );
67  
68 0 my $class = ref($self);
69 0 $self->postamble(
70 "# --- $class section:\n" .
71 Module::AutoInstall::postamble()
72 );
73 }
74  
75 0 ▶sub installdeps_target {
Subroutine installdeps_target: not called CC=1 SCAR=6.9
Pod undocumented
76 0 my ($self, @args) = @_;
77  
78 0 $self->include('Module::AutoInstall');
79 0 require Module::AutoInstall;
80  
81 0 Module::AutoInstall::_installdeps_target(1);
82  
83 0 $self->auto_install(@args);
84 }
85  
86 0 ▶sub auto_install_now {
Subroutine auto_install_now: not called CC=1 SCAR=6.9
Pod undocumented
87 0 my $self = shift;
88 0 $self->auto_install(@_);
89 0 Module::AutoInstall::do_install();
90 }
91  
92 46 1;
« lib/Module/Install/Admin/Bundle.pm ↑ Summary lib/Module/Install/Admin/Metadata.pm »