Branch Coverage

blib/lib/Net/DNSBL/Statistics.pm
Criterion Covered Total %
branch 120 144 83.3


line true false branch
180 0 0 if ++$w > $#w
186 1 12 unless $$conf{'FILES'}
187 3 9 ref $$conf{'FILES'} ? :
191 5 10 unless -e $_ and open F, $_
193 0 167 unless $_ =~ /\S/
194 12 155 if $_ =~ /^\s*#/
195 6 149 unless $_ =~ /(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/
203 3 9 if $DEBUG and $DEBUG == 1
206 9 0 if ($$conf{'IGNORE'})
225 0 35 unless exists $$conf{"$_"} and exists $$conf{"$_"}{'timeout'}
227 6 29 if $$conf{"$_"}{'timeout'} < $uto
233 5 4 if ($$conf{'in-addr.arpa'})
237 9 0 if ($$conf{'GENERIC'})
239 4 5 unless $needPTR
241 0 9 unless $regexptr = $$conf{'GENERIC'}{'regexp'} and ref $regexptr eq 'ARRAY' and @$regexptr > 0
243 0 9 unless $iptr = $$conf{'GENERIC'}{'ignore'} and ref $iptr eq 'ARRAY' and @$iptr > 0
247 0 9 if $uto < $needPTR
249 0 9 unless $uto
254 1 8 if $DEBUG and $DEBUG == 2
256 1 7 if $DEBUG and $DEBUG == 3
282 70 279 if ($qsize > $Q and $ip = shift @ips)
283 14 56 if matchNetAddr($ip, \@NAignor)
287 56 0 if ($needPTR)
303 6 162 if $dnsbls{"$bl"}{'TO'} > 5
321 74 261 if (@sndQ) { }
327 181 154 if ($nfound > 0) { }
334 259 41 if $DEBUG
336 133 48 if (vec $rout, $fileno, 1)
338 0 133 unless recv $Usock, $msg, PACKETSZ(), 0
339 0 133 unless length $msg > HFIXEDSZ()
346 0 133 unless $tc == 0 and $qr == 1 and $opcode == QUERY() and $rcode == NOERROR() || $rcode == NXDOMAIN() || $rcode == SERVFAIL() and $qdcount == 1 and exists $queue{$id}
354 0 133 unless $class == C_IN()
359 84 49 unless $bl eq 'in-addr.arpa'
361 84 49 if ($ancount and $rcode == &NOERROR) { }
35 14 elsif ($t == T_A()) { }
6 8 elsif ($needPTR and $t == T_PTR() and exists $$conf{'in-addr.arpa'}) { }
363 0 84 unless lc $bl eq lc $' and $t == T_A() || $t == T_PTR()
371 77 49 if ($t == T_A()) { }
49 0 elsif ($needPTR and $t == T_PTR() and exists $dnsbls{'GENERIC'}) { }
374 35 42 if (grep(($ip eq $_), keys %{$$conf{"$bl"}{'accept'};}))
388 35 14 if (@generic)
390 14 35 if $iptr and grep(($g =~ /$_/i), @$iptr)
391 7 28 if $g and not grep(($g =~ /$_/i), @$regexptr)
412 77 77 unless $now > $then
416 37 167 if $now < $queue{$id}{'T'}
418 11 156 if ($bl eq 'in-addr.arpa') { }
419 3 8 if (exists $$conf{'in-addr.arpa'}) { }
8 0 elsif (exists $dnsbls{'GENERIC'}) { }
427 4 4 if (not $queue{$id}{'R'}) { }
439 78 78 if (not $queue{$id}{'R'}) { }
452 7 70 unless @ips or keys %queue
453 56 14 unless $uage < $now
457 12 0 if $ips{"$_"} > $now
463 1 6 unless $DEBUG
465 6 1 if ($DEBUG) { }
466 2 4 if $DEBUG == 4
467 2 2 if $DEBUG == 5
502 24 34 if (exists $$union{"$rip"}) { }
503 0 24 if $expire > $$union{"$rip"}
542 2 22 if ($bl eq 'TOTAL') { }
2 20 elsif ($bl eq 'UNION') { }
543 1 1 if ($nbsp) { }
549 1 1 if ($nbsp) { }
555 5 5 $nbsp ? :
10 10 exists $$conf{"$bl"}{'comment'} && $$conf{"$bl"}{'comment'} ? :
558 10 10 unless $nbsp
559 3 7 exists $$conf{"$bl"}{'url'} && $$conf{"$bl"}{'url'} ? :
567 0 1 unless keys %$dnsbls and $$dnsbls{'TOTAL'}
572 0 28 unless $$dnsbls{"$b"} <=> $$dnsbls{"$a"}
612 0 1 unless keys %$dnsbls and $$dnsbls{'TOTAL'}
617 0 28 unless $$dnsbls{"$b"} <=> $$dnsbls{"$a"}
621 3 9 $url ? :