Branch Coverage

blib/lib/Clustericious/Client.pm
Criterion Covered Total %
branch 46 168 27.3


line true false branch
37 3 0 unless $caller->isa($class)
55 0 1 if ($$self{'app'}) { }
58 0 0 unless ref $app
60 0 0 unless $client
68 0 1 unless (length $self->server_url)
85 0 0 unless @_ > 0
87 0 0 unless ($remote)
110 0 0 @_ ? :
0 0 @_ == 2 ? :
120 1 0 unless $self->res
121 1 0 unless $self->res
122 0 0 if $self->res->code and $self->res->is_status_class(200)
123 0 0 unless $self->res->error
130 3 0 unless $c->tx or $c->res
131 0 0 if $c->tx and $c->tx->error
132 0 0 if $c->res and not $c->res->is_status_class(200)
140 0 6 ref $_[0] eq 'ARRAY' ? :
141 0 6 ref $_[-1] eq 'SCALAR' ? :
155 0 6 if ($objclass)
157 0 0 if ($@)
158 0 0 unless $@ =~ /Can't locate/i
168 0 4 if $objclass
191 0 9 unless ref $args eq 'ARRAY'
204 0 0 ref $_[-1] eq 'SCALAR' ? :
211 0 0 if ($@)
212 0 0 unless $@ =~ /Can't locate/i
215 0 0 unless $objclass->can('new')
251 4 0 if ref $_[0] eq 'Clustericious::Client::Meta::Route'
255 0 4 if $meta and $meta->get('auto_failover')
257 4 0 if $self->server_url and not $url =~ /^http/
258 0 4 if $self->server_url eq 'http://0.0.0.0'
264 0 4 if ($method eq 'POST' and grep /^--/, @args)
269 4 0 unless ref $url
284 0 1 unless $key
292 4 0 if ($meta and my $arg_spec = $meta->get('args'))
295 13 2 if (my $modifies_url = $$_{'modifies_url'})
296 13 0 ($a = $gen_url_modifier{$modifies_url}) ? :
0 13 ref $modifies_url eq 'CODE' ? :
301 2 13 if (my $modifies_payload = $$_{'modifies_payload'})
302 2 0 ($a = $gen_payload_modifier{$modifies_payload}) ? :
0 2 ref $modifies_payload eq 'CODE' ? :
311 0 15 if (ref $arg eq 'HASH') { }
0 15 elsif (ref $arg eq 'CODE') { }
13 2 elsif (my $code = $url_modifier{$arg}) { }
2 0 elsif (my $code2 = $payload_modifer{$arg}) { }
0 0 elsif ($method eq 'GET' and $arg =~ s/^--//) { }
0 0 elsif ($method eq 'GET' and $arg =~ s/^-//) { }
0 0 elsif ($method eq 'POST' and not ref $arg) { }
313 0 0 if $meta and $meta->get('skip_existing')
328 0 0 if (ref $value eq 'ARRAY')
334 0 0 if $args[0] and ref $args[0] eq 'HASH'
339 0 4 unless $url->is_abs
340 0 4 unless $url =~ /^http/i or $ENV{'HARNESS_ACTIVE'}
342 0 4 if $self->userinfo
348 1 3 if ($body and ref $body eq 'HASH' or ref $body eq 'ARRAY')
354 0 4 if $cb
364 0 0 if (($tx->res->code || 0) == 401 and $auth_header = $tx->res->headers->www_authenticate and not $url->userinfo and $self->_has_auth || $self->_can_auth)
369 0 0 $self->_has_auth ? :
370 0 0 $meta ? :
373 0 4 if ($res->is_status_class(200))
379 0 0 $content_type =~ qr"application/json" ? :
0 0 $method =~ /HEAD|DELETE/ ? :
389 0 4 if ($code)
390 0 0 if ($code == 404) { }
391 0 0 unless $ENV{'ACPS_SUPPRESS_404'} and $url =~ /$ENV{'ACPS_SUPPRESS_404'}/
396 0 0 if $res->body
399 0 0 if $brief
405 4 0 unless ($auto_failover)
407 0 4 if $res->body
411 0 0 unless (@$failover_urls)
421 0 0 if $got
438 0 0 if ($tx->res->is_status_class(200)) { }
440 0 0 $tx->res->headers->content_type =~ qr"application/json" ? :
443 0 0 $body ? :
455 0 8 unless ref $url eq 'Mojo::URL'
456 8 0 unless $url->userinfo
471 0 0 if (my $remote = $self->_remote)
480 0 0 if defined $$self{'_base_config'}
487 0 0 unless $self->_config->username('default', '')
488 0 0 unless $self->_config->password('default', '')
494 0 0 -t STDIN ? :
501 0 0 unless defined $realm
502 0 0 if exists $self->_cache->{$host}{$realm}
515 10 6 if ($route_name =~ /::([^:]+)$/)