| 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
| |||||||||||||||||||||||
| 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'} || []
MC/DC0%0/1
$self->{'extra'}{'headers'} || []
$self->{'extra'}{'headers'}
Truth table50%1/2
A
A= $self->{'extra'}{'headers'}
| |||||||||||||||||||||||
| 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__ | ||||||||||||||||||||||