Branch Coverage

blib/lib/Mail/SpamAssassin/Plugin/MIMEEval.pm
Criterion Covered Total %
branch 1 174 0.5


line true false branch
96 0 0 if $numlos <= $numhis
120 0 0 unless exists $pms->{'mime_checked_attachments'}
121 0 0 unless exists $pms->{'mime_ascii_text_illegal'}
145 0 0 unless $ratio =~ /^\d{0,3}\.\d{1,3}$/
147 0 0 unless exists $pms->{'mime_checked_attachments'}
148 0 0 unless exists $pms->{'mime_text_unicode_ratio'}
159 0 0 if grep {$_ eq 'all';} @locales
161 0 0 if defined $type
163 0 0 if (defined $type and not Mail::SpamAssassin::Locales::is_charset_ok_for_locales($type, @locales))
172 0 0 if ($self->are_more_high_bits_set($body))
183 0 0 unless exists $pms->{'mime_checked_attachments'}
184 0 0 unless exists $pms->{$test}
193 0 0 if $ctype =~ m[^text/html]i
195 0 0 unless exists $pms->{'mime_checked_attachments'}
196 0 0 unless exists $pms->{'mime_body_html_count'}
205 0 0 if $ctype =~ m[^text/html]i
207 0 0 unless exists $pms->{'mime_checked_attachments'}
208 0 0 unless exists $pms->{'mime_body_html_count'}
209 0 0 unless exists $pms->{'mime_body_text_count'}
217 0 0 unless exists $pms->{'mime_checked_attachments'}
218 0 0 unless exists $pms->{'mime_multipart_ratio'}
228 0 0 if ($ctype eq 'text/html') { }
0 0 elsif ($ctype =~ /^text/i) { }
235 0 0 if ($cte =~ /base64/) { }
0 0 elsif ($cte =~ /quoted-printable/) { }
242 0 0 if ($cd and $cd =~ /attachment/)
246 0 0 if ($ctype =~ /^text/ and $cte =~ /base64/ and !$charset || $charset =~ /(?:us-ascii|ansi_x3\.4-1968|iso-ir-6|ansi_x3\.4-1986|iso_646\.irv:1991|ascii|iso646-us|us|ibm367|cp367|csascii)/ and not $cd && $cd =~ /^(?:attachment|inline)/)
254 0 0 if ($charset =~ /iso-\S+-\S+\b/i and not $charset =~ /iso-(?:8859-\d{1,2}|2022-(?:jp|kr))\b/)
281 0 0 if ($charset =~ /[a-z]/i)
282 0 0 if (defined $pms->{'mime_html_charsets'}) { }
288 0 0 if (not $pms->{'mime_faraway_charset'})
291 0 0 if (not grep({$_ eq 'all';} @l) || Mail::SpamAssassin::Locales::is_charset_ok_for_locales($charset, @l))
345 0 0 if ($ctype eq 'multipart/alternative')
350 0 0 defined $cte ? :
353 0 0 defined $cd ? :
355 0 0 if $charset
356 0 0 if $name
362 0 0 unless ($p->is_leaf)
368 0 0 unless $cd =~ /attachment/
387 0 0 if ($pms->{'mime_multipart_alternative'} and not $cd =~ /attachment/ and $ctype eq 'text/plain' || $ctype eq 'text/html')
392 0 0 if ($where != 1 and $cte eq 'quoted-printable' and not /^SPAM: /)
402 0 0 if (length $_ > 79)
417 0 0 if (index($_, '=') != -1)
420 0 0 if ($qp)
425 0 0 if ($trailing)
435 0 0 if ($ctype eq 'text/plain' and !defined($charset) || $charset eq 'us-ascii')
437 0 0 if (/[\x00\x0d\x80-\xff]+/)
438 0 0 if (would_log('dbg', 'eval'))
449 0 0 if ($ctype eq 'text/plain' and $cte eq '' || $cte eq '7bit' || $cte eq '8bit')
456 0 0 if ($subs and would_log('dbg', 'eval'))
458 0 0 if length $str > 512
467 0 0 if ($qp_bytes)
473 0 0 if ($normal_chars)
477 0 0 if ($pms->{'mime_multipart_alternative'})
482 0 0 unless defined $part_bytes[$i]
483 0 0 if (not defined $html and $part_type[$i] eq 'text/html') { }
0 0 elsif (not defined $text and $part_type[$i] eq 'text/plain') { }
489 0 0 if defined $html and defined $text
491 0 0 if (defined $text and defined $html and $html > 0)
498 0 0 if ($val != 0)
525 0 0 unless exists $pms->{'mime_checked_attachments'}
526 0 0 unless exists $pms->{'mime_qp_ratio'}
532 0 0 defined $qp_ratio && $qp_ratio >= $min ? :
538 0 81 if ref $type
546 0 0 if (exists $pms->{'uppercase'})
550 0 0 if ($self->body_charset_is_likely_to_fp($pms))
563 0 0 unless /\S\s+\S/
565 0 0 if m[^(?:[A-Za-z0-9+/=]{60,76} ){2}]
581 0 0 if ($len < 200)
585 0 0 if ($upper + $lower == 0) { }
600 0 0 unless exists $pms->{'mime_checked_attachments'}
603 0 0 if defined $type
604 0 0 if defined $type
605 0 0 if (defined $pms->{'mime_html_charsets'})
611 0 0 if ($charset =~ /^$CHARSETS_LIKELY_TO_FP_AS_CAPS$/)
620 0 0 unless (defined $type)
621 0 0 if ($type =~ /charset="([^"]+)"/i)
622 0 0 if ($type =~ /charset='([^']+)'/i)
623 0 0 if ($type =~ /charset=(\S+)/i)
634 0 0 if lc $p->{'type'} eq 'multipart/related'
635 0 0 if lc $p->{'type'} eq 'application/rtf'
636 0 0 if $p->{'type'} =~ m[^text/]i
651 0 0 unless (defined $pms->{'base64_length'})
655 0 0 if defined $max and $pms->{'base64_length'} > $max
671 0 0 if $ctype eq 'application/ics'
674 0 0 unless $cte =~ /^base64$/
676 0 0 if length $l > $result