lib/Mail/DMARC/Report/Aggregate/Record/Auth_Results.pm

filter: Statementstmt 100% 45 / 45 Branchbran 91.6% 11 / 12 Conditioncond 100% 6 / 6 MC/DCmcdc 100% 4 / 4 Subroutinesub 100% 7 / 7 Podpod 0.0% 0 / 3 totaltotal 94.8% 73 / 77 CC 12 SCAR 13.6
CC
12
Cov
98%
spf
5.0
dkim
5.0
new
4.0
CRAP 3.9
« lib/Mail/DMARC/Result.pm ↑ Summary blib/lib/Mail/DMARC/Report/Store.pm »
1 package Mail::DMARC::Report::Aggregate::Record::Auth_Results;
2 17 our $VERSION = '2.20260827';
3 17 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 17 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 17 ▶use feature 'signatures';
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 17 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 17 require Mail::DMARC::Report::Aggregate::Record::Auth_Results::SPF;
9 17 require Mail::DMARC::Report::Aggregate::Record::Auth_Results::DKIM;
10  
11 32 ▶sub new( $class, @args ) {
Subroutine new: called CC=4 SCAR=13.9
Pod undocumented
12 32 ▶ croak "invalid arguments" if @args % 2;
Branch: 1 branch
BranchTrueFalseTotal
if @args % 2 0 32 32
13  
14 32 my $self = bless { spf => [], dkim => [] }, $class;
15 32 ▶ return $self if !@args;
Branch: 1 branch
BranchTrueFalseTotal
unless @args 15 17 32
16  
17 17 my %args = @args;
18 17 foreach my $key ( keys %args ) {
19 33 $self->$key( $args{$key} );
20 }
21  
22 17 return $self;
23 }
24  
25 48 ▶sub spf( $self, @args ) {
Subroutine spf: called CC=5 SCAR=16.1
Pod undocumented
26 48 ▶ return $self->{spf} if !@args;
Branch: 1 branch
BranchTrueFalseTotal
unless @args 15 33 48
27  
28 # one shot
29 33 ▶ if ( @args == 1 && ref $args[0] eq 'ARRAY' ) {
Branch: 1 branch
BranchTrueFalseTotal
if (@args == 1 and ref $args[0] eq "ARRAY") 29 4 33
Condition100%3/3
@args == 1 and ref $args[0] eq "ARRAY"
!ll&&!rl&&r
2229
MC/DC100%2/2
@args == 1 and ref $args[0] eq "ARRAY"
@args == 1 ref $args[0] eq "ARRAY"
Truth table100%3/3
A and B
A= @args == 1B= ref $args[0] eq "ARRAY"
ABresult
0X0
100
111
30  
31 #warn "SPF one shot";
32 29 my $iter = 0;
33 29 foreach my $d ( @{ $args[0] } ) {
34 44 $self->{spf}->[$iter]
35 = Mail::DMARC::Report::Aggregate::Record::Auth_Results::SPF->new(
36 $d);
37 44 $iter++;
38 }
39 29 return $self->{spf};
40 }
41  
42 #warn "SPF iterative";
43 4 push @{ $self->{spf} },
44 Mail::DMARC::Report::Aggregate::Record::Auth_Results::SPF->new(@args);
45  
46 4 return $self->{spf};
47 }
48  
49 50 ▶sub dkim( $self, @args ) {
Subroutine dkim: called CC=5 SCAR=16.1
Pod undocumented
50 50 ▶ return $self->{dkim} if !@args;
Branch: 1 branch
BranchTrueFalseTotal
unless @args 17 33 50
51  
52 33 ▶ if ( @args == 1 && ref $args[0] eq 'ARRAY' ) {
Branch: 1 branch
BranchTrueFalseTotal
if (@args == 1 and ref $args[0] eq "ARRAY") 28 5 33
Condition100%3/3
@args == 1 and ref $args[0] eq "ARRAY"
!ll&&!rl&&r
1428
MC/DC100%2/2
@args == 1 and ref $args[0] eq "ARRAY"
@args == 1 ref $args[0] eq "ARRAY"
Truth table100%3/3
A and B
A= @args == 1B= ref $args[0] eq "ARRAY"
ABresult
0X0
100
111
53  
54 #warn "dkim one shot";
55 28 my $iter = 0;
56 28 foreach my $d ( @{ $args[0] } ) {
57 36 $self->{dkim}->[$iter]
58 = Mail::DMARC::Report::Aggregate::Record::Auth_Results::DKIM->new(
59 $d);
60 36 $iter++;
61 }
62 28 return $self->{dkim};
63 }
64  
65 #warn "dkim iterative";
66 5 push @{ $self->{dkim} },
67 Mail::DMARC::Report::Aggregate::Record::Auth_Results::DKIM->new(@args);
68  
69 5 return $self->{dkim};
70 }
71  
72 17 1;
73  
74 __END__
75  
76 =pod
77  
78 =head1 NAME
79  
80 Mail::DMARC::Report::Aggregate::Record::Auth_Results - auth_results section of a DMARC aggregate record
81  
82 =head1 VERSION
83  
84 version 2.20260827
85  
86 =head1 AUTHORS
87  
88 =over 4
89  
90 =item *
91  
92 Matt Simerson <msimerson@cpan.org>
93  
94 =item *
95  
96 Davide Migliavacca <shari@cpan.org>
97  
98 =item *
99  
100 Marc Bradshaw <marc@marcbradshaw.net>
101  
102 =back
103  
104 =head1 COPYRIGHT AND LICENSE
105  
106 This software is copyright (c) 2026 by Matt Simerson.
107  
108 This is free software; you can redistribute it and/or modify it under
109 the same terms as the Perl 5 programming language system itself.
110  
111 =cut
« lib/Mail/DMARC/Result.pm ↑ Summary blib/lib/Mail/DMARC/Report/Store.pm »