Branch Coverage

blib/lib/Mail/Message/Body/Encode.pm
Criterion Covered Total %
branch 82 130 63.0


line true false branch
45 0 28 if @_
46 28 0 unless $self->{'MMBE_det'}
53 86 50 if not $charset or $charset eq "PERL"
55 0 50 unless my $enc = &find_encoding($charset)
69 0 71 unless builtin::blessed($type_to)
75 64 7 unless builtin::blessed($transfer)
86 68 3 if ($is_text) { }
0 3 elsif ($trans_was eq $trans_to) { }
90 63 5 if (my $charset = delete $args{'charset'}) { }
0 10 elsif (not $char_to and $char_was) { }
92 42 21 if (not $char_to or $char_to ne $charset)
103 0 68 if ($char_to and $trans_to ne "none" and $char_to eq "PERL")
112 4 64 if ($from and $to)
113 0 4 if ($char_was ne $char_to and $from->name eq $to->name)
120 0 4 if $trans_was eq $trans_to and $char_was eq $char_to
132 62 9 if ($trans_was eq 'none') { }
9 0 elsif (my $decoder = $self->getTransferEncHandler($trans_was)) { }
144 68 3 if ($is_text) { }
145 0 68 unless ($char_was)
152 0 0 unless ($char_to)
160 0 26 $to && $from && $char_was ne $char_to ? :
9 26 $from && $char_to eq 'PERL' ? :
33 35 $to && $char_was eq 'PERL' ? :
166 42 26 $new_data ? :
178 36 35 if ($trans_to ne "none")
179 0 36 unless $trans = $self->getTransferEncHandler($trans_to)
183 36 35 defined $trans ? :
193 6 22 if (utf8::is_utf8($text))
194 0 6 unless $args{'external'}
201 0 0 if $text =~ / [\xC0-\xDF][\x80-\xBF] # 110xxxxx, 10xxxxxx | [\xE0-\xEF][\x80-\xBF]{2} # 1110xxxx, (10xxxxxx)\302\262 | [\xF0-\xF7][\x80-\xBF]{3} # 11110xxx, (10xxxxxx)3 /x and not $text =~ /[\xC0-\xFF][^\x80-\xBF]/ and not $text =~ /[\xC0-\xFF]\z/
211 0 28 $text =~ /[\x80-\xFF]/ ? :
217 22 1 if $self->checked
221 0 1 if $encoding eq "none"
225 1 0 $encoder ? :
235 4 53 if ($mime->isBinary)
236 3 1 $self->transferEncoding eq 'none' ? :
240 28 25 if (not $charset or $charset eq "PERL")
246 29 24 $enc_was eq 'none' ? :
248 22 31 $enc_was eq $enc && $old_charset eq $charset ? :
259 1 3 unless @_
262 0 3 if $eol eq "NATIVE"
264 0 3 unless $eol ne $old_eol or not $self->checked
272 1 0 $eol eq 'LF' ? :
0 1 $eol eq 'CR' ? :
2 1 $eol eq 'CRLF' ? :
275 2 1 unless $wrong
278 0 0 $eol eq 'CR' ? :
1 0 $eol eq 'CRLF' ? :
286 0 0 if $self == $body
293 0 0 $mime eq $encoded->type && $transfer eq $encoded->transferEncoding ? :
301 0 11 unless my $type = $self->type
302 0 11 unless my $mime = $mime_types->type($type->body)
315 1 0 if ($field = $self->disposition)
316 1 0 if $field->can("study")
320 1 0 if (not defined $raw and $field = $self->type)
321 1 0 if $field->can("study")
326 1 0 if (not defined $raw && length $raw) { }
0 0 elsif (index($raw, '?') != -1) { }
335 0 1 unless @_
339 0 1 if (defined $base)
343 0 1 length $filename && $filename =~ /(.*)\.([^.]+)/ ? :
372 35 11 if exists $transfer_encoders{$type}
374 0 11 unless my $class = $transfer_encoder_classes{$type}
378 0 11 if $@
388 0 0 if (ref $what) { }