blib/lib/Log/Dispatch/Configurator/Perl.pm

filter: Statementstmt 96.0% 24 / 25 Branchbran 50.0% 2 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 88.8% 8 / 9 Podpod 0.0% 0 / 5 totaltotal 79.0% 34 / 43 CC 3 SCAR 3.9
CC
3
Cov
90%
get_attrs_global
2.1
exec_file
2.0
reload
2.0
CRAP 1.5
↑ Summary
1 package Log::Dispatch::Configurator::Perl;
2 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use Carp qw/croak/;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 3 ▶use parent 'Log::Dispatch::Configurator';
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 3 our $VERSION = '0.0132';
8  
9 2 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
Pod undocumented
10 2 my ($class, $file) = @_;
11  
12 2 my $self = bless { file => $file }, $class;
13 2 $self->exec_file;
14 2 return $self;
15 }
16  
17  
18 2 ▶sub exec_file {
Subroutine exec_file: called CC=2 SCAR=7.1
Pod undocumented
19 2 my $self = shift;
20  
21 my $config = do $self->{file}
22 2 ▶ or croak "could not load conf file: $self->{file}";
Branch: 1 branch
BranchTrueFalseTotal
my $config = do $self->{"file"} or croak(qq[could not load conf file: $self->{"file"}]) 2 0 2
23 2 $self->{'_config'} = $config;
24 }
25  
26  
27 0 ▶sub reload {
Subroutine reload: not called CC=1 SCAR=6.9
Pod undocumented
28 0 $_[0]->exec_file;
29 }
30  
31  
32 2 ▶sub get_attrs_global {
Subroutine get_attrs_global: called CC=2 SCAR=7.2
Pod undocumented
33 2 my $self = shift;
34  
35 +{
36 format => undef,
37 dispatchers => (exists $self->{'_config'}{'dispatchers'})
38 2 ▶ ? $self->{'_config'}{'dispatchers'} : [],
Branch: 1 branch
BranchTrueFalseTotal
exists $self->{'_config'}{'dispatchers'} ? : 2 0 2
39 };
40 }
41  
42  
43 4 ▶sub get_attrs {
Subroutine get_attrs: called CC=1 SCAR=0.0
Pod undocumented
44 4 $_[0]->{'_config'}{$_[1]};
45 }
46  
47 3 1;
48  
49 __END__
↑ Summary