Branch Coverage

lib/Sisimai/MIME.pm
Criterion Covered Total %
branch 104 124 83.8


line true false branch
25 0 8778 unless ref $argv1 eq "SCALAR"
31 3514 5264 if (rindex($text1, ' ') > -1) { }
40 19646 1276 unless $e =~ /[ \t]*=[?][-_0-9A-Za-z]+[?][BbQq][?].+[?]=?[ \t]*/
52 0 2692 unless ref $argvs eq "ARRAY"
64 490 2419 if ('Sisimai::MIME'->is_mimeencoded(\$e)) { }
66 22 468 unless $e =~ /\A(.*)=[?]([-_0-9A-Za-z]+)[?]([BbQq])[?](.+)[?]=?(.*)\z/
71 390 78 $encodingname eq 'B' ? :
78 125 2294 scalar @decodedtext0 ? :
81 0 2692 unless scalar @decodedtext0
84 403 2289 if ($characterset and $encodingname)
86 265 138 if $characterset eq "utf-8"
88 138 265 if ($characterset ne "utf8")
91 0 138 if $@
106 0 245 unless ref $argv1 eq "SCALAR"
108 244 1 unless (exists $heads->{'content-type'} and $heads->{'content-type'})
116 0 1 unless ($boundary00 and lc($$argv1) =~ m[{"7bit-encoded" => qr/^content-transfer-encoding:[ ]*7bit/m,"html-message" => qr/^content-type:[ ]*text\/html;/m,"only-charset" => qr/^[\s\t]+charset=['"]?([-0-9a-z]+)['"]?\b/,"quoted-print" => qr/^content-transfer-encoding:[ ]*quoted-printable/m,"some-iso2022" => qr/^content-type:[ ]*.+;[ ]*charset=["']?(iso-2022-[-a-z0-9]+)['"]?\b/m,"with-charset" => qr/^content[-]type:[ ]*.+[;][ ]*charset=['"]?([-0-9a-z]+)['"]?\b/}->{'quoted-print'}])
137 21 10 if ($mimeinside) { }
139 1 20 if ($e eq $boundary00) { }
157 1 9 if ((my $lowercased = lc $e) =~ /\A[-]{2}[^\s]+[^-]\z/) { }
1 8 elsif ($lowercased =~ /{7bit-encoded => \undef, html-message => \undef, only-charset => \undef, quoted-print => \undef, some-iso2022 => \undef, with-charset => \undef}->{'with-charset'}/ or $lowercased =~ /{7bit-encoded => \undef, html-message => \undef, only-charset => \undef, quoted-print => \undef, some-iso2022 => \undef, with-charset => \undef}->{'only-charset'}/) { }
1 7 elsif ($lowercased =~ /{7bit-encoded => \undef, html-message => \undef, only-charset => \undef, quoted-print => \undef, some-iso2022 => \undef, with-charset => \undef}->{'quoted-print'}/) { }
0 7 elsif ($e eq $boundary01) { }
160 0 1 unless ($e eq $boundary00)
168 0 1 if $ctencoding
173 1 0 if $encodename
184 0 1 if length $notdecoded
194 0 35 unless ref $argv1 eq "SCALAR"
197 35 0 $$argv1 =~ m[([+/=0-9A-Za-z\r\n]+)] ? :
213 2302 45 if (lc $argv1 =~ /\bboundary=([^ ]+)/)
219 2271 31 if $start > -1
220 54 2248 if $start > 0
243 5067 0 $$argv0 =~ /$thisformat/ ? :
244 194 4873 index($argv1, 'multipart/alternative') == 0 ? :
248 5 5062 unless $mimeformat =~ /$leavesonly/
249 0 5062 if $alternates and $mimeformat eq "text/html"
260 269 4793 if (index($mimeformat, 'multipart/') == 0) { }
264 0 269 unless length $innerparts[0]
265 245 24 if $innerparts[0] eq "\n"
269 309 237 if ($e =~ /$thisformat/) { }
273 1 308 unless $nextformat =~ /$leavesonly/
274 23 285 if $nextformat eq "text/html"
285 1288 3505 if ($upperchunk =~ /Content-Transfer-Encoding: ([^\s;]+)/) { }
289 197 1091 if ((my $ctencoding = lc $1) eq 'quoted-printable') { }
29 1062 elsif ($ctencoding eq 'base64') { }
788 274 elsif ($ctencoding eq '7bit') { }
299 59 729 if (lc($upperchunk) =~ /{7bit-encoded => \undef, html-message => \undef, only-charset => \undef, quoted-print => \undef, some-iso2022 => \undef, with-charset => \undef}->{'some-iso2022'}/) { }
311 5 1283 if index($getdecoded, "\r\n") > -1
313 614 674 if ($mimeformat =~ /$alsoappend/) { }
0 674 elsif ($mimeformat eq 'text/html') { }
317 70 544 if substr($upperchunk, 0, 1) eq " "
318 614 0 if substr($upperchunk, -1, 1) eq " "
325 1288 0 if length $getdecoded
328 2760 745 if (index($mimeformat, "message/") == 0 or $mimeformat eq "text/rfc822-headers")
337 5 3500 unless $lowerchunk =~ /\n\z/
354 1928 31 $argv0 =~ qr"\A([0-9a-z]+/[^ ;]+)" ? :
357 31 1928 unless index($mimeformat, "multipart/") > -1
358 13 1915 unless $ehboundary
375 489 1426 unless length $multiparts[0]
391 4752 3648 if $e =~ /\AContent-T[ry]/
392 51 0 if $e =~ /\A(.+?)Content-Type:/s or last XCCT
393 22 29 if $p =~ /\n\n/m
397 4781 3619 if ($e =~ /\A(?:Content-[A-Za-z-]+:.+?\r?\n)?Content-Type:[ ]*[^\s]+/) { }