| 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
MC/DC0%0/1
delete $$self{'from'} || 0
delete $$self{'from'}
Truth table0%0/2
A
A= delete $$self{'from'}
| |||||||||||||||||||||||||||||
| 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
Condition0%0/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 table0%0/3
A and B
A= defined $$self{"to"}B= $$self{"current"} + 1 > $$self{"to"}
| |||||||||||||||||||||||||||||
| 27 | 0 | my $cell = $self->range()->cell_at_offset($self->{current}, $self->{dim}); | |||||||||||||||||||||||||||
| 28 | 0 | ▶ | $self->{current} += $self->{by} if $cell; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 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__ | ||||||||||||||||||||||||||||