Parser/File/Container.pm

filter: Statementstmt 100% 26 / 26 Branchbran 50.0% 1 / 2 Conditioncond 36.3% 4 / 11 MC/DCmcdc 0.0% 0 / 7 Subroutinesub 100% 9 / 9 Podpod 0.0% 0 / 4 totaltotal 67.8% 40 / 59 CC 6 SCAR 6.9
CC
6
Cov
79%
new
3.1
parser
2.3
data
2.3
CRAP 2.0
« Parser/File/OPF/Context/Manifest.pm ↑ Summary Parser/File/OPF.pm »
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
BranchTrueFalseTotal
my $zip = +(shift() || {})->{"zip"} or croak("mandatory parameter 'zip'") 10 0 10
Condition50%1/2
shift() || {}
l!l
100
MC/DC0%0/1
shift() || {}
shift()
Truth table50%1/2
A
A= shift()
Aresult
11
00
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})
l!l&&r!l&&!r
0100
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})
ABresult
1X1
011
000
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"})
l!l&&r!l&&!r
0100
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"})
ABresult
1X1
011
000
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
l!l&&r!l&&!r
0100
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
ABresult
1X1
011
000
34 }
35  
36 14 1;
37  
« Parser/File/OPF/Context/Manifest.pm ↑ Summary Parser/File/OPF.pm »