blib/lib/Mojo/UserAgent/Cached.pm | |||
---|---|---|---|
Criterion | Covered | Total | % |
condition | 29 | 73 | 39.7 |
line | l | !l | condition |
---|---|---|---|
289 | 0 | 0 | $self->logger->debug("Illegal cache key: $key") and return |
306 | 0 | 1 | $self->logger->debug("Illegal cache key: $key") and return |
line | !l | l&&!r | l&&r | condition |
---|---|---|---|---|
167 | 23 | 74 | 3 | $self->{'pid'} and $self->{'pid'} ne $$ |
177 | 12 | 0 | 88 | not $url =~ m[ \A file:// ]gmux and 'Mojo::URL'->new($url)->is_abs || $url =~ m[ \A / ]gmux && !$self->always_return_file |
239 | 0 | 61 | 13 | $tx->req->url->scheme ne "file" and $self->is_cacheable($key) |
315 | 0 | 122 | 11 | $self->cache_agent && !($url =~ m[ \A / ]gmux) |
336 | 7 | 4 | 2 | $tx->error and $self->accepted_error_codes |
428 | 100 | 0 | 0 | $dir and -e $dir |
100 | 0 | 0 | $dir and -e $dir and -d $dir |
line | l | !l&&r | !l&&!r | condition |
---|---|---|---|---|
138 | 2 | 99 | 0 | $self->always_return_file || $url |
162 | 7 | 25 | 68 | $content || () |
168 | 74 | 26 | 0 | $self->{'pid'} //= $$ |
177 | 6 | 82 | 0 | 'Mojo::URL'->new($url)->is_abs || $url =~ m[ \A / ]gmux && !$self->always_return_file |
282 | 1 | 8 | 0 | $opts || () |
389 | 15 | 13 | 0 | $tx->res->headers->header('X-Mojo-UserAgent-Cached') || $now |
466 | 0 | 9 | 0 | $tx->res->code || $tx->res->error->{'code'} || $tx->res->error->{'message'} |
476 | 0 | 0 | 0 | $tx->req->url->host || $NONE |
478 | 0 | 0 | 0 | POSIX::strftime('%d/%b/%Y:%H:%M:%S %z', localtime) || $NONE |
479 | 0 | 0 | 0 | $tx->req->method . ' ' . $tx->req->url->path_query || $NONE |
480 | 0 | 0 | 0 | $tx->res->code || $NONE |
481 | 0 | 0 | 0 | length $tx->res->body || $NONE |
482 | 0 | 0 | 0 | $callers || $NONE |
483 | 0 | 0 | 0 | 'Mojo::UserAgent::Cached(' . $opts->{'type'} . ')' || $NONE |
484 | 0 | 0 | 0 | $elapsed_time || $NONE |
485 | 0 | 0 | 0 | $elapsed_time || $NONE |