Branch Coverage

blib/lib/LWPx/ParanoidAgent.pm
Criterion Covered Total %
branch 67 140 47.8


line true false branch
56 0 1 if $depth > 10
57 0 1 if $self->_bad_host($host)
60 0 1 if $host =~ /^\d+\.\d+\.\d+\.\d+$/
62 0 1 unless my $sock = $res->bgsend($host)
67 0 1 unless ($sock and $sock eq 'MOCK')
71 0 0 unless $nf
74 0 1 unless my $packet = $res->bgread($sock)
81 1 0 if ($rr->type eq 'A') { }
0 0 elsif ($rr->type eq 'CNAME') { }
82 1 0 if $self->_bad_host($rr->address)
91 0 0 if @addr
92 0 0 unless $cname
101 0 23 unless $$self{$list_name}
102 0 35 if (ref $rule eq 'CODE') { }
12 23 elsif (ref $rule) { }
103 0 0 if &$rule($host)
106 0 12 if $host =~ /$rule/
108 1 22 if $host eq $rule
117 0 11 if $self->_host_list_match('whitelisted_hosts', $host)
118 0 11 if $self->_host_list_match('blocked_hosts', $host)
119 0 11 if $host =~ /^localhost$/i or $host =~ /\s/i
130 0 11 if @parts > 4
135 2 24 unless /^\d+$/ or /^0x[a-f\d]+$/
137 13 11 if /^0/
141 0 9 if $overflow_flag
145 1 8 if (@parts == 1) { }
4 4 elsif (@parts == 2) { }
1 3 elsif (@parts == 3) { }
3 0 elsif (@parts == 4) { }
147 0 1 if $parts[0] > 4294967295
152 0 4 if $parts[0] > 255 or $parts[1] > 16777215
158 0 1 if $parts[0] > 255 or $parts[1] > 255 or $parts[2] > 65535
165 0 3 if $parts[0] > 255 or $parts[1] > 255 or $parts[2] > 255 or $parts[3] > 255
176 1 1 if ($haddr & 4278190080) == 0 or ($haddr & 4278190080) == 167772160 or ($haddr & 4278190080) == 2130706432 or ($haddr & 4293918720) == 2886729728 or ($haddr & 4294901760) == 2851995648 or ($haddr & 4294901760) == 3232235520 or ($haddr & 4294967040) == 3221225984 or ($haddr & 4294967040) == 3227017984 or $haddr == 4294967295 or ($haddr & 4026531840) == 3758096384
191 1 0 if $self->_host_list_match('blocked_hosts', $can_ip)
204 0 9 $first_res ? :
207 8 1 if ($self->_bad_host($host))
217 0 1 if (my $pp = $$self{'paranoid_proxy'})
238 0 1 unless $method
240 0 1 unless $url
242 0 1 unless $url->scheme
244 0 1 if $self->_need_proxy($url)
250 0 1 unless $scheme eq 'http' or $scheme eq 'https'
261 0 1 if ($x = $self->protocols_allowed) { }
0 1 elsif ($x = $self->protocols_forbidden) { }
262 0 0 if (grep((lc $_ eq $scheme), @$x)) { }
272 0 0 if (grep((lc $_ eq $scheme), @$x)) { }
284 1 0 unless ($protocol)
287 0 1 if ($@)
293 1 0 $scheme eq 'http' ? :
294 0 1 if ($@)
297 0 0 if ($scheme eq 'https')
315 1 0 if ($use_eval) { }
322 1 0 if ($error)
336 0 1 if $cookie_jar
338 1 0 if $self->can('run_handlers')
346 1 0 if (@_)
351 0 0 unless $$self{'blocked_hosts'}
358 1 0 if (@_)
363 0 0 unless $$self{'whitelisted_hosts'}
370 2 1 if (@_)
373 0 2 unless UNIVERSAL::isa($$self{'resolver'}, 'Net::DNS::Resolver')
384 0 1 unless ref $url
387 0 1 if (my $proxy = $$self{'proxy'}{$scheme})
388 0 0 if ($$self{'no_proxy'} and @{$$self{'no_proxy'};})
389 0 0 if (my $host = eval { do { $url->host } })
391 0 0 if ($host =~ /\Q$domain\E$/)
410 1 0 if (defined $request) { }
411 1 0 if (ref $request) { }
412 0 1 if ref $request eq 'ARRAY' or ref $request eq 'HASH' or not $request->can('method') or not $request->can('uri')