Condition Coverage

blib/lib/Encode/MIME/Header.pm
Criterion Covered Total %
condition 63 84 75.0


and 3 conditions

line !l l&&!r l&&r condition
90 200 0 416 not $stop and $str =~ s[^((?:[^\r\n]*(?:${re_newline}[ \t])?)*)($re_newline)?][my $line = $1; my $sep = defined $2 ? $2 : ''; $stop = 1 unless length $line or length $sep; '???' while not $STRICT_DECODE and $line =~ s/$re_capture_encoded_word_split\s*=\?\1\2\?\3\?($re_encoded_text)\?=/=?$1$2?$3?$4$5?=/os; '???' while not $stop and $line =~ s[^(.*?)$re_match_decode][my $begin = $1 . $2; my $words = $3; $begin =~ tr/\n\r//d; $output .= $begin; '???' while not $stop and $words =~ s[^(.*?)($re_capture_decode)][$output .= $1; my $orig = $2; my $charset = $3; my($mime_enc, $text) = split(/\?/, $5, 3); $text =~ tr/\n\r//d; my $enc = &Encode::find_mime_encoding($charset); unless (defined $enc or $STRICT_DECODE) { $charset = 'UTF-8' if lc $charset eq 'utf8'; $enc = &Encode::find_encoding($charset); } ; if (not defined $enc) { Carp::croak(qq[Unknown charset "$charset"]) if not ref $chk and $chk & 1; Carp::carp(qq[Unknown charset "$charset"]) if not ref $chk and $chk & 2; $stop = 1 if not ref $chk and $chk & 4; $output .= ($output =~ /(?:\A|[ \t])$/ ? '' : ' ') . $orig unless $stop; $stop ? $orig : ''; } else { if (uc $mime_enc eq 'B' and $obj->{'decode_b'}) { my $decoded = _decode_b($enc, $text, $chk); $stop = 1 if not defined $decoded || ref $chk and $chk & 4; $output .= defined $decoded ? $decoded : $text unless $stop; $stop ? $orig : ''; } elsif (uc $mime_enc eq 'Q' and $obj->{'decode_q'}) { my $decoded = _decode_q($enc, $text, $chk); $stop = 1 if not defined $decoded || ref $chk and $chk & 4; $output .= defined $decoded ? $decoded : $text unless $stop; $stop ? $orig : ''; } else { Carp::croak(qq[MIME "$mime_enc" unsupported]) if not ref $chk and $chk & 1; Carp::carp(qq[MIME "$mime_enc" unsupported]) if not ref $chk and $chk & 2; $stop = 1 if not ref $chk and $chk & 4; $output .= ($output =~ /(?:\A|[ \t])$/ ? '' : ' ') . $orig unless $stop; $stop ? $orig : ''; } ; } ;]es; unless ($stop) { $output .= $words; $words = ''; } ; $words;]es; unless ($stop) { $line =~ tr/\n\r//d; $output .= $line . $sep; $line = ''; $sep = ''; } ; $line . $sep;]es
100 182 234 10052 not $STRICT_DECODE and $line =~ s/$re_capture_encoded_word_split\s*=\?\1\2\?\3\?($re_encoded_text)\?=/=?$1$2?$3?$4$5?=/os
103 200 216 197 not $stop and $line =~ s[^(.*?)$re_match_decode][my $begin = $1 . $2; my $words = $3; $begin =~ tr/\n\r//d; $output .= $begin; '???' while not $stop and $words =~ s[^(.*?)($re_capture_decode)][$output .= $1; my $orig = $2; my $charset = $3; my($mime_enc, $text) = split(/\?/, $5, 3); $text =~ tr/\n\r//d; my $enc = &Encode::find_mime_encoding($charset); unless (defined $enc or $STRICT_DECODE) { $charset = 'UTF-8' if lc $charset eq 'utf8'; $enc = &Encode::find_encoding($charset); } ; if (not defined $enc) { Carp::croak(qq[Unknown charset "$charset"]) if not ref $chk and $chk & 1; Carp::carp(qq[Unknown charset "$charset"]) if not ref $chk and $chk & 2; $stop = 1 if not ref $chk and $chk & 4; $output .= ($output =~ /(?:\A|[ \t])$/ ? '' : ' ') . $orig unless $stop; $stop ? $orig : ''; } else { if (uc $mime_enc eq 'B' and $obj->{'decode_b'}) { my $decoded = _decode_b($enc, $text, $chk); $stop = 1 if not defined $decoded || ref $chk and $chk & 4; $output .= defined $decoded ? $decoded : $text unless $stop; $stop ? $orig : ''; } elsif (uc $mime_enc eq 'Q' and $obj->{'decode_q'}) { my $decoded = _decode_q($enc, $text, $chk); $stop = 1 if not defined $decoded || ref $chk and $chk & 4; $output .= defined $decoded ? $decoded : $text unless $stop; $stop ? $orig : ''; } else { Carp::croak(qq[MIME "$mime_enc" unsupported]) if not ref $chk and $chk & 1; Carp::carp(qq[MIME "$mime_enc" unsupported]) if not ref $chk and $chk & 2; $stop = 1 if not ref $chk and $chk & 4; $output .= ($output =~ /(?:\A|[ \t])$/ ? '' : ' ') . $orig unless $stop; $stop ? $orig : ''; } ; } ;]es; unless ($stop) { $output .= $words; $words = ''; } ; $words;]es
112 4 193 50224 not $stop and $words =~ s[^(.*?)($re_capture_decode)][$output .= $1; my $orig = $2; my $charset = $3; my($mime_enc, $text) = split(/\?/, $5, 3); $text =~ tr/\n\r//d; my $enc = &Encode::find_mime_encoding($charset); unless (defined $enc or $STRICT_DECODE) { $charset = 'UTF-8' if lc $charset eq 'utf8'; $enc = &Encode::find_encoding($charset); } ; if (not defined $enc) { Carp::croak(qq[Unknown charset "$charset"]) if not ref $chk and $chk & 1; Carp::carp(qq[Unknown charset "$charset"]) if not ref $chk and $chk & 2; $stop = 1 if not ref $chk and $chk & 4; $output .= ($output =~ /(?:\A|[ \t])$/ ? '' : ' ') . $orig unless $stop; $stop ? $orig : ''; } else { if (uc $mime_enc eq 'B' and $obj->{'decode_b'}) { my $decoded = _decode_b($enc, $text, $chk); $stop = 1 if not defined $decoded || ref $chk and $chk & 4; $output .= defined $decoded ? $decoded : $text unless $stop; $stop ? $orig : ''; } elsif (uc $mime_enc eq 'Q' and $obj->{'decode_q'}) { my $decoded = _decode_q($enc, $text, $chk); $stop = 1 if not defined $decoded || ref $chk and $chk & 4; $output .= defined $decoded ? $decoded : $text unless $stop; $stop ? $orig : ''; } else { Carp::croak(qq[MIME "$mime_enc" unsupported]) if not ref $chk and $chk & 1; Carp::carp(qq[MIME "$mime_enc" unsupported]) if not ref $chk and $chk & 2; $stop = 1 if not ref $chk and $chk & 4; $output .= ($output =~ /(?:\A|[ \t])$/ ? '' : ' ') . $orig unless $stop; $stop ? $orig : ''; } ; } ;]es
131 1 12 0 not ref $chk and $chk & 1
132 1 12 0 not ref $chk and $chk & 2
133 1 10 2 not ref $chk and $chk & 4
137 50165 0 46 uc $mime_enc eq 'B' and $obj->{'decode_b'}
0 50165 0 uc $mime_enc eq 'Q' and $obj->{'decode_q'}
139 46 0 0 not defined $decoded || ref $chk and $chk & 4
144 50163 0 2 not defined $decoded || ref $chk and $chk & 4
148 0 0 0 not ref $chk and $chk & 1
149 0 0 0 not ref $chk and $chk & 2
150 0 0 0 not ref $chk and $chk & 4
178 3 190 7 not ref $chk and $chk
193 4 3 not ref $chk and $chk and not $chk & 8
201 4 50197 10 not ref $chk and $chk
203 4 50197 10 not ref $chk and $chk
50201 8 2 not ref $chk and $chk and $octets ne ''
211 2 51 4 not ref $chk and $chk
53 2 2 not ref $chk and $chk and not $chk & 8
241 2 51 4 !ref($chk) && $chk
257 2 51 4 not ref $chk and $chk
53 2 2 not ref $chk and $chk and not $chk & 8

or 3 conditions

line l !l&&r !l&&!r condition
95 214 6 196 length $line or length $sep
124 50208 10 6 defined $enc or $STRICT_DECODE
139 46 0 0 defined $decoded || ref $chk
144 50163 0 2 defined $decoded || ref $chk