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

filter: Statementstmt 100% 45 / 45 Branchbran 95.4% 21 / 22 Conditioncond 66.6% 4 / 6 MC/DCmcdc 50.0% 2 / 4 Subroutinesub 100% 9 / 9 Podpod 0.0% 0 / 4 totaltotal 90.0% 81 / 90 CC 15 SCAR 13.3
CC
15
Cov
96%
auth_results
5.0
row
5.0
new
4.0
CRAP 3.8
« lib/Mail/DMARC/Report/Aggregate/Record/Auth_Results.pm ↑ Summary lib/Mail/DMARC/Report/Aggregate/Record/Row/Policy_Evaluated.pm »
1 package Mail::DMARC::Report::Aggregate::Record;
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  
7 16 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 16 ▶use parent 'Mail::DMARC::Base';
Subroutine BEGIN: called CC=1 SCAR=0.0
10 16 require Mail::DMARC::Report::Aggregate::Record::Identifiers;
11 16 require Mail::DMARC::Report::Aggregate::Record::Auth_Results;
12 16 require Mail::DMARC::Report::Aggregate::Record::Row;
13  
14 55 ▶sub new( $class, @args ) {
Subroutine new: called CC=4 SCAR=13.9
Pod undocumented
15 55 ▶ croak "invalid arguments" if @args % 2;
Branch: 1 branch
BranchTrueFalseTotal
if @args % 2 0 55 55
16  
17 55 my $self = bless {}, $class;
18 55 ▶ return $self if !@args;
Branch: 1 branch
BranchTrueFalseTotal
unless @args 37 18 55
19  
20 18 my %args = @args;
21 18 foreach my $key ( keys %args ) {
22 54 $self->$key( $args{$key} );
23 }
24  
25 18 return $self;
26 }
27  
28 272 ▶sub identifiers( $self, @args ) {
Subroutine identifiers: called CC=4 SCAR=13.9
Pod undocumented
29  
30 272 ▶ if ( !@args ) {
Branch: 1 branch
BranchTrueFalseTotal
unless (@args) 217 55 272
31 217 ▶ return $self->{identifiers} if $self->{identifiers};
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"identifiers"} 216 1 217
32 }
33  
34 56 ▶ if ( 'HASH' eq ref $args[0] ) {
Branch: 1 branch
BranchTrueFalseTotal
if ("HASH" eq ref $args[0]) 18 38 56
35 18 @args = %{ $args[0] };
36 }
37  
38 return $self->{identifiers}
39 56 = Mail::DMARC::Report::Aggregate::Record::Identifiers->new(@args);
40 }
41  
42 68 ▶sub auth_results( $self, @args ) {
Subroutine auth_results: called CC=5 SCAR=16.1
Pod undocumented
43  
44 68 ▶ if ( !@args ) {
Branch: 1 branch
BranchTrueFalseTotal
unless (@args) 50 18 68
45 50 ▶ return $self->{auth_results} if $self->{auth_results};
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"auth_results"} 37 13 50
46 }
47  
48 31 ▶ if ( @args == 1 && 'HASH' eq ref $args[0] ) {
Branch: 1 branch
BranchTrueFalseTotal
if (@args == 1 and "HASH" eq ref $args[0]) 18 13 31
Condition66%2/3
@args == 1 and "HASH" eq ref $args[0]
!ll&&!rl&&r
13018
MC/DC50%1/2
@args == 1 and "HASH" eq ref $args[0]
@args == 1 "HASH" eq ref $args[0]
Truth table66%2/3
A and B
A= @args == 1B= "HASH" eq ref $args[0]
ABresult
0X0
100
111
49 18 @args = %{ $args[0] };
50 }
51  
52 return $self->{auth_results}
53 31 = Mail::DMARC::Report::Aggregate::Record::Auth_Results->new(@args);
54 }
55  
56 227 ▶sub row( $self, @args ) {
Subroutine row: called CC=5 SCAR=16.1
Pod undocumented
57  
58 227 ▶ if ( !@args ) {
Branch: 1 branch
BranchTrueFalseTotal
unless (@args) 185 42 227
59 185 ▶ return $self->{row} if $self->{row};
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"row"} 172 13 185
60 }
61  
62 55 ▶ if ( @args == 1 && 'HASH' eq ref $args[0] ) {
Branch: 1 branch
BranchTrueFalseTotal
if (@args == 1 and "HASH" eq ref $args[0]) 18 37 55
Condition66%2/3
@args == 1 and "HASH" eq ref $args[0]
!ll&&!rl&&r
37018
MC/DC50%1/2
@args == 1 and "HASH" eq ref $args[0]
@args == 1 "HASH" eq ref $args[0]
Truth table66%2/3
A and B
A= @args == 1B= "HASH" eq ref $args[0]
ABresult
0X0
100
111
63 18 @args = %{ $args[0] };
64 }
65  
66 55 return $self->{row} = Mail::DMARC::Report::Aggregate::Record::Row->new(@args);
67 }
68  
69 16 1;
70  
71 __END__
« lib/Mail/DMARC/Report/Aggregate/Record/Auth_Results.pm ↑ Summary lib/Mail/DMARC/Report/Aggregate/Record/Row/Policy_Evaluated.pm »