Stream/Iterator/Stack.pm

filter: Statementstmt 100% 22 / 22 Branchbran 100% 4 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod 50.0% 2 / 4 totaltotal 94.5% 35 / 37 CC 3 SCAR 5.1
CC
3
Cov
100%
has_next
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.7
« Stream/Iterator/Compare/Result.pm ↑ Summary Stream/Iterator/Base.pm »
1 package Data::Range::Compare::Stream::Iterator::Stack;
2  
3 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 3 ▶use base qw(Data::Range::Compare::Stream::Iterator::Base);
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 14 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
Pod undocumented
8 14 my ($class,%args)=@_;
9 14 my $self=$class->SUPER::new(stack=>[],%args);
10 }
11  
12 3 ▶sub stack_push {
Subroutine stack_push: called CC=1 SCAR=0.0
Pod documented
13 3 my ($self,$it)=@_;
14 3 push @{$self->{stack}},$it;
15 }
16  
17 8264 ▶sub has_next {
Subroutine has_next: called CC=3 SCAR=11.0
Pod undocumented
18 8264 my ($self)=@_;
19 8264 my $stack=$self->{stack};
20 8264 ▶ while($#$stack!=-1) {
Branch: 1 branch
BranchTrueFalseTotal
if ($stack->$#* != -1) 8270 16 8286
21 8270 ▶ return 1 if $stack->[0]->has_next;
Branch: 1 branch
BranchTrueFalseTotal
if $stack->[0]->has_next 8248 22 8270
22 22 shift @$stack;
23 }
24 16 return 0;
25 }
26  
27 8247 ▶sub get_next { $_[0]->{stack}->[0]->get_next }
Subroutine get_next: called CC=1 SCAR=0.0
Pod documented
28  
29  
30 3 1;
« Stream/Iterator/Compare/Result.pm ↑ Summary Stream/Iterator/Base.pm »