Sisimai/Reason/FailedSTARTTLS.pm

filter: Statementstmt 100% 26 / 26 Branchbran 83.3% 5 / 6 Conditioncond 66.6% 10 / 15 MC/DCmcdc 50.0% 4 / 8 Subroutinesub 100% 8 / 8 Podpod 50.0% 2 / 4 totaltotal 82.0% 55 / 67 CC 10 SCAR 16.5
CC
10
Cov
87%
true
9.1
match
3.0
BEGIN
1.0
CRAP 5.2
« Sisimai/RFC791.pm ↑ Summary Sisimai/Reason/HostUnknown.pm »
1 package Sisimai::Reason::FailedSTARTTLS;
2 43 ▶use v5.26;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 43 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 43 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 43 ▶use Sisimai::Eb;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 1 ▶sub text { $Sisimai::Eb::ReTTLS }
Subroutine text: called CC=1 SCAR=0.0
Pod documented
8 4 ▶sub description { "Email delivery failed due to STARTTLS related problem" }
Subroutine description: called CC=1 SCAR=0.0
Pod undocumented
9 714 ▶sub match {
Subroutine match: called CC=3 SCAR=11.0
Pod documented
10 # Try to match that the given text and regular expressions
11 # @param [String] argv1 String to be matched with regular expressions
12 # @return [Integer] 0: Did not match
13 # 1: Matched
14 # @since v5.2.0
15 714 my $class = shift;
16 714 ▶ my $argv1 = shift // return 0;
Condition100%2/2
shift() // (return 0)
l!l
7131
MC/DC100%1/1
shift() // (return 0)
shift()
Truth table100%2/2
A
A= shift()
Aresult
11
00
17  
18 713 state $index = [
19 "starttls is required to send mail",
20 "tls required but not supported", # SendGrid:the recipient mailserver does not support TLS or have a valid certificate
21 ];
22 713 ▶ return 1 if grep { rindex($argv1, $_) > -1 } @$index;
Branch: 1 branch
BranchTrueFalseTotal
if grep {rindex($argv1, $_) != -1;} @$index 2 711 713
23 711 return 0;
24 }
25  
26 641 ▶sub true {
Subroutine true: called CC=8 SCAR=22.1
Pod undocumented
27 # The bounce reason is "FailedSTARTTLS" or not
28 # @param [Sisimai::Fact] argvs Object to be detected the reason
29 # @return [Integer] 1: is FailedSTARTTLS
30 # 0: is not FailedSTARTTLS
31 # @see http://www.ietf.org/rfc/rfc2822.txt
32 # @since v5.2.0
33 641 my $class = shift;
34 641 ▶ my $argvs = shift // return 0;
Condition100%2/2
shift() // (return 0)
l!l
6401
MC/DC100%1/1
shift() // (return 0)
shift()
Truth table100%2/2
A
A= shift()
Aresult
11
00
35 640 ▶ my $reply = $argvs->{'replycode'} || 0;
Condition100%2/2
$argvs->{'replycode'} || 0
l!l
291349
MC/DC100%1/1
$argvs->{'replycode'} || 0
$argvs->{'replycode'}
Truth table100%2/2
A
A= $argvs->{'replycode'}
Aresult
11
00
36  
37 640 ▶ return 1 if $argvs->{"reason"} eq $Sisimai::Eb::ReTTLS || $argvs->{"command"} eq "STARTTLS";
Branch: 1 branch
BranchTrueFalseTotal
if $argvs->{"reason"} eq $Sisimai::Eb::ReTTLS or $argvs->{"command"} eq "STARTTLS" 1 639 640
Condition66%2/3
$argvs->{"reason"} eq $Sisimai::Eb::ReTTLS or $argvs->{"command"} eq "STARTTLS"
l!l&&r!l&&!r
10639
MC/DC50%1/2
$argvs->{"reason"} eq $Sisimai::Eb::ReTTLS or $argvs->{"command"} eq "STARTTLS"
$argvs->{"reason"} eq $Sisimai::Eb::ReTTLS $argvs->{"command"} eq "STARTTLS"
Truth table66%2/3
A or B
A= $argvs->{"reason"} eq $Sisimai::Eb::ReTTLSB= $argvs->{"command"} eq "STARTTLS"
ABresult
1X1
011
000
38 639 ▶ return 1 if $reply == 523 || $reply == 524 || $reply == 538;
Branch: 1 branch
BranchTrueFalseTotal
if $reply == 523 or $reply == 524 or $reply == 538 0 639 639
Condition33%2/6
$reply == 523 or $reply == 524 or $reply == 538
l!l&&r!l&&!r
00639
$reply == 523 or $reply == 524
l!l&&r!l&&!r
00639
MC/DC0%0/3
$reply == 523 or $reply == 524 or $reply == 538
$reply == 523 $reply == 524 $reply == 538
Truth table25%1/4
A or B or C
A= $reply == 523B= $reply == 524C= $reply == 538
ABCresult
1XX1
01X1
0011
0000
39 639 return __PACKAGE__->match(lc $argvs->{"diagnosticcode"});
40 }
41  
42 43 1;
43 __END__
« Sisimai/RFC791.pm ↑ Summary Sisimai/Reason/HostUnknown.pm »