| 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
MC/DC0%0/2
ref $self || $self
ref $self
$self
Truth table0%0/3
A || B
A= ref $selfB= $self
| |||||||||||||||||||||
| 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
| |||||||||||||||||||||
| 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
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
| |||||||||||||||||||||
| 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
MC/DC0%0/2
ref $class || $class
ref $class
$class
Truth table0%0/3
A || B
A= ref $classB= $class
| |||||||||||||||||||||
| 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
MC/DC0%0/2
$Confman::DEFAULT ||= $self->new
$Confman::DEFAULT
$self->new
Truth table0%0/3
A ||= B
A= $Confman::DEFAULTB= $self->new
| |||||||||||||||||||||
| 43 | 0 | $DEFAULT; | |||||||||||||||||||
| 44 | } | ||||||||||||||||||||
| 45 | |||||||||||||||||||||
| 46 | 1 | 1; | |||||||||||||||||||
| 47 | __END__ | ||||||||||||||||||||