blib/lib/Net/LMTP2.pm

filter: Statementstmt 43.7% 14 / 32 Branchbran 0.0% 0 / 10 Conditioncond 0.0% 0 / 4 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 50.0% 4 / 8 Podpod 100% 1 / 1 totaltotal 33.3% 19 / 57 CC 9 SCAR 39.4
CC
9
Cov
30%
hello
90.0
_EHLO
2.0
_HELO
2.0
CRAP 51.2
↑ Summary
1 package Net::LMTP2;
2 1 $Net::LMTP2::VERSION = '0.2';
3 # ABSTRACT: A client class for the LMTP protocol
4 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 1 ▶use base 'Net::SMTP';
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use Net::Cmd;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10  
11  
12 0 ▶sub hello {
Subroutine hello: not called CC=9 SCAR=45.0
Pod documented
13 0 my $me = shift;
14 0 ▶ my $domain = shift || "localhost.localdomain";
Condition0%0/2
shift() || 'localhost.localdomain'
l!l
00
MC/DC0%0/1
shift() || 'localhost.localdomain'
shift()
Truth table0%0/2
A
A= shift()
Aresult
11
00
15 0 my $ok = $me->_LHLO($domain);
16 0 my @msg = $me->message;
17  
18 0 ▶ if ($ok) {
Branch: 2 branches
BranchTrueFalseTotal
if ($ok) { } 0 0 0
elsif ($me->status == 5) { } 0 0 0
19 0 my $h = ${*$me}{'net_smtp_esmtp'} = {};
20 0 foreach my $ln (@msg) {
21 0 ▶ $h->{uc $1} = $2 if $ln =~ /([-\w]+)\b[= \t]*([^\n]*)/;
Branch: 1 branch
BranchTrueFalseTotal
if $ln =~ /([-\w]+)\b[= \t]*([^\n]*)/ 0 0 0
22 }
23 }
24 elsif ($me->status == CMD_ERROR) {
25 0 ▶ @msg = $me->message if $ok = $me->_HELO($domain);
Branch: 1 branch
BranchTrueFalseTotal
if $ok = $me->_HELO($domain) 0 0 0
26 }
27  
28  
29 0 ▶ return unless $ok;
Branch: 1 branch
BranchTrueFalseTotal
unless $ok 0 0 0
30 0 ${*$me}{net_smtp_hello_domain} = $domain;
31 0 $msg[0] =~ /\A\s*(\S+)/;
32 0 ▶ return ($1 || " ");
Condition0%0/2
$1 || ' '
l!l
00
MC/DC0%0/1
$1 || ' '
$1
Truth table0%0/2
A
A= $1
Aresult
11
00
33  
34 }
35  
36  
37  
38 0 ▶sub _EHLO { shift->unsupported(@_);}
Subroutine _EHLO: not called CC=1 SCAR=6.9
39 0 ▶sub _HELO { shift->unsupported(@_);}
Subroutine _HELO: not called CC=1 SCAR=6.9
40 0 ▶sub _LHLO { shift->command("LHLO", @_)->response() == CMD_OK }
Subroutine _LHLO: not called CC=1 SCAR=6.9
41 1 1;
42  
43 __END__
↑ Summary