Branch Coverage

blib/lib/App/PAIA/Command.pm
Criterion Covered Total %
branch 49 68 72.0


line true false branch
23 6 239 if (@_ > 1) { }
106 133 elsif (not exists $_[0]{$name} and $default) { }
90 0 12 if (defined $self->app->global_options->{$name})
95 7 5 if (defined $base)
102 4 2 if (defined $_->get($name))
108 1 0 if (defined $self->config->get('base'))
162 3 2 $expires ? :
170 0 5 if $self->expired
172 0 3 if ($scope and $self->scope and not $self->has_scope($scope))
189 4 4 unless ($url =~ /login$/)
197 1 7 if (ref $json and defined $$json{'error'})
199 1 0 if (defined $$json{'error_description'})
205 2 5 if ($$response{'status'} ne '200')
210 0 5 if (my $scopes = $$response{'headers'}{'x-oauth-scopes'})
220 0 4 if ($self->session->purge)
225 0 4 unless my $auth = $self->auth
234 1 3 if (defined $scope)
246 1 0 if defined $self->core
269 1 3 if ($self->not_authentificated($scope))
274 0 1 if ($self->scope and not $self->has_scope($scope))
285 2 1 if defined $self->session->get('access_token')
287 2 1 if defined $self->session->get('scope')
289 2 1 if defined $self->session->get('patron')
304 2 2 if $command ne 'patron'
307 2 2 if (($self->session->get('core') // '') ne $core)
315 2 2 if ($$json{'doc'})
318 1 1 if (@errors)
332 0 1 unless $uri and $uri->scheme
342 0 0 if ref $class
347 0 0 unless $pm_file = $INC{$pm_file}
349 0 0 unless open my $input, '<', $pm_file
372 0 24 if ($self->app->global_options->version) { }
0 24 elsif ($self->app->global_options->help) { }
381 4 14 if (defined $response and not $self->app->global_options->quiet)