| 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
MC/DC100%1/1
delete $$self{'from'} || 0
delete $$self{'from'}
Truth table100%2/2
A
A= delete $$self{'from'}
| |||||||||||||||||||||||||||||
| 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
Condition33%1/3
defined $$self{"to"} and $$self{"current"} + 1 > $$self{"to"}
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"}
| |||||||||||||||||||||||||||||
| 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
| |||||||||||||||||||||||||||||
| 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__ | ||||||||||||||||||||||||||||