blib/lib/PMLTQ/Relation/SameTreeIterator.pm

filter: Statementstmt 68.0% 17 / 25 Branchbran 0.0% 0 / 6 Conditioncond 0.0% 0 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 71.4% 5 / 7 Podpod 0.0% 0 / 2 totaltotal 44.0% 22 / 50 CC 6 SCAR 26.3
CC
6
Cov
46%
start
30.0
new
6.0
BEGIN
1.0
CRAP 13.9
« blib/lib/PMLTQ/Relation/Treex/AEParentIterator.pm ↑ Summary blib/lib/PMLTQ/Relation/DepthFirstFollowsIterator.pm »
1 package PMLTQ::Relation::SameTreeIterator;
2 12 our $AUTHORITY = 'cpan:MATY';
3 12 $PMLTQ::Relation::SameTreeIterator::VERSION = '1.5.0';
4 # ABSTRACT: Evaluates condition on nodes of current tree
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 Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 12 ▶use base qw(PMLTQ::Relation::TreeIterator);
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 sub new {
14 0 ▶ my ($class,$conditions)=@_;
Subroutine new: not called CC=2 SCAR=17.9
Pod undocumented
15 0 ▶ croak "usage: $class->new(sub{...})" unless ref($conditions) eq 'CODE';
Branch: 1 branch
BranchTrueFalseTotal
unless ref $conditions eq "CODE" 0 0 0
16 0 return bless [$conditions],$class;
17 }
18 sub start {
19 0 ▶ my ($self,$root,$fsfile)=@_;
Subroutine start: not called CC=5 SCAR=34.0
Pod undocumented
20 0 ▶ $root=$root->root if $root;
Branch: 1 branch
BranchTrueFalseTotal
if $root 0 0 0
21 0 $self->[PMLTQ::Relation::TreeIterator::NODE] = $self->[PMLTQ::Relation::TreeIterator::TREE] = $root;
22 0 $self->[PMLTQ::Relation::TreeIterator::FILE]=$fsfile;
23 0 ▶ return ($root && $self->[PMLTQ::Relation::TreeIterator::CONDITIONS]->($root,$fsfile)) ? $root : ($root && $self->next);
Branch: 1 branch
BranchTrueFalseTotal
$root && $self->[0]->($root, $fsfile) ? : 0 0 0
Condition0%0/6
$root and $self->[0]->($root, $fsfile)
!ll&&!rl&&r
000
$root and $self->next
!ll&&!rl&&r
000
MC/DC0%0/2
$root and $self->[0]->($root, $fsfile)
$root $self->[0]->($root, $fsfile)
MC/DC0%0/2
$root and $self->next
$root $self->next
Truth table0%0/3
A and B
A= $rootB= $self->[0]->($root, $fsfile)
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= $rootB= $self->next
ABresult
0X0
100
111
24 }
25  
26 12 1; # End of PMLTQ::Relation::SameTreeIterator
27  
28 __END__
« blib/lib/PMLTQ/Relation/Treex/AEParentIterator.pm ↑ Summary blib/lib/PMLTQ/Relation/DepthFirstFollowsIterator.pm »