Branch Coverage

blib/lib/Email/MIME/ContentType.pm
Criterion Covered Total %
branch 109 158 68.9


line true false branch
95 2 81 unless defined $ct and length $ct
102 0 81 unless ($ct =~ s[^($re_token)/($re_token)][])
103 0 0 unless ($STRICT_PARAMS and $ct =~ s[^($re_token_non_strict)/($re_token_non_strict)][])
115 0 81 if ($STRICT_PARAMS and length $ct and not $ct =~ /^;/) { }
138 2 32 unless defined $cd and length $cd
143 0 32 unless ($cd =~ s/^($re_token)//)
144 0 0 unless ($STRICT_PARAMS and $cd =~ s/^($re_token_non_strict)//)
156 0 32 if ($STRICT_PARAMS and length $cd and not $cd =~ /^;/) { }
174 0 15 unless exists $ct->{'type'}
175 0 15 unless exists $ct->{'subtype'}
177 0 15 unless $ct->{'type'} =~ /^(?:$re_token)*$/
178 0 15 unless $ct->{'subtype'} =~ /^(?:$re_token)*$/
180 0 15 if length($ct->{'type'}) + length($ct->{'subtype'}) > 76
183 0 15 if defined $extra
186 15 0 exists $ct->{'attributes'} ? :
187 13 2 if length $attrs
194 0 13 unless exists $cd->{'type'}
196 0 13 unless $cd->{'type'} =~ /^(?:$re_token)*$/
198 0 13 if length $cd->{'type'} > 77
201 0 13 if defined $extra
204 13 0 exists $cd->{'attributes'} ? :
205 11 2 if length $attrs
220 0 38 if $key =~ /$re_escape_extended_value/
221 0 38 unless defined $value
223 7 31 if ($value =~ /\P{ASCII}/)
230 20 18 if (not $ascii_value =~ /^(?:$re_token)*$/ or $ascii_value =~ /'/)
231 0 20 if ($ascii_value =~ /$re_invalid_for_quoted_value/)
232 0 0 unless @continuous_value
240 3 35 if (length($key) + length($ascii_value) > 75)
241 0 3 if length $key > 71
242 2 1 $ascii_value =~ /"$/ ? :
244 3 0 unless @continuous_value
247 10 28 if (@continuous_value)
249 3 7 unless (defined $extended_value_charset)
250 195 9 unless not $_ =~ /^(?:$re_token)*$/
2 1 if grep {$_ =~ /'/ unless not $_ =~ /^(?:$re_token)*$/;} @continuous_value
251 0 3 if $needs_quote and grep /$re_invalid_for_quoted_value/, @continuous_value
255 7 3 if (defined $extended_value_charset) { }
2 1 elsif ($needs_quote) { }
264 4 6 if ($value =~ /\P{ASCII}/ and length(my $oneparameter = "; $key*=" . join('', @continuous_value)) <= 78) { }
270 6 302 if (length($key) + length($count) + length($buf) + length($_) + $add_param_len > 78)
271 2 4 if $needs_quote
273 3 3 if defined $extended_value_charset
275 0 6 if length $parameter > 78
282 6 0 if (length $buf)
283 2 4 if $needs_quote
285 3 3 if defined $extended_value_charset
287 0 6 if length $parameter > 78
296 24 4 if length $ret
307 742 32 unless $_[0] =~ s/^\(//
311 10 398 if ($ch eq '(') { }
42 356 elsif ($ch eq ')') { }
12 344 elsif ($ch eq '\\') { }
315 32 10 if $level == 0
320 0 0 if $level != 0 and $STRICT_PARAMS
332 115 64 unless $_ =~ /^(.*)\*([0-9]+)\*?$/
335 38 26 if $_ =~ /\*$/
341 19 5 if $encoded{$_}
346 103 33 unless $_ =~ /^(.*)\*$/
348 0 33 unless defined $attribs->{$_} and $attribs->{$_} =~ /^$re_exvalue$/
351 21 12 if (length $charset)
353 21 0 if (defined $enc) { }
368 0 113 if length $_ and not $_ =~ /^;/
372 2 181 unless s/^;//
379 4 179 unless (length $_)
384 0 4 if $STRICT_PARAMS
389 178 1 if (s/^($re_token)=//) { }
392 0 1 if ($STRICT_PARAMS)
396 0 1 if (s/^($re_token_non_strict)=//) { }
399 0 1 unless (s/^([^;=\s]+)\s*=//)
419 110 73 if (s/^($re_token)//) { }
73 0 elsif (s/^$re_quoted_string//) { }
0 0 elsif ($STRICT_PARAMS) { }
0 0 elsif (s/^($re_token_non_strict)//) { }
0 0 elsif (s/^$re_quoted_string_non_strict//) { }
438 177 6 if not length $_ or /^;/
439 0 6 if ($STRICT_PARAMS)
445 6 0 if ($erased)
447 2 4 if /^$re_token_non_strict=/