Branch Coverage

blib/lib/Email/MIME.pm
Criterion Covered Total %
branch 94 118 79.6


line true false branch
142 87 77 exists $arg->{'encode_check'} ? :
216 8 46 if (exists $args{'header'})
218 0 8 if @headers % 2 == 1
225 11 43 if (exists $args{'header_str'})
227 0 11 if @headers % 2 == 1
239 54 0 unless exists $headers{'Date'}
242 31 23 $args{'attributes'} ? :
252 30 24 if (grep {exists $attrs{$_};} "content_type", "charset", "name", "format", "boundary")
260 3 51 if (exists $args{'encode_check'})
271 0 54 if $body_args > 1
274 14 40 if ($args{'parts'} and @{$args{'parts'};}) { }
33 7 elsif (defined $args{'body'}) { }
6 1 elsif (defined $args{'body_str'}) { }
276 14 11 unless ref $part
284 0 6 unless my $charset = $attrs{'charset'}
287 0 6 unless $attrs{'encoding'}
306 164 138 unless $self->{'parts'}
309 197 105 unless @parts
316 0 52 unless $self->{'parts'}
324 41 152 if ($self->{'ct'}{'type'} eq 'multipart' or $self->{'ct'}{'type'} eq 'message') { }
345 51 55 unless $cte
347 26 29 if (not $self->force_decode_hook and $cte =~ /$NO_ENCODE_RE/u)
351 29 0 if $self->can("decode_hook")
371 2 12 unless ($encoding)
372 1 0 if ($self->{'ct'}{'type'} eq "text" and $self->{'ct'}{'subtype'} eq 'plain' || $self->{'ct'}{'subtype'} eq 'html')
394 0 41 if $MAX_DEPTH and $DEPTH > $MAX_DEPTH
402 0 41 unless length $boundary and $self->body_raw =~ /^--\Q$boundary\E\s*$/msu
418 41 0 if index($bits[0] || '', ":") == -1
421 0 41 if $MAX_PARTS and $CUR_PARTS > $MAX_PARTS
457 1 4 if exists $gcache{$self}
463 2 2 if $name or not $force
543 15 1 if ($value) { }
561 1 0 if (length $value) { }
568 0 1 if $self->parts > 1
575 62 3 if ($CT_SETTER{$key})
584 0 3 if lc $existing_key eq $key
587 3 0 if ($value) { }
666 165 130 if (ref $body) { }
667 0 165 unless builtin::reftype($body) eq "SCALAR"
680 131 164 unless (((caller 1)[3] || '') eq "Email::Simple::new")
681 41 90 unless not $enc or $enc =~ /$NO_ENCODE_RE/u
708 0 0 unless my $charset = $ct->{'attributes'}{'charset'}
727 3 5 $dis_header ? :
746 4 0 if ($dis_header)
751 3 1 if ($filename) { }
773 25 4 if (@{$parts;} > 1 or $ct_header->{'type'} eq 'multipart') { }
4 0 elsif (@$parts == 1) { }
777 16 9 unless length $ct_header->{'attributes'}{'boundary'}
785 10 15 unless (grep {$ct_header->{'type'} eq $_;} "multipart", "message")
786 0 10 if (scalar $self->header("Content-Type"))
800 2 2 if (exists $from_ct->{'attributes'}{'charset'}) { }
861 14 26 if (my(@orig_subparts) = $part->subparts)
867 0 30 unless my $new = &$walk_weak($part)
868 9 21 if $str ne $new->as_string
877 6 8 if ($differ)
912 19 38 if ($self->parts > 1)
913 4 15 if ($ct_header->{'subtype'} eq 'alternative') { }
919 3 1 if keys %cids == 1
926 30 8 unless $_->header("Content-ID")