Pickles/View.pm

filter: Statementstmt 85.7% 24 / 28 Branchbran 100% 4 / 4 Conditioncond 50.0% 2 / 4 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 71.4% 5 / 7 Podpod 0.0% 0 / 5 totaltotal 70.0% 35 / 50 CC 5 SCAR 9.0
CC
5
Cov
83%
config
4.0
merge_config
2.0
new
2.0
CRAP 2.5
« Pickles/Container.pm ↑ Summary Pickles/WebApp.pm »
1 package Pickles::View;
2 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 3 ▶use base qw(Class::Data::Inheritable);
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 3 __PACKAGE__->mk_classdata(qw(__Config));
6  
7 0 ▶sub new {
Subroutine new: not called CC=1 SCAR=6.9
Pod undocumented
8 0 my $class = shift;
9 0 my $self = bless {}, $class;
10 0 $self;
11 }
12  
13 0 ▶sub render { die 'abstract method!'; }
Subroutine render: not called CC=1 SCAR=6.9
Pod undocumented
14 2 ▶sub content_type { 'text/html'; }
Subroutine content_type: called CC=1 SCAR=0.0
Pod undocumented
15  
16 6 ▶sub config {
Subroutine config: called CC=4 SCAR=13.9
Pod undocumented
17 6 my $class = shift;
18 6 ▶ return ($class->__Config || {}) unless @_;
Branch: 1 branch
BranchTrueFalseTotal
unless @_ 2 4 6
Condition50%1/2
$class->__Config || {}
l!l
20
MC/DC0%0/1
$class->__Config || {}
$class->__Config
Truth table50%1/2
A
A= $class->__Config
Aresult
11
00
19 4 my $values = $_[0];
20 4 ▶ if ( @_ > 1 ) {
Branch: 1 branch
BranchTrueFalseTotal
if (@_ > 1) 2 2 4
21 2 $values = { @_ };
22 }
23 4 $class->__Config( $values );
24 }
25  
26 2 ▶sub merge_config {
Subroutine merge_config: called CC=2 SCAR=6.9
Pod undocumented
27 2 my( $self, $c ) = @_;
28  
29 2 my $class = ref $self;
30 2 my $appname = $c->config->appname;
31 2 (my $config_key = $class) =~ s/^${appname}:://;
32 2 ▶ my $config = $c->config->{$config_key} || {};
Condition50%1/2
$c->config->{$config_key} || {}
l!l
20
MC/DC0%0/1
$c->config->{$config_key} || {}
$c->config->{$config_key}
Truth table50%1/2
A
A= $c->config->{$config_key}
Aresult
11
00
33 my %config = (
34 2 %{$self->config},
35 2 %{$config},
36 );
37 2 return \%config;
38 }
39  
40 3 1;
41  
42 __END__
« Pickles/Container.pm ↑ Summary Pickles/WebApp.pm »