Template/TextObject.pm

filter: Statementstmt 37.9% 11 / 29 Branchbran 0.0% 0 / 8 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 66.6% 4 / 6 Podpod 0.0% 0 / 2 totaltotal 30.0% 15 / 50 CC 7 SCAR 27.6
CC
7
Cov
28%
resolve
30.0
new
12.0
BEGIN
1.0
CRAP 15.8
« Template/Factory.pm ↑ Summary Template/Container/Loop.pm »
1 package Excel::Template::TextObject;
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 BEGIN {
6 1 ▶ use vars qw(@ISA);
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶ @ISA = qw(Excel::Template::Base);
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 1 ▶ use Excel::Template::Base;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 }
11  
12 # This is a helper object. It is not instantiated by the user,
13 # nor does it represent an XML object. Rather, certain elements,
14 # such as <textbox>, can use this object to do text with variable
15 # substitutions.
16  
17 sub new
18 {
19 0 ▶ my $class = shift;
Subroutine new: not called CC=3 SCAR=24.8
Pod undocumented
20 0 my $self = $class->SUPER::new(@_);
21  
22 $self->{STACK} = []
23 unless defined $self->{STACK} &&
24 0 ▶ ref $self->{STACK} eq 'ARRAY';
Branch: 1 branch
BranchTrueFalseTotal
unless defined $self->{"STACK"} and ref $self->{"STACK"} eq "ARRAY" 0 0 0
Condition0%0/3
defined $self->{"STACK"} and ref $self->{"STACK"} eq "ARRAY"
!ll&&!rl&&r
000
MC/DC0%0/2
defined $self->{"STACK"} and ref $self->{"STACK"} eq "ARRAY"
defined $self->{"STACK"} ref $self->{"STACK"} eq "ARRAY"
Truth table0%0/3
A and B
A= defined $self->{"STACK"}B= ref $self->{"STACK"} eq "ARRAY"
ABresult
0X0
100
111
25  
26 0 return $self;
27 }
28  
29 sub resolve
30 {
31 0 ▶ my $self = shift;
Subroutine resolve: not called CC=5 SCAR=34.0
Pod undocumented
32 0 my ($context) = @_;
33  
34 0 my $use_unicode = $context->use_unicode;
35  
36 0 my $t;
37 0 ▶ if ($use_unicode)
Branch: 1 branch
BranchTrueFalseTotal
if ($use_unicode) { } 0 0 0
38 {
39 0 require Unicode::String;
40 0 $t = Unicode::String::utf8('');
41 }
42 else
43 {
44 0 $t = '';
45 }
46  
47 0 for my $tok (@{$self->{STACK}})
48 {
49 0 my $val = $tok;
50 0 ▶ $val = $val->resolve($context)
Branch: 1 branch
BranchTrueFalseTotal
if Excel::Template::Factory::is_embedded($val) 0 0 0
51 if Excel::Template::Factory::is_embedded( $val );
52  
53 0 ▶ $t .= $use_unicode
Branch: 1 branch
BranchTrueFalseTotal
$use_unicode ? : 0 0 0
54 ? Unicode::String::utf8("$val")
55 : $val;
56 }
57  
58 0 return $t;
59 }
60  
61 1 1;
62 __END__
« Template/Factory.pm ↑ Summary Template/Container/Loop.pm »