« lib/Mail/DMARC/Report/Aggregate/Record/Auth_Results/DKIM.pm
↑ Summary
lib/Mail/DMARC/Report/Aggregate/Record/Row.pm »
| 1 | package Mail::DMARC::Result::Reason; | ||||||||||||||||||||||||||||
| 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 | |||||||||||||||||||||||||||||
| 10 | 40 | ▶ | sub new( $class, @args ) { | ||||||||||||||||||||||||||
|
Subroutine
new: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 11 | 40 | ▶ | croak "invalid arguments" if @args % 2; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 12 | 40 | my %args = @args; | |||||||||||||||||||||||||||
| 13 | 40 | my $self = bless {}, $class; | |||||||||||||||||||||||||||
| 14 | 40 | foreach my $key ( keys %args ) { | |||||||||||||||||||||||||||
| 15 | 66 | $self->$key( $args{$key} ); | |||||||||||||||||||||||||||
| 16 | } | ||||||||||||||||||||||||||||
| 17 | 34 | return $self; | |||||||||||||||||||||||||||
| 18 | } | ||||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | 41 | ▶ | sub type( $self, $val = undef ) { | ||||||||||||||||||||||||||
|
Subroutine
type: called CC=5 SCAR=16.1
Pod
documented
| |||||||||||||||||||||||||||||
| 21 | 41 | ▶ | return $self->{type} if @_ == 1; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 22 | croak "invalid type" | ||||||||||||||||||||||||||||
| 23 | if !defined $val | ||||||||||||||||||||||||||||
| 24 | 40 | ▶ | || 0 == grep {/^\Q$val\E$/ix} | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
not defined $val or 0 == grep({/^\Q$val\E$/xi;} "forwarded", "sampled_out", "trusted_forwarder", "mailing_list", "local_policy", "other", "policy_test_mode")
MC/DC100%2/2
not defined $val or 0 == grep({/^\Q$val\E$/xi;} "forwarded", "sampled_out", "trusted_forwarder", "mailing_list", "local_policy", "other", "policy_test_mode")
not defined $val
0 == grep({/^\Q$val\E$/xi;} "forwarded", "sampled_out", "trusted_forwarder", "mailing_list", "local_policy", "other", "policy_test_mode")
Truth table100%3/3
not(A) or B
A= not defined $valB= 0 == grep({/^\Q$val\E$/xi;} "forwarded", "sampled_out", "trusted_forwarder", "mailing_list", "local_policy", "other", "policy_test_mode")
| |||||||||||||||||||||||||||||
| 25 | qw/ forwarded sampled_out trusted_forwarder | ||||||||||||||||||||||||||||
| 26 | mailing_list local_policy other policy_test_mode /; | ||||||||||||||||||||||||||||
| 27 | 33 | return $self->{type} = $val; | |||||||||||||||||||||||||||
| 28 | } | ||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||
| 30 | 35 | ▶ | sub comment( $self, $val = undef ) { | ||||||||||||||||||||||||||
|
Subroutine
comment: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||
| 31 | 35 | ▶ | return $self->{comment} if @_ == 1; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||
| 33 | # comment is optional and requires no validation | ||||||||||||||||||||||||||||
| 34 | 30 | return $self->{comment} = $val; | |||||||||||||||||||||||||||
| 35 | } | ||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||
| 37 | # keeps an unrecognized type as the comment, rather than losing it | ||||||||||||||||||||||||||||
| 38 | 22 | ▶ | sub as_known_type( $type, $comment, $known ) { | ||||||||||||||||||||||||||
|
Subroutine
as_known_type: called CC=4 SCAR=14.9
Pod
documented
| |||||||||||||||||||||||||||||
| 39 | 22 | ▶ | return ( lc $type, $comment ) if $known->{ lc $type }; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 40 | 2 | ▶ | $comment = $type if !defined $comment || $comment !~ /\S/; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $comment and $comment =~ /\S/
MC/DC0%0/2
defined $comment and $comment =~ /\S/
defined $comment
$comment =~ /\S/
Truth table33%1/3
A and B
A= defined $commentB= $comment =~ /\S/
| |||||||||||||||||||||||||||||
| 41 | 2 | return ( 'other', $comment ); | |||||||||||||||||||||||||||
| 42 | } | ||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||
| 44 | 16 | 1; | |||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||
| 46 | __END__ | ||||||||||||||||||||||||||||