Branch Coverage

lib/Mail/Make.pm
Criterion Covered Total %
branch 132 246 53.6


line true false branch
53 0 49 unless $self->SUPER::init(@_)
73 0 54 if defined $self->{'_gpg_entity'}
77 0 54 if defined $self->{'_smime_entity'}
87 50 25 if ($type eq 'text/plain' and not $cd =~ /attachment/) { }
9 16 elsif ($type eq 'text/html' and not $cd =~ /attachment/) { }
6 10 elsif ($cd =~ /inline/ and $part->headers->get('Content-ID')) { }
107 6 48 if (@plain and @html) { }
3 45 elsif (@html) { }
44 1 elsif (@plain) { }
129 6 47 if (@inline)
139 7 46 if (@attachment)
160 45 8 unless ($self->{'_headers'}->exists("Message-ID"))
163 0 45 unless $self->{'_headers'}->message_id({"generate", 1, "domain", $self->_default_domain})
207 0 0 unless ($force_file or defined $threshold and $threshold > 0 and $entity->length > $threshold)
216 0 0 unless $entity->print($fh)
231 4 0 if (scalar(@_) % 2 and !ref($_[0]) || $self->_can_overload($_[0], '""') and index("$_[0]", "\n") == -1)
237 4 0 if ($f->exists)
244 1 10 unless (defined $opts->{'data'} or defined $opts->{'path'})
262 0 7 unless (defined $opts->{'data'} or defined $opts->{'path'})
266 1 6 unless (defined $opts->{'id'} or defined $opts->{'cid'})
284 2 0 if (@_)
286 0 2 ref $_[0] eq 'ARRAY' ? :
288 0 2 unless $self->{'_headers'}->push_header("Bcc", join(", ", @encoded))
306 18 46 if exists $params->{$field}
311 8 24 if (exists $params->{$field})
314 1 7 ref $v eq 'ARRAY' ? :
0 8 unless $self->$field(ref $v eq "ARRAY" ? @$v : $v)
318 8 0 if (exists $params->{'plain'})
320 0 8 if (exists $params->{'plain_opts'} and ref $params->{'plain_opts'} ne "HASH")
325 0 8 unless $self->plain($params->{'plain'}, %opts)
327 0 8 if (exists $params->{'html'})
329 0 0 if (exists $params->{'html_opts'} and ref $params->{'html_opts'} ne "HASH")
334 0 0 unless $self->html($params->{'html'}, %opts)
337 4 4 if (exists $params->{'attach'} and defined $params->{'attach'})
341 3 1 $self->_is_array($attach) ? :
344 0 7 unless defined $item
348 3 4 if (ref $item eq 'HASH') { }
350 0 3 unless $self->attach(%$item)
359 0 4 unless $self->attach($item)
364 1 7 if (exists $params->{'headers'} and ref $params->{'headers'} eq "HASH")
368 0 1 unless $self->header($n, $v)
379 3 0 if (@_)
381 0 3 ref $_[0] eq 'ARRAY' ? :
383 0 3 unless $self->{'_headers'}->push_header("Cc", join(", ", @encoded))
395 0 0 if (@_)
398 0 0 unless $self->{'_headers'}->date(@_)
408 47 0 if (@_)
412 0 47 unless $self->{'_headers'}->set("From", $addr)
424 0 2 if (@_ == 1)
430 0 2 unless (defined $name and length $name and defined $value)
435 0 2 unless $self->{'_headers'}->push_header($name, $value)
452 0 9 unless (defined $text)
470 0 0 if (@_)
473 0 0 unless $self->{'_headers'}->set("In-Reply-To", shift @_)
491 0 0 if (@_)
494 0 0 unless $self->{'_headers'}->message_id(@_)
507 0 43 unless (defined $text)
528 0 0 unless ($self->_is_glob($fh))
533 0 0 unless $entity->print($fh)
542 0 0 if (@_)
544 0 0 ref $_[0] eq 'ARRAY' ? :
549 0 0 unless $self->{'_headers'}->set("References", $new)
559 1 0 if (@_)
563 0 1 unless $self->{'_headers'}->set("Reply-To", $addr)
573 0 0 if (@_)
577 0 0 unless $self->{'_headers'}->set("Return-Path", $addr)
587 1 0 if (@_)
591 0 1 unless $self->{'_headers'}->set("Sender", $addr)
621 0 12 unless $self->_load_class("Net::SMTP")
628 11 1 unless (defined $mail_from and length $mail_from)
631 1 10 if ($from_hdr =~ /<([^>]+)>/) { }
641 0 12 unless (defined $mail_from and length $mail_from)
651 2 10 if (defined $username and length $username)
653 1 1 unless (defined $password)
662 0 2 unless $self->_load_class($mod)
673 1 32 if (defined $v) { }
675 0 1 ref $v eq 'ARRAY' ? :
680 13 19 if length $hv
693 0 14 if (@found_angle) { }
707 1 10 unless (@addr)
715 9 1 if defined $opts->{'Hello'}
716 9 1 if defined $opts->{'Port'}
717 0 10 if defined $opts->{'Debug'}
718 1 9 if defined $opts->{'Timeout'}
719 0 10 if ($opts->{'SSL'})
722 0 0 if (ref $opts->{'SSL_opts'} eq "HASH")
733 0 10 if (not defined $host) { }
1 9 elsif ($self->_is_a($host, 'Net::SMTP')) { }
736 0 0 if (defined $ENV{'SMTPHOSTS'} and length $ENV{'SMTPHOSTS'})
745 0 0 if defined $smtp
760 1 9 unless (defined $smtp)
766 0 9 if ($opts->{'StartTLS'} and $quit)
769 0 0 if (ref $opts->{'SSL_opts'} eq "HASH")
773 0 0 unless ($smtp->starttls(%tls_opts))
777 0 0 length $smtp_msg ? :
797 1 8 if (defined $username and length $username)
799 1 0 if (ref $password eq "CODE")
803 0 1 if ($@ or not defined $password)
805 0 0 if $quit
820 1 0 unless (@agreed)
837 1 0 unless ($smtp->auth($sasl))
841 1 0 if $quit
842 1 0 length $smtp_msg ? :
864 7 1 if $quit
866 0 8 unless ($ok)
871 0 8 wantarray ? :
879 39 0 if (@_)
883 0 39 unless $self->{'_headers'}->set("Subject", $enc)
894 48 0 if (@_)
896 0 48 ref $_[0] eq 'ARRAY' ? :
899 51 46 if defined $_
901 0 48 unless $self->{'_headers'}->set("To", $new_val)
940 0 0 unless ref $recipients eq "ARRAY"
1005 0 0 unless ref $recipients eq "ARRAY"
1112 0 45 if $@ or not defined $host or not length $host
1115 45 0 if (index($host, ".") == -1)
1132 0 103 unless defined $addr and length $addr
1133 7 96 if ($addr =~ /^("?)([^<"]+)\1\s*<([^>]+)>\s*$/)
1141 3 4 $enc ne $name ? :
1156 0 46 unless defined $str
1174 0 53 if $lt[5] > $gt[5] or $lt[5] == $gt[5] and $lt[7] > $gt[7]
1175 0 53 if $lt[5] < $gt[5] or $lt[5] == $gt[5] and $lt[7] < $gt[7]
1176 53 0 $diff >= 0 ? :