ZofCMS/Plugin/ConfigToTemplate.pm

filter: Statementstmt 40.0% 10 / 25 Branchbran 0.0% 0 / 6 Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 50.0% 3 / 6 Podpod n/a totaltotal 32.5% 13 / 40 CC 6 SCAR 31.6
CC
6
Cov
30%
_do
42.0
_key
2.0
_defaults
2.0
CRAP 23.5
« ZofCMS/Plugin/Base.pm ↑ Summary ZofCMS/Plugin/ConditionalRedirect.pm »
1 package App::ZofCMS::Plugin::ConfigToTemplate;
2  
3 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 our $VERSION = '1.001010'; # VERSION
7  
8 1 ▶use base 'App::ZofCMS::Plugin::Base';
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 0 ▶sub _key { 'plug_config_to_template' }
Subroutine _key: not called CC=1 SCAR=6.9
11 0 ▶sub _defaults {
Subroutine _defaults: not called CC=1 SCAR=6.9
12 return (
13 0 cell => 'd',
14 key => 'public_config',
15 config_cell => 'public_config',
16 config_keys => undef,
17 noop => 0,
18 );
19 }
20 0 ▶sub _do {
Subroutine _do: not called CC=6 SCAR=37.4
21 0 my ( $self, $conf, $t, $q, $config ) = @_;
22  
23 return
24 0 ▶ if $conf->{noop};
Branch: 1 branch
BranchTrueFalseTotal
if $conf->{"noop"} 0 0 0
25  
26 0 my $zcms_config = $config->conf;
27 0 my ( $cell, $key, $ccell, $ckeys ) = @$conf{ qw/cell key config_cell config_keys/ };
28  
29 0 my @keys;
30 0 ▶ if ( defined $ckeys ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $ckeys) { } 0 0 0
31 0 @keys = @$ckeys;
32 }
33 else {
34 0 ▶ @keys = keys %{ $zcms_config->{ $ccell } || {} };
Condition0%0/2
$zcms_config->{$ccell} || {}
l!l
00
MC/DC0%0/1
$zcms_config->{$ccell} || {}
$zcms_config->{$ccell}
Truth table0%0/2
A
A= $zcms_config->{$ccell}
Aresult
11
00
35 }
36  
37 0 for ( @keys ) {
38 0 ▶ if ( defined $key ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $key) { } 0 0 0
39 0 $t->{ $cell }{ $key }{ $_ } = $zcms_config->{ $ccell }{ $_ };
40 }
41 else {
42 0 $t->{ $cell }{ $_ } = $zcms_config->{ $ccell }{ $_ };
43 }
44 }
45 };
46  
47 __END__
« ZofCMS/Plugin/Base.pm ↑ Summary ZofCMS/Plugin/ConditionalRedirect.pm »