RestApi/SheetsApi4/Range/Iterator.pm

filter: Statementstmt 27.7% 5 / 18 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 5 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 16.6% 1 / 6 Podpod 100% 5 / 5 totaltotal 26.8% 11 / 41 CC 5 SCAR 22.9
CC
5
Cov
19%
iterate
20.0
new
6.0
next
2.0
CRAP 9.9
« RestApi/CalendarApi3/Event.pm ↑ Summary RestApi/DriveApi3/File.pm »
1 package Google::RestApi::SheetsApi4::Range::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 0 ▶sub new {
Subroutine new: not called CC=2 SCAR=17.9
Pod documented
8 0 my $class = shift;
9 0 state $check = signature(
10 bless => !!0,
11 named => [
12 range => HasMethods[qw(range worksheet)],
13 dim => StrMatch[qr/^(col|row)$/], { default => 'row' },
14 by => PositiveInt, { default => 1 },
15 from => PositiveOrZeroInt, { optional => 1 },
16 to => PositiveOrZeroInt, { optional => 1 },
17 ],
18 );
19 0 my $self = $check->(@_);
20 0 ▶ $self->{current} = delete $self->{from} || 0;
Condition0%0/2
delete $$self{'from'} || 0
l!l
00
MC/DC0%0/1
delete $$self{'from'} || 0
delete $$self{'from'}
Truth table0%0/2
A
A= delete $$self{'from'}
Aresult
11
00
21 0 return bless $self, $class;
22 }
23  
24 0 ▶sub iterate {
Subroutine iterate: not called CC=4 SCAR=30.0
Pod documented
25 0 my $self = shift;
26 0 ▶ 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 0 0
Condition0%0/3
defined $$self{"to"} and $$self{"current"} + 1 > $$self{"to"}
!ll&&!rl&&r
000
MC/DC0%0/2
defined $$self{"to"} and $$self{"current"} + 1 > $$self{"to"}
defined $$self{"to"} $$self{"current"} + 1 > $$self{"to"}
Truth table0%0/3
A and B
A= defined $$self{"to"}B= $$self{"current"} + 1 > $$self{"to"}
ABresult
0X0
100
111
27 0 my $cell = $self->range()->cell_at_offset($self->{current}, $self->{dim});
28 0 ▶ $self->{current} += $self->{by} if $cell;
Branch: 1 branch
BranchTrueFalseTotal
if $cell 0 0 0
29 0 return $cell;
30 }
31 0 ▶sub next { iterate(@_); }
Subroutine next: not called CC=1 SCAR=6.9
Pod documented
32  
33 0 ▶sub range { shift->{range}; }
Subroutine range: not called CC=1 SCAR=6.9
Pod documented
34 0 ▶sub worksheet { shift->range()->worksheet(); }
Subroutine worksheet: not called CC=1 SCAR=6.9
Pod documented
35  
36 2 1;
37  
38 __END__
« RestApi/CalendarApi3/Event.pm ↑ Summary RestApi/DriveApi3/File.pm »