Tabular/Row/Averages.pm

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