Parser/File/OPF/Context/Spine.pm

filter: Statementstmt 100% 34 / 34 Branchbran 50.0% 1 / 2 Conditioncond 75.0% 3 / 4 MC/DCmcdc 50.0% 1 / 2 Subroutinesub 100% 9 / 9 Podpod 100% 4 / 4 totaltotal 94.5% 52 / 55 CC 5 SCAR 5.7
CC
5
Cov
95%
attrs
3.0
ordered_list
2.0
items_path
2.0
CRAP 1.8
« Parser/File/Document.pm ↑ Summary Parser.pm »
1 package EPUB::Parser::File::OPF::Context::Spine;
2 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 3 ▶use parent 'EPUB::Parser::File::OPF::Context';
Subroutine BEGIN: called CC=1 SCAR=0.0
6 3 ▶use EPUB::Parser::Util::AttributePacker;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 6 ▶sub ordered_list {
Subroutine ordered_list: called CC=2 SCAR=7.1
Pod documented
9 6 my $self = shift;
10 6 my $node_list = $self->parser->find('pkg:itemref');
11 6 ▶ EPUB::Parser::Util::AttributePacker->ordered_list($node_list) || [];
Branch: 1 branch
BranchTrueFalseTotal
"EPUB::Parser::Util::AttributePacker"->ordered_list($node_list) or [] 6 0 6
12 }
13  
14 5 ▶sub attrs {
Subroutine attrs: called CC=3 SCAR=11.0
Pod documented
15 5 my $self = shift;
16  
17 5 my $items;
18 5 my $attr_by_id = $self->opf->manifest->attr_by_id;
19  
20 5 for my $idref ( @{$self->ordered_list} ) {
21 45 push @$items, $attr_by_id->{$idref->{idref}};
22 }
23  
24 5 ▶ return $items || [];
Condition50%1/2
$items || []
l!l
50
MC/DC0%0/1
$items || []
$items
Truth table50%1/2
A
A= $items
Aresult
11
00
25 }
26  
27 4 ▶sub items_path {
Subroutine items_path: called CC=2 SCAR=6.9
Pod documented
28 4 my $self = shift;
29 4 ▶ my $args = shift || {};
Condition100%2/2
shift() || {}
l!l
31
MC/DC100%1/1
shift() || {}
shift()
Truth table100%2/2
A
A= shift()
Aresult
11
00
30 4 my @href = map { $_->{href} } @{$self->attrs};
31  
32 4 $self->opf->manifest->_items_path({ %$args, href => \@href });
33 }
34  
35 2 ▶sub items {
Subroutine items: called CC=1 SCAR=0.0
Pod documented
36 2 my $self = shift;
37 2 $self->opf->manifest->_items( $self->items_path({ abs => 1 }) );
38 }
39  
40  
41  
42 3 1;
43  
44 __END__
« Parser/File/Document.pm ↑ Summary Parser.pm »