| 1 | package Data::ObjectDriver::Iterator; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 1 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||
| 6 | 1 | my %Iterators = (); | |||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | 0 | ▶ | sub new { | ||||||||||||||||||||||||||
|
Subroutine
new: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 9 | 0 | my $class = shift; | |||||||||||||||||||||||||||
| 10 | 0 | my( $each, $end ) = @_; | |||||||||||||||||||||||||||
| 11 | 0 | bless $each, $class; | |||||||||||||||||||||||||||
| 12 | 0 | ▶ | if ($end) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 13 | 0 | $Iterators{ $each }{ end } = $end; | |||||||||||||||||||||||||||
| 14 | } | ||||||||||||||||||||||||||||
| 15 | 0 | return $each; | |||||||||||||||||||||||||||
| 16 | } | ||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||
| 18 | 0 | ▶ | sub next { | ||||||||||||||||||||||||||
|
Subroutine
next: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 19 | 0 | return shift->(); | |||||||||||||||||||||||||||
| 20 | } | ||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||
| 22 | 0 | ▶ | sub end { | ||||||||||||||||||||||||||
|
Subroutine
end: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||
| 23 | 0 | my $each = shift; | |||||||||||||||||||||||||||
| 24 | 0 | my $hash = delete $Iterators{ $each }; | |||||||||||||||||||||||||||
| 25 | 0 | ▶ | $hash->{ end }->() if $hash and ref $hash->{ end } eq 'CODE'; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$hash and ref $hash->{"end"} eq "CODE"
MC/DC0%0/2
$hash and ref $hash->{"end"} eq "CODE"
$hash
ref $hash->{"end"} eq "CODE"
Truth table0%0/3
A and B
A= $hashB= ref $hash->{"end"} eq "CODE"
| |||||||||||||||||||||||||||||
| 26 | } | ||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||
| 28 | 0 | ▶ | sub DESTROY { | ||||||||||||||||||||||||||
|
Subroutine
DESTROY: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 29 | 0 | my $iter = shift; | |||||||||||||||||||||||||||
| 30 | # use YAML; warn Dump \%Iterators; | ||||||||||||||||||||||||||||
| 31 | 0 | $iter->end(); | |||||||||||||||||||||||||||
| 32 | } | ||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||
| 34 | 1 | 1; | |||||||||||||||||||||||||||