ObjectDriver/Iterator.pm

filter: Statementstmt 40.0% 8 / 20 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 33.3% 2 / 6 Podpod 0.0% 0 / 3 totaltotal 26.3% 10 / 38 CC 4 SCAR 17.9
CC
4
Cov
30%
end
12.0
new
6.0
next
2.0
CRAP 6.0
« ObjectDriver/Driver/Cache/Apache.pm ↑ Summary ObjectDriver/Driver/DBD.pm »
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
BranchTrueFalseTotal
if ($end) 0 0 0
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
BranchTrueFalseTotal
if $hash and ref $hash->{"end"} eq "CODE" 0 0 0
Condition0%0/3
$hash and ref $hash->{"end"} eq "CODE"
!ll&&!rl&&r
000
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"
ABresult
0X0
100
111
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;
« ObjectDriver/Driver/Cache/Apache.pm ↑ Summary ObjectDriver/Driver/DBD.pm »