Branch Coverage

blib/lib/Email/MIME.pm
Criterion Covered Total %
branch 93 116 80.1


line true false branch
131 87 77 exists $arg->{'encode_check'} ? :
205 8 46 if (exists $args{'header'})
207 0 8 if @headers % 2 == 1
214 11 43 if (exists $args{'header_str'})
216 0 11 if @headers % 2 == 1
228 54 0 unless exists $headers{'Date'}
231 31 23 $args{'attributes'} ? :
241 30 24 if (grep {exists $attrs{$_};} "content_type", "charset", "name", "format", "boundary")
249 3 51 if (exists $args{'encode_check'})
260 0 54 if $body_args > 1
263 14 40 if ($args{'parts'} and @{$args{'parts'};}) { }
33 7 elsif (defined $args{'body'}) { }
6 1 elsif (defined $args{'body_str'}) { }
265 14 11 unless ref $part
273 0 6 unless my $charset = $attrs{'charset'}
276 0 6 unless $attrs{'encoding'}
295 164 138 unless $self->{'parts'}
298 197 105 unless @parts
305 0 52 unless $self->{'parts'}
313 41 152 if ($self->{'ct'}{'type'} eq 'multipart' or $self->{'ct'}{'type'} eq 'message') { }
334 51 55 unless $cte
336 26 29 if (not $self->force_decode_hook and $cte =~ /$NO_ENCODE_RE/u)
340 29 0 if $self->can("decode_hook")
360 2 12 unless ($encoding)
361 1 0 if ($self->{'ct'}{'type'} eq "text" and $self->{'ct'}{'subtype'} eq 'plain' || $self->{'ct'}{'subtype'} eq 'html')
385 0 41 if $MAX_DEPTH and $DEPTH > $MAX_DEPTH
393 0 41 unless length $boundary and $self->body_raw =~ /^--\Q$boundary\E\s*$/msu
409 41 0 if index($bits[0] || '', ":") == -1
446 1 4 if exists $gcache{$self}
452 2 2 if $name or not $force
532 15 1 if ($value) { }
550 1 0 if (length $value) { }
557 0 1 if $self->parts > 1
564 62 3 if ($CT_SETTER{$key})
573 0 3 if lc $existing_key eq $key
576 3 0 if ($value) { }
655 165 130 if (ref $body) { }
656 0 165 unless &reftype($body) eq "SCALAR"
669 131 164 unless (((caller 1)[3] || '') eq "Email::Simple::new")
670 41 90 unless not $enc or $enc =~ /$NO_ENCODE_RE/u
697 0 0 unless my $charset = $ct->{'attributes'}{'charset'}
716 3 5 $dis_header ? :
735 4 0 if ($dis_header)
740 3 1 $filename ? :
762 25 4 if (@{$parts;} > 1 or $ct_header->{'type'} eq 'multipart') { }
4 0 elsif (@$parts == 1) { }
766 16 9 unless length $ct_header->{'attributes'}{'boundary'}
774 10 15 unless (grep {$ct_header->{'type'} eq $_;} "multipart", "message")
775 0 10 if (scalar $self->header("Content-Type"))
789 2 2 if (exists $from_ct->{'attributes'}{'charset'}) { }
850 14 26 if (my(@orig_subparts) = $part->subparts)
856 0 30 unless my $new = &$walk_weak($part)
857 9 21 if $str ne $new->as_string
866 6 8 if ($differ)
901 19 38 if ($self->parts > 1)
902 4 15 if ($ct_header->{'subtype'} eq 'alternative') { }
908 3 1 if keys %cids == 1
915 30 8 unless $_->header("Content-ID")