Branch Coverage

lib/Mail/DMARC/Base.pm
Criterion Covered Total %
branch 67 108 62.0


line true false branch
21 0 99 if scalar @args % 2 != 0
32 21 12 defined $Mail::DMARC::Base::_fake_time ? :
43 0 2196 if scalar @too_many
44 2149 47 if ref $self->{'config'} and not $file
50 96 4 $subdir ? :
57 0 22 if $self->verbose
63 0 47 unless my $file = shift() || $ENV{'MAIL_DMARC_CONFIG_FILE'} || $self->{'config_file'}
64 35 12 if -r $file
66 24 24 unless -d $d
67 24 0 unless -e "$d/$file"
68 0 0 unless -r "$d/$file"
73 1 11 if ($file ne "mail-dmarc.ini")
81 0 24 unless $ip_bin
83 6 18 if (length $ip_bin == 16)
92 0 14 unless $ip_txt
94 4 10 if ($ip_txt =~ /:/)
109 334 7 if ($public_suffixes)
115 0 7 unless open my $fh, "<:encoding(UTF-8)", $file
130 1 1 if ($new_public_suffixes_stamp != $public_suffixes_stamp)
142 0 340 unless $zone
146 2 338 if $zone =~ /xn--/
148 176 164 if $public_suffixes->{$zone}
153 1 163 if $public_suffixes->{$zone}
162 0 0 unless $psl_file
163 0 0 unless -f $psl_file
164 0 0 unless -w $psl_file
167 0 0 if ($dryrun)
174 0 0 if (not $response->{'success'}) { }
179 0 0 if ($response->{'status'} eq '304') { }
193 0 0 if ($file =~ m[^/] and -f $file and -r $file)
194 0 0 if $self->verbose
199 0 40 if -f $path and -r $path
201 0 10 if ($path and -r $path)
202 0 0 if $self->verbose
215 40 33 unless (my $query = $res->query($domain, $type))
216 40 0 unless wantarray
220 4 57 if $rr->type ne $type
221 20 0 $rr->type eq 'MX' ? :
1 20 $rr->type eq 'AAAA' ? :
0 21 $rr->type eq 'SPF' ? :
0 21 $rr->type eq 'TXT' ? :
29 21 $rr->type eq 'NS' ? :
0 50 $rr->type eq 'PTR' ? :
7 50 $rr->type eq 'A' ? :
230 33 0 unless wantarray
253 86 11 if defined $self->{'resolver'}
273 1 20 if ($ip =~ /:/)
282 3 65 unless $domain =~ /^$Mail::DMARC::Base::RE{'net'}{'domain'}{'-rfc1101'}{'-nospace'}$/x
284 60 5 if $self->is_public_suffix($tld)
286 0 5 if $self->is_public_suffix($tld)
292 53 0 if grep {lc $scope eq $_;} "mfrom", "helo"
299 53 0 if grep {lc $result eq $_;} "fail", "neutral", "none", "pass", "permerror", "softfail", "temperror"
307 0 11 unless open my $FH, "<", $file
314 228 4 if 1 == scalar @_