Confman.pm

filter: Statementstmt 44.1% 15 / 34 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 12 MC/DCmcdc 0.0% 0 / 8 Subroutinesub 44.4% 4 / 9 Podpod 0.0% 0 / 4 totaltotal 27.5% 19 / 69 CC 6 SCAR 15.6
CC
6
Cov
31%
load_conf_set
8.2
api
6.0
new
6.0
CRAP 4.8
« Confman/API.pm ↑ Summary
1 package Confman;
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 ▶use Confman::API;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 our $VERSION = '0.04';
9 1 our $DEFAULT;
10  
11 0 ▶sub load_conf_set {
Subroutine load_conf_set: not called CC=3 SCAR=21.1
Pod undocumented
12 0 my $self = shift;
13  
14 0 my $getter = shift;
15 0 my $conf_set_name = shift;
16  
17 0 my $conf_set = $self->api->find_by_name($conf_set_name);
18 {
19 0 ▶ my $class = ref($self) || $self;
Condition0%0/3
ref $self || $self
l!l&&r!l&&!r
000
MC/DC0%0/2
ref $self || $self
ref $self $self
Truth table0%0/3
A || B
A= ref $selfB= $self
ABresult
1X1
011
000
20 1 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
21 0 ▶ *{$class.'::'.$getter} = sub { $conf_set; };
Subroutine __ANON__: not called CC=1 SCAR=6.9
22 }
23 0 ▶ return $conf_set ? $conf_set->pairs : undef;
Branch: 1 branch
BranchTrueFalseTotal
$conf_set ? : 0 0 0
24 }
25  
26 0 ▶sub api {
Subroutine api: not called CC=2 SCAR=17.9
Pod undocumented
27 0 my $self = shift;
28 0 ▶ $self->{_api} ||= Confman::API->new->load_config;
Condition0%0/3
$self->{"_api"} ||= "Confman::API"->new->load_config
l!l&&r!l&&!r
000
MC/DC0%0/2
$self->{"_api"} ||= "Confman::API"->new->load_config
$self->{"_api"} "Confman::API"->new->load_config
Truth table0%0/3
A ||= B
A= $self->{"_api"}B= "Confman::API"->new->load_config
ABresult
1X1
011
000
29 0 return $self->{_api};
30 }
31  
32 0 ▶sub new {
Subroutine new: not called CC=2 SCAR=17.9
Pod undocumented
33 0 my $class = shift;
34 0 ▶ my $self = bless({}, ref($class) || $class);
Condition0%0/3
ref $class || $class
l!l&&r!l&&!r
000
MC/DC0%0/2
ref $class || $class
ref $class $class
Truth table0%0/3
A || B
A= ref $classB= $class
ABresult
1X1
011
000
35  
36 0 $self;
37 }
38  
39 0 ▶sub default {
Subroutine default: not called CC=2 SCAR=17.9
Pod undocumented
40 0 my $self = shift;
41  
42 0 ▶ $DEFAULT ||= $self->new();
Condition0%0/3
$Confman::DEFAULT ||= $self->new
l!l&&r!l&&!r
000
MC/DC0%0/2
$Confman::DEFAULT ||= $self->new
$Confman::DEFAULT $self->new
Truth table0%0/3
A ||= B
A= $Confman::DEFAULTB= $self->new
ABresult
1X1
011
000
43 0 $DEFAULT;
44 }
45  
46 1 1;
47 __END__
« Confman/API.pm ↑ Summary