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/Result/Reason.pm ↑ Summary lib/Mail/DMARC/Report/Aggregate/Metadata.pm »
1 package Mail::DMARC::Report::Aggregate::Record::Row;
2 16 our $VERSION = '2.20261110';
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 56 ▶sub new( $class, @args ) {
Subroutine new: called CC=3 SCAR=11.0
Pod undocumented
12 56 ▶ croak "invalid arguments" if @args % 2;
Branch: 1 branch
BranchTrueFalseTotal
if @args % 2 0 56 56
13 56 my %args = @args;
14 56 my $self = bless {}, $class;
15 56 foreach my $key ( keys %args ) {
16 124 $self->$key( $args{$key} );
17 }
18 56 return $self;
19 }
20  
21 91 ▶sub source_ip( $self, $value = undef ) {
Subroutine source_ip: called CC=3 SCAR=11.0
Pod undocumented
22 91 ▶ return $self->{source_ip} if @_ == 1;
Branch: 1 branch
BranchTrueFalseTotal
if @_ == 1 36 55 91
23 55 return $self->{source_ip} = $value;
24 }
25  
26 179 ▶sub policy_evaluated( $self, @args ) {
Subroutine policy_evaluated: called CC=5 SCAR=16.2
Pod undocumented
27  
28 179 ▶ if ( !@args ) {
Branch: 1 branch
BranchTrueFalseTotal
unless (@args) 124 55 179
29 124 ▶ return $self->{policy_evaluated} if $self->{policy_evaluated};
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"policy_evaluated"} 124 0 124
30 }
31  
32 55 ▶ if ( @args == 1 ) {
Branch: 1 branch
BranchTrueFalseTotal
if (@args == 1) 43 12 55
33 43 ▶ if ( 'HASH' eq ref $args[0] ) {
Branch: 1 branch
BranchTrueFalseTotal
if ("HASH" eq ref $args[0]) 43 0 43
34 43 @args = %{ $args[0] };
35 }
36 }
37  
38 return $self->{policy_evaluated}
39 55 = Mail::DMARC::Report::Aggregate::Record::Row::Policy_Evaluated->new(@args);
40 }
41  
42 45 ▶sub count( $self, $value = undef ) {
Subroutine count: called CC=3 SCAR=11.0
Pod undocumented
43 45 ▶ return $self->{count} if @_ == 1;
Branch: 1 branch
BranchTrueFalseTotal
if @_ == 1 2 43 45
44 43 return $self->{count} = $value;
45 }
46  
47 16 1;
48  
49 __END__
« lib/Mail/DMARC/Result/Reason.pm ↑ Summary lib/Mail/DMARC/Report/Aggregate/Metadata.pm »