| 1 | package EPUB::Parser::File::Container; | ||||||||||||||||||||
| 2 | 14 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 3 | 14 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | 14 | ▶ | use Carp; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | 14 | ▶ | use EPUB::Parser::File::Parser::Container; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 6 | |||||||||||||||||||||
| 7 | 14 | ▶ | use constant FILE_PATH => 'META-INF/container.xml'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 8 | |||||||||||||||||||||
| 9 | 10 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=3 SCAR=11.4
Pod
undocumented
| |||||||||||||||||||||
| 10 | 10 | my $class = shift; | |||||||||||||||||||
| 11 | 10 | ▶ | my $zip = ( shift || {} )->{zip} or croak "mandatory parameter 'zip'"; | ||||||||||||||||||
|
Branch: 1 branch
Condition50%1/2
shift() || {}
MC/DC0%0/1
shift() || {}
shift()
Truth table50%1/2
A
A= shift()
| |||||||||||||||||||||
| 12 | |||||||||||||||||||||
| 13 | 10 | my $self = bless { | |||||||||||||||||||
| 14 | zip => $zip, | ||||||||||||||||||||
| 15 | } => $class; | ||||||||||||||||||||
| 16 | |||||||||||||||||||||
| 17 | 10 | return $self; | |||||||||||||||||||
| 18 | } | ||||||||||||||||||||
| 19 | |||||||||||||||||||||
| 20 | 10 | ▶ | sub parser { | ||||||||||||||||||
|
Subroutine
parser: called CC=2 SCAR=8.1
Pod
undocumented
| |||||||||||||||||||||
| 21 | 10 | my $self = shift; | |||||||||||||||||||
| 22 | $self->{parser} | ||||||||||||||||||||
| 23 | 10 | ▶ | ||= EPUB::Parser::File::Parser::Container->new({ data => $self->data }); | ||||||||||||||||||
|
Condition33%1/3
$self->{"parser"} ||= "EPUB::Parser::File::Parser::Container"->new({"data", $self->data})
MC/DC0%0/2
$self->{"parser"} ||= "EPUB::Parser::File::Parser::Container"->new({"data", $self->data})
$self->{"parser"}
"EPUB::Parser::File::Parser::Container"->new({"data", $self->data})
Truth table33%1/3
A ||= B
A= $self->{"parser"}B= "EPUB::Parser::File::Parser::Container"->new({"data", $self->data})
| |||||||||||||||||||||
| 24 | } | ||||||||||||||||||||
| 25 | |||||||||||||||||||||
| 26 | 10 | ▶ | sub data { | ||||||||||||||||||
|
Subroutine
data: called CC=2 SCAR=8.1
Pod
undocumented
| |||||||||||||||||||||
| 27 | 10 | my $self = shift; | |||||||||||||||||||
| 28 | 10 | ▶ | $self->{data} ||= $self->{zip}->get_member_data({ file_path => FILE_PATH() }); | ||||||||||||||||||
|
Condition33%1/3
$self->{"data"} ||= $self->{"zip"}->get_member_data({"file_path", "META-INF/container.xml"})
MC/DC0%0/2
$self->{"data"} ||= $self->{"zip"}->get_member_data({"file_path", "META-INF/container.xml"})
$self->{"data"}
$self->{"zip"}->get_member_data({"file_path", "META-INF/container.xml"})
Truth table33%1/3
A ||= B
A= $self->{"data"}B= $self->{"zip"}->get_member_data({"file_path", "META-INF/container.xml"})
| |||||||||||||||||||||
| 29 | } | ||||||||||||||||||||
| 30 | |||||||||||||||||||||
| 31 | 10 | ▶ | sub opf_path { | ||||||||||||||||||
|
Subroutine
opf_path: called CC=2 SCAR=8.1
Pod
undocumented
| |||||||||||||||||||||
| 32 | 10 | my $self = shift; | |||||||||||||||||||
| 33 | 10 | ▶ | $self->{opf_path} ||= $self->parser->single('/container:container/container:rootfiles/container:rootfile[1]/@full-path')->string_value; | ||||||||||||||||||
|
Condition33%1/3
$self->{"opf_path"} ||= $self->parser->single("/container:container/container:rootfiles/container:rootfile[1]/\@full-path")->string_value
MC/DC0%0/2
$self->{"opf_path"} ||= $self->parser->single("/container:container/container:rootfiles/container:rootfile[1]/\@full-path")->string_value
$self->{"opf_path"}
$self->parser->single("/container:container/container:rootfiles/container:rootfile[1]/\@full-path")->string_value
Truth table33%1/3
A ||= B
A= $self->{"opf_path"}B= $self->parser->single("/container:container/container:rootfiles/container:rootfile[1]/\@full-path")->string_value
| |||||||||||||||||||||
| 34 | } | ||||||||||||||||||||
| 35 | |||||||||||||||||||||
| 36 | 14 | 1; | |||||||||||||||||||
| 37 | |||||||||||||||||||||