| 1 | package EBook::Ishmael::EBook::KF8; | ||||||||||||||||||||||||||||
| 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::Mobi'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | 17 | my $TYPE = 'BOOK'; | |||||||||||||||||||||||||||
| 10 | 17 | my $CREATOR = 'MOBI'; | |||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | sub heuristic { | ||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||
| 14 | 81 | ▶ | my $class = shift; | ||||||||||||||||||||||||||
|
Subroutine
heuristic: called CC=5 SCAR=16.1
Pod
undocumented
| |||||||||||||||||||||||||||||
| 15 | 81 | my $file = shift; | |||||||||||||||||||||||||||
| 16 | 81 | my $fh = shift; | |||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||
| 18 | 81 | ▶ | return 0 unless -s $file >= 68; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | 81 | seek $fh, 32, 0; | |||||||||||||||||||||||||||
| 21 | 81 | read $fh, my ($null), 1; | |||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||
| 23 | 81 | ▶ | unless ($null eq "\0") { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 24 | 35 | return 0; | |||||||||||||||||||||||||||
| 25 | } | ||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||
| 27 | 46 | seek $fh, 60, 0; | |||||||||||||||||||||||||||
| 28 | 46 | read $fh, my ($type), 4; | |||||||||||||||||||||||||||
| 29 | 46 | read $fh, my ($creator), 4; | |||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||
| 31 | 46 | ▶ | return 0 unless $type eq $TYPE && $creator eq $CREATOR; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$type eq $TYPE and $creator eq $CREATOR
MC/DC50%1/2
$type eq $TYPE and $creator eq $CREATOR
$type eq $TYPE
$creator eq $CREATOR
Truth table66%2/3
A and B
A= $type eq $TYPEB= $creator eq $CREATOR
| |||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||
| 33 | 22 | seek $fh, 78, 0; | |||||||||||||||||||||||||||
| 34 | 22 | read $fh, my ($off), 4; | |||||||||||||||||||||||||||
| 35 | 22 | $off = unpack "N", $off; | |||||||||||||||||||||||||||
| 36 | 22 | seek $fh, $off + 36, 0; | |||||||||||||||||||||||||||
| 37 | 22 | read $fh, my ($ver), 4; | |||||||||||||||||||||||||||
| 38 | 22 | $ver = unpack "N", $ver; | |||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||
| 40 | 22 | return $ver == 8; | |||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||
| 42 | } | ||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||
| 44 | 17 | 1; | |||||||||||||||||||||||||||