CCDICT/ResultSet/Array.pm

filter: Statementstmt 69.5% 16 / 23 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 83.3% 5 / 6 Podpod 66.6% 2 / 3 totaltotal 67.6% 23 / 34 CC 2 SCAR 8.9
CC
2
Cov
64%
next
6.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.4
« CCDICT/Storage/InMemory.pm ↑ Summary CCDICT/Romanization.pm »
1 package Lingua::ZH::CCDICT::ResultSet::Array;
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 ▶use base 'Lingua::ZH::CCDICT::ResultSet';
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8  
9 sub new
10 9 ▶{
Subroutine new: called CC=1 SCAR=0.0
Pod undocumented
11 9 my $class = shift;
12 9 my %p = @_;
13  
14 return bless { index => 0,
15 array => $p{array},
16 9 }, $class;
17 }
18  
19 sub next
20 0 ▶{
Subroutine next: not called CC=2 SCAR=17.9
Pod documented
21 0 my $self = shift;
22  
23 0 my $index = $self->{index};
24  
25 0 ▶ unless ( exists $self->{array}[$index] )
Branch: 1 branch
BranchTrueFalseTotal
unless (exists $self->{"array"}[$index]) 0 0 0
26 {
27 0 $self->{index} = 0;
28  
29 0 return;
30 }
31  
32 0 $self->{index}++;
33  
34 0 return $self->{array}[$index];
35 }
36  
37 sub all
38 9 ▶{
Subroutine all: called CC=1 SCAR=0.0
Pod documented
39 9 my $self = shift;
40  
41 9 return @{ $self->{array} };
42 }
43  
44  
45 1 1;
46  
47 __END__
« CCDICT/Storage/InMemory.pm ↑ Summary CCDICT/Romanization.pm »