Tabular/Row/Totals.pm

filter: Statementstmt 86.3% 19 / 22 Branchbran 75.0% 6 / 8 Conditioncond 50.0% 1 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 100% 3 / 3 Podpod 0.0% 0 / 1 totaltotal 78.3% 29 / 37 CC 6 SCAR 16.3
CC
6
Cov
81%
get_column
6.5
BEGIN
1.0
BEGIN
1.0
CRAP 5.1
« Tabular/Row/Extra.pm ↑ Summary Tabular/Row/Averages.pm »
1 # Copyright (C) 2003-2007, G. Allen Morris III, all rights reserved
2  
3 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 package
5 Data::Tabular::Row::Totals;
6  
7 3 ▶use base 'Data::Tabular::Row::Function';
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 sub get_column
10 127 ▶{
Subroutine get_column: called CC=6 SCAR=18.7
Pod undocumented
11 127 my $self = shift;
12 127 my $column_name = shift;
13 127 my $ret;
14 127 my $reg = qr|^$column_name$|;
15  
16 127 ▶ if ($column_name eq '_description') {
Branch: 4 branches
BranchTrueFalseTotal
if ($column_name eq '_description') { } 19 108 127
elsif (grep /$reg/, @{$self->sum_list;}) { } 89 19 108
elsif (grep /$reg/, @{$self->{'extra'}{'headers'} or [];}) { } 0 19 19
elsif ($column_name eq '_filler') { } 19 0 19
17 $ret = Data::Tabular::Type::Text->new(
18 data => $self->{text},
19 19 type => 'description',
20 );
21 108 } elsif (grep(m|$reg|, @{$self->sum_list})) {
22 89 $ret = $self->table->column_sum($column_name);
23 19 ▶ } elsif (grep(m|$reg|, @{$self->{extra}->{headers} || []})) {
Condition50%1/2
$self->{'extra'}{'headers'} || []
l!l
190
MC/DC0%0/1
$self->{'extra'}{'headers'} || []
$self->{'extra'}{'headers'}
Truth table50%1/2
A
A= $self->{'extra'}{'headers'}
Aresult
11
00
24 0 die;
25 0 $ret = "extra($column_name)";
26 } elsif ($column_name eq '_filler') {
27 19 $ret = undef;
28 19 $ret = Data::Tabular::Type::Text->new(
29 data => '',
30 type => 'filler',
31 );
32 } else {
33 0 $ret = 'N/A('. $column_name . ')';
34 }
35 127 $ret;
36 }
37  
38 3 1;
39 __END__
« Tabular/Row/Extra.pm ↑ Summary Tabular/Row/Averages.pm »