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

filter: Statementstmt 100% 37 / 37 Branchbran 78.5% 11 / 14 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 9 / 9 Podpod 0.0% 0 / 4 totaltotal 89.0% 57 / 64 CC 11 SCAR 11.0
CC
11
Cov
94%
policy_evaluated
5.1
new
3.0
source_ip
3.0
CRAP 3.0
« lib/Mail/DMARC/Report/Aggregate/Metadata.pm ↑ Summary lib/Mail/DMARC/Result/Reason.pm »
1 package Mail::DMARC::Report::Aggregate::Record::Row;
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 16 require Mail::DMARC::Report::Aggregate::Record::Row::Policy_Evaluated;
10  
11 54 ▶sub new( $class, @args ) {
Subroutine new: called CC=3 SCAR=11.0
Pod undocumented
12 54 ▶ croak "invalid arguments" if @args % 2;
Branch: 1 branch
BranchTrueFalseTotal
if @args % 2 0 54 54
13 54 my %args = @args;
14 54 my $self = bless {}, $class;
15 54 foreach my $key ( keys %args ) {
16 121 $self->$key( $args{$key} );
17 }
18 54 return $self;
19 }
20  
21 88 ▶sub source_ip( $self, $value = undef ) {
Subroutine source_ip: called CC=3 SCAR=11.0
Pod undocumented
22 88 ▶ return $self->{source_ip} if @_ == 1;
Branch: 1 branch
BranchTrueFalseTotal
if @_ == 1 35 53 88
23 53 return $self->{source_ip} = $value;
24 }
25  
26 173 ▶sub policy_evaluated( $self, @args ) {
Subroutine policy_evaluated: called CC=5 SCAR=16.2
Pod undocumented
27  
28 173 ▶ if ( !@args ) {
Branch: 1 branch
BranchTrueFalseTotal
unless (@args) 120 53 173
29 120 ▶ return $self->{policy_evaluated} if $self->{policy_evaluated};
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"policy_evaluated"} 120 0 120
30 }
31  
32 53 ▶ if ( @args == 1 ) {
Branch: 1 branch
BranchTrueFalseTotal
if (@args == 1) 42 11 53
33 42 ▶ if ( 'HASH' eq ref $args[0] ) {
Branch: 1 branch
BranchTrueFalseTotal
if ("HASH" eq ref $args[0]) 42 0 42
34 42 @args = %{ $args[0] };
35 }
36 }
37  
38 return $self->{policy_evaluated}
39 53 = Mail::DMARC::Report::Aggregate::Record::Row::Policy_Evaluated->new(@args);
40 }
41  
42 44 ▶sub count( $self, $value = undef ) {
Subroutine count: called CC=3 SCAR=11.0
Pod undocumented
43 44 ▶ return $self->{count} if @_ == 1;
Branch: 1 branch
BranchTrueFalseTotal
if @_ == 1 2 42 44
44 42 return $self->{count} = $value;
45 }
46  
47 16 1;
48  
49 __END__
50  
51 =pod
52  
53 =head1 NAME
54  
55 Mail::DMARC::Report::Aggregate::Record::Row - row section of a DMARC aggregate record
56  
57 =head1 VERSION
58  
59 version 2.20260827
60  
61 =head1 AUTHORS
62  
63 =over 4
64  
65 =item *
66  
67 Matt Simerson <msimerson@cpan.org>
68  
69 =item *
70  
71 Davide Migliavacca <shari@cpan.org>
72  
73 =item *
74  
75 Marc Bradshaw <marc@marcbradshaw.net>
76  
77 =back
78  
79 =head1 COPYRIGHT AND LICENSE
80  
81 This software is copyright (c) 2026 by Matt Simerson.
82  
83 This is free software; you can redistribute it and/or modify it under
84 the same terms as the Perl 5 programming language system itself.
85  
86 =cut
« lib/Mail/DMARC/Report/Aggregate/Metadata.pm ↑ Summary lib/Mail/DMARC/Result/Reason.pm »