blib/lib/PMLTQ/Relation/DepthFirstPrecedesIterator.pm

filter: Statementstmt 56.1% 23 / 41 Branchbran 0.0% 0 / 6 Conditioncond 0.0% 0 / 9 MC/DCmcdc 0.0% 0 / 6 Subroutinesub 58.3% 7 / 12 Podpod 0.0% 0 / 5 totaltotal 37.9% 30 / 79 CC 7 SCAR 24.0
CC
7
Cov
41%
start
30.0
next
12.0
node
2.0
CRAP 11.1
« blib/lib/PMLTQ/Relation/DepthFirstFollowsIterator.pm ↑ Summary blib/lib/PMLTQ/Relation/ChildnodeIterator.pm »
1 package PMLTQ::Relation::DepthFirstPrecedesIterator;
2 12 our $AUTHORITY = 'cpan:MATY';
3 12 $PMLTQ::Relation::DepthFirstPrecedesIterator::VERSION = '1.2.2';
4 # ABSTRACT: Iterates tree using depth first search calling $node->following
5  
6 12 ▶use 5.006;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 12 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 12 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 12 ▶use base qw(PMLTQ::Relation::Iterator);
Subroutine BEGIN: called CC=1 SCAR=0.0
11 12 ▶use constant CONDITIONS=>0;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 12 ▶use constant NODE=>1;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 12 ▶use constant FILE=>2;
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 sub start {
16 0 ▶ my ($self,$parent,$fsfile)=@_;
Subroutine start: not called CC=5 SCAR=34.0
Pod undocumented
17 0 ▶ if ($fsfile) {
Branch: 1 branch
BranchTrueFalseTotal
if ($fsfile) { } 0 0 0
18 0 $self->[FILE]=$fsfile;
19 } else {
20 0 $fsfile=$self->[FILE];
21 }
22 0 my $n= $parent->following;
23 0 $self->[NODE]=$n;
24 0 ▶ return ($n && $self->[CONDITIONS]->($n,$fsfile)) ? $n : ($n && $self->next);
Branch: 1 branch
BranchTrueFalseTotal
$n && $self->[0]->($n, $fsfile) ? : 0 0 0
Condition0%0/6
$n and $self->[0]->($n, $fsfile)
!ll&&!rl&&r
000
$n and $self->next
!ll&&!rl&&r
000
MC/DC0%0/2
$n and $self->[0]->($n, $fsfile)
$n $self->[0]->($n, $fsfile)
MC/DC0%0/2
$n and $self->next
$n $self->next
Truth table0%0/3
A and B
A= $nB= $self->[0]->($n, $fsfile)
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= $nB= $self->next
ABresult
0X0
100
111
25 }
26 sub next {
27 0 ▶ my ($self)=@_;
Subroutine next: not called CC=3 SCAR=24.8
Pod undocumented
28 0 my $conditions=$self->[CONDITIONS];
29 0 my $n=$self->[NODE]->following();
30 0 my $fsfile=$self->[FILE];
31 0 ▶ $n=$n->following() while ($n and !$conditions->($n,$fsfile));
Branch: 1 branch
BranchTrueFalseTotal
$n and not &$conditions($n, $fsfile) and do { $n = $n->following } 0 0 0
Condition0%0/3
$n and not &$conditions($n, $fsfile)
!ll&&!rl&&r
000
MC/DC0%0/2
$n and not &$conditions($n, $fsfile)
$n not &$conditions($n, $fsfile)
Truth table0%0/3
A and not(B)
A= $nB= not &$conditions($n, $fsfile)
ABresult
0X0
100
111
32 0 return $self->[NODE]=$n;
33 }
34 sub node {
35 0 ▶ return $_[0]->[NODE];
Subroutine node: not called CC=1 SCAR=6.9
Pod undocumented
36 }
37 sub file {
38 0 ▶ return $_[0]->[FILE];
Subroutine file: not called CC=1 SCAR=6.9
Pod undocumented
39 }
40 sub reset {
41 0 ▶ my ($self)=@_;
Subroutine reset: not called CC=1 SCAR=6.9
Pod undocumented
42 0 $self->[NODE]=undef;
43 0 $self->[FILE]=undef;
44 }
45  
46 12 1; # End of PMLTQ::Relation::DepthFirstPrecedesIterator
47  
48 __END__
« blib/lib/PMLTQ/Relation/DepthFirstFollowsIterator.pm ↑ Summary blib/lib/PMLTQ/Relation/ChildnodeIterator.pm »