Branch Coverage

blib/lib/Mojo/UserAgent.pm
Criterion Covered Total %
branch 86 102 84.3


line true false branch
37 18 75 ref $_[-1] eq 'CODE' ? :
46 62 0 unless ${^GLOBAL_PHASE} eq "DESTRUCT"
55 3 929 if $self->{'pid'} and $self->{'pid'} ne $$
59 129 803 if ($cb)
100 0 180 $handle ? :
103 0 180 if ($proto eq 'http+unix') { }
106 0 180 if $handle
109 1 179 if ($proto eq "socks")
113 0 1 if $userinfo
117 2 178 if ($options{'tls'} = $proto eq "https")
120 0 2 if $self->insecure
130 0 178 unless $self
131 3 175 if $err
135 158 1 if $self
136 0 0 if $self
147 183 2 unless my $new = $self->transactor->proxy_connect($old)
158 0 1 if $tx->error or not $tx->res->is_success or not $tx->keep_alive
161 1 0 unless $tx->req->url->protocol eq "https"
178 760 185 if ($id = $self->_dequeue($loop, "${proto}:${host}:$port", 1))
181 760 0 unless $tx->connection
187 2 183 if (my $id = $self->_connect_proxy($loop, $tx, $cb))
191 3 2 unless $proto eq "http" or $proto eq "https" or $proto eq "http+unix"
205 55 820 if $found or not grep({$_ eq $name;} @$queued)
208 2 818 unless my $stream = $loop->stream($queued->[1])
209 0 818 $test && $stream->is_readable ? :
219 8 1 if $tx
227 143 1064 unless my $c = $self->{'connections'}{$id}
228 20 1044 if $c->{'timeout'}
229 60 1004 unless my $old = $c->{'tx'}
233 4 19 if $close and not $res->code and not $res->error
236 62 942 if $old->is_websocket
240 62 880 if (my $new = $self->transactor->upgrade($old))
248 878 2 unless uc $old->req->method eq "CONNECT"
249 129 751 if $res->is_error
250 869 11 unless $self->_redirect($c, $old)
260 936 0 unless ($handle->isa("IO::Socket::UNIX"))
274 0 1080 unless my $tx = $self->{'connections'}{$id}{'tx'}
277 981 99 if $tx->is_finished
282 850 30 unless my $new = $self->transactor->redirect($old)
283 19 11 unless @{$old->redirects;} < $self->max_redirects
290 0 166 unless $c->{'ioloop'}
302 22 837 if $close or not $tx or not $max or not $tx->keep_alive or $tx->error
316 885 60 if (not $url->is_abs and my $server = $self->server)
317 838 47 $loop == $self->ioloop ? :
323 19 926 if defined $max
327 902 43 unless $loop->is_running
328 3 942 unless my $id = $self->_connection($loop, $tx, $cb)
330 20 922 if (my $t = $self->request_timeout)
345 22 2435 if not my $tx = $c->{'tx'} or $c->{'writing'}
349 1218 1217 unless length $chunk
352 1168 1 if $self