blib/lib/DTL/Fast/Renderer.pm

filter: Statementstmt 100% 30 / 30 Branchbran 100% 2 / 2 Conditioncond 80.0% 4 / 5 MC/DCmcdc 66.6% 2 / 3 Subroutinesub 100% 8 / 8 Podpod 0.0% 0 / 3 totaltotal 90.2% 46 / 51 SCAR 16.1
CC
5
Cov
97%
render
4.0
add_chunk
2.0
BEGIN
1.0
CRAP 5.0
« blib/lib/DTL/Fast/Tag/Widthratio.pm ↑ Summary blib/lib/DTL/Fast/Filter/Pluralize.pm »
1 package DTL::Fast::Renderer;
2 98 ▶use strict; use utf8; use warnings FATAL => 'all';
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
3 98 ▶use parent 'DTL::Fast::Replacer';
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 98 ▶use DTL::Fast::Context;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 sub new
8 {
9 3344 ▶ my( $proto, %kwargs ) = @_;
Subroutine new: called CC=1 SCAR=0.0
Pod undocumented
10  
11 3344 $kwargs{'chunks'} = [];
12
13 3344 return $proto->SUPER::new(%kwargs);
14 }
15  
16 sub add_chunk
17 {
18 6671 ▶ my( $self, $chunk ) = @_;
Subroutine add_chunk: called CC=2 SCAR=6.9
Pod undocumented
19
20 6671 ▶ push @{$self->{'chunks'}}, $chunk if defined $chunk;
Branch: 1 branch
BranchTrueFalseTotal
if defined $chunk 3810 2861 6671
21 6671 return $self;
22 }
23  
24 sub render
25 {
26 4454 ▶ my( $self, $context, $global_safe ) = @_;
Subroutine render: called CC=4 SCAR=13.9
Pod undocumented
27  
28 4454 ▶ $global_safe ||= $context->{'ns'}->[-1]->{'_dtl_safe'};
Condition66%2/3
$global_safe ||= $context->{"ns"}[-1]{"_dtl_safe"}
l!l&&r!l&&!r
0214433
MC/DC50%1/2
$global_safe ||= $context->{"ns"}[-1]{"_dtl_safe"}
$global_safe $context->{"ns"}[-1]{"_dtl_safe"}
Truth table66%2/3
A ||= B
A= $global_safeB= $context->{"ns"}[-1]{"_dtl_safe"}
ABresult
1X1
011
000
29
30 4454 my $result = [];
31
32 4454 foreach my $chunk (@{$self->{'chunks'}})
33 {
34 6122 ▶ push @$result, $chunk->render($context, $global_safe) // '';
Condition100%2/2
$chunk->render($context, $global_safe) // ""
l!l
60836
MC/DC100%1/1
$chunk->render($context, $global_safe) // ""
$chunk->render($context, $global_safe)
Truth table100%2/2
A
A= $chunk->render($context, $global_safe)
Aresult
11
00
35 }
36
37 4421 return join '', @$result;
38 }
39  
40 98 1;
« blib/lib/DTL/Fast/Tag/Widthratio.pm ↑ Summary blib/lib/DTL/Fast/Filter/Pluralize.pm »