Condition Coverage

blib/lib/MIME/Mini.pm
Criterion Covered Total %
condition 153 243 62.9


and 3 conditions

line !l l&&!r l&&r condition
37 18 30 130 exists $mail->{'header'} and exists $mail->{'header'}{'content-type'}
12 0 36 defined $parent and exists $parent->{'mime_type'}
0 30 6 defined $parent and exists $parent->{'mime_type'} and $parent->{'mime_type'} =~ m[^multipart/digest$]iu
38 6 0 130 exists $mail->{'header'} && exists $mail->{'header'}{'content-type'}
41 0 112 24 defined $type and $type =~ m[^multipart/]iu && $boundary || $type =~ m[^message/rfc822$]iu
65 30 0 54 defined $1 and $1 eq "--"
75 54 2 6 $state eq "part" and length $text
76 8 38 16 $state eq "epilogue" and length $text
98 734 1564 68 not defined $parent and /^From (?:\S+\s+)?\s*[a-zA-Z]+\s+[a-zA-Z]+\s+\d{1,2}\s+\d{2}:\d{2}:\d{2}\s+(?:[A-Z]+\s+)?\d{4}/u
100 22 0 46 $mail and exists $mail->{'mbox'}
0 0 46 $mail and exists $mail->{'mbox'} and exists $mail->{'body'}
129 8 110 22 $mail and exists $mail->{'mbox'}
110 2 20 $mail and exists $mail->{'mbox'} and exists $mail->{'body'}
142 200 70 2 exists $mail->{'mime_boundary'} and not exists $mail->{'mime_parts'}
155 8 4 12 exists $m->{'mime_type'} and $m->{'mime_type'} =~ m[^multipart/]iu
166 0 4 8 exists $m->{'header'} and exists $m->{'header'}{'mime-version'}
175 16 20 4 exists $m->{'mime_type'} and $m->{'mime_type'} =~ m[^message/]iu
176 16 0 20 exists $m->{'mime_type'} and $m->{'mime_type'} =~ m[^multipart/]iu
16 4 16 exists $m->{'mime_type'} and $m->{'mime_type'} =~ m[^multipart/]iu and @{$m->{'mime_parts'};} <= 1
241 36 6 2 $r and exists $m->{'mime_parts'}
242 36 6 2 $r and exists $m->{'mime_message'}
272 36 66 257 exists $m->{'header'} and exists $m->{'header'}{lc $h}
309 32 0 0 defined $ENV{'LANG'} && $ENV{'LANG'} =~ /^.+\.(.+)$/u && $1 ne 'UTF-8'
318 329 649 45 $lf && $lf + ($lf ? 1 : 0) + length($_) - $p > 78
334 80 2 16 $decode and substr($n, -1) eq "*"
346 56 42 2 defined $e and not $e =~ /^(?:[78]bit|binary|quoted-printable|base64)$/iu
348 20 2 76 defined $type and $type =~ m[^((?:text|image|audio|video|application|message|multipart)/[^\s;]+)]iu
349 2 18 2 not defined $type and defined $p
20 0 2 not defined $type and defined $p and exists $p->{'mime_type'}
0 0 2 not defined $type and defined $p and exists $p->{'mime_type'} and $p->{'mime_type'} =~ m[^multipart/digest]iu
357 6 4 12 defined $e && $e =~ /^([78]bit|binary|quoted-printable|base64)$/iu
0 6 4 exists $m->{'body'} && $m->{'body'} =~ tr/\200-\377//
394 42 0 4 $enc and not $c
395 42 2 2 $c and not $l
412 54 8 2 exists $a{'filename'} and not exists $a{'body'}
62 0 2 exists $a{'filename'} and not exists $a{'body'} and not exists $a{'message'}
8 0 2 exists $a{'filename'} and not exists $a{'body'} and not exists $a{'message'} and not exists $a{'parts'}
0 0 2 exists $a{'filename'} and not exists $a{'body'} and not exists $a{'message'} and not exists $a{'parts'} and -r $a{'filename'}
0 0 2 exists $a{'filename'} and not exists $a{'body'} and not exists $a{'message'} and not exists $a{'parts'} and -r $a{'filename'} and stat $a{'filename'}
0 0 2 exists $a{'filename'} and not exists $a{'body'} and not exists $a{'message'} and not exists $a{'parts'} and -r $a{'filename'} and stat $a{'filename'} and open my $fh, "<", $a{'filename'}
426 34 0 30 grep {/^(?:date|from|sender|reply-to)$/iu;} keys %a and not grep({/^date$/iu;} keys %a)
427 34 0 30 grep {/^(?:date|from|sender|reply-to)$/iu;} keys %a and not grep({/^mime-version$/u;} keys %a)
428 34 0 30 grep {/^(?:date|from|sender|reply-to)$/iu;} keys %a and not grep({/^message-id$/iu;} keys %a)
429 18 10 36 $type =~ m[^text/plain$]iu and $char =~ /^us-ascii$/iu
437 64 0 0 exists $a{'mbox'} and defined $a{'mbox'}
64 0 0 exists $a{'mbox'} and defined $a{'mbox'} and length $a{'mbox'}
466 10 0 0 $len > 1024 && $high > $len * 0.167
569 0 0 62 exists $m->{'mime_type'} and $m->{'mime_type'} =~ m[^multipart/]iu
0 2 60 exists $m->{'mime_type'} and $m->{'mime_type'} =~ m[^multipart/]iu and exists $m->{'mime_parts'}
571 88 0 2 mimetype($_) =~ m[^application/ms-tnef]iu && filename($_) =~ /winmail\.dat$/iu
590 0 2 12 defined $type and $type == MESSAGE()
604 0 2 0 defined $type and $type == MESSAGE()
618 0 2 0 defined $type and $type == ATTACHMENT()
620 0 0 0 $id == ATTACH_RENDDATA() and @attachment
0 0 0 $id == ATTACH_RENDDATA() and @attachment and not exists $attachment->{'body'}
629 0 0 0 $id == ATTACH_FILENAME() and not exists $attachment->{'filename'}
630 0 0 0 $id == ATTACH_ATTACHMENT() and $fname = realname($buf)
658 2 0 0 @attachment and not exists $attachment->{'body'}

or 2 conditions

line l !l condition
44 18 2 delete $mail->{'body'} || ''
54 62 0 delete $mail->{'body'} || ''
101 46 0 &$act(mime($mail, $parent)) or return
248 2 0 $i || 0
434 6 0 $a{'parts'} || []
435 12 0 $a{'message'} || {}
436 46 0 $a{'body'} || ''
629 0 0 $mimetype{$attachment->{'filename'} =~ /\.([^.]+)$/u or 'other'} || 'application/octet-stream'
630 0 0 $mimetype{$attachment->{'filename'} =~ /\.([^.]+)$/u or 'other'} || 'application/octet-stream'

or 3 conditions

line l !l&&r !l&&!r condition
37 130 6 42 exists $mail->{'header'} and exists $mail->{'header'}{'content-type'} or defined $parent and exists $parent->{'mime_type'} and $parent->{'mime_type'} =~ m[^multipart/digest$]iu
41 62 20 54 $type =~ m[^multipart/]iu && $boundary || $type =~ m[^message/rfc822$]iu
306 18 36 33 not defined $s or $s =~ /^[\x00-\x7f]*$/u
317 0 6 0 $c || charsetof($h)
0 13 0 $c || charsetof($h)
364 4 0 0 param($p, 'content-disposition', 'filename') || param($p, 'content-type', 'name') || 'attachment' . ++$filename_counter
393 4 0 42 $high || $ctrl
409 2 62 0 $a{'type'} || (exists $a{'parts'} ? 'multipart/mixed' : (exists $a{'message'} ? 'message/rfc822' : 'text/plain'))
422 0 64 0 $a{'disposition'} || ($type =~ m[^(?:text/|message/rfc822)]iu ? 'inline' : 'attachment')
423 0 64 0 $a{'charset'} || charsetof($a{'body'})
424 0 64 0 $a{'encoding'} || ($multi || $msg ? '7bit' : ($a{'body'} ? choose_encoding($a{'body'}) : '7bit'))
431 10 0 54 $a{'filename'} or $a{'size'}
0 0 54 $a{'filename'} or $a{'size'} or $a{'created'}
0 0 54 $a{'filename'} or $a{'size'} or $a{'created'} or $a{'modified'}
0 0 54 $a{'filename'} or $a{'size'} or $a{'created'} or $a{'modified'} or $a{'read'}
436 6 12 46 $multi or $msg
653 2 0 0 $type == MESSAGE() or $type == ATTACHMENT()