Branch Coverage

lib/MIME/Lite.pm
Criterion Covered Total %
branch 136 368 36.9


line true false branch
484 5 1 $MIME::Lite::VANILLA ? :
517 0 0 unless $str
524 0 0 if ($str =~ /\G$SEP($PHRASE)\s*<\s*($ADDR)\s*>/cog) { }
0 0 elsif ($str =~ /\G$SEP($ADDR)/cog or $str =~ /\G$SEP($ATOM)/cog) { }
533 0 0 wantarray ? :
537 0 0 /<([^>]+)>/ ? :
538 0 0 wantarray ? :
546 0 0 wantarray ? :
10 0 wantarray ? :
699 15 10 @_ ? :
756 0 10 @_ == 1 ? :
759 5 5 unless ($attrs->{'content-type'} =~ m[^(multipart|message)/]i)
994 0 20 unless defined($params{'Data'}) + defined($params{'Path'}) + defined($params{'FH'}) <= 1
998 5 15 unless ref $self
1008 13 7 if ($type eq 'TEXT') { }
0 7 elsif ($type eq 'HTML') { }
0 7 elsif ($type eq 'BINARY') { }
1 6 elsif ($type eq 'AUTO') { }
1023 1 19 if ($is_multipart)
1031 0 20 if (defined $params{'Id'})
1033 0 0 unless $id =~ /\A\s*<.*>\s*\z/
1044 13 7 if (defined $params{'Data'}) { }
4 3 elsif (defined $params{'Path'}) { }
0 3 elsif (defined $params{'FH'}) { }
1050 1 3 if $params{'ReadNow'}
1056 0 0 if $params{'ReadNow'}
1063 1 19 if (defined $params{'Filename'})
1077 1 19 if ($type =~ m[^(multipart|message)/])
1078 0 1 unless $enc =~ /^(7bit|8bit|binary)\Z/
1091 0 20 if (exists $params{'Length'}) { }
1098 10 10 defined $params{'Top'} ? :
1104 10 10 if ($ds_wanted || $ds_defaulted and not exists $params{'Date'})
1117 0 49 if ($lc_tag =~ /^-(.*)/) { }
0 49 elsif ($lc_tag =~ /^(.*):$/) { }
13 36 elsif ($KnownField{$lc_tag} or $lc_tag =~ /^(content|resent|x)-./) { }
1161 15 15 if ($onoff) { }
1163 15 0 @Uses ? :
1164 1 14 unless $MIME::Lite::VANILLA
1214 0 27 if is_mime_field($tag) and not $MIME::Lite::QUIET
1220 1 26 ref $value && ref $value eq 'ARRAY' ? :
1270 2 1 if (defined $subtag)
1276 2 1 if (@_ > 2)
1277 2 0 if (defined $value) { }
1290 0 0 defined $self->{'Attrs'}{$attr} ? :
1316 7 4 if $field->[0] ne $tag
1345 1 0 if (ref $self) { }
1393 0 71 if $explicit{$tag}
1397 15 56 unless defined $value
1400 9 47 if (my $subs = $sub_attrs->{$tag})
1422 16 1 unless $self->{'FieldOrder'}
1423 16 1 unless @order
1424 1 16 if (@order)
1469 5 0 if (@_ > 1)
1500 0 12 if is_mime_field($tag)
1502 23 43 $_->[0] eq $tag ? :
1503 2 3 wantarray ? :
7 5 defined $index ? :
1551 17 20 if (not $is_multipart and $enc eq 'binary')
1552 13 4 if (defined $self->{'Data'}) { }
0 4 elsif (defined $self->{'FH'}) { }
4 0 elsif (defined $self->{'Path'}) { }
1557 2 2 if -e $self->{'Path'}
1580 0 9 unless $self->{'Parts'}
1613 0 0 if @_
1650 2 0 if defined $value
1680 0 0 if (not @a) { }
0 0 elsif ($expl and ref $expl eq 'ARRAY') { }
1686 0 0 if (not $self->_safe_attr('content-disposition.filename') or $self->_safe_attr('content-type.name'))
1693 0 0 if ($self->_safe_attr('content-transfer-encoding') =~ /^(7bit|8bit|binary)$/i)
1698 0 0 if ($self->_safe_attr('content-type.charset') =~ /^(us-ascii)/i)
1703 0 0 if (keys %{$$self{'Attrs'}{'content-type'};} == 1 and $self->_safe_attr('content-type') eq 'text/plain')
1752 0 2 if @_
1755 0 2 defined $self->{'Binmode'} ? :
1776 13 0 if (@_)
1777 2 11 ref $_[0] eq 'ARRAY' ? :
1799 0 0 if @_
1819 4 0 if (@_)
1826 3 1 if ($self->{'Path'} and not $self->{'Path'} =~ /\|$/)
1830 3 0 if ($HaveFileBasename) { }
1893 0 1 if ($self->{'FH'}) { }
1 0 elsif ($self->{'Path'}) { }
1896 0 0 if $self->binmode
1902 0 1 unless open SLURP, $self->{'Path'}
1903 0 1 if $self->binmode
1944 0 0 unless @_
1947 0 0 unless defined $self->{'Data'}
1951 0 0 unless (defined($sig = $params{'Data'}))
1953 0 0 unless open SIG, $params{'Path'}
1957 0 0 if ref $sig and ref $sig eq 'ARRAY'
1998 20 0 if ($HaveMimeTypes)
2002 19 1 if (scalar @mappings)
2005 19 0 if ($encoding and $encoding =~ /^(base64|binary|[78]bit|quoted-printable)$/i)
2016 0 1 if ($type eq 'text' or $type eq 'message') { }
2019 1 0 $type eq 'multipart' ? :
2036 0 1 unless $path
2039 1 0 if ($HaveMimeTypes)
2043 1 0 if $mimetype and $mimetype =~ m[^\S+/\S+$]
2068 4 32 if ($path and not $path =~ /\|$/)
2070 1 3 unless -r $path
2114 16 0 if $MIME::Lite::AUTO_VERIFY
2180 4 12 if ($type =~ m[^multipart/]i) { }
0 12 elsif ($type =~ m[^message/]) { }
2186 0 4 defined $self->{'Preamble'} ? :
2202 0 0 if (@parts == 0) { }
0 0 elsif (@parts == 1) { }
2240 0 12 if $MIME::Lite::DEBUG
2248 11 1 if (defined $self->{'Data'}) { }
1 0 elsif (defined $self->{'Path'} or defined $self->{'FH'}) { }
2253 0 11 if (/^BINARY$/)
2254 0 0 if $is_smtp
2258 11 0 if (/^8BIT$/)
2262 0 0 if (/^7BIT$/)
2266 0 0 if (/^QUOTED-PRINTABLE$/)
2278 0 0 if (/^BASE64/)
2295 1 0 if (defined $self->{'Path'}) { }
2297 0 1 unless $DATA->open("$self->{'Path'}")
2302 0 1 if $self->binmode
2309 0 1 if (/^BINARY$/)
2312 0 0 if length $last
2315 0 0 if (length $last)
2316 0 0 if $is_smtp
2321 1 0 if (/^8BIT$/)
2325 0 0 if (/^7BIT$/)
2329 0 0 if (/^QUOTED-PRINTABLE$/)
2333 0 0 if (/^BASE64$/)
2341 1 0 if defined $self->{'Path'}
2432 0 66 if $value eq ''
2578 0 2 if (ref $self) { }
2580 0 0 if (@_) { }
2585 0 0 unless $SenderArgs{$Sender}
2587 0 0 if $MIME::Lite::AUTO_VERIFY
2588 0 0 unless $self->can($method)
2591 2 0 if (@_) { }
2680 0 0 if (not ref $item) { }
0 0 elsif (UNIVERSAL::isa($item, 'HASH')) { }
0 0 elsif (UNIVERSAL::isa($item, 'ARRAY')) { }
2697 0 0 if (@_ == 1 and not ref $_[0]) { }
2700 0 0 unless $sendmailcmd
2704 0 0 unless open SENDMAIL, "|$sendmailcmd"
2707 0 0 $? >> 8 ? :
2711 0 0 unless defined $p{'Sendmail'}
2714 0 0 unless $p{'BaseArgs'}
2717 0 0 unless defined $p{'SetSender'}
2723 0 0 if ($p{'SetSender'})
2725 0 0 if ($from)
2727 0 0 if $from_addr
2733 0 0 unless defined $pid
2734 0 0 if (not $pid) { }
2735 0 0 unless exec @cmd
2739 0 0 unless close SENDMAIL
2857 0 0 exists $args->{$_} ? :
2868 0 0 if ($MIME::Lite::AUTO_CC)
2873 0 0 unless @hdr_to
2885 0 0 unless my $smtp = 'MIME::Lite::SMTP'->new($hostname, %opts)
2889 0 0 if (defined $args{'AuthUser'} and defined $args{'AuthPass'} and not $args{'NoAuth'})
2892 0 0 if ($smtp->supports('AUTH', 500, [q[Command unknown: 'AUTH']])) { }
2894 0 0 unless $smtp->auth($args{'AuthUser'}, $args{'AuthPass'})
2903 0 0 %opts ? :
0 0 unless $smtp->mail($args{'From'}, %opts ? \%opts : ())
2909 0 0 %opts ? :
0 0 unless $smtp->recipient(@{$args{'To'};}, %opts ? \%opts : ())
2914 0 0 unless $smtp->data
2920 0 0 unless $smtp->dataend
2947 0 0 if (@_ == 1 and not ref $_[0])
2950 0 0 unless $filename
2955 0 0 unless open FILE, ">> $filename"
2958 0 0 $? >> 8 ? :
2992 0 0 if $MIME::Lite::DEBUG
2998 0 0 unless defined $to
3003 0 0 if ($MIME::Lite::AUTO_CC)
3006 0 0 if defined $value
3013 0 0 unless my $smtp = 'MIME::Lite::SMTP'->new(@args)
3015 0 0 unless $smtp->mail($from)
3017 0 0 unless $smtp->to(@to_all)
3019 0 0 unless $smtp->data
3025 0 0 unless $smtp->dataend
3097 0 0 if @_
3140 0 0 if $MIME::Lite::DEBUG
3141 0 0 unless $smtp->datasend(@_)
3162 0 44 unless $fh
3163 0 44 unless ref $fh
3166 44 0 if ref $fh and ref $fh ne 'GLOB'
3188 0 7 unless defined $scalarref
3208 0 0 unless defined $arrayref