Forest/Tree/Indexer/SimpleUIDIndexer.pm

filter: Statementstmt 100% 20 / 20 Branchbran 50.0% 2 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod 100% 1 / 1 totaltotal 93.1% 27 / 29 CC 3 SCAR 5.2
CC
3
Cov
92%
__ANON__
2.0
build_index
2.0
BEGIN
1.0
CRAP 1.7
« Forest/Tree/Writer/SimpleHTML.pm ↑ Summary Forest/Tree/Builder.pm »
1 package Forest::Tree::Indexer::SimpleUIDIndexer;
2 4 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 4 our $VERSION = '0.10';
5 4 our $AUTHORITY = 'cpan:STEVAN';
6  
7 4 with 'Forest::Tree::Indexer';
8  
9 3 ▶sub build_index {
Subroutine build_index: called CC=2 SCAR=7.0
Pod documented
10 3 my $self = shift;
11 3 my $root = $self->get_root;
12 3 my $index = $self->index;
13  
14 3 ▶ (!exists $index->{$root->uid})
Branch: 1 branch
BranchTrueFalseTotal
exists $$index{$root->uid} and confess("Tree root has already been indexed, you must clear it before re-indexing") 0 3 3
15 || confess "Tree root has already been indexed, you must clear it before re-indexing";
16  
17 3 $index->{$root->uid} = $root;
18  
19 21 ▶ $root->traverse(sub {
Subroutine __ANON__: called CC=2 SCAR=7.1
20 21 my $t = shift;
21 21 ▶ (!exists $index->{$t->uid})
Branch: 1 branch
BranchTrueFalseTotal
exists $$index{$t->uid} and confess('Duplicate tree id (' . $t->uid . ') found') 0 21 21
22 || confess "Duplicate tree id (" . $t->uid . ") found";
23 21 $index->{$t->uid} = $t;
24 3 });
25  
26 };
27  
28 4 __PACKAGE__->meta->make_immutable;
29  
30 4 ▶no Moose; 1;
Subroutine BEGIN: called CC=1 SCAR=0.0
31  
32 __END__
« Forest/Tree/Writer/SimpleHTML.pm ↑ Summary Forest/Tree/Builder.pm »