TextTemplate.pm

filter: Statementstmt 79.4% 27 / 34 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 80.0% 8 / 10 Podpod 100% 1 / 1 totaltotal 73.4% 36 / 49 CC 4 SCAR 14.6
CC
4
Cov
71%
_build_engine
12.0
render
6.0
BEGIN
1.0
CRAP 4.3
« TextTemplate/FakeEngine.pm ↑ Summary
1 package Dancer2::Template::TextTemplate;
2 # ABSTRACT: Text::Template engine for Dancer2
3  
4 1 ▶use 5.010_000;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 our $VERSION = '1.003'; # VERSION
9  
10 1 ▶use Carp 'croak';
Subroutine BEGIN: called CC=1 SCAR=0.0
11 1 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 1 ▶use Dancer2::Core::Types 'InstanceOf';
Subroutine BEGIN: called CC=1 SCAR=0.0
13 1 ▶use Dancer2::Template::TextTemplate::FakeEngine;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 1 ▶use namespace::clean;
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 1 with 'Dancer2::Core::Role::Template';
17  
18  
19 1 has '+engine' =>
20 ( isa => InstanceOf['Dancer2::Template::TextTemplate::FakeEngine'] );
21  
22 0 ▶sub _build_engine {
Subroutine _build_engine: not called CC=3 SCAR=24.8
23 0 my $self = shift;
24 0 my $engine = Dancer2::Template::TextTemplate::FakeEngine->new;
25 0 for (qw/ caching expires delimiters cache_stringrefs prepend /) {
26 0 ▶ $engine->$_($self->config->{$_}) if $self->config->{$_};
Branch: 1 branch
BranchTrueFalseTotal
if $self->config->{$_} 0 0 0
27 }
28 0 return $engine;
29 }
30  
31  
32 0 ▶sub render {
Subroutine render: not called CC=2 SCAR=17.9
Pod documented
33 0 my ( $self, $template, $tokens ) = @_;
34 0 ▶ $self->engine->process( $template, $tokens )
Branch: 1 branch
BranchTrueFalseTotal
$self->engine->process($template, $tokens) or croak($Dancer2::Template::TextTemplate::FakeEngine::ERROR) 0 0 0
35 or croak $Dancer2::Template::TextTemplate::FakeEngine::ERROR;
36 }
37  
38 1 1;
39  
40 __END__
« TextTemplate/FakeEngine.pm ↑ Summary