CCfnX/Deployment.pm

filter: Statementstmt 42.4% 14 / 33 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 12 MC/DCmcdc 0.0% 0 / 6 Subroutinesub 16.6% 2 / 12 Podpod 0.0% 0 / 6 totaltotal 21.9% 16 / 73 CC 8 SCAR 20.3
CC
8
Cov
29%
get_params_from_origin
20.0
output
12.0
new_with_roles
6.0
CRAP 7.6
« CCfnX/PersistentDeployment.pm ↑ Summary CCfnX/MakeAMI.pm »
1 15 package CCfnX::Deployment {
2 15 ▶ use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 15 ▶ use Module::Runtime qw/use_module/;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 15 has origin => (is => 'rw', isa => 'CCfn');
6 0 ▶ has name => (is => 'rw', isa => 'Str', required => 1, lazy => 1, default => sub { $_[0]->origin->params->name });
Subroutine __ANON__: not called CC=1 SCAR=1.2
7 has type => (
8 is => 'rw',
9 isa => 'Str',
10 required => 1,
11 lazy => 1,
12 clearer => 'clear_type',
13 0 ▶ default => sub { $_[0]->origin->meta->name }
Subroutine __ANON__: not called CC=1 SCAR=6.9
14 15 );
15 0 ▶ has account => (is => 'rw', isa => 'Str', required => 1, lazy => 1, default => sub { (defined $_[0]->origin)?$_[0]->origin->params->account:$ENV{CPSD_AWS_ACCOUNT} });
Subroutine __ANON__: not called CC=2 SCAR=13.0
Branch: 1 branch
BranchTrueFalseTotal
defined $_[0]->origin ? : 0 0 0
16 15 has outputs => (is => 'rw', isa => 'HashRef');
17 0 ▶ has params => (is => 'rw', isa => 'HashRef', lazy => 1, default => sub { $_[0]->get_params_from_origin });
Subroutine __ANON__: not called CC=1 SCAR=1.2
18  
19 0 ▶ sub get_params_from_origin {
Subroutine get_params_from_origin: not called CC=4 SCAR=30.0
Pod undocumented
20 0 my $params = $_[0]->origin->params;
21 0 my @attrs = map { $_->name } $params->meta->get_all_attributes;
22 0 my %p = map { $_ => $params->$_ } grep {
23 0 ▶ $_ ne 'ARGV'
Condition0%0/9
$_ ne 'ARGV' && $_ ne 'extra_argv' && $_ ne 'help_flag' && $_ ne 'usage'
!ll&&!rl&&r
000
$_ ne "ARGV" and $_ ne "extra_argv" and $_ ne "help_flag"
!ll&&!rl&&r
000
$_ ne "ARGV" and $_ ne "extra_argv"
!ll&&!rl&&r
000
MC/DC0%0/4
$_ ne 'ARGV' && $_ ne 'extra_argv' && $_ ne 'help_flag' && $_ ne 'usage'
$_ ne "ARGV" $_ ne "extra_argv" $_ ne "help_flag" $_ ne 'usage'
Truth table0%0/5
A and B and C && D
A= $_ ne "ARGV"B= $_ ne "extra_argv"C= $_ ne "help_flag"D= $_ ne 'usage'
ABCDresult
0XXX0
10XX0
110X0
11100
11111
24 and $_ ne 'extra_argv'
25 and $_ ne 'help_flag'
26 and $_ ne 'usage'
27 } @attrs;
28 0 return \%p;
29 }
30  
31 0 ▶ sub output {
Subroutine output: not called CC=3 SCAR=24.8
Pod undocumented
32 0 my ($self, $name) = @_;
33 0 ▶ die "Output $name not found in " . $self->name if (not defined $self->outputs or not defined $self->outputs->{ $name });
Branch: 1 branch
BranchTrueFalseTotal
unless defined $self->outputs and defined $self->outputs->{$name} 0 0 0
Condition0%0/3
defined $self->outputs and defined $self->outputs->{$name}
!ll&&!rl&&r
000
MC/DC0%0/2
defined $self->outputs and defined $self->outputs->{$name}
defined $self->outputs defined $self->outputs->{$name}
Truth table0%0/3
A and B
A= defined $self->outputsB= defined $self->outputs->{$name}
ABresult
0X0
100
111
34 0 return $self->outputs->{ $name };
35 }
36  
37 0 ▶ sub undeploy { }
Subroutine undeploy: not called CC=1 SCAR=0.0
Pod undocumented
38  
39 0 ▶ sub redeploy { }
Subroutine redeploy: not called CC=1 SCAR=0.0
Pod undocumented
40  
41 0 ▶ sub deploy { }
Subroutine deploy: not called CC=1 SCAR=0.0
Pod undocumented
42  
43 0 ▶ sub new_with_roles {
Subroutine new_with_roles: not called CC=2 SCAR=17.9
Pod undocumented
44 0 my ($class, $params, @roles) = @_;
45 0 use_module($_) for (@roles);
46 0 my $new_class = Moose::Util::with_traits('CCfnX::Deployment', @roles);
47 0 my $dep = $new_class->new(%$params);
48 0 return $dep;
49 }
50 }
51  
52 15 1;
« CCfnX/PersistentDeployment.pm ↑ Summary CCfnX/MakeAMI.pm »