| 1 | package PMLTQ::Relation::ParentIterator; | ||||||||||||||||||||||||||||
| 2 | 12 | our $AUTHORITY = 'cpan:MATY'; | |||||||||||||||||||||||||||
| 3 | 12 | $PMLTQ::Relation::ParentIterator::VERSION = '1.2.2'; | |||||||||||||||||||||||||||
| 4 | # ABSTRACT: Evaluates condition on the parent of start node | ||||||||||||||||||||||||||||
| 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,$node,$fsfile)=@_; | ||||||||||||||||||||||||||
|
Subroutine
start: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||
| 17 | 0 | $self->[FILE]=$fsfile; | |||||||||||||||||||||||||||
| 18 | 0 | my $n = $node->parent; | |||||||||||||||||||||||||||
| 19 | 0 | ▶ | return $self->[NODE] = ($n && $self->[CONDITIONS]->($n,$fsfile)) ? $n : undef; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$n and $self->[0]->($n, $fsfile)
MC/DC0%0/2
$n and $self->[0]->($n, $fsfile)
$n
$self->[0]->($n, $fsfile)
Truth table0%0/3
A and B
A= $nB= $self->[0]->($n, $fsfile)
| |||||||||||||||||||||||||||||
| 20 | } | ||||||||||||||||||||||||||||
| 21 | sub next { | ||||||||||||||||||||||||||||
| 22 | 0 | ▶ | return $_[0]->[NODE]=undef; | ||||||||||||||||||||||||||
|
Subroutine
next: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 23 | } | ||||||||||||||||||||||||||||
| 24 | sub node { | ||||||||||||||||||||||||||||
| 25 | 0 | ▶ | return $_[0]->[NODE]; | ||||||||||||||||||||||||||
|
Subroutine
node: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 26 | } | ||||||||||||||||||||||||||||
| 27 | sub file { | ||||||||||||||||||||||||||||
| 28 | 0 | ▶ | return $_[0]->[FILE]; | ||||||||||||||||||||||||||
|
Subroutine
file: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 29 | } | ||||||||||||||||||||||||||||
| 30 | sub reset { | ||||||||||||||||||||||||||||
| 31 | 0 | ▶ | my ($self)=@_; | ||||||||||||||||||||||||||
|
Subroutine
reset: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 32 | 0 | $self->[NODE]=undef; | |||||||||||||||||||||||||||
| 33 | 0 | $self->[FILE]=undef; | |||||||||||||||||||||||||||
| 34 | } | ||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||
| 36 | 12 | 1; # End of PMLTQ::Relation::ParentIterator | |||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||
| 38 | __END__ | ||||||||||||||||||||||||||||