lib/Mail/DMARC/Report/Aggregate/Record/Row/Policy_Evaluated.pm

filter: Statementstmt 95.1% 39 / 41 Branchbran 85.7% 12 / 14 Conditioncond 60.0% 3 / 5 MC/DCmcdc 33.3% 1 / 3 Subroutinesub 100% 10 / 10 Podpod 0.0% 0 / 5 totaltotal 83.3% 65 / 78 CC 15 SCAR 12.8
CC
15
Cov
90%
disposition
6.1
reason
4.3
new
3.0
CRAP 3.6
« lib/Mail/DMARC/Report/Aggregate/Record.pm ↑ Summary blib/lib/Mail/DMARC/Report/Send.pm »
1 package Mail::DMARC::Report::Aggregate::Record::Row::Policy_Evaluated;
2 16 our $VERSION = '2.20260827';
3 16 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 16 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 16 ▶use feature 'signatures';
Subroutine BEGIN: called CC=1 SCAR=0.0
6 16 ▶no warnings 'experimental::args_array_with_signatures'; ## no critic (ProhibitNoWarnings)
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 16 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 55 ▶sub new( $class, @args ) {
Subroutine new: called CC=3 SCAR=11.0
Pod undocumented
11 55 ▶ croak "invalid arguments" if @args % 2;
Branch: 1 branch
BranchTrueFalseTotal
if @args % 2 0 55 55
12 55 my %args = @args;
13 55 my $self = bless { reason => [] }, $class;
14 55 foreach my $key ( keys %args ) {
15 174 $self->$key( $args{$key} );
16 }
17 55 return $self;
18 }
19  
20 90 ▶sub disposition( $self, $value = undef ) {
Subroutine disposition: called CC=6 SCAR=18.1
Pod undocumented
21 90 ▶ return $self->{disposition} if @_ == 1;
Branch: 1 branch
BranchTrueFalseTotal
if @_ == 1 35 55 90
22 croak 'invalid disposition: ' . ( $value // '(undef)' )
23 55 ▶ if !defined $value || 0 == grep {/^$value$/ix} qw/ reject quarantine none /;
Branch: 1 branch
BranchTrueFalseTotal
if not defined $value or 0 == grep({/^$value$/xi;} "reject", "quarantine", "none") 1 54 55
Condition60%3/5
not defined $value or 0 == grep({/^$value$/xi;} "reject", "quarantine", "none")
l!l&&r!l&&!r
1054
$value // "(undef)"
l!l
01
MC/DC50%1/2
not defined $value or 0 == grep({/^$value$/xi;} "reject", "quarantine", "none")
not defined $value 0 == grep({/^$value$/xi;} "reject", "quarantine", "none")
MC/DC0%0/1
$value // "(undef)"
$value
Truth table66%2/3
not(A) or B
A= not defined $valueB= 0 == grep({/^$value$/xi;} "reject", "quarantine", "none")
ABresult
1X1
011
000
Truth table50%1/2
A
A= $value
Aresult
11
00
24 54 return $self->{disposition} = $value;
25 }
26  
27 94 ▶sub dkim( $self, $value = undef ) {
Subroutine dkim: called CC=3 SCAR=11.0
Pod undocumented
28 94 ▶ return $self->{dkim} if @_ == 1;
Branch: 1 branch
BranchTrueFalseTotal
if @_ == 1 37 57 94
29 57 return $self->{dkim} = $value;
30 }
31  
32 90 ▶sub spf( $self, $value = undef ) {
Subroutine spf: called CC=3 SCAR=11.0
Pod undocumented
33 90 ▶ return $self->{spf} if @_ == 1;
Branch: 1 branch
BranchTrueFalseTotal
if @_ == 1 35 55 90
34 55 return $self->{spf} = $value;
35 }
36  
37 26 ▶sub reason( $self, $value = undef ) {
Subroutine reason: called CC=4 SCAR=14.6
Pod undocumented
38 26 ▶ return $self->{reason} if @_ == 1;
Branch: 1 branch
BranchTrueFalseTotal
if @_ == 1 11 15 26
39 15 ▶ if ( 'ARRAY' eq ref $value ) { # one shot argument
Branch: 1 branch
BranchTrueFalseTotal
if ('ARRAY' eq ref $value) { } 15 0 15
40 15 $self->{reason} = $value;
41 }
42 else {
43 0 push @{ $self->{reason} }, $value;
44 }
45 15 return $self->{reason};
46 }
47  
48 16 1;
49  
50 __END__
51  
52 =pod
53  
54 =head1 NAME
55  
56 Mail::DMARC::Report::Aggregate::Record::Row::Policy_Evaluated - row/policy_evaluated section of a DMARC aggregate record
57  
58 =head1 VERSION
59  
60 version 2.20260827
61  
62 =head1 AUTHORS
63  
64 =over 4
65  
66 =item *
67  
68 Matt Simerson <msimerson@cpan.org>
69  
70 =item *
71  
72 Davide Migliavacca <shari@cpan.org>
73  
74 =item *
75  
76 Marc Bradshaw <marc@marcbradshaw.net>
77  
78 =back
79  
80 =head1 COPYRIGHT AND LICENSE
81  
82 This software is copyright (c) 2026 by Matt Simerson.
83  
84 This is free software; you can redistribute it and/or modify it under
85 the same terms as the Perl 5 programming language system itself.
86  
87 =cut
« lib/Mail/DMARC/Report/Aggregate/Record.pm ↑ Summary blib/lib/Mail/DMARC/Report/Send.pm »