Branch Coverage

blib/lib/Mail/Message/Body/Encode.pm
Criterion Covered Total %
branch 71 114 62.2


line true false branch
36 82 44 if not $charset or $charset eq "PERL"
38 0 44 unless my $enc = &find_encoding($charset)
53 0 66 unless ref $type_to
59 59 7 unless ref $transfer
69 63 3 if ($is_text) { }
0 3 elsif ($trans_was eq $trans_to) { }
73 61 2 if (my $charset = delete $args{'charset'}) { }
0 4 elsif (not $char_to and $char_was) { }
75 42 19 if (not $char_to or $char_to ne $charset)
86 0 63 if ($char_to and $trans_to ne "none" and $char_to eq "PERL")
97 1 62 if ($from and $to)
98 0 1 if ($char_was ne $char_to and $from->name eq $to->name)
105 0 1 if $trans_was eq $trans_to and $char_was eq $char_to
117 58 8 if ($trans_was eq 'none') { }
8 0 elsif (my $decoder = $self->getTransferEncHandler($trans_was)) { }
130 63 3 if ($is_text) { }
131 0 63 unless ($char_was)
138 0 0 unless ($char_to)
145 0 21 $to && $from && $char_was ne $char_to ? :
9 21 $from && $char_to eq 'PERL' ? :
33 30 $to && $char_was eq 'PERL' ? :
151 42 21 $new_data ? :
164 34 32 if ($trans_to ne "none")
165 0 34 unless $trans = $self->getTransferEncHandler($trans_to)
170 34 32 defined $trans ? :
180 0 32 if @_
181 32 0 unless $self->{'MMBE_det'}
191 6 26 if (utf8::is_utf8($text))
192 0 6 unless $args{'external'}
200 0 32 if $text =~ /[\0xC0-\xDF][\x80-\xBF]/ and not $text =~ /[\0xC0-\xFF]([^\0x80-\xBF]|$)/
206 0 32 $text =~ /[\x80-\xFF]/ ? :
213 22 1 if $self->checked
217 0 1 if $encoding eq "none"
222 1 0 $encoder ? :
241 32 23 if (not $charset or $charset eq "PERL")
248 30 0 defined $mime ? :
30 25 if $enc eq "none"
253 4 51 !($mime && $mime =~ m[^text/]i) ? :
255 23 32 $enc_was ne 'none' && $old_charset eq $new_charset ? :
265 0 0 if $self == $body
278 0 0 unless $newmime eq $mime
279 0 0 unless $transfer eq $encoded->transferEncoding
289 0 11 unless my $type = $self->type
290 0 11 unless my $mime = $mime_types->type($type->body)
303 1 0 if ($field = $self->disposition)
304 1 0 if $field->can("study")
310 1 0 if (not defined $raw and $field = $self->type)
311 1 0 if $field->can("study")
318 1 0 if (not defined $raw && length $raw) { }
0 0 elsif (index($raw, '?') >= 0) { }
327 0 1 unless @_
332 0 1 if (defined $base)
340 0 1 length $filename && $filename =~ /(.*)\.([^.]+)/ ? :
369 32 11 if exists $transfer_encoders{$type}
372 0 11 unless $class
375 0 11 if $@
385 0 0 if (ref $what) { }