Reverse/Converter/TT2.pm

filter: Statementstmt 100% 27 / 27 Branchbran 75.0% 6 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod 0.0% 0 / 1 totaltotal 92.3% 36 / 39 SCAR 17.9
CC
6
Cov
94%
Convert
6.0
BEGIN
1.0
BEGIN
1.0
CRAP 6.0
« Reverse.pm ↑ Summary Reverse/Part.pm »
1 package Template::Reverse::Converter::TT2;
2  
3 # ABSTRACT: Convert parts to TT2 format simply
4  
5 4 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 4 ▶use Scalar::Util qw(blessed);
Subroutine BEGIN: called CC=1 SCAR=0.0
7 4 our $VERSION = '0.143'; # VERSION
8  
9 sub Convert{
10 10 ▶ my $self = shift;
Subroutine Convert: called CC=6 SCAR=17.9
Pod undocumented
11 10 my $parts = shift;
12 10 my @temps;
13  
14 10 foreach my $pat (@{$parts}){
15 15 my @pre = @{$pat->pre};
16 15 my @post = @{$pat->post};
17  
18 15 ▶ @pre = map{blessed($_)?$_->as_string:$_}@pre;
Branch: 1 branch
BranchTrueFalseTotal
builtin::blessed($_) ? : 0 49 49
19 15 ▶ @post= map{blessed($_)?$_->as_string:$_}@post;
Branch: 1 branch
BranchTrueFalseTotal
builtin::blessed($_) ? : 0 40 40
20 15 my $pretxt = join '',@pre;
21 15 my $posttxt = join '',@post;
22 15 ▶ $pretxt .= '' if $pretxt;
Branch: 1 branch
BranchTrueFalseTotal
if $pretxt 13 2 15
23 15 ▶ $posttxt = ''.$posttxt if $posttxt;
Branch: 1 branch
BranchTrueFalseTotal
if $posttxt 13 2 15
24 15 push(@temps,$pretxt."[\% value \%]".$posttxt);
25 }
26  
27 10 return \@temps;
28 }
29  
30  
31  
32 4 1;
33  
34 __END__
« Reverse.pm ↑ Summary Reverse/Part.pm »