Mock/StatementTrack/Iterator.pm

filter: Statementstmt 100% 14 / 14 Branchbran 100% 2 / 2 Conditioncond 50.0% 1 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 3 totaltotal 81.4% 22 / 27 CC 3 SCAR 4.6
CC
3
Cov
94%
new
2.1
next
2.0
BEGIN
1.0
CRAP 1.6
« Mock.pm ↑ Summary Mock/Pool/db.pm »
1 package DBD::Mock::StatementTrack::Iterator;
2  
3 41 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 41 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 2 ▶sub new {
Subroutine new: called CC=2 SCAR=7.2
Pod undocumented
7 2 my ( $class, $history ) = @_;
8 2 ▶ bless {
Condition50%1/2
$history || []
l!l
20
MC/DC0%0/1
$history || []
$history
Truth table50%1/2
A
A= $history
Aresult
11
00
9 pointer => 0,
10 history => $history || []
11 } => $class;
12 }
13  
14 16 ▶sub next {
Subroutine next: called CC=2 SCAR=6.9
Pod undocumented
15 16 my ($self) = @_;
16 16 ▶ return unless $self->{pointer} < scalar( @{ $self->{history} } );
Branch: 1 branch
BranchTrueFalseTotal
unless $self->{"pointer"} < scalar @{$self->{"history"};} 4 12 16
17 12 return $self->{history}->[ $self->{pointer}++ ];
18 }
19  
20 1 ▶sub reset { (shift)->{pointer} = 0 }
Subroutine reset: called CC=1 SCAR=0.0
Pod undocumented
21  
22 41 1;
« Mock.pm ↑ Summary Mock/Pool/db.pm »