OpenInteract2/Controller/ManageTemplates.pm

filter: Statementstmt 62.5% 15 / 24 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 57.1% 4 / 7 Podpod 0.0% 0 / 3 totaltotal 46.3% 19 / 41 CC 3 SCAR 15.9
CC
3
Cov
52%
add_template_used
12.0
init_templates
2.0
get_templates_used
2.0
CRAP 4.9
« OpenInteract2/Manage/Website/Create.pm ↑ Summary OpenInteract2/Setup/RegisterRequestAndResponse.pm »
1 package OpenInteract2::Controller::ManageTemplates;
2  
3 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use Log::Log4perl qw( get_logger );
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use OpenInteract2::Constants qw( :log );
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 ▶use OpenInteract2::Context qw( CTX );
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 2 $OpenInteract2::Controller::MangeTemplates::VERSION = sprintf("%d.%02d", q$Revision: 1.10 $ =~ /(\d+)\.(\d+)/);
9  
10 2 my ( $log );
11  
12 0 ▶sub init_templates {
Subroutine init_templates: not called CC=1 SCAR=6.9
Pod undocumented
13 0 my ( $self ) = @_;
14 0 $self->{_template_used} = [];
15 }
16  
17 ########################################
18 # TEMPLATES USED
19  
20 0 ▶sub add_template_used {
Subroutine add_template_used: not called CC=3 SCAR=24.8
Pod undocumented
21 0 my ( $self, $name ) = @_;
22 0 ▶ $log ||= get_logger( LOG_ACTION );
Condition0%0/3
$log ||= get_logger("OI2.ACTION")
l!l&&r!l&&!r
000
MC/DC0%0/2
$log ||= get_logger("OI2.ACTION")
$log get_logger("OI2.ACTION")
Truth table0%0/3
A ||= B
A= $logB= get_logger("OI2.ACTION")
ABresult
1X1
011
000
23 0 ▶ $log->is_debug &&
Branch: 1 branch
BranchTrueFalseTotal
$log->is_debug and $log->debug("Adding template [$name] list of those used") 0 0 0
24 $log->debug( "Adding template [$name] list of those used" );
25 0 return push @{ $self->{_template_used} }, $name;
26 }
27  
28 0 ▶sub get_templates_used {
Subroutine get_templates_used: not called CC=1 SCAR=6.9
Pod undocumented
29 0 my ( $self ) = @_;
30 0 return $self->{_template_used};
31 }
32  
33 2 1;
34  
35 __END__
« OpenInteract2/Manage/Website/Create.pm ↑ Summary OpenInteract2/Setup/RegisterRequestAndResponse.pm »