blib/lib/PMLTQ/Relation/MemberIterator.pm

filter: Statementstmt 60.6% 20 / 33 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 66.6% 6 / 9 Podpod 0.0% 0 / 3 totaltotal 50.0% 26 / 52 CC 3 SCAR 14.3
CC
3
Cov
53%
new
12.0
clone
2.0
get_node_list
2.0
CRAP 4.2
« Build ↑ Summary blib/lib/PMLTQ/Relation/OptionalIterator.pm »
1 package PMLTQ::Relation::MemberIterator;
2 12 our $AUTHORITY = 'cpan:MATY';
3 12 $PMLTQ::Relation::MemberIterator::VERSION = '1.5.0';
4 # ABSTRACT: Iterates over member nodes of given list
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::SimpleListIterator);
Subroutine BEGIN: called CC=1 SCAR=0.0
11 12 ▶use constant ATTR => PMLTQ::Relation::SimpleListIterator::FIRST_FREE;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 12 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 sub new {
15 0 ▶ my ($class,$conditions,$attr)=@_;
Subroutine new: not called CC=3 SCAR=24.8
Pod undocumented
16 0 ▶ croak "usage: $class->new(sub{...},\$attr)" unless (ref($conditions) eq 'CODE' and defined $attr);
Branch: 1 branch
BranchTrueFalseTotal
unless ref $conditions eq "CODE" and defined $attr 0 0 0
Condition0%0/3
ref $conditions eq "CODE" and defined $attr
!ll&&!rl&&r
000
MC/DC0%0/2
ref $conditions eq "CODE" and defined $attr
ref $conditions eq "CODE" defined $attr
Truth table0%0/3
A and B
A= ref $conditions eq "CODE"B= defined $attr
ABresult
0X0
100
111
17 0 my $self = PMLTQ::Relation::SimpleListIterator->new($conditions);
18 0 $self->[ATTR]=$attr;
19 0 bless $self, $class; # reblessing
20 0 return $self;
21 }
22 sub clone {
23 0 ▶ my ($self)=@_;
Subroutine clone: not called CC=1 SCAR=6.9
Pod undocumented
24 0 my $clone = $self->PMLTQ::Relation::SimpleListIterator::clone();
25 0 $clone->[ATTR]=$self->[ATTR];
26 0 return $clone;
27 }
28 sub get_node_list {
29 0 ▶ my ($self,$node)=@_;
Subroutine get_node_list: not called CC=1 SCAR=6.9
Pod undocumented
30 0 my $fsfile = $self->[PMLTQ::Relation::SimpleListIterator::FILE];
31 #print STDERR "MemberIterator attr: $self->[ATTR]\n";
32 0 return [map [$_,$fsfile], Treex::PML::Instance::get_all($node,$self->[ATTR])];
33  
34 }
35  
36 12 1; # End of PMLTQ::Relation::MemberIterator
37  
38 __END__
« Build ↑ Summary blib/lib/PMLTQ/Relation/OptionalIterator.pm »