Branch Coverage

blib/lib/Mail/SpamAssassin/Dns.pm
Criterion Covered Total %
branch 27 150 18.0


line true false branch
109 0 0 unless ($existing_ent)
124 0 0 if ($existing_ent)
129 0 0 if (defined $subtest) { }
143 0 0 if ($subtest =~ /^sb:/)
177 0 0 if (substr($rule, 0, 2) eq '__') { }
0 0 elsif ($answer->type eq 'TXT') { }
188 0 0 if ($question->string =~ /^((?:[0-9a-fA-F]\.){32})(\S+\w)/) { }
0 0 elsif ($question->string =~ /^(\d+)\.(\d+)\.(\d+)\.(\d+)\.(\S+\w)/) { }
209 0 0 if ($log and not $self->{'already_logged'}{$log})
214 0 0 if (not $self->{'tests_already_hit'}{$rule})
229 0 0 $answer->UNIVERSAL::can('rdstring') ? :
0 0 $answer->UNIVERSAL::can('txtdata') ? :
232 0 0 if (defined $qname and defined $rdatastr)
236 0 0 if $qclass ne "IN"
237 0 0 if $qtype ne "A"
238 0 0 @vals ? :
250 0 0 unless $pkt
252 0 0 unless $question
258 0 0 if ($self->{'sender_host'} and lc $question->qname eq lc $self->{'sender_host'} and $question->qtype =~ /^(?:A|MX)$/ and $pkt->header->rcode =~ /^(?:NXDOMAIN|SERVFAIL)$/ and ++$self->{'sender_host_fail'} == 2)
272 0 0 unless $answer
277 0 0 if $answ_type ne "A" and $answ_type ne "TXT"
278 0 0 if ($answ_type eq "A")
280 0 0 $answer->UNIVERSAL::can('address') ? :
283 0 0 unless $ip_address =~ /^127\./
289 0 0 if ($self->{'dnspost'}{$set})
305 0 0 $answer->UNIVERSAL::can('rdstring') ? :
0 0 $answer->UNIVERSAL::can('txtdata') ? :
310 0 0 if $self->{'tests_already_hit'}{$rule}
312 0 0 if ($subtest =~ /^\d+\.\d+\.\d+\.\d+$/) { }
0 0 elsif ($subtest =~ /^\d+$/) { }
314 0 0 if $subtest eq $rdatastr
319 0 0 if ($rdatastr =~ /^127\.\d{1,3}\.\d{1,3}\.\d{1,3}$/ and Mail::SpamAssassin::Util::my_inet_aton($rdatastr) & $subtest)
328 0 0 if ($rdatastr =~ /$test/)
345 0 0 $first ? :
347 0 0 if $self->is_rule_complete($rule)
348 0 0 if $result or $alldone
371 96 0 $first ? :
373 96 0 if $alldone
394 33 3063 if defined $last_poll_time and &Mail::SpamAssassin::PerMsgStatus::time() - $last_poll_time < "0.1"
397 3 3060 if ($anydone)
408 0 96 unless defined $rbl_tag
413 0 96 if (defined $rbl_tag and $rbl_tag ne "")
448 0 0 unless $self->load_resolver
449 0 0 if $self->server_failed_to_respond_for_domain($dom)
457 0 0 if ($query)
459 0 0 if ($rr->type eq "NS")
464 0 0 unless (eval {
465 0 0 $@ ne '' ? :
484 0 336 if ($dnsopt eq "test" and $diff > $dnsint)
490 328 8 if defined $IS_DNS_AVAILABLE
494 0 8 if ($dnsopt eq "no")
501 7 1 if $self->{'main'}{'local_tests_only'}
504 1 0 if (defined $Net::DNS::VERSION)
505 0 1 if (am_running_on_windows()) { }
506 0 0 if ($Net::DNS::VERSION < "0.46")
512 0 1 if ($Net::DNS::VERSION < "0.34")
520 0 1 unless $self->load_resolver
522 1 0 if ($dnsopt eq "yes")
524 0 1 if ($self->{'conf'}{'dns_options'}{'rotate'})
535 0 0 if ($dnsopt =~ /^test:\s*(\S.*)$/) { }
548 0 0 if ($self->{'conf'}{'dns_options'}{'rotate'}) { }
564 0 0 if (not $result) { }
0 0 elsif (not @$result) { }
579 0 0 if (not @good_nameservers) { }
598 0 0 if ($self->{'dns_server_too_slow'}{$dom})
619 4 0 if (%ENV)
623 136 0 if defined $value
630 0 4 if ($self->{'main'}{'home_dir_for_helpers'}) { }
637 4 0 if ($newhome)
656 3 1 if (defined $self->{'old_sigchld_handler'}) { }
672 0 0 if ($SIG{'CHLD'} and $SIG{'CHLD'} ne "IGNORE")
700 0 0 unless (defined $key)
705 0 0 if ($key eq "*ASYNC_START")
711 0 0 unless (defined $ent)
725 0 8 if (defined $pms->{'sender_host_fail'})