Branch Coverage

blib/lib/EBook/Ishmael/EBook/Mobi.pm
Criterion Covered Total %
branch 70 152 46.0


line true false branch
38 0 70 unless -s $file >= 68
43 35 35 unless ($null eq "\0")
51 24 11 unless $type eq $TYPE and $creator eq $CREATOR
78 0 0 unless (substr($huff, 0, 8) eq $HUFF_HDR)
90 0 0 if ($len == 0)
94 0 0 if ($len <= 8 and not $term)
121 0 0 unless (substr($cdic, 0, 8) eq $CDIC_HDR)
184 0 0 if ($n <= 0)
192 0 0 unless ($term)
199 0 0 if $left < 0
205 0 0 unless ($flag)
247 0 0 if ($c & 128)
270 138 0 if ($self->{'_extra_data'} & 1)
285 0 20 if $idx == $NULL_INDEX
325 0 100 if (@$hordt2)
350 0 40 unless (substr($$data, 0, 4) eq "INDX")
376 0 40 if ($header->{'code'} == 65002 or $ocnt != 0 or $oentries > 0)
378 0 0 unless ($ocnt == 1)
381 0 0 unless (substr($$data, $op1, 4) eq "ORDT")
384 0 0 unless (substr($$data, $op2, 4) eq "ORDT")
412 10 30 if (substr($$data, $off, 1) eq "\0")
444 560 250 if (ord $v & 128)
463 20 0 if (substr($$data, $start, 4) eq "TAGX")
483 280 1960 if (($val & 1) == 1)
508 100 340 if ($endflag == 1)
514 340 0 if ($val != 0)
515 280 60 if ($val == $mask) { }
516 0 280 if (_count_setbits($mask) > 1) { }
536 340 0 if (defined $count) { }
564 10 0 if ($self->{'_fdst'} != $NULL_INDEX)
566 0 10 unless (substr($hdr, 0, 4) eq "FDST")
578 10 0 if ($self->{'_skelidx'} != $NULL_INDEX)
592 10 0 if ($self->{'_fragidx'} != $NULL_INDEX)
605 0 10 if ($self->{'_guideidx'} != $NULL_INDEX)
613 0 0 if (exists $tagmap->{'3'})
616 0 0 if (exists $tagmap->{'6'})
690 0 138 if ($self->{'_compression'} == 1) { }
138 0 elsif ($self->{'_compression'} == 2) { }
0 0 elsif ($self->{'_compression'} == 17480) { }
716 20 0 if (defined $self->{'_imgrec'})
733 100 290 if (exists $exth_records{$id})
805 0 20 unless ($self->{'_compression'} == 1 or $self->{'_compression'} == 2 or $self->{'_compression'} == 17480)
813 0 20 if ($self->{'_recsize'} != 4096)
817 0 20 unless ($self->{'_encryption'} == 0)
830 0 20 unless ($self->{'_codepage'} == 1252 or $self->{'_codepage'} == 65001)
842 0 20 if ($self->{'_compression'} == 17480)
844 0 0 unless ($UNPACK_Q)
853 20 0 if ($self->{'_length'} >= 227 and $self->{'_version'} >= 5)
856 0 0 if $flags & 2
861 10 10 if ($self->{'_version'} == 8)
869 0 20 if ($self->{'_lastcont'} > $self->{'_pdb'}->recnum - 1)
873 0 20 if ($self->{'_imgrec'} >= $self->{'_lastcont'})
877 20 0 if (defined $self->{'_imgrec'})
881 10 40 unless defined $format
886 20 0 if ($self->{'_exth_flag'})
890 0 20 if (defined $self->{'_coverrec'} and not grep({$self->{'_coverrec'} == $_->[0];} @{$$self{"_images"};}))
899 20 0 if (not defined $self->{'Metadata'}->created or $self->{'_pdb'}->cdate > $self->{'Metadata'}->created)
908 20 0 if ($self->{'_pdb'}->mdate)
912 10 10 if ($self->{'_version'} == 8) { }
10 0 elsif (not defined $self->{'Metadata'}->format) { }
935 5 5 if $clean
937 0 10 if ($decode and $self->{'_codepage'} == 1252)
938 0 0 unless &from_to($cont, "cp1252", "utf-8")
953 3 3 if ($self->{'_version'} == 8) { }
963 0 9 unless my($body) = $dom->findnodes("/html/body")
973 0 3 $self->{'_codepage'} == 1252 ? :
984 0 6 if (defined $out) { }
985 0 0 unless open my $fh, ">", $out
1004 2 2 if ($self->{'_version'} == 8) { }
1012 0 6 unless my($body) = $dom->findnodes("/html/body")
1020 0 2 $self->{'_codepage'} == 1252 ? :
1032 0 4 if (defined $out) { }
1033 0 0 unless open my $fh, ">", $out
1066 0 4 unless $self->has_cover
1070 0 4 unless defined $format
1089 0 8 if ($n >= $self->image_num)