Template/Base.pm

filter: Statementstmt 80.0% 16 / 20 Branchbran 50.0% 2 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 3 / 6 Podpod 0.0% 0 / 4 totaltotal 61.7% 21 / 34 CC 4 SCAR 10.2
CC
4
Cov
75%
new
4.2
enter_scope
2.0
exit_scope
2.0
CRAP 2.8
« Template/Element/Range.pm ↑ Summary Template/Container/Format.pm »
1 package Excel::Template::Base;
2  
3 30 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 30 ▶use Excel::Template::Factory;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 sub new
8 {
9 28 ▶ my $class = shift;
Subroutine new: called CC=4 SCAR=14.5
Pod undocumented
10  
11 28 ▶ push @_, %{shift @_} while ref $_[0] eq 'HASH';
Branch: 1 branch
BranchTrueFalseTotal
ref $_[0] eq "HASH" and do { push @_, %{shift @_;} } 0 28 28
12 28 ▶ (@_ % 2)
Branch: 1 branch
BranchTrueFalseTotal
@_ % 2 and die "$class->new() called with odd number of option parameters\n" 0 28 28
13 and die "$class->new() called with odd number of option parameters\n";
14  
15 28 my %x = @_;
16  
17 # Do not use a hashref-slice here because of the uppercase'ing
18 28 my $self = {};
19 28 $self->{uc $_} = $x{$_} for keys %x;
20  
21 28 bless $self, $class;
22 }
23  
24 30 *isa = *isa = \&Excel::Template::Factory::isa;
25 30 *is_embedded = *is_embedded = \&Excel::Template::Factory::is_embedded;
26  
27 #sub calculate { ($_[1])->get(@_[0,2]) }
28 #{
29 # my $self = shift;
30 # my ($context, $attr) = @_;
31 #
32 # return $context->get($self, $attr);
33 #}
34  
35 0 ▶sub enter_scope { ($_[1])->enter_scope($_[0]) }
Subroutine enter_scope: not called CC=1 SCAR=6.9
Pod undocumented
36 #{
37 # my $self = shift;
38 # my ($context) = @_;
39 #
40 # return $context->enter_scope($self);
41 #}
42  
43 0 ▶sub exit_scope { ($_[1])->exit_scope($_[0], $_[2]) }
Subroutine exit_scope: not called CC=1 SCAR=6.9
Pod undocumented
44 #{
45 # my $self = shift;
46 # my ($context, $no_delta) = @_;
47 #
48 # return $context->exit_scope($self, $no_delta);
49 #}
50  
51 sub deltas
52 {
53 # my $self = shift;
54 # my ($context) = @_;
55  
56 0 ▶ return {};
Subroutine deltas: not called CC=1 SCAR=6.9
Pod undocumented
57 }
58  
59 # Everyone seems to have their own versions.
60 # Maybe, it's part of the API to require that you have the right one of these
61 # defined?
62 #sub resolve
63 #{
64 # my $self = shift;
65 # my ($context) = @_;
66 #
67 # '';
68 #}
69 #
70 #sub render
71 #{
72 # my $self = shift;
73 # my ($context) = @_;
74 #
75 # 1;
76 #}
77  
78 30 1;
79 __END__
« Template/Element/Range.pm ↑ Summary Template/Container/Format.pm »