Branch Coverage

lib/Mail/DMARC/Policy.pm
Criterion Covered Total %
branch 87 100 87.0


line true false branch
13 0 82 ref $class ? :
16 11 71 if 0 == scalar @args
17 55 16 if (1 == @args)
23 0 16 if @args % 2 != 0
26 0 14 unless $self->is_valid($policy)
32 0 75 if 0 != scalar @junk
38 4 71 if ";" eq substr($cleaned, -1, 1)
44 2 480 if (not defined $tag && defined $value or $value eq "")
45 2 0 unless ($warned)
62 6 1 unless defined $self->adkim
63 6 1 unless defined $self->aspf
64 7 0 unless defined $self->fo
65 7 0 unless defined $self->ri
66 7 0 unless defined $self->rf
73 2 4 if 1 == scalar @_
74 1 3 if "DMARC1" ne uc $_[1]
79 28 9 if 1 == scalar @_
80 3 6 unless $_[0]->is_valid_p($_[1])
85 15 9 if 1 == scalar @_
86 3 6 unless $_[0]->is_valid_p($_[1])
91 30 12 if 1 == scalar @_
92 2 10 if 0 == grep({/^\Q$_[1]\E$/xi;} "r", "s")
97 33 13 if 1 == scalar @_
98 2 11 if 0 == grep({/^\Q$_[1]\E$/xi;} "r", "s")
103 7 19 if 1 == scalar @_
104 4 15 unless $_[1] =~ /^[01ds](:[01ds])*$/xi
109 19 17 if 1 == scalar @_
110 2 15 unless $_[0]->is_valid_uri_list($_[1])
115 0 2 if 1 == scalar @_
116 1 1 unless $_[0]->is_valid_uri_list($_[1])
121 7 14 if 1 == scalar @_
123 3 11 unless $_[0]->is_valid_rf($f)
129 12 14 if 1 == scalar @_
130 2 12 if $_[1] =~ /\D/
131 0 12 if $_[1] != int $_[1]
132 1 11 if $_[1] < 0 or $_[1] > 4294967295
137 9 11 if 1 == scalar @_
138 5 6 if $_[1] =~ /\D/
139 0 6 if $_[1] != int $_[1]
140 1 5 if $_[1] < 0 or $_[1] > 100
145 55 7 if 1 == scalar @_
151 13 6 grep({/^\Q$f\E$/i;} 'iodef', 'afrf') ? :
156 0 140 unless defined $p
157 129 11 grep({/^\Q$p\E$/i;} 'none', 'reject', 'quarantine') ? :
169 38 71 unless $obj
170 1 108 unless $obj->{'v'}
171 0 108 if "DMARC1" ne uc $obj->{'v'}
172 4 104 unless ($obj->{'p'})
173 1 3 if ($obj->{'rua'} and $self->is_valid_uri_list($obj->{'rua'})) { }
180 1 104 unless $self->is_valid_p($obj->{'p'})