Sisimai/Rhost/Outlook.pm

filter: Statementstmt 100% 22 / 22 Branchbran 100% 4 / 4 Conditioncond 100% 2 / 2 MC/DCmcdc 100% 1 / 1 Subroutinesub 100% 4 / 4 Podpod 0.0% 0 / 1 totaltotal 97.0% 33 / 34 CC 5 SCAR 12.5
CC
5
Cov
100%
find
5.0
BEGIN
1.0
BEGIN
1.0
CRAP 3.5
« Sisimai/Rhost/MessageLabs.pm ↑ Summary Sisimai/Rhost/Tencent.pm »
1 package Sisimai::Rhost::Outlook;
2 8 ▶use v5.26;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 8 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 8 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 93 ▶sub find {
Subroutine find: called CC=5 SCAR=16.1
Pod undocumented
7 # Detect bounce reason from Microsoft Outlook.com: https://www.outlook.com/
8 # @param [Sisimai::Fact] argvs Decoded email object
9 # @return [String] The bounce reason for Outlook
10 # @since v5.2.0
11 93 my $class = shift;
12 93 ▶ my $argvs = shift // return ""; return '' unless length $argvs->{'diagnosticcode'};
Branch: 1 branch
BranchTrueFalseTotal
unless length $argvs->{"diagnosticcode"} 1 91 92
Condition100%2/2
shift() // (return "")
l!l
921
MC/DC100%1/1
shift() // (return "")
shift()
Truth table100%2/2
A
A= shift()
Aresult
11
00
13  
14 91 require Sisimai::Eb;
15 91 state $messagesof = {
16 $Sisimai::Eb::ReHOST => ['The mail could not be delivered to the recipient because the domain is not reachable'],
17 $Sisimai::Eb::ReUSER => ['Requested action not taken: mailbox unavailable'],
18 };
19 91 my $issuedcode = $argvs->{'diagnosticcode'};
20 91 my $reasontext = '';
21  
22 91 for my $e ( keys %$messagesof ) {
23 # Try to find the error message matches with the given error message string
24 167 ▶ next unless grep { index($issuedcode, $_) > -1 } $messagesof->{ $e }->@*;
Branch: 1 branch
BranchTrueFalseTotal
unless grep {index($issuedcode, $_) != -1;} @{$$messagesof{$e}} 145 22 167
25 22 $reasontext = $e;
26 22 last;
27 }
28 91 return $reasontext;
29 }
30  
31 8 1;
32 __END__
« Sisimai/Rhost/MessageLabs.pm ↑ Summary Sisimai/Rhost/Tencent.pm »