RestApi/SheetsApi4/RangeGroup/Iterator.pm

filter: Statementstmt 100% 24 / 24 Branchbran 50.0% 2 / 4 Conditioncond 60.0% 3 / 5 MC/DCmcdc 33.3% 1 / 3 Subroutinesub 100% 7 / 7 Podpod 100% 5 / 5 totaltotal 87.5% 42 / 48 CC 5 SCAR 8.7
CC
5
Cov
88%
iterate
4.3
new
2.0
BEGIN
1.0
CRAP 2.4
« RestApi/SheetsApi4.pm ↑ Summary RestApi/DocsApi1/Document.pm »
1 package Google::RestApi::SheetsApi4::RangeGroup::Iterator;
2  
3 2 our $VERSION = '2.2.5';
4  
5 2 ▶use Google::RestApi::Setup;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 2 ▶use aliased 'Google::RestApi::SheetsApi4::RangeGroup';
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 2 ▶sub new {
Subroutine new: called CC=2 SCAR=6.9
Pod documented
10 2 my $class = shift;
11 2 state $check = signature(
12 bless => !!0,
13 named => [
14 range_group => HasMethods[qw(ranges)],
15 dim => StrMatch[qr/^(col|row)$/], { default => 'row' },
16 by => PositiveInt, { default => 1 },
17 from => PositiveOrZeroInt, { optional => 1 },
18 to => PositiveOrZeroInt, { optional => 1 },
19 ],
20 );
21 2 my $self = $check->(@_);
22 2 ▶ $self->{current} = delete $self->{from} || 0;
Condition100%2/2
delete $$self{'from'} || 0
l!l
11
MC/DC100%1/1
delete $$self{'from'} || 0
delete $$self{'from'}
Truth table100%2/2
A
A= delete $$self{'from'}
Aresult
11
00
23 2 return bless $self, $class;
24 }
25  
26 6 ▶sub iterate {
Subroutine iterate: called CC=4 SCAR=14.6
Pod documented
27 6 my $self = shift;
28  
29 6 ▶ return if defined $self->{to} && $self->{current} + 1 > $self->{to};
Branch: 1 branch
BranchTrueFalseTotal
if defined $$self{"to"} and $$self{"current"} + 1 > $$self{"to"} 0 6 6
Condition33%1/3
defined $$self{"to"} and $$self{"current"} + 1 > $$self{"to"}
!ll&&!rl&&r
600
MC/DC0%0/2
defined $$self{"to"} and $$self{"current"} + 1 > $$self{"to"}
defined $$self{"to"} $$self{"current"} + 1 > $$self{"to"}
Truth table33%1/3
A and B
A= defined $$self{"to"}B= $$self{"current"} + 1 > $$self{"to"}
ABresult
0X0
100
111
30  
31 my @ranges = map {
32 6 $_->cell_at_offset($self->{current}, $self->{dim});
33 } $self->range_group()->ranges();
34 6 ▶ return if grep { undef; } @ranges;
Branch: 1 branch
BranchTrueFalseTotal
if grep {undef;} @ranges 0 6 6
35  
36 6 $self->{current} += $self->{by};
37  
38 6 return $self->spreadsheet()->range_group(@ranges);
39 }
40 4 ▶sub next { iterate(@_); }
Subroutine next: called CC=1 SCAR=0.0
Pod documented
41  
42 12 ▶sub range_group { shift->{range_group}; }
Subroutine range_group: called CC=1 SCAR=0.0
Pod documented
43 6 ▶sub spreadsheet { shift->range_group()->spreadsheet(); }
Subroutine spreadsheet: called CC=1 SCAR=0.0
Pod documented
44  
45 2 1;
46  
47 __END__
« RestApi/SheetsApi4.pm ↑ Summary RestApi/DocsApi1/Document.pm »