blib/lib/DTL/Fast/Tag/Verbatim.pm

filter: Statementstmt 96.8% 31 / 32 Branchbran 100% 4 / 4 Conditioncond 100% 2 / 2 MC/DCmcdc 100% 1 / 1 Subroutinesub 88.8% 8 / 9 Podpod 0.0% 0 / 4 totaltotal 88.4% 46 / 52 SCAR 13.9
CC
4
Cov
97%
parse_next_chunk
3.0
get_close_tag
2.0
parse_parameters
2.0
CRAP 4.0
« blib/lib/DTL/Fast/Filter/Stringformat.pm ↑ Summary blib/lib/DTL/Fast/Replacer/Replacement.pm »
1 package DTL::Fast::Tag::Verbatim;
2 3 ▶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 3 ▶use parent 'DTL::Fast::Tag';
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 $DTL::Fast::TAG_HANDLERS{'verbatim'} = __PACKAGE__;
5  
6 3 ▶use DTL::Fast::Text;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 #@Override
9 0 ▶sub get_close_tag{return 'endverbatim';}
Subroutine get_close_tag: not called CC=1 SCAR=6.9
Pod undocumented
10  
11 #@Override
12 sub parse_parameters
13 {
14 22 ▶ my $self = shift;
Subroutine parse_parameters: called CC=2 SCAR=6.9
Pod undocumented
15 22 $self->{'contents'} = DTL::Fast::Text->new();
16 22 ▶ $self->{'last_tag'} = $self->{'parameter'} ?
Branch: 1 branch
BranchTrueFalseTotal
$self->{'parameter'} ? : 2 20 22
17 qr/\Qendverbatim\E\s+\Q$self->{'parameter'}\E/
18 : 'endverbatim';
19 22 return $self;
20 }
21  
22 #@Override
23 sub parse_next_chunk
24 {
25 130 ▶ my $self = shift;
Subroutine parse_next_chunk: called CC=3 SCAR=11.0
Pod undocumented
26 130 my $chunk = shift @{$self->{'raw_chunks'}};
27 130 ▶ my $chunk_lines = scalar (my @tmp = $chunk =~ /(\n)/g ) || 0;
Condition100%2/2
scalar(my(@tmp) = $chunk =~ /(\n)/g) || 0
l!l
6862
MC/DC100%1/1
scalar(my(@tmp) = $chunk =~ /(\n)/g) || 0
scalar(my(@tmp) = $chunk =~ /(\n)/g)
Truth table100%2/2
A
A= scalar(my(@tmp) = $chunk =~ /(\n)/g)
Aresult
11
00
28
29 130 ▶ if( $chunk =~ /^\{\%\s*$self->{'last_tag'}\s*\%\}$/six )
Branch: 1 branch
BranchTrueFalseTotal
if ($chunk =~ /^\{\%\s*$self->{'last_tag'}\s*\%\}$/six) { } 22 108 130
30 {
31 22 $self->{'raw_chunks'} = []; # this stops parsing
32 }
33 else
34 {
35 108 $self->{'contents'}->append($chunk);
36 }
37  
38 130 $DTL::Fast::Template::CURRENT_TEMPLATE_LINE += $chunk_lines;
39
40 130 return;
41 }
42  
43 #@Override
44 sub render
45 {
46 11 ▶ return shift->{'contents'}->render(shift);
Subroutine render: called CC=1 SCAR=0.0
Pod undocumented
47 }
48  
49 3 1;
« blib/lib/DTL/Fast/Filter/Stringformat.pm ↑ Summary blib/lib/DTL/Fast/Replacer/Replacement.pm »