Branch Coverage

lib/Sisimai/MIME.pm
Criterion Covered Total %
branch 105 124 84.6


line true false branch
25 0 8698 unless ref $argv1 eq "SCALAR"
31 3470 5228 if (rindex($text1, ' ') > -1) { }
40 19376 1276 unless $e =~ /[ \t]*=[?][-_0-9A-Za-z]+[?][BbQq][?].+[?]=?[ \t]*/
52 0 2667 unless ref $argvs eq "ARRAY"
64 490 2394 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 2269 scalar @decodedtext0 ? :
81 0 2667 unless scalar @decodedtext0
84 403 2264 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 266 unless ref $argv1 eq "SCALAR"
108 265 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 2272 45 if (lc $argv1 =~ /\bboundary=([^ ]+)/)
219 2241 31 if $start > -1
220 54 2218 if $start > 0
243 5040 0 $$argv0 =~ /$thisformat/ ? :
244 194 4846 index($argv1, 'multipart/alternative') == 0 ? :
248 41 4999 unless $mimeformat =~ /$leavesonly/
249 0 4999 if $alternates and $mimeformat eq "text/html"
260 269 4730 if (index($mimeformat, 'multipart/') == 0) { }
264 0 269 unless length $innerparts[0]
265 245 24 if $innerparts[0] eq "\n"
269 522 39 if ($e =~ /$thisformat/) { }
273 67 455 unless $nextformat =~ /$leavesonly/
274 170 285 if $nextformat eq "text/html"
285 1297 3433 if ($upperchunk =~ /Content-Transfer-Encoding: ([^\s;]+)/) { }
289 218 1079 if ((my $ctencoding = lc $1) eq 'quoted-printable') { }
29 1050 elsif ($ctencoding eq 'base64') { }
788 262 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 1292 if index($getdecoded, "\r\n") > -1
313 608 689 if ($mimeformat =~ /$alsoappend/) { }
21 668 elsif ($mimeformat eq 'text/html') { }
317 70 538 if substr($upperchunk, 0, 1) eq " "
318 608 0 if substr($upperchunk, -1, 1) eq " "
325 1297 0 if length $getdecoded
328 2706 727 if (index($mimeformat, "message/") == 0 or $mimeformat eq "text/rfc822-headers")
337 5 3428 unless $lowerchunk =~ /\n\z/
354 1898 31 $argv0 =~ qr"\A([0-9a-z]+/[^ ;]+)" ? :
357 31 1898 unless index($mimeformat, "multipart/") > -1
358 13 1885 unless $ehboundary
375 489 1396 unless length $multiparts[0]
391 4725 3561 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 4754 3532 if ($e =~ /\A(?:Content-[A-Za-z-]+:.+?\r?\n)?Content-Type:[ ]*[^\s]+/) { }