Branch Coverage

blib/lib/MIME/Entity.pm
Criterion Covered Total %
branch 161 240 67.0


line true false branch
293 85 20 unless $KnownField{$field}
375 10 13 if $self->head->ambiguous_content
376 7 6 unless $self->is_multipart
379 5 7 if $part->ambiguous_content
407 151 0 unless defined $index
410 151 0 if $index < 0
597 39 0 unless ref $self
608 10 29 exists $params{'Top'} ? :
614 6 33 exists $params{'Filename'} ? :
615 0 39 if defined $filename and $filename eq ""
618 7 32 if ($type =~ m[^(multipart/|message/(rfc822|partial|external-body|delivery-status|disposition-notification|feedback-report)$)]i)
619 2 5 unless $encoding =~ /^(|7bit|8bit|binary|-suggest)$/i
624 5 32 if ($is_multipart) { }
627 2 3 if (defined($boundary = $params{'Boundary'}))
628 0 2 if ($boundary eq '') { }
0 2 elsif ($boundary =~ m[[^0-9a-zA-Z_\'\(\)\+\,\.\/\:\=\?\- ]]) { }
639 3 2 unless defined $boundary
643 14 18 if ($params{'Path'}) { }
18 0 elsif (defined $params{'Data'}) { }
654 6 26 unless textual_type($type)
668 1 36 if $charset
669 17 20 if defined $filename
670 5 32 if defined $boundary
675 30 7 if (not $encoding) { }
3 4 elsif (lc $encoding eq '-suggest') { }
683 32 5 unless ($is_multipart)
686 17 15 if defined $filename
691 37 0 if $encoding
692 0 37 if $desc
697 2 35 if (defined $id)
698 1 1 unless ($id =~ /^<.*>$/)
703 27 10 if $top
706 27 10 if $top
715 2 105 if ($tag =~ /^-(.*)/s) { }
0 105 elsif ($tag =~ /(.*):$/s) { }
21 84 elsif (known_field(lc $tag)) { }
722 0 23 ref $value ? :
723 0 23 unless defined $value and $value ne ""
753 0 20 unless ref $self->{$_}
756 4 3 $self->bodyhandle ? :
760 2 12 if $self->{$_}
816 0 3 if (@_ > 1) { }
820 0 3 unless my $fh = "IO::File"->new(\$output, ">:")
867 195 464 if @_ > 1
904 0 354 if @_
905 0 354 $self->{'ME_EffType'} ? :
925 50 15 if @_ > 1
946 244 2087 if @_ > 1
969 0 46 unless $self->head
971 24 22 $type eq 'multipart' ? :
991 0 0 wantarray ? :
0 444 unless $self->head
1010 74 0 if $self->bodyhandle
1057 5 227 if ref $_[0]
1058 111 116 @_ ? :
1096 54 18 if @_ > 1
1172 9 3 if $self->is_multipart and not $force
1217 0 1 unless $self->is_multipart
1218 0 1 if $self->parts > 1
1226 0 1 if ($self->parts == 1) { }
1240 0 0 if $self->is_multipart
1279 3 1 if $self->bodyhandle
1298 2 23 if ($body->[$line] =~ /\A--[ \040][\r\n]+\Z/)
1339 2 1 if ($self->is_multipart)
1341 1 1 if ($first_part)
1348 0 1 unless textual_type($self->head->mime_type)
1352 0 1 unless $self->bodyhandle
1434 3 3 if ($self->is_multipart and not $params{'Attach'})
1440 0 3 if (defined($sig = $params{'Signature'})) { }
3 0 elsif ($params{'File'}) { }
1441 0 0 ref $sig ? :
1444 0 3 unless my $fh = "IO::File"->new($params{'File'})
1446 0 3 unless $fh->close
1453 0 3 if ($params{'Attach'}) { }
1463 0 0 unless $self->head->mime_type =~ m[text/]i or $params{'Force'}
1467 0 3 unless $self->bodyhandle
1471 3 0 if (not defined $params{'Remove'} or $params{'Remove'} > 0)
1477 0 3 unless $io = $self->open("w")
1479 0 3 unless ($body[-1] || '') =~ /\n\Z/
1481 0 3 unless $io->close
1514 2 1 if ($type eq 'text' or $type eq 'message') { }
1515 0 0 $self->parts ? :
0 2 unless $self->bodyhandle
1517 2 0 if ($IO = $self->bodyhandle->open("r"))
1521 1 5 if $unclean = length $_ > 999 || /[\200-\377]/
1526 0 1 $type eq 'message' ? :
1 1 $unclean ? :
1532 0 1 $type eq 'multipart' ? :
1539 26 4 $type =~ /^(text|message|multipart)$/ ? :
1596 1 4 int(@_) % 2 == 0 ? :
1607 5 0 if ($o_nonstandard eq "ERASE")
1610 0 19 if ($tag =~ /\AContent-/i and not $tag =~ /\AContent-$StandardFields\Z/io)
1618 5 0 if ($o_length eq 'COMPUTE') { }
0 0 elsif ($o_length eq 'ERASE') { }
1622 1 4 if ($self->is_multipart) { }
1628 4 0 unless ($ENCBODY)
1651 0 4 unless $part->sync_headers($opts)
1709 0 0 unless $fh
1710 0 0 unless defined $indent
1721 0 0 $self->bodyhandle ? :
1726 0 0 if $filename
1730 0 0 unless defined $subj
1732 0 0 if $subj
1736 0 0 if @parts
1815 1 66 if @_ < 2
1816 8 59 unless ref $out
1863 12 71 if ($type eq 'multipart') { }
0 71 elsif ($self->parts) { }
1868 9 3 if (defined $plines) { }
1871 2 7 if @$plines > 0
1887 3 9 unless $self->epilogue
1888 1 11 if ($epilogue ne "")
1890 0 1 unless $epilogue =~ /\n\Z/
1901 0 0 if $need_sep++
1908 71 0 $self->bodyhandle ? :
1928 7 64 if ($self->bodyhandle->is_encoded) { }
1938 58 6 textual_type($self->head->mime_type) ? :
0 64 unless $decoder->encode($IO, $out, textual_type($self->head->mime_type) ? 1 : 0)
1971 0 19 unless my $fh = "IO::File"->new(\$output, ">:")
2002 0 0 unless my $fh = "IO::File"->new(\$output, ">:")