Branch Coverage

blib/lib/EBook/Ishmael/EBook/FictionBook2.pm
Criterion Covered Total %
branch 44 74 59.4


line true false branch
23 11 93 if $file =~ /\.fb2$/u
24 58 35 unless -T $fh
41 0 10 unless my($desc) = $xpc->findnodes("/FictionBook:FictionBook/FictionBook:description")
50 10 0 if (defined $title)
53 10 100 if ($name eq 'genre') { }
10 90 elsif ($name eq 'author') { }
10 80 elsif ($name eq 'book-title') { }
10 70 elsif ($name eq 'lang' or $name eq 'src-lang') { }
0 70 elsif ($name eq 'translator') { }
69 10 0 if (defined $doc)
72 10 100 if ($name eq 'author') { }
10 90 elsif ($name eq 'program-used') { }
10 80 elsif ($name eq 'date') { }
10 70 elsif ($name eq 'id') { }
10 60 elsif ($name eq 'version') { }
0 60 elsif ($name eq 'src-ocr') { }
80 10 0 if (defined $t)
93 10 0 if (defined $publish)
96 0 30 if ($name eq 'year' and not defined $self->{'Metadata'}->created) { }
0 30 elsif ($name eq 'publisher') { }
0 30 elsif ($name eq 'book-name') { }
98 0 0 if (defined $t)
116 10 0 if (defined $covmeta)
118 0 10 unless my($img) = $xpc->findnodes("./FictionBook:image", $covmeta)
120 0 10 unless my $href = $img->getAttribute("l:href")
123 0 10 unless my($binary) = $xpc->findnodes(qq[/FictionBook:FictionBook/FictionBook:binary[\@id="$href"]])
162 0 10 unless (defined $self->{'Metadata'}->format)
180 0 3 unless my(@bodies) = $xpc->findnodes("/FictionBook:FictionBook/FictionBook:body")
190 0 3 if (defined $out) { }
191 0 0 unless open my $fh, ">", $out
213 0 2 unless my(@bodies) = $xpc->findnodes("/FictionBook:FictionBook/FictionBook:body")
220 0 2 if (defined $out) { }
221 0 0 unless open my $fh, ">", $out
254 0 3 unless $self->has_cover
258 0 3 if (defined $out) { }
259 0 0 unless open my $fh, ">", $out
284 0 2 if ($n >= $self->image_num)