Branch Coverage

blib/lib/EBook/Ishmael/EBook/Mobi.pm
Criterion Covered Total %
branch 70 138 50.7


line true false branch
36 0 70 unless -s $file >= 68
41 35 35 unless ($null eq "\0")
49 24 11 unless $type eq $TYPE and $creator eq $CREATOR
88 0 0 if ($c & 128)
111 138 0 if ($self->{'_extra_data'} & 1)
126 0 20 if $idx == $NULL_INDEX
166 0 100 if (@$hordt2)
191 0 40 unless (substr($$data, 0, 4) eq "INDX")
217 0 40 if ($header->{'code'} == 65002 or $ocnt != 0 or $oentries > 0)
219 0 0 unless ($ocnt == 1)
222 0 0 unless (substr($$data, $op1, 4) eq "ORDT")
225 0 0 unless (substr($$data, $op2, 4) eq "ORDT")
253 10 30 if (substr($$data, $off, 1) eq "\0")
285 560 250 if (ord $v & 128)
304 20 0 if (substr($$data, $start, 4) eq "TAGX")
324 280 1960 if (($val & 1) == 1)
349 100 340 if ($endflag == 1)
355 340 0 if ($val != 0)
356 280 60 if ($val == $mask) { }
357 0 280 if (_count_setbits($mask) > 1) { }
377 340 0 if (defined $count) { }
405 10 0 if ($self->{'_fdst'} != $NULL_INDEX)
407 0 10 unless (substr($hdr, 0, 4) eq "FDST")
419 10 0 if ($self->{'_skelidx'} != $NULL_INDEX)
433 10 0 if ($self->{'_fragidx'} != $NULL_INDEX)
446 0 10 if ($self->{'_guideidx'} != $NULL_INDEX)
454 0 0 if (exists $tagmap->{'3'})
457 0 0 if (exists $tagmap->{'6'})
531 0 138 if ($self->{'_compression'} == 1) { }
138 0 elsif ($self->{'_compression'} == 2) { }
0 0 elsif ($self->{'_compression'} == 17480) { }
557 20 0 if (defined $self->{'_imgrec'})
574 100 290 if (exists $exth_records{$id})
646 0 20 unless ($self->{'_compression'} == 1 or $self->{'_compression'} == 2 or $self->{'_compression'} == 17480)
654 0 20 if ($self->{'_recsize'} != 4096)
658 0 20 unless ($self->{'_encryption'} == 0)
671 0 20 unless ($self->{'_codepage'} == 1252 or $self->{'_codepage'} == 65001)
683 0 20 if ($self->{'_compression'} == 17480)
685 0 0 unless ($EBook::Ishmael::MobiHuff::UNPACK_Q)
694 20 0 if ($self->{'_length'} >= 227 and $self->{'_version'} >= 5)
697 0 0 if $flags & 2
702 10 10 if ($self->{'_version'} == 8)
710 0 20 if ($self->{'_lastcont'} > $self->{'_pdb'}->recnum - 1)
714 0 20 if ($self->{'_imgrec'} >= $self->{'_lastcont'})
718 20 0 if (defined $self->{'_imgrec'})
722 40 10 if defined $id
726 20 0 if ($self->{'_exth_flag'})
730 0 20 if (defined $self->{'_coverrec'} and not grep({$self->{'_coverrec'} == $_;} @{$$self{"_images"};}))
739 20 0 if (not defined $self->{'Metadata'}->created or $self->{'_pdb'}->cdate > $self->{'Metadata'}->created)
748 20 0 if ($self->{'_pdb'}->mdate)
752 10 10 if ($self->{'_version'} == 8) { }
10 0 elsif (not defined $self->{'Metadata'}->format) { }
775 5 5 if $clean
777 0 10 if ($decode and $self->{'_codepage'} == 1252)
778 0 0 unless &from_to($cont, "cp1252", "utf-8")
793 3 3 if ($self->{'_version'} == 8) { }
803 0 9 unless my($body) = $dom->findnodes("/html/body")
812 0 3 $self->{'_codepage'} == 1252 ? :
822 0 6 if (defined $out) { }
823 0 0 unless open my $fh, ">", $out
842 2 2 if ($self->{'_version'} == 8) { }
850 0 6 unless my($body) = $dom->findnodes("/html/body")
857 0 2 $self->{'_codepage'} == 1252 ? :
869 0 4 if (defined $out) { }
870 0 0 unless open my $fh, ">", $out
903 0 6 unless $self->has_cover
907 0 6 if (defined $out) { }
908 0 0 unless open my $fh, ">", $out
933 0 8 if ($n >= $self->image_num)