CGI/Builder/Conf.pm

filter: Statementstmt 100% 34 / 34 Branchbran 66.6% 4 / 6 Conditioncond 33.3% 2 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 100% 8 / 8 Podpod n/a totaltotal 82.7% 48 / 58 CC 8 SCAR 12.9
CC
8
Cov
87%
default
6.6
__ANON__
3.0
BEGIN
1.0
CRAP 3.6
« CGI/Builder.pm ↑ Summary Bundle/CGI/Builder/Complete.pm »
1 1 ▶use strict ;
Subroutine BEGIN: called CC=1 SCAR=0.0
2  
3 # This file uses the "Perlish" coding style
4 # please read http://perl.4pro.net/perlish_coding_style.html
5  
6 ; package CGI::Builder::Conf
7 ; use Carp
8 1 ▶; $Carp::Internal{+__PACKAGE__}++
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ; $Carp::Internal{__PACKAGE__.'::_'}++
10 ; use IO::Util
11  
12  
13 1 ▶; use Class::constr
Subroutine BEGIN: called CC=1 SCAR=0.0
14 1 ▶ { default => \&CGI::Builder::Conf::_::default
Subroutine BEGIN: called CC=1 SCAR=0.0
15 , init => \&CGI::Builder::_::init
16 , no_strict => 1
17 }
18  
19 1 ; use Class::groups
20 1 ▶ ( { name => 'conf_mml_options'
Subroutine BEGIN: called CC=1 SCAR=0.0
21 , default => { optional => 1
22 , filter => { qr/.+/ => 'TRIM_BLANKS' }
23 }
24 }
25 )
26  
27 1 ; *conf_option = \&conf_mml_options
28
29 1 ▶; use Object::props 'conf_file'
Subroutine BEGIN: called CC=1 SCAR=0.0
30  
31 1 ; sub CGI::Builder::Conf::_::default
32 2 ▶ { my ($s, %args) = @_
Subroutine default: called CC=6 SCAR=18.8
33 2 ▶ ; my $file = $args{conf_file} || $s->conf_file or return {}
Branch: 1 branch
BranchTrueFalseTotal
my $file = $args{"conf_file"} || $s->conf_file or return {} 2 0 2
Condition33%1/3
$args{'conf_file'} || $s->conf_file
l!l&&r!l&&!r
200
MC/DC0%0/2
$args{'conf_file'} || $s->conf_file
$args{'conf_file'} $s->conf_file
Truth table33%1/3
A || B
A= $args{'conf_file'}B= $s->conf_file
ABresult
1X1
011
000
34 2 ▶ ; my $opt = $args{conf_mml_options} || $s->conf_mml_options
Condition33%1/3
$args{'conf_mml_options'} || $s->conf_mml_options
l!l&&r!l&&!r
020
MC/DC0%0/2
$args{'conf_mml_options'} || $s->conf_mml_options
$args{'conf_mml_options'} $s->conf_mml_options
Truth table33%1/3
A || B
A= $args{'conf_mml_options'}B= $s->conf_mml_options
ABresult
1X1
011
000
35 2 ; my (%defaults, $sub)
36 ; $sub = sub
37 3 ▶ { my ($res, $h) = @_
Subroutine __ANON__: called CC=3 SCAR=11.1
38 3 ; foreach my $k ( keys %$h )
39 { $$res{$k} = ref $$h{$k} eq 'HASH'
40 ? $sub->($$res{$k}, $$h{$k})
41 6 ▶ : $$h{$k}
Branch: 1 branch
BranchTrueFalseTotal
ref $h->{$k} eq 'HASH' ? : 0 6 6
42 }
43 3 ; $res
44 }
45 2 ▶ ; foreach my $conf ( ref $file eq 'ARRAY' ? @$file : $file )
Branch: 1 branch
BranchTrueFalseTotal
ref $file eq 'ARRAY' ? : 1 1 2
46 3 { $sub->( \%defaults, IO::Util::load_mml( $conf, $opt ) )
47 }
48 2 ; \%defaults
49 }
50  
51 1 ; 1
52  
53 __END__
« CGI/Builder.pm ↑ Summary Bundle/CGI/Builder/Complete.pm »