Branch Coverage

blib/lib/Opsview/RestAPI.pm
Criterion Covered Total %
branch 19 74 25.6


line true false branch
24 2 4 defined $args{'ssl_verify_hostname'} ? :
56 0 22 if $level <= $self->{'debug'}
62 0 0 if $level <= $self->{'debug'}
85 5 0 if (my $error = $@)
96 0 0 if ($json_result->{'message'})
112 2 6 $args{'api'} ? :
117 0 4 if (not defined $args{'params'}{$param}) { }
4 0 elsif (not ref $args{'params'}{$param}) { }
0 0 elsif (ref $args{'params'}{$param} eq 'ARRAY') { }
132 2 6 if $params
140 0 5 unless $args{'type'} =~ /^(GET|POST|PUT|DELETE)$/u
146 0 5 unless $self->{'token'} or not defined $args{'api'} or not $args{'api'} or $args{'api'} =~ /login/u
152 0 5 $args{'data'} ? :
163 5 0 if ($self->_client->responseCode ne 200)
165 0 5 if ($self->_client->responseContent =~ /deadlock/iu and $deadlock_attempts < 5)
187 0 0 if ($api_version->{'api_version'} < 4)
201 0 0 if ($self->{'token'})
214 0 0 unless (my $result = eval { do { $self->post('api', 'login', 'params', {'username', $self->{'username'}, 'password', $self->{'password'}}) } })
237 5 0 unless ($self->{'api_version'})
247 0 0 unless ($self->{'opsview_info'})
274 0 0 if ($self->{'api_version'}{'api_version'} < 5)
290 0 0 if ($args{'batch_size'} and $args{'params'}{'rows'})
298 0 5 if ($args{'batch_size'})
365 0 0 unless (defined $result->{'configuration_status'})
368 0 0 $result->{'configuration_status'} eq 'pending' ? :
383 0 0 unless $url =~ m[/upload$]u
403 1 0 unless $self->{'token'}
425 0 0 if (ref $hash ne 'HASH')
428 0 0 unless ($do_not_die_on_non_hash)
435 0 0 if (not defined $allowed_keys) { }
0 0 elsif (ref $allowed_keys eq 'HASH') { }
0 0 elsif (ref $allowed_keys eq 'ARRAY') { }
0 0 elsif (ref $allowed_keys) { }
456 0 0 if (exists $allowed_keys->{$k}) { }
0 0 elsif (ref $hash->{$k} eq 'ARRAY') { }
0 0 elsif (ref $hash->{$k} eq 'HASH') { }
480 1 0 if $self->_client