Branch Coverage

blib/lib/MIME/Lite.pm
Criterion Covered Total %
branch 142 374 37.9


line true false branch
467 5 1 $VANILLA ? :
500 0 0 unless $str
507 0 0 if ($str =~ /\G$SEP($PHRASE)\s*<\s*($ADDR)\s*>/cgou) { }
0 0 elsif ($str =~ /\G$SEP($ADDR)/cgou or $str =~ /\G$SEP($ATOM)/cgou) { }
516 0 0 wantarray ? :
520 0 0 if (/<([^>]+)>/u) { }
521 0 0 wantarray ? :
529 0 0 wantarray ? :
10 0 wantarray ? :
682 15 10 @_ ? :
739 0 10 @_ == 1 ? :
742 5 5 unless ($attrs->{'content-type'} =~ m[^(multipart|message)/]iu)
977 0 20 unless defined($params{'Data'}) + defined($params{'Path'}) + defined($params{'FH'}) <= 1
981 5 15 unless ref $self
991 13 7 if ($type eq 'TEXT') { }
0 7 elsif ($type eq 'HTML') { }
0 7 elsif ($type eq 'BINARY') { }
1 6 elsif ($type eq 'AUTO') { }
1006 1 19 if ($is_multipart)
1014 0 20 if (defined $params{'Id'})
1016 0 0 unless $id =~ /\A\s*<.*>\s*\z/u
1027 13 7 if (defined $params{'Data'}) { }
4 3 elsif (defined $params{'Path'}) { }
0 3 elsif (defined $params{'FH'}) { }
1033 1 3 if $params{'ReadNow'}
1039 0 0 if $params{'ReadNow'}
1046 1 19 if (defined $params{'Filename'})
1060 1 19 if ($type =~ m[^(multipart|message)/]u)
1061 0 1 unless $enc =~ /^(7bit|8bit|binary)\Z/u
1074 0 20 if (exists $params{'Length'}) { }
1081 10 10 defined $params{'Top'} ? :
1087 10 10 if ($ds_wanted || $ds_defaulted and not exists $params{'Date'})
1100 0 49 if ($lc_tag =~ /^-(.*)/u) { }
0 49 elsif ($lc_tag =~ /^(.*):$/u) { }
13 36 elsif ($KnownField{$lc_tag} or $lc_tag =~ /^(content|resent|x)-./u) { }
1144 15 15 if ($onoff) { }
1146 15 0 @Uses ? :
1147 1 14 unless $VANILLA
1198 0 27 if is_mime_field($tag) and not $QUIET
1204 1 26 ref $value && ref $value eq 'ARRAY' ? :
1254 2 1 if (defined $subtag)
1260 2 1 if (@_ > 2)
1261 2 0 if (defined $value) { }
1274 0 0 defined $self->{'Attrs'}{$attr} ? :
1300 7 4 if $field->[0] ne $tag
1329 1 0 if (ref $self) { }
1377 0 41 if $explicit{$tag}
1381 9 32 unless defined $value
1384 7 25 if (my $subs = $sub_attrs->{$tag})
1387 0 7 /\*$/u ? :
1408 8 1 unless $self->{'FieldOrder'}
1409 8 1 unless @order
1410 1 8 if (@order)
1455 5 0 if (@_ > 1)
1486 0 12 if is_mime_field($tag)
1488 23 43 $_->[0] eq $tag ? :
1489 1 4 wantarray ? :
7 5 if (defined $index) { }
1537 17 20 if (not $is_multipart and $enc eq "binary")
1538 13 4 if (defined $self->{'Data'}) { }
0 4 elsif (defined $self->{'FH'}) { }
4 0 elsif (defined $self->{'Path'}) { }
1543 2 2 if -e $self->{'Path'}
1566 0 9 unless $self->{'Parts'}
1599 0 0 if @_
1636 2 0 if defined $value
1666 0 0 if (not @a) { }
0 0 elsif ($expl and ref $expl eq 'ARRAY') { }
1672 0 0 if (not $self->_safe_attr("content-disposition.filename") or $self->_safe_attr("content-type.name"))
1679 0 0 if ($self->_safe_attr("content-transfer-encoding") =~ /^(7bit|8bit|binary)$/iu)
1684 0 0 if ($self->_safe_attr("content-type.charset") =~ /^(us-ascii)/iu)
1689 0 0 if (keys %{$$self{"Attrs"}{"content-type"};} == 1 and $self->_safe_attr("content-type") eq "text/plain")
1738 0 2 if @_
1741 0 2 defined $self->{'Binmode'} ? :
1762 13 0 if (@_)
1763 2 11 ref $_[0] eq 'ARRAY' ? :
1785 0 0 if @_
1805 4 0 if (@_)
1812 3 1 if ($self->{'Path'} and not $self->{'Path'} =~ /\|$/u)
1875 0 1 if ($self->{'FH'}) { }
1 0 elsif ($self->{'Path'}) { }
1878 0 0 if $self->binmode
1884 0 1 unless open SLURP, $self->{'Path'}
1885 0 1 if $self->binmode
1926 0 0 unless @_
1929 0 0 unless defined $self->{'Data'}
1933 0 0 unless (defined($sig = $params{'Data'}))
1935 0 0 unless open SIG, $params{'Path'}
1939 0 0 if ref $sig and ref $sig eq "ARRAY"
1980 20 0 if ($HaveMimeTypes)
1984 19 1 if (scalar @mappings)
1987 19 0 if ($encoding and $encoding =~ /^(base64|binary|[78]bit|quoted-printable)$/iu)
1998 0 1 if ($type eq 'text' or $type eq 'message') { }
2001 1 0 $type eq 'multipart' ? :
2018 0 1 unless $path
2021 1 0 if ($HaveMimeTypes)
2025 1 0 if $mimetype and $mimetype =~ m[^\S+/\S+$]u
2050 4 14 if ($path and not $path =~ /\|$/u)
2052 1 3 unless -r $path
2096 8 0 if $AUTO_VERIFY
2162 2 6 if ($type =~ m[^multipart/]iu) { }
0 6 elsif ($type =~ m[^message/]u) { }
2168 0 2 defined $self->{'Preamble'} ? :
2184 0 0 if (@parts == 0) { }
0 0 elsif (@parts == 1) { }
2222 0 6 if $DEBUG
2230 5 1 if (defined $self->{'Data'}) { }
1 0 elsif (defined $self->{'Path'} or defined $self->{'FH'}) { }
2235 0 5 if (/^BINARY$/u)
2236 0 0 if $is_smtp
2240 5 0 if (/^8BIT$/u)
2244 0 0 if (/^7BIT$/u)
2248 0 0 if (/^QUOTED-PRINTABLE$/u)
2260 0 0 if (/^BASE64/u)
2277 1 0 if (defined $self->{'Path'}) { }
2279 0 1 unless $DATA->open("$self->{'Path'}")
2284 0 1 if $self->binmode
2291 0 1 if (/^BINARY$/u)
2294 0 0 if length $last
2297 0 0 if (length $last)
2298 0 0 if $is_smtp
2303 1 0 if (/^8BIT$/u)
2307 0 0 if (/^7BIT$/u)
2311 0 0 if (/^QUOTED-PRINTABLE$/u)
2315 0 0 if (/^BASE64$/u)
2323 1 0 if defined $self->{'Path'}
2414 0 39 if $value eq ""
2417 0 39 if (length $value > 72 and not $value =~ /\n/u)
2435 0 0 if (length $_ < 72)
2442 0 0 unless s/^(.{18,72}[;,])([ \t])//u or s/^(.{18,72})([ \t])//u or s/^(.{72,}?)([ \t])//u
2594 0 2 if (ref $self) { }
2596 0 0 if (@_) { }
2601 0 0 unless $SenderArgs{$Sender}
2603 0 0 if $AUTO_VERIFY
2604 0 0 unless $self->can($method)
2607 2 0 if (@_) { }
2696 4 2 if (not ref $item) { }
1 1 elsif (UNIVERSAL::isa($item, 'HASH')) { }
1 0 elsif (UNIVERSAL::isa($item, 'ARRAY')) { }
2713 0 0 if (@_ == 1 and not ref $_[0]) { }
2716 0 0 unless $sendmailcmd
2720 0 0 unless open SENDMAIL, "|$sendmailcmd"
2723 0 0 $? >> 8 ? :
2727 0 0 unless defined $p{'Sendmail'}
2730 0 0 unless $p{'BaseArgs'}
2733 0 0 unless defined $p{'SetSender'}
2739 0 0 if ($p{'SetSender'})
2741 0 0 if ($from)
2743 0 0 if $from_addr
2749 0 0 unless defined $pid
2750 0 0 if (not $pid) { }
2751 0 0 unless exec @cmd
2755 0 0 unless close SENDMAIL
2873 0 0 exists $args->{$_} ? :
2884 0 0 if ($AUTO_CC)
2889 0 0 unless @hdr_to
2901 0 0 unless my $smtp = "MIME::Lite::SMTP"->new($hostname, %opts)
2905 0 0 if (defined $args{'AuthUser'} and defined $args{'AuthPass'} and not $args{'NoAuth'})
2908 0 0 if ($smtp->supports('AUTH', 500, [q[Command unknown: 'AUTH']])) { }
2910 0 0 unless $smtp->auth($args{'AuthUser'}, $args{'AuthPass'})
2919 0 0 %opts ? :
0 0 unless $smtp->mail($args{'From'}, %opts ? \%opts : ())
2925 0 0 %opts ? :
0 0 unless $smtp->recipient(@{$args{"To"};}, %opts ? \%opts : ())
2930 0 0 unless $smtp->data
2936 0 0 unless $smtp->dataend
2963 0 0 if (@_ == 1 and not ref $_[0])
2966 0 0 unless $filename
2971 0 0 unless open FILE, ">> $filename"
2974 0 0 $? >> 8 ? :
3008 0 0 if $DEBUG
3014 0 0 unless defined $to
3019 0 0 if ($AUTO_CC)
3022 0 0 if defined $value
3029 0 0 unless my $smtp = "MIME::Lite::SMTP"->new(@args)
3031 0 0 unless $smtp->mail($from)
3033 0 0 unless $smtp->to(@to_all)
3035 0 0 unless $smtp->data
3041 0 0 unless $smtp->dataend
3113 0 0 if @_
3156 0 0 if $MIME::Lite::DEBUG
3157 0 0 unless $smtp->datasend(@_)
3178 0 22 unless $fh
3179 0 22 unless ref $fh
3182 22 0 if ref $fh and ref $fh ne "GLOB"
3204 0 6 unless defined $scalarref
3224 0 0 unless defined $arrayref