Sietima/Role/Debounce.pm

filter: Statementstmt 100% 18 / 18 Branchbran 75.0% 3 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod n/a totaltotal 96.1% 25 / 26 CC 3 SCAR 7.0
CC
3
Cov
95%
__ANON__
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.0
« Sietima/Role/StripHeaders.pm ↑ Summary Sietima/CmdLine.pm »
1 package Sietima::Role::Debounce;
2 2 ▶use Moo::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 2 ▶use Sietima::Policy;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use namespace::clean;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 2 our $VERSION = '1.1.5'; # VERSION
7 # ABSTRACT: avoid mail loops
8  
9  
10 2 my $been_there = 'X-Been-There';
11  
12 5 ▶around munge_mail => sub ($orig,$self,$incoming_mail) {
Subroutine __ANON__: called CC=3 SCAR=11.0
13 5 my $return_path = $self->return_path->address;
14 5 ▶ if (my $there = $incoming_mail->header_str($been_there)) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $there = $incoming_mail->header_str($been_there)) 2 3 5
15 2 ▶ return if $there =~ m{\b\Q$return_path\E\b};
Branch: 1 branch
BranchTrueFalseTotal
if $there =~ /\b\Q$return_path\E\b/u 2 0 2
16 }
17  
18 $incoming_mail->header_str_set(
19 3 $been_there => $return_path,
20 );
21  
22 3 return $self->$orig($incoming_mail);
23 2 };
24  
25 2 1;
26  
27 __END__
« Sietima/Role/StripHeaders.pm ↑ Summary Sietima/CmdLine.pm »