Condition Coverage

lib/Mail/Make.pm
Criterion Covered Total %
condition 70 205 34.1


and 3 conditions

line !l l&&!r l&&r condition
87 25 0 50 $type eq "text/plain" and not $cd =~ /attachment/
16 0 9 $type eq "text/html" and not $cd =~ /attachment/
10 0 6 $cd =~ /inline/ and $part->headers->get("Content-ID")
107 4 44 6 @plain and @html
207 0 0 0 defined $threshold and $threshold > 0
0 0 0 defined $threshold and $threshold > 0 and $entity->length > $threshold
231 7 0 4 scalar(@_) % 2 and !ref($_[0]) || $self->_can_overload($_[0], '""')
0 0 4 scalar(@_) % 2 and !ref($_[0]) || $self->_can_overload($_[0], '""') and index("$_[0]", "\n") == -1
320 8 0 0 exists $params->{'plain_opts'} and ref $params->{'plain_opts'} ne "HASH"
329 0 0 0 exists $params->{'html_opts'} and ref $params->{'html_opts'} ne "HASH"
337 4 0 4 exists $params->{'attach'} and defined $params->{'attach'}
364 7 0 1 exists $params->{'headers'} and ref $params->{'headers'} eq "HASH"
430 0 0 2 defined $name and length $name
0 0 2 defined $name and length $name and defined $value
628 11 0 1 defined $mail_from and length $mail_from
641 0 0 12 defined $mail_from and length $mail_from
651 10 0 2 defined $username and length $username
736 0 0 0 defined $ENV{'SMTPHOSTS'} and length $ENV{'SMTPHOSTS'}
766 9 0 0 $opts->{'StartTLS'} and $quit
797 8 0 1 defined $username and length $username
860 0 0 8 $smtp->mail($mail_from) && $smtp->to(@addr) && $smtp->data($msg)
1132 0 0 103 defined $addr and length $addr
1174 0 53 0 $lt[5] == $gt[5] and $lt[7] > $gt[7]
1175 0 53 0 $lt[5] == $gt[5] and $lt[7] < $gt[7]

or 2 conditions

line l !l condition
83 75 0 $part->effective_type // ""
86 16 59 $part->headers->get("Content-Disposition") // ""
109 6 0 'Mail::Make::Entity'->build('type', 'multipart/alternative') || (return $self->pass_error('Mail::Make::Entity'->error))
131 6 0 'Mail::Make::Entity'->build('type', 'multipart/related') || (return $self->pass_error('Mail::Make::Entity'->error))
141 7 0 'Mail::Make::Entity'->build('type', 'multipart/mixed') || (return $self->pass_error('Mail::Make::Entity'->error))
189 25 1 $self->as_entity || (return $self->pass_error)
202 0 0 $self->as_entity || (return $self->pass_error)
215 0 0 $buf->open('>', {'binmode', ':raw', 'autoflush', 1}) || (return $buf->error)
248 0 10 $opts->{'disposition'} //= "attachment"
249 10 0 'Mail::Make::Entity'->build(%$opts) || (return $self->pass_error('Mail::Make::Entity'->error))
272 0 6 $opts->{'disposition'} //= "inline"
273 6 0 'Mail::Make::Entity'->build(%$opts) || (return $self->pass_error('Mail::Make::Entity'->error))
300 8 0 $class->new || (return $class->pass_error)
306 18 0 $self->$field($params->{$field}) or return $self->pass_error
322 0 0 $params->{'plain_opts'} // "undef"
324 0 8 $params->{'plain_opts'} // {}
331 0 0 $params->{'html_opts'} // "undef"
333 0 0 $params->{'html_opts'} // {}
459 9 0 'Mail::Make::Entity'->build('type', 'text/html', 'charset', $opts->{'charset'} // 'utf-8', 'encoding', $opts->{'encoding'} // 'quoted-printable', 'data', $text) || (return $self->pass_error('Mail::Make::Entity'->error))
514 43 0 'Mail::Make::Entity'->build('type', 'text/plain', 'charset', $opts->{'charset'} // 'utf-8', 'encoding', $opts->{'encoding'} // 'quoted-printable', 'data', $text) || (return $self->pass_error('Mail::Make::Entity'->error))
526 0 0 shift @_ || (return $self->error('No file handle was provided to print the mail entity.'))
530 0 0 $fh // "undef"
532 0 0 $self->as_entity || (return $self->pass_error)
546 0 0 $self->{'_headers'}->header("References") // ""
624 12 0 $self->as_entity || (return $self->pass_error)
630 11 0 $self->{'_headers'}->header("From") // ""
679 13 19 $self->{'_headers'}->header($field) // ""
806 0 0 $@ // "returned undef"
811 0 1 $smtp->supports("AUTH") // ""
814 0 1 $opts->{'AuthMechanisms'} // "PLAIN LOGIN"
935 0 0 'Mail::Make::GPG'->new(defined $opts->{'GpgBin'} ? ('gpg_bin', $opts->{'GpgBin'}) : (), defined $opts->{'Digest'} ? ('digest', $opts->{'Digest'}) : (), defined $opts->{'KeyServer'} ? ('keyserver', $opts->{'KeyServer'}) : (), defined $opts->{'AutoFetch'} ? ('auto_fetch', $opts->{'AutoFetch'}) : ()) || (return $self->pass_error('Mail::Make::GPG'->error))
939 0 0 $opts->{'Recipients'} || (return $self->error('gpg_encrypt(): Recipients option is required.'))
966 0 0 'Mail::Make::GPG'->new(defined $opts->{'GpgBin'} ? ('gpg_bin', $opts->{'GpgBin'}) : (), defined $opts->{'Digest'} ? ('digest', $opts->{'Digest'}) : ()) || (return $self->pass_error('Mail::Make::GPG'->error))
1000 0 0 'Mail::Make::GPG'->new(defined $opts->{'GpgBin'} ? ('gpg_bin', $opts->{'GpgBin'}) : (), defined $opts->{'Digest'} ? ('digest', $opts->{'Digest'}) : (), defined $opts->{'KeyServer'} ? ('keyserver', $opts->{'KeyServer'}) : (), defined $opts->{'AutoFetch'} ? ('auto_fetch', $opts->{'AutoFetch'}) : ()) || (return $self->pass_error('Mail::Make::GPG'->error))
1004 0 0 $opts->{'Recipients'} || (return $self->error('gpg_sign_encrypt(): Recipients option is required.'))
1032 0 0 'Mail::Make::SMIME'->new(defined $opts->{'CACert'} ? ('ca_cert', $opts->{'CACert'}) : ()) || (return $self->pass_error('Mail::Make::SMIME'->error))
1061 0 0 'Mail::Make::SMIME'->new(defined $opts->{'Cert'} ? ('cert', $opts->{'Cert'}) : (), defined $opts->{'Key'} ? ('key', $opts->{'Key'}) : (), defined $opts->{'KeyPassword'} ? ('key_password', $opts->{'KeyPassword'}) : (), defined $opts->{'CACert'} ? ('ca_cert', $opts->{'CACert'}) : ()) || (return $self->pass_error('Mail::Make::SMIME'->error))
1090 0 0 'Mail::Make::SMIME'->new(defined $opts->{'Cert'} ? ('cert', $opts->{'Cert'}) : (), defined $opts->{'Key'} ? ('key', $opts->{'Key'}) : (), defined $opts->{'KeyPassword'} ? ('key_password', $opts->{'KeyPassword'}) : (), defined $opts->{'CACert'} ? ('ca_cert', $opts->{'CACert'}) : ()) || (return $self->pass_error('Mail::Make::SMIME'->error))

or 3 conditions

line l !l&&r !l&&!r condition
207 0 0 0 $force_file or defined $threshold and $threshold > 0 and $entity->length > $threshold
231 4 0 0 !ref($_[0]) || $self->_can_overload($_[0], '""')
244 0 10 1 defined $opts->{'data'} or defined $opts->{'path'}
262 0 7 0 defined $opts->{'data'} or defined $opts->{'path'}
266 1 5 1 defined $opts->{'id'} or defined $opts->{'cid'}
271 5 1 0 $opts->{'cid'} //= delete $opts->{'id'}
803 0 0 1 $@ or not defined $password
848 8 0 0 $self->as_entity || do {
854 8 0 0 $send_entity->as_string || do {
942 0 0 0 $gpg->encrypt('entity', $self, 'recipients', $recipients) || $self->pass_error($gpg->error)
973 0 0 0 $gpg->sign('entity', $self, 'key_id', $opts->{'KeyId'} // '', 'passphrase', $opts->{'Passphrase'} // undef, defined $opts->{'Digest'} ? ('digest', $opts->{'Digest'}) : ()) || $self->pass_error($gpg->error)
1012 0 0 0 $gpg->sign_encrypt('entity', $self, 'key_id', $opts->{'KeyId'} // '', 'passphrase', $opts->{'Passphrase'} // undef, 'recipients', $recipients, defined $opts->{'Digest'} ? ('digest', $opts->{'Digest'}) : ()) || $self->pass_error($gpg->error)
1037 0 0 0 $smime->encrypt('entity', $self, 'RecipientCert', $opts->{'RecipientCert'} || (return $self->error('smime_encrypt(): RecipientCert option is required.'))) || $self->pass_error($smime->error)
1064 0 0 0 $smime->sign('entity', $self) || $self->pass_error($smime->error)
1096 0 0 0 $smime->sign_encrypt('entity', $self, 'RecipientCert', $opts->{'RecipientCert'} || (return $self->error('smime_sign_encrypt(): RecipientCert option is required.'))) || $self->pass_error($smime->error)
1112 0 0 45 $@ or not defined $host
0 0 45 $@ or not defined $host or not length $host
1174 0 0 53 $lt[5] > $gt[5] or $lt[5] == $gt[5] and $lt[7] > $gt[7]
1175 0 0 53 $lt[5] < $gt[5] or $lt[5] == $gt[5] and $lt[7] < $gt[7]