Simple/Iterator.pm

filter: Statementstmt 100% 18 / 18 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 3 totaltotal 89.2% 25 / 28 CC 2 SCAR 2.9
CC
2
Cov
100%
next
2.0
BEGIN
1.0
new
1.0
CRAP 1.3
« Simple/Constants.pm ↑ Summary Simple/ArrayList.pm »
1 package FormValidator::Simple::Iterator;
2 10 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 2 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
Pod undocumented
5 2 my $class = shift;
6 2 my $self = bless { }, $class;
7 2 $self->_init(@_);
8 2 return $self;
9 }
10  
11 2 ▶sub _init {
Subroutine _init: called CC=1 SCAR=0.0
12 2 my ($self, $records) = @_;
13 2 $self->{_index} = 0;
14 2 $self->{_records} = $records;
15 }
16  
17 1 ▶sub reset {
Subroutine reset: called CC=1 SCAR=0.0
Pod undocumented
18 1 my $self = shift;
19 1 $self->{_index} = 0;
20 }
21  
22 9 ▶sub next {
Subroutine next: called CC=2 SCAR=6.9
Pod undocumented
23 9 my $self = shift;
24 9 ▶ return unless ($self->{_records}->records_count > $self->{_index});
Branch: 1 branch
BranchTrueFalseTotal
unless $self->{"_records"}->records_count > $self->{"_index"} 2 7 9
25 7 my $record = $self->{_records}->get_record_at($self->{_index});
26 7 $self->{_index}++;
27 7 return $record;
28 }
29  
30 10 1;
31 __END__
« Simple/Constants.pm ↑ Summary Simple/ArrayList.pm »