Salus/Row.pm

filter: Statementstmt 81.8% 27 / 33 Branchbran 25.0% 1 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 87.5% 7 / 8 Podpod n/a totaltotal 77.7% 35 / 45 CC 4 SCAR 13.0
CC
4
Cov
76%
__ANON__
8.1
__ANON__
2.0
BEGIN
1.0
CRAP 3.7
« Salus/Table.pm ↑ Summary Salus.pm »
1 package Salus::Row;
2  
3 3 ▶use Rope;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use Rope::Autoload;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 3 ▶use Types::Standard qw/ArrayRef/;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 3 ▶use Salus::Row::Column;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 3 property columns => (
9 initable => 1,
10 writeable => 0,
11 configurable => 1,
12 required => 1,
13 enumerable => 1,
14 type => ArrayRef,
15 value => []
16 );
17  
18 function as_array => sub {
19 5 ▶ my ($self) = @_;
Subroutine __ANON__: called CC=1 SCAR=0.0
20 return [map {
21 20 $_->value
22 5 } @{$self->columns}];
23 3 };
24  
25 function get_col => sub {
26 12 ▶ my ($self, $col) = @_;
Subroutine __ANON__: called CC=4 SCAR=20.9
27 12 ▶ if ($col !~ m/^\d+$/) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($col =~ /^\d+$/) 0 12 12
28 0 for (@{$self->columns}) {
29 0 ▶ if ($_->header->name =~ m/^($col)$/) {
Branch: 1 branch
BranchTrueFalseTotal
if ($_->header->name =~ /^($col)$/) 0 0 0
30 0 $col = $_->header->index;
31 }
32 }
33 }
34 12 return $self->columns->[$col];
35 3 };
36  
37 function set_col => sub {
38 2 ▶ my ($self, $col, $value) = @_;
Subroutine __ANON__: called CC=1 SCAR=0.0
39 2 $self->get_col($col)->value = $value;
40 3 };
41  
42 function delete_col => sub {
43 0 ▶ my ($self, $col) = @_;
Subroutine __ANON__: not called CC=1 SCAR=6.9
44 0 $self->get_col($col)->value = '';
45 3 };
46  
47 3 1;
« Salus/Table.pm ↑ Summary Salus.pm »