Salus/Row.pm

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