Streaming/Reducer/Input/ValuesIterator.pm

filter: Statementstmt 89.4% 17 / 19 Branchbran 75.0% 6 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod 100% 2 / 2 totaltotal 87.5% 28 / 32 CC 5 SCAR 11.2
CC
5
Cov
85%
has_next
4.0
next
2.2
BEGIN
1.0
CRAP 3.1
« Streaming/Reducer/Input/Iterator.pm ↑ Summary Streaming/Combiner.pm »
1 package Hadoop::Streaming::Reducer::Input::ValuesIterator;
2 6 $Hadoop::Streaming::Reducer::Input::ValuesIterator::VERSION = '0.143060';
3 6 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 6 with 'Hadoop::Streaming::Role::Iterator';
5  
6 #ABSTRACT: Role providing access to values for a given key.
7  
8 6 has input_iter => (
9 is => 'ro',
10 does => 'Hadoop::Streaming::Role::Iterator',
11 required => 1,
12 );
13  
14 6 has first => ( is => 'rw', );
15  
16  
17 sub has_next
18 376 ▶{
Subroutine has_next: called CC=4 SCAR=13.9
Pod documented
19 376 my $self = shift;
20 376 ▶ return 1 if $self->first;
Branch: 1 branch
BranchTrueFalseTotal
if $self->first 0 376 376
21 376 ▶ return unless defined $self->input_iter->input->next_key;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $self->input_iter->input->next_key 5 371 376
22 371 ▶ return $self->input_iter->current_key eq
Branch: 1 branch
BranchTrueFalseTotal
$self->input_iter->current_key eq $self->input_iter->input->next_key ? : 299 72 371
23 $self->input_iter->input->next_key ? 1 : 0;
24 }
25  
26  
27 sub next
28 299 ▶{
Subroutine next: called CC=2 SCAR=7.9
Pod documented
29 299 my $self = shift;
30 299 ▶ if ( my $first = $self->first )
Branch: 1 branch
BranchTrueFalseTotal
if (my $first = $self->first) 0 299 299
31 {
32 0 $self->first(undef);
33 0 return $first;
34 }
35 299 my ( $key, $value ) = $self->input_iter->input->each;
36 299 $value;
37 }
38  
39 6 __PACKAGE__->meta->make_immutable;
40  
41 6 1;
42  
43 __END__
« Streaming/Reducer/Input/Iterator.pm ↑ Summary Streaming/Combiner.pm »