Branch Coverage

blib/lib/MIME/Parser.pm
Criterion Covered Total %
branch 135 206 65.5


line true false branch
329 0 0 if (@_ > 1)
331 0 0 if ($yesno)
332 0 0 if ($yesno eq 'I_KNOW_WHAT_I_AM_DOING' or $yesno eq 'I_NEED_TO_FIX_THIS') { }
394 25 26 if @_ > 1
422 25 274 if @_ > 1
442 25 0 if @_ > 1
475 3 307 if @_ > 1
490 0 1489 if ("MIME::Tools"->debugging)
491 0 0 if (my $r = $self->{'MP5_Results'})
505 6 0 if (my $r = $self->{'MP5_Results'})
521 5 0 if (my $r = $self->{'MP5_Results'})
526 5 0 $self->{'MP5_IgnoreErrors'} ? :
548 0 51 unless $rdr->depth > 0
553 0 51 unless open my $fh, ">", \$data
559 2 49 if ($data =~ /^[\r\n]\z/) { }
627 0 203 unless open my $outfh, ">:scalar", \$headstr
632 2 201 if ($hdr_rdr->eos_type eq "DELIM")
636 1 200 unless $hdr_rdr->eos_type eq "DONE"
644 0 201 unless open my $readfh, "<:scalar", \$headstr
647 0 201 unless ($readfh->eof)
658 0 201 if $self->{'MP5_DecodeHeaders'}
661 65 136 unless $self->results->top_head
687 1 50 $subtype eq 'digest' ? :
691 0 51 if (not defined $bound or $bound =~ /[\r\n]/)
707 50 1 if ($eos_type eq 'DELIM') { }
1 0 elsif ($eos_type eq 'CLOSE') { }
722 0 125 unless defined $part
728 75 50 if ($eos_type eq 'DELIM') { }
48 2 elsif ($eos_type eq 'CLOSE') { }
764 20 117 if ($can_shortcut) { }
781 116 1 if ($rdr->has_bounds)
782 2 114 unless $rdr->eos_type =~ /^(DELIM|CLOSE)$/
787 0 117 unless $ENCODED->flush
788 0 117 unless $ENCODED->seek(0, 0)
794 0 137 unless ($decoder)
804 7 130 unless ($self->decode_bodies)
814 3 0 if ($self->extract_uuencode and $encoding =~ /^(7bit|8bit|binary)\Z/ and $ent->effective_type =~ m[^(?:text/plain|application/mac-binhex40|application/mac-binhex)\Z])
820 2 1 if ($uu_ent) { }
826 0 1 unless $ENCODED->seek(0, 0)
831 0 135 unless my $body = $self->new_body_for($head)
832 34 101 unless textual_type($ent->effective_type) or not $self->decode_bodies
834 7 128 unless $self->decode_bodies
837 0 135 unless my $DECODED = $body->open("w")
839 0 135 if $@
840 0 135 unless $DECODED->close
864 0 3 unless $ENCODED->seek(0, 0)
866 2 16 if ($good = /^begin [0-7]{3}/)
870 0 16 if ($good = /^\(This file must be converted with/i)
875 1 2 unless ($good)
878 2 0 $how_encoded eq 'uu' ? :
880 0 2 unless (defined $decoder)
891 0 2 unless $ENCODED->seek(0, 0)
899 2 4 if $@
907 4 0 if ($ext =~ /^(gif|jpe?g|xbm|xpm|png)\Z/)
910 2 2 if (@$preamble and grep /\S/, @$preamble and not @parts)
918 0 2 unless my $io = $txt_ent->bodyhandle->open("w")
919 0 2 unless $io->print(@$preamble)
920 0 2 unless $io->close
932 0 4 unless $bin_ent->bodyhandle->binmode(1)
933 0 4 unless my $io = $bin_ent->bodyhandle->open("w")
934 0 4 unless $io->print($bin_data)
935 0 4 unless $io->close
941 0 2 unless @parts
967 0 13 unless ($encoding =~ /^(7bit|8bit|binary)$/)
975 0 13 unless defined $msg
978 1 12 if ($self->extract_nested_messages eq 'REPLACE') { }
1006 0 203 if ($self->{'MP5_MaxParts'} > 0)
1008 0 0 if ($self->{'MP5_NumParts'} > $self->{'MP5_MaxParts'})
1023 2 201 unless (defined $head)
1029 0 2 unless $ent->bodyhandle->open("w")->close
1030 2 0 unless ($self->{'MP5_AmbiguousContent'})
1031 0 2 if ($ent->head->ambiguous_content)
1042 2 199 if $p{'Retype'}
1046 195 6 unless ($self->{'MP5_AmbiguousContent'})
1047 9 186 if ($ent->head->ambiguous_content)
1056 51 150 if ($type eq 'multipart') { }
13 137 elsif ("$type/$subtype" eq 'message/rfc822' || "$type/$subtype" eq 'message/external-body' || "$type/$subtype" eq 'message/partial' && defined $head->mime_attr('content-type.number') && $head->mime_attr('content-type.number') == 1 and $self->extract_nested_messages) { }
1057 0 51 unless defined $self->process_multipart($in, $rdr, $ent)
1064 0 13 unless defined $self->process_message($in, $rdr, $ent)
1128 0 11 unless (defined $data)
1135 9 2 if (not ref $data) { }
1 1 elsif (ref $data eq 'SCALAR') { }
1 0 elsif (ref $data eq 'ARRAY') { }
1149 0 11 unless ($io)
1213 0 41 unless my $io = "IO::File"->new($expr)
1215 0 41 unless $io->close
1251 0 2 unless open IN, "<$_"
1253 0 2 unless close IN
1301 78 245 if (@_ > 1)
1327 75 6 if (@_ > 1) { }
1355 3 0 if (@_ > 1) { }
1446 0 0 if (@_ > 1)
1477 44 143 if (@_ > 1)
1478 2 42 if $yesno and $yesno eq "NONE"
1521 0 0 if @_ > 1
1600 90 410 if defined $value
1628 47 96 if ($self->output_to_core) { }
1666 0 120 if ($dirname)
1703 1 119 if ($self->{'MP5_TmpToCore'}) { }
1705 0 1 unless $io = "IO::File"->new(\$var, "+>:")
1708 1 118 if ($self->tmp_dir)
1711 0 119 unless $io = tmpopen($args)
1712 0 119 unless binmode $io