blib/lib/EBook/EPUB/Check.pm

filter: Statementstmt 71.0% 27 / 38 Branchbran 0.0% 0 / 6 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 88.8% 8 / 9 Podpod 100% 1 / 1 totaltotal 61.0% 36 / 59 SCAR 19.4
CC
5
Cov
57%
epubcheck
30.0
BEGIN
1.0
BEGIN
1.0
CRAP 6.9
« Build ↑ Summary blib/lib/EBook/EPUB/Check/Result.pm »
1 package EBook::EPUB::Check;
2  
3 2 ▶use 5.008_001;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 ▶use Carp ();
Subroutine BEGIN: called CC=1 SCAR=0.0
7 2 ▶use Exporter qw/import/;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 2 ▶use File::ShareDir ();
Subroutine BEGIN: called CC=1 SCAR=0.0
9 2 ▶use IPC::Run3 ();
Subroutine BEGIN: called CC=1 SCAR=0.0
10 2 ▶use EBook::EPUB::Check::Result ();
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 2 our $VERSION = "0.00_02";
13 2 our @EXPORT = qw(epubcheck);
14 2 our @EXPORT_OK = qw();
15  
16 sub epubcheck
17 {
18 0 ▶ my ($epub, $jar) = @_;
Subroutine epubcheck: not called CC=5 SCAR=34.0
Pod documented
19  
20 0 ▶ if (scalar @_ == 1)
Branch: 1 branch
BranchTrueFalseTotal
if (scalar @_ == 1) 0 0 0
21 {
22 0 $jar = File::ShareDir::dist_file('EBook-EPUB-Check', 'epubcheck-3.0.1/epubcheck-3.0.1.jar');
23 }
24  
25 0 ▶ Carp::croak('jar file not found') unless -f $jar;
Branch: 1 branch
BranchTrueFalseTotal
unless -f $jar 0 0 0
26  
27 0 ▶ if ( ! defined $epub || ! -f $epub )
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $epub and -f $epub) 0 0 0
Condition0%0/3
defined $epub and -f $epub
!ll&&!rl&&r
000
MC/DC0%0/2
defined $epub and -f $epub
defined $epub -f $epub
Truth table0%0/3
A and B
A= defined $epubB= -f $epub
ABresult
0X0
100
111
28 {
29 0 Carp::carp('epub file not found');
30 0 return EBook::EPUB::Check::Result->new(\'');
31 }
32  
33 0 my $out;
34 0 my @cmd = ('java', '-jar', $jar, $epub);
35  
36 0 IPC::Run3::run3(\@cmd, \undef, \$out, \$out);
37  
38 0 return EBook::EPUB::Check::Result->new(\$out);
39 }
40  
41 2 1;
42  
43 __END__
« Build ↑ Summary blib/lib/EBook/EPUB/Check/Result.pm »