Cinnamon/Role.pm

filter: Statementstmt 100% 24 / 24 Branchbran 100% 4 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod 0.0% 0 / 2 totaltotal 94.5% 35 / 37 CC 3 SCAR 5.1
CC
3
Cov
100%
get_hosts
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.7
« Cinnamon/Config/Loader.pm ↑ Summary Cinnamon/DSL.pm »
1 package Cinnamon::Role;
2 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 4 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 4 ▶use Hash::MultiValue;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 4 has name => (is => 'ro', required => 1);
9 4 has hosts => (is => 'ro', required => 1);
10 3 ▶has params => (is => 'ro', default => sub { Hash::MultiValue->new });
Subroutine __ANON__: called CC=1 SCAR=0.0
11  
12 22 ▶sub get_hosts {
Subroutine get_hosts: called CC=3 SCAR=11.0
Pod undocumented
13 22 my ($self) = @_;
14 22 my $hosts = $self->hosts;
15 22 ▶ if (ref $hosts eq 'CODE') {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $hosts eq "CODE") 2 20 22
16 2 return $hosts->();
17 }
18 20 ▶ return ref $hosts eq 'ARRAY' ? $hosts : [$hosts];
Branch: 1 branch
BranchTrueFalseTotal
ref $hosts eq 'ARRAY' ? : 1 19 20
19 }
20  
21 1 ▶sub info {
Subroutine info: called CC=1 SCAR=0.0
Pod undocumented
22 1 my ($self) = @_;
23 return +{
24 1 hosts => $self->get_hosts,
25 params => $self->params->as_hashref,
26 };
27 }
28  
29 4 1;
« Cinnamon/Config/Loader.pm ↑ Summary Cinnamon/DSL.pm »