Sisimai/Reason/HasMoved.pm

filter: Statementstmt 100% 27 / 27 Branchbran 100% 6 / 6 Conditioncond 100% 4 / 4 MC/DCmcdc 100% 2 / 2 Subroutinesub 100% 8 / 8 Podpod 50.0% 2 / 4 totaltotal 96.0% 49 / 51 CC 6 SCAR 8.7
CC
6
Cov
100%
true
4.0
match
3.0
BEGIN
1.0
CRAP 2.4
« Sisimai/Fact/JSON.pm ↑ Summary Sisimai/Reason/NetworkError.pm »
1 package Sisimai::Reason::HasMoved;
2 68 ▶use v5.26;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 68 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 68 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 68 ▶use Sisimai::Eb;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 1 ▶sub text { $Sisimai::Eb::ReMOVE }
Subroutine text: called CC=1 SCAR=0.0
Pod documented
8 4 ▶sub description { "Email rejected due to user's mailbox has moved and is not forwarded automatically" }
Subroutine description: called CC=1 SCAR=0.0
Pod undocumented
9 2395 ▶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.1.25
15 2395 my $class = shift;
16 2395 ▶ my $argv1 = shift // return 0;
Condition100%2/2
shift() // (return 0)
l!l
23941
MC/DC100%1/1
shift() // (return 0)
shift()
Truth table100%2/2
A
A= shift()
Aresult
11
00
17  
18 2394 state $index = [' has been replaced by '];
19 2394 ▶ return 1 if grep { rindex($argv1, $_) > -1 } @$index;
Branch: 1 branch
BranchTrueFalseTotal
if grep {rindex($argv1, $_) != -1;} @$index 2 2392 2394
20 2392 return 0;
21 }
22  
23 2109 ▶sub true {
Subroutine true: called CC=4 SCAR=13.9
Pod undocumented
24 # Whether the address has moved or not
25 # @param [Sisimai::Fact] argvs Object to be detected the reason
26 # @return [Integer] 1: The address has moved
27 # 0: Has not moved
28 # @since v4.1.25
29 # @see http://www.ietf.org/rfc/rfc2822.txt
30 2109 my $class = shift;
31 2109 ▶ my $argvs = shift // return 0;
Condition100%2/2
shift() // (return 0)
l!l
21081
MC/DC100%1/1
shift() // (return 0)
shift()
Truth table100%2/2
A
A= shift()
Aresult
11
00
32  
33 2108 require Sisimai::SMTP::Command;
34 2108 ▶ return 1 if $argvs->{'reason'} eq $Sisimai::Eb::ReMOVE;
Branch: 1 branch
BranchTrueFalseTotal
if $argvs->{"reason"} eq $Sisimai::Eb::ReMOVE 1 2107 2108
35 2107 ▶ return 0 if grep { $argvs->{'command'} eq $_ } Sisimai::SMTP::Command->BeforeRCPT->@*;
Branch: 1 branch
BranchTrueFalseTotal
if grep {$argvs->{"command"} eq $_;} @{"Sisimai::SMTP::Command"->BeforeRCPT} 227 1880 2107
36 1880 return __PACKAGE__->match(lc $argvs->{'diagnosticcode'});
37 }
38  
39 68 1;
40 __END__
« Sisimai/Fact/JSON.pm ↑ Summary Sisimai/Reason/NetworkError.pm »