Parser/Util/EpubLoad.pm

filter: Statementstmt 100% 26 / 26 Branchbran 50.0% 4 / 8 Conditioncond 50.0% 2 / 4 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 2 totaltotal 79.1% 38 / 48 CC 7 SCAR 11.5
CC
7
Cov
84%
load_file
4.2
load_binary
4.2
BEGIN
1.0
CRAP 3.1
« Parser/File/Parser.pm ↑ Summary Parser/File/Navi/Context/Toc.pm »
1 package EPUB::Parser::Util::EpubLoad;
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 Archive::Zip qw/:ERROR_CODES/;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 13 ▶sub load_file {
Subroutine load_file: called CC=4 SCAR=14.5
Pod undocumented
8 13 my $class = shift;
9 13 ▶ my $args = shift || {};
Condition50%1/2
shift() || {}
l!l
130
MC/DC0%0/1
shift() || {}
shift()
Truth table50%1/2
A
A= shift()
Aresult
11
00
10 13 ▶ my $file_path = $args->{file_path} or croak "mandatory parameter 'file_path'";
Branch: 1 branch
BranchTrueFalseTotal
my $file_path = $args->{"file_path"} or croak("mandatory parameter 'file_path'") 13 0 13
11  
12 13 my $zip = Archive::Zip->new();
13 13 ▶ ( $zip->read( $file_path ) == AZ_OK() ) or die 'read error';
Branch: 1 branch
BranchTrueFalseTotal
$zip->read($file_path) == 0 or die "read error" 13 0 13
14  
15 13 return $zip;
16 }
17  
18 1 ▶sub load_binary {
Subroutine load_binary: called CC=4 SCAR=14.3
Pod undocumented
19 1 my $class = shift;
20 1 ▶ my $args = shift || {};
Condition50%1/2
shift() || {}
l!l
10
MC/DC0%0/1
shift() || {}
shift()
Truth table50%1/2
A
A= shift()
Aresult
11
00
21 1 ▶ my $zip_data = $args->{data} or croak "mandatory parameter 'data'";
Branch: 1 branch
BranchTrueFalseTotal
my $zip_data = $args->{"data"} or croak("mandatory parameter 'data'") 1 0 1
22  
23 1 require IO::String;
24 1 my $zip = Archive::Zip->new();
25 1 ▶ ( $zip->readFromFileHandle( IO::String->new($zip_data) ) == AZ_OK() ) or die 'open error';
Branch: 1 branch
BranchTrueFalseTotal
$zip->readFromFileHandle("IO::String"->new($zip_data)) == 0 or die "open error" 1 0 1
26  
27 1 return $zip;
28 }
29  
30  
31  
32 14 1;
« Parser/File/Parser.pm ↑ Summary Parser/File/Navi/Context/Toc.pm »