Branch Coverage

blib/lib/Net/DNS/Resolver/Base.pm
Criterion Covered Total %
branch 264 264 100.0


line true false branch
102 6 1 unless $warned{join $", @note}++
129 4 87 if (my $file = $args{'config_file'}) { }
79 8 elsif ($init) { }
133 1 1 unless $init
144 2 73 unless $public_attr{$attr}
146 4 69 if $ref and $ref ne "ARRAY"
148 26 43 $ref ? :
169 3 4 unless scalar @value
177 1 7 if defined $ENV{'LOCALDOMAIN'}
179 1 7 if defined $ENV{'RES_NAMESERVERS'}
181 1 7 if defined $ENV{'RES_SEARCHLIST'}
193 2 17 unless my $filehandle = "IO::File"->new($file, "<")
202 10 48 if (/^nameserver/)
208 2 46 if (/^domain/)
214 10 36 if (/^search/)
220 2 34 if (/^option/)
230 10 7 if @nameserver
231 10 7 if @searchlist
238 1 1 unless ref $self
266 145 36 unless ref $self
269 26 155 if scalar @domain
280 2 292 unless ref $self
284 1320 12 if (_ipv4($ns) or _ipv6($ns)) { }
303 1 11 unless scalar @address
309 126 168 if (scalar @ns or not defined wantarray)
317 3 291 $self->{'force_v6'} ? :
318 4 290 $self->{'force_v4'} ? :
321 127 167 if $self->{'prefer_v4'} or not scalar @ns6
322 26 268 if $self->{'prefer_v6'} or not scalar @ns4
324 276 18 if scalar @nameservers
327 1 17 if scalar @ns4 < scalar @{$self->{'nameserver4'};}
328 1 17 if scalar @ns6 < scalar @{$self->{'nameserver6'};}
376 2 11 $self->{'defnames'} && !($name =~ /[.:]/) ? :
381 7 3 $packet->header->ancount ? :
388 1 6 unless $self->{'dnsrch'}
393 1 5 $dots < $self->{'ndots'} ? :
394 1 1 $dots ? :
4 2 $name =~ /:|\.\d*$/ ? :
397 2 5 $suffix ? :
400 1 1 if $packet->header->ancount
415 7 108 if $self->{'usevc'} or length $packet_data > $self->_packetsz
419 4 84 if $self->{'igntc'}
420 82 2 unless $reply->header->tc
451 2 9 unless $self->_accept_reply($reply, $query)
454 2 7 if ($self->{'tsig_rr'} and not $reply->verify($query))
460 4 3 if $rcode eq "NOERROR"
461 1 2 if $rcode eq "NXDOMAIN"
465 1 4 if $fallback
466 2 3 unless $self->{'errorstring'}
479 105 4 $servers ? :
491 190 12 unless (ref $ns)
498 12 93 if $failed
519 2 91 unless $self->_accept_reply($packet, $query)
525 2 91 unless $reply
527 2 89 if ($self->{'tsig_rr'} and not $reply->verify($query))
533 84 5 if $rcode eq "NOERROR"
534 3 2 if $rcode eq "NXDOMAIN"
543 1 21 if $fallback
544 15 7 unless $self->{'errorstring'}
557 7 9 if $self->{'usevc'} or length $packet_data > $self->_packetsz
573 2 10 unless $socket
618 2 11698 unless $handle
622 1 11697 if ref $read
624 11682 15 unless "IO::Select"->new($handle)->can_read(0)
626 1 14 unless $query
627 3 11 if $self->{'igntc'}
628 6 5 unless $handle->socktype == 2
632 1 4 unless $ans
633 2 2 unless $ans->header->tc
658 1 16 unless $handle
662 4 12 if ref $read
665 1 11 unless ($select->can_read(0))
673 6 5 $dgram ? :
678 1 10 unless $self->_accept_reply($reply, $query)
681 9 1 unless $self->{'tsig_rr'} and not $reply->verify($query)
690 1 119 unless $reply
693 1 118 unless $header->qr
695 6 112 if $query and $header->id != $query->header->id
703 7 2 scalar @argument ? :
715 6 2685 if (ref $rr eq "Net::DNS::RR::SOA")
716 3 3 if ($soa)
718 2 1 if $rr->canonical eq $soa->canonical
724 31 2657 unless (scalar @rr)
727 30 1 if $reply
733 1 2 unless wantarray
779 3 6 if ($rcode = $reply->header->rcode) eq "NOERROR"
782 2 6 unless $reply
786 3 3 $request->sigrr ? :
787 3 3 unless ($verify)
788 1 2 unless $rcode eq "NOERROR"
793 1 2 unless $verifyok
794 1 1 if $rcode ne "NOERROR"
805 1 41 unless $socket
809 1 40 if $@
811 29 11 unless $verify
814 1 10 unless $verifyok
834 57 3 unless length($buffer .= $fragment || (last)) < $size
856 2 31 if ($socket = $self->{'persistent'}{$sock_key})
858 1 1 if $socket->connected
871 2 30 $ip6_addr ? :
885 2 30 if $self->{'persistent_tcp'}
895 1 168 if $socket = $self->{'persistent'}{$sock_key}
901 66 102 $ip6_addr ? :
916 1 167 if $self->{'persistent_udp'}
946 78 123 _ipv6($ip) ? :
956 1284 1389 if /[^.0-9]/
964 968 1419 unless /:.*:/
965 1415 4 unless /[^:0-9A-Fa-f]/
966 2 2 if /^[:.0-9A-Fa-f]+\%.+$/
977 70 97 if (ref $packet) { }
979 4 66 unless defined $edns->{'udpsize'}
987 5 91 if $self->{'dnssec'}
991 12 154 if ($self->{'tsig_rr'})
992 11 1 unless $packet->sigrr
1011 3 2 if $self->{'force_v6'} = $_
1012 4 4 $self->{'force_v6'} ? :
1017 4 2 if $self->{'force_v4'} = $_
1018 5 4 $self->{'force_v4'} ? :
1023 4 1 if $self->{'prefer_v6'} = $_
1024 5 3 $self->{'prefer_v6'} ? :
1029 2 1 if $self->{'prefer_v4'} = $_
1030 3 3 $self->{'prefer_v4'} ? :
1036 1 1 _ipv6($_) ? :
1046 1 8 unless $arg
1047 1 7 if ref $arg eq "Net::DNS::RR::TSIG"
1052 1 8 if $@
1062 150 81 $udpsize > 512 ? :
1082 544 1 unless +(shift())->{'debug'}
1107 4 2 unless scalar @ip
1123 1 41 unless $public_attr{$name}
1127 2 99 unless ref $self
1128 77 24 if scalar @_