| 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
| |||||||||||||
| 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 || []
MC/DC0%0/1
$items || []
$items
Truth table50%1/2
A
A= $items
| |||||||||||||
| 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() || {}
MC/DC100%1/1
shift() || {}
shift()
Truth table100%2/2
A
A= shift()
| |||||||||||||
| 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__ | ||||||||||||