| 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
| |||||||||||||||||||||
| 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"}
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"}
| |||||||||||||||||||||
| 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) // ""
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)
| |||||||||||||||||||||
| 35 | } | ||||||||||||||||||||
| 36 | |||||||||||||||||||||
| 37 | 4421 | return join '', @$result; | |||||||||||||||||||
| 38 | } | ||||||||||||||||||||
| 39 | |||||||||||||||||||||
| 40 | 98 | 1; | |||||||||||||||||||