Template/Element/Range.pm

filter: Statementstmt 45.1% 14 / 31 Branchbran 0.0% 0 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 55.5% 5 / 9 Podpod 0.0% 0 / 3 totaltotal 38.7% 19 / 49 CC 5 SCAR 14.1
CC
5
Cov
38%
min
6.0
max
6.0
resolve
6.0
CRAP 4.1
« Template/Element/Backref.pm ↑ Summary Template/Base.pm »
1 package Excel::Template::Element::Range;
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use Spreadsheet::WriteExcel::Utility;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 BEGIN {
7 1 ▶ use vars qw(@ISA);
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶ @ISA = qw(Excel::Template::Element);
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 1 ▶ use Excel::Template::Element;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 }
12  
13 0 ▶sub min { $_[0] < $_[1] ? $_[0] : $_[1] }
Subroutine min: not called CC=2 SCAR=17.9
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
$_[0] < $_[1] ? : 0 0 0
14 0 ▶sub max { $_[0] > $_[1] ? $_[0] : $_[1] }
Subroutine max: not called CC=2 SCAR=17.9
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
$_[0] > $_[1] ? : 0 0 0
15  
16 sub resolve
17 {
18 0 ▶ my $self = shift;
Subroutine resolve: not called CC=2 SCAR=17.9
Pod undocumented
19 0 my ($context) = @_;
20  
21 0 my $ref_name = $context->resolve($self, 'REF');
22  
23 0 my @refs = $context->get_all_references( $ref_name );
24 0 ▶ return '' unless @refs;
Branch: 1 branch
BranchTrueFalseTotal
unless @refs 0 0 0
25  
26 0 return $self->_join_refs(@refs);
27 }
28  
29 sub _join_refs {
30 0 ▶ my ($self, @refs) = @_;
Subroutine _join_refs: not called CC=2 SCAR=17.9
31
32 0 my ($top, $left, $bottom, $right) =
33 ( $refs[0][0], $refs[0][1] ) x 2;
34  
35 0 shift @refs;
36 0 foreach my $ref ( @refs )
37 {
38 0 $top = min( $top, $ref->[0]);
39 0 $bottom = max( $bottom, $ref->[0]);
40 0 $left = min( $left, $ref->[1]);
41 0 $right = max( $right, $ref->[1]);
42 }
43  
44 0 return join( ':',
45 xl_rowcol_to_cell($top, $left),
46 xl_rowcol_to_cell($bottom, $right)
47 );
48 }
49  
50 1 1;
51 __END__
« Template/Element/Backref.pm ↑ Summary Template/Base.pm »