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 lib/Mail/DMARC/Report/Aggregate/Record.pm »
1 package Mail::DMARC::Report::Aggregate::Record::Auth_Results;
2 17 our $VERSION = '2.20261110';
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 34 ▶sub new( $class, @args ) {
Subroutine new: called CC=4 SCAR=13.9
Pod undocumented
12 34 ▶ croak "invalid arguments" if @args % 2;
Branch: 1 branch
BranchTrueFalseTotal
if @args % 2 0 34 34
13  
14 34 my $self = bless { spf => [], dkim => [] }, $class;
15 34 ▶ return $self if !@args;
Branch: 1 branch
BranchTrueFalseTotal
unless @args 16 18 34
16  
17 18 my %args = @args;
18 18 foreach my $key ( keys %args ) {
19 35 $self->$key( $args{$key} );
20 }
21  
22 18 return $self;
23 }
24  
25 51 ▶sub spf( $self, @args ) {
Subroutine spf: called CC=5 SCAR=16.1
Pod undocumented
26 51 ▶ return $self->{spf} if !@args;
Branch: 1 branch
BranchTrueFalseTotal
unless @args 16 35 51
27  
28 # one shot
29 35 ▶ if ( @args == 1 && ref $args[0] eq 'ARRAY' ) {
Branch: 1 branch
BranchTrueFalseTotal
if (@args == 1 and ref $args[0] eq "ARRAY") 31 4 35
Condition100%3/3
@args == 1 and ref $args[0] eq "ARRAY"
!ll&&!rl&&r
2231
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 31 my $iter = 0;
33 31 foreach my $d ( @{ $args[0] } ) {
34 48 $self->{spf}->[$iter]
35 = Mail::DMARC::Report::Aggregate::Record::Auth_Results::SPF->new(
36 $d);
37 48 $iter++;
38 }
39 31 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 53 ▶sub dkim( $self, @args ) {
Subroutine dkim: called CC=5 SCAR=16.1
Pod undocumented
50 53 ▶ return $self->{dkim} if !@args;
Branch: 1 branch
BranchTrueFalseTotal
unless @args 18 35 53
51  
52 35 ▶ if ( @args == 1 && ref $args[0] eq 'ARRAY' ) {
Branch: 1 branch
BranchTrueFalseTotal
if (@args == 1 and ref $args[0] eq "ARRAY") 30 5 35
Condition100%3/3
@args == 1 and ref $args[0] eq "ARRAY"
!ll&&!rl&&r
1430
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 30 my $iter = 0;
56 30 foreach my $d ( @{ $args[0] } ) {
57 38 $self->{dkim}->[$iter]
58 = Mail::DMARC::Report::Aggregate::Record::Auth_Results::DKIM->new(
59 $d);
60 38 $iter++;
61 }
62 30 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__
« lib/Mail/DMARC/Result.pm ↑ Summary lib/Mail/DMARC/Report/Aggregate/Record.pm »