Sisimai/Reason/NotCompliantRFC.pm

filter: Statementstmt 100% 24 / 24 Branchbran 100% 4 / 4 Conditioncond 100% 4 / 4 MC/DCmcdc 100% 2 / 2 Subroutinesub 100% 8 / 8 Podpod 50.0% 2 / 4 totaltotal 95.6% 44 / 46 CC 5 SCAR 6.9
CC
5
Cov
100%
match
3.0
true
3.0
BEGIN
1.0
CRAP 2.0
« Sisimai/Reason/BadReputation.pm ↑ Summary Sisimai/Reason/Expired.pm »
1 package Sisimai::Reason::NotCompliantRFC;
2 51 ▶use v5.26;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 51 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 51 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 51 ▶use Sisimai::Eb;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 16 ▶sub text { $Sisimai::Eb::ReNRFC }
Subroutine text: called CC=1 SCAR=0.0
Pod documented
8 4 ▶sub description { "Email rejected due to non-compliance with RFC" }
Subroutine description: called CC=1 SCAR=0.0
Pod undocumented
9 1069 ▶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.0.0
15 1069 my $class = shift;
16 1069 ▶ my $argv1 = shift // return 0;
Condition100%2/2
shift() // (return 0)
l!l
10681
MC/DC100%1/1
shift() // (return 0)
shift()
Truth table100%2/2
A
A= shift()
Aresult
11
00
17  
18 1068 state $index = [
19 "duplicate header",
20 "duplicated message-id",
21 "message is not rfc 5322 compliant",
22 "multiple addresses in from: header are not accepted",
23 "rfc 1035 violation",
24 "https://support.google.com/mail/?p=rfcmessagenoncompliant",
25 ];
26 1068 ▶ return 1 if grep { rindex($argv1, $_) > -1 } @$index;
Branch: 1 branch
BranchTrueFalseTotal
if grep {rindex($argv1, $_) != -1;} @$index 19 1049 1068
27 1049 return 0;
28 }
29  
30 1067 ▶sub true {
Subroutine true: called CC=3 SCAR=11.0
Pod undocumented
31 # Whether the email is RFC compliant or not
32 # @param [Sisimai::Fact] argvs Object to be detected the reason
33 # @return [Integer] 1: RFC compliant
34 # 0: Is not RFC compliant
35 # @since v5.0.0
36 # @see http://www.ietf.org/rfc/rfc5322.txt
37 1067 my $class = shift;
38 1067 ▶ my $argvs = shift // return 0;
Condition100%2/2
shift() // (return 0)
l!l
10661
MC/DC100%1/1
shift() // (return 0)
shift()
Truth table100%2/2
A
A= shift()
Aresult
11
00
39  
40 1066 ▶ return 1 if $argvs->{'reason'} eq $Sisimai::Eb::ReNRFC;
Branch: 1 branch
BranchTrueFalseTotal
if $argvs->{"reason"} eq $Sisimai::Eb::ReNRFC 1 1065 1066
41 1065 return __PACKAGE__->match(lc $argvs->{'diagnosticcode'});
42 }
43  
44 51 1;
45 __END__
« Sisimai/Reason/BadReputation.pm ↑ Summary Sisimai/Reason/Expired.pm »