blib/lib/EBook/Ishmael/EBook/CBZ.pm

filter: Statementstmt 100% 28 / 28 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 8 / 8 Podpod 0.0% 0 / 3 totaltotal 92.6% 38 / 41 CC 2 SCAR 2.0
CC
2
Cov
100%
heuristic
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« blib/lib/EBook/Ishmael/Dir.pm ↑ Summary blib/lib/EBook/Ishmael/CharDet/CP1250.pm »
1 package EBook::Ishmael::EBook::CBZ;
2 17 ▶use 5.016;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 17 our $VERSION = '2.03';
4 17 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 17 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 17 ▶use parent 'EBook::Ishmael::EBook::CB';
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 17 ▶use EBook::Ishmael::Unzip qw(unzip);
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 17 my $MAGIC = pack "C*", 0x50, 0x4b, 0x03, 0x04;
12  
13 sub heuristic {
14  
15 126 ▶ my $class = shift;
Subroutine heuristic: called CC=2 SCAR=6.9
Pod undocumented
16 126 my $file = shift;
17 126 my $fh = shift;
18  
19 126 ▶ return 0 unless $file =~ /\.cbz$/;
Branch: 1 branch
BranchTrueFalseTotal
unless $file =~ /\.cbz$/u 115 11 126
20  
21 11 read $fh, my $mag, length $MAGIC;
22  
23 11 return $mag eq $MAGIC;
24  
25 }
26  
27 sub extract {
28  
29 10 ▶ my $self = shift;
Subroutine extract: called CC=1 SCAR=0.0
Pod undocumented
30 10 my $out = shift;
31  
32 10 unzip($self->{Source}, $out);
33  
34 10 return 1;
35  
36 }
37  
38 10 ▶sub format { 'CBZ' }
Subroutine format: called CC=1 SCAR=0.0
Pod undocumented
39  
40 17 1;
« blib/lib/EBook/Ishmael/Dir.pm ↑ Summary blib/lib/EBook/Ishmael/CharDet/CP1250.pm »