Sisimai/Rhost/Cloudflare.pm

filter: Statementstmt 100% 18 / 18 Branchbran 100% 4 / 4 Conditioncond 100% 2 / 2 MC/DCmcdc 100% 1 / 1 Subroutinesub 100% 4 / 4 Podpod 0.0% 0 / 1 totaltotal 96.6% 29 / 30 CC 5 SCAR 12.5
CC
5
Cov
100%
find
5.0
BEGIN
1.0
BEGIN
1.0
CRAP 3.5
« Sisimai/Reason/OnHold.pm ↑ Summary Sisimai/Rhost/Zoho.pm »
1 package Sisimai::Rhost::Cloudflare;
2 3 ▶use v5.26;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 10 ▶sub find {
Subroutine find: called CC=5 SCAR=16.1
Pod undocumented
7 # Detect bounce reason for Cloudflare Email Routing
8 # @param [Sisimai::Fact] argvs Decoded email object
9 # @return [String] Detected bounce reason
10 # @since v5.2.1
11 # @see https://developers.cloudflare.com/email-routing/postmaster/
12 10 my $class = shift;
13 10 ▶ my $argvs = shift // return ""; return "" unless $argvs->{'diagnosticcode'};
Branch: 1 branch
BranchTrueFalseTotal
unless $argvs->{"diagnosticcode"} 1 8 9
Condition100%2/2
shift() // (return "")
l!l
91
MC/DC100%1/1
shift() // (return "")
shift()
Truth table100%2/2
A
A= shift()
Aresult
11
00
14  
15 8 require Sisimai::Eb;
16 8 state $messagesof = {
17 # - 554 <YOUR_IP_ADDRESS> found on one or more RBLs (abusixip). Refer to
18 # https://developers.cloudflare.com/email-routing/postmaster/#spam-and-abusive-traffic/
19 $Sisimai::Eb::ReBLOC => ["found on one or more DNSBLs"],
20 $Sisimai::Eb::RePROC => ["Upstream error"],
21 };
22 8 for my $e ( keys %$messagesof ) {
23 # Try to find the error message matches with the given error message string
24 14 ▶ return $e if grep { index($argvs->{"diagnosticcode"}, $_) > -1 } $messagesof->{ $e }->@*;
Branch: 1 branch
BranchTrueFalseTotal
if grep {index($argvs->{"diagnosticcode"}, $_) != -1;} @{$$messagesof{$e}} 6 8 14
25 }
26 2 return "";
27 }
28  
29 3 1;
30 __END__
« Sisimai/Reason/OnHold.pm ↑ Summary Sisimai/Rhost/Zoho.pm »