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 89 if (my $file = $args{'config_file'}) { }
81 8 elsif ($init) { }
133 1 1 unless $init
144 2 75 unless $public_attr{$attr}
146 4 71 if $ref and $ref ne "ARRAY"
148 26 45 $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 316 unless ref $self
284 1460 14 if (_ipv4($ns) or _ipv6($ns)) { }
303 1 13 unless scalar @address
309 139 179 if (scalar @ns or not defined wantarray)
317 3 315 $self->{'force_v6'} ? :
318 4 314 $self->{'force_v4'} ? :
321 127 191 if $self->{'prefer_v4'} or not scalar @ns6
322 26 292 if $self->{'prefer_v6'} or not scalar @ns4
324 300 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 120 if $self->{'usevc'} or length $packet_data > $self->_packetsz
419 4 96 if $self->{'igntc'}
420 95 1 unless $reply->header->tc
451 2 8 unless $self->_accept_reply($reply, $query)
454 2 6 if ($self->{'tsig_rr'} and not $reply->verify($query))
460 3 3 if $rcode eq "NOERROR"
461 1 2 if $rcode eq "NXDOMAIN"
465 1 4 if $fallback
466 2 3 unless $self->{'errorstring'}
479 117 4 $servers ? :
491 198 12 unless (ref $ns)
498 12 105 if $failed
519 2 103 unless $self->_accept_reply($packet, $query)
525 2 103 unless $reply
527 2 101 if ($self->{'tsig_rr'} and not $reply->verify($query))
533 96 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 174 unless $handle
622 1 173 if ref $read
624 158 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 130 unless $reply
693 1 129 unless $header->qr
695 6 123 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 56 3 unless length($buffer .= $fragment || (last)) < $size
856 2 29 if ($socket = $self->{'persistent'}{$sock_key})
858 1 1 if $socket->connected
871 1 29 $ip6_addr ? :
885 2 28 if $self->{'persistent_tcp'}
895 1 176 if $socket = $self->{'persistent'}{$sock_key}
901 62 114 $ip6_addr ? :
916 1 175 if $self->{'persistent_udp'}
946 74 135 _ipv6($ip) ? :
956 1428 1531 if /[^.0-9]/
964 1065 1552 unless /:.*:/
965 1548 4 unless /[^:0-9A-Fa-f]/
966 2 2 if /^[:.0-9A-Fa-f]+\%.+$/
977 82 101 if (ref $packet) { }
979 4 78 unless defined $edns->{'udpsize'}
987 5 95 if $self->{'dnssec'}
991 12 170 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 174 81 $udpsize > 512 ? :
1082 589 1 unless +(shift())->{'debug'}
1107 4 2 unless scalar @ip
1123 1 41 unless $public_attr{$name}
1127 2 101 unless ref $self
1128 79 24 if scalar @_