Sisimai/Reason/PolicyViolation.pm

filter: Statementstmt 100% 25 / 25 Branchbran 83.3% 5 / 6 Conditioncond 100% 7 / 7 MC/DCmcdc 100% 4 / 4 Subroutinesub 100% 8 / 8 Podpod 50.0% 2 / 4 totaltotal 94.4% 51 / 54 CC 7 SCAR 10.5
CC
7
Cov
97%
true
5.0
match
3.0
BEGIN
1.0
CRAP 2.9
« Sisimai/Order.pm ↑ Summary Sisimai/Reason/VirusDetected.pm »
1 package Sisimai::Reason::PolicyViolation;
2 44 ▶use v5.26;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 44 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 44 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 44 ▶use Sisimai::Eb;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 16 ▶sub text { $Sisimai::Eb::ReWONT }
Subroutine text: called CC=1 SCAR=0.0
Pod documented
8 4 ▶sub description { 'Email rejected due to policy violation on a destination host' }
Subroutine description: called CC=1 SCAR=0.0
Pod undocumented
9 844 ▶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 v4.22.0
15 844 my $class = shift;
16 844 ▶ my $argv1 = shift // return 0;
Condition100%2/2
shift() // (return 0)
l!l
8431
MC/DC100%1/1
shift() // (return 0)
shift()
Truth table100%2/2
A
A= shift()
Aresult
11
00
17  
18 843 state $index = [
19 "because the recipient is not accepting mail with ", # AOL Phoenix
20 "closed mailing list",
21 "delivery not authorized, message refused",
22 "denied by policy",
23 # http://kb.mimecast.com/Mimecast_Knowledge_Base/Administration_Console/Monitoring/Mimecast_SMTP_Error_Codes#554
24 "email rejected due to security policies",
25 "for policy reasons",
26 "local policy violation",
27 "message bounced due to organizational settings",
28 "message given low priority",
29 "message was rejected by organization policy",
30 "protocol violation",
31 "support.google.com/a/answer/172179",
32 "you're using a mass mailer",
33 ];
34 843 ▶ return 1 if grep { rindex($argv1, $_) > -1 } @$index;
Branch: 1 branch
BranchTrueFalseTotal
if grep {rindex($argv1, $_) != -1;} @$index 28 815 843
35 815 return 0;
36 }
37  
38 609 ▶sub true {
Subroutine true: called CC=5 SCAR=16.1
Pod undocumented
39 # The bounce reason is "PolicyViolation" or not
40 # @param [Sisimai::Fact] argvs Object to be detected the reason
41 # @return [Integer] 1: is PolicyViolation
42 # 0: is not PolicyViolation
43 # @since v4.22.0
44 # @see http://www.ietf.org/rfc/rfc2822.txt
45 609 my $class = shift;
46 609 ▶ my $argvs = shift // return 0;
Condition100%2/2
shift() // (return 0)
l!l
6081
MC/DC100%1/1
shift() // (return 0)
shift()
Truth table100%2/2
A
A= shift()
Aresult
11
00
47  
48 608 ▶ return 1 if $argvs->{'reason'} eq $Sisimai::Eb::ReWONT;
Branch: 1 branch
BranchTrueFalseTotal
if $argvs->{"reason"} eq $Sisimai::Eb::ReWONT 0 608 608
49 608 ▶ return 0 if $argvs->{'command'} ne '' && $argvs->{'command'} ne $Sisimai::Eb::CeDATA;
Branch: 1 branch
BranchTrueFalseTotal
if $argvs->{"command"} ne "" and $argvs->{"command"} ne $Sisimai::Eb::CeDATA 136 472 608
Condition100%3/3
$argvs->{"command"} ne "" and $argvs->{"command"} ne $Sisimai::Eb::CeDATA
!ll&&!rl&&r
42547136
MC/DC100%2/2
$argvs->{"command"} ne "" and $argvs->{"command"} ne $Sisimai::Eb::CeDATA
$argvs->{"command"} ne "" $argvs->{"command"} ne $Sisimai::Eb::CeDATA
Truth table100%3/3
A and B
A= $argvs->{"command"} ne ""B= $argvs->{"command"} ne $Sisimai::Eb::CeDATA
ABresult
0X0
100
111
50 472 return __PACKAGE__->match(lc $argvs->{'diagnosticcode'});
51 }
52  
53 44 1;
54 __END__
« Sisimai/Order.pm ↑ Summary Sisimai/Reason/VirusDetected.pm »