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 63 0 unless ${^GLOBAL_PHASE} eq "DESTRUCT"
55 3 941 if $self->{'pid'} and $self->{'pid'} ne $$
59 129 815 if ($cb)
100 0 181 $handle ? :
103 0 181 if ($proto eq 'http+unix') { }
106 0 181 if $handle
109 1 180 if ($proto eq "socks")
113 0 1 if $userinfo
117 2 179 if ($options{'tls'} = $proto eq "https")
120 0 2 if $self->insecure
130 0 179 unless $self
131 3 176 if $err
135 159 1 if $self
136 0 0 if $self
147 184 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 771 186 if ($id = $self->_dequeue($loop, "${proto}:${host}:$port", 1))
181 771 0 unless $tx->connection
187 2 184 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 832 if $found or not grep({$_ eq $name;} @$queued)
208 2 830 unless my $stream = $loop->stream($queued->[1])
209 0 830 $test && $stream->is_readable ? :
219 8 1 if $tx
227 145 1077 unless my $c = $self->{'connections'}{$id}
228 20 1057 if $c->{'timeout'}
229 61 1016 unless my $old = $c->{'tx'}
233 4 18 if $close and not $res->code and not $res->error
236 62 954 if $old->is_websocket
240 62 892 if (my $new = $self->transactor->upgrade($old))
248 890 2 unless uc $old->req->method eq "CONNECT"
249 133 759 if $res->is_error
250 881 11 unless $self->_redirect($c, $old)
260 948 0 unless ($handle->isa("IO::Socket::UNIX"))
274 0 1090 unless my $tx = $self->{'connections'}{$id}{'tx'}
277 994 96 if $tx->is_finished
282 862 30 unless my $new = $self->transactor->redirect($old)
283 19 11 unless @{$old->redirects;} < $self->max_redirects
290 0 167 unless $c->{'ioloop'}
302 22 849 if $close or not $tx or not $max or not $tx->keep_alive or $tx->error
316 897 60 if (not $url->is_abs and my $server = $self->server)
317 850 47 $loop == $self->ioloop ? :
323 19 938 if defined $max
327 914 43 unless $loop->is_running
328 3 954 unless my $id = $self->_connection($loop, $tx, $cb)
330 20 934 if (my $t = $self->request_timeout)
345 22 2459 if not my $tx = $c->{'tx'} or $c->{'writing'}
349 1230 1229 unless length $chunk
352 1180 1 if $self