Branch Coverage

blib/lib/JSON/API.pm
Criterion Covered Total %
branch 35 40 87.5


line true false branch
23 1 153 if $$self{'debug'}
49 6 16 if (defined $data)
51 1 1 wantarray ? :
2 4 unless defined $json
59 14 6 if ($res->is_success) { }
68 0 6 if ($res->header('client-warning') =~ /internal response/i)
69 0 0 wantarray ? :
72 18 2 $res->content ? :
76 10 10 wantarray ? :
88 8 0 unless (eval { do { $json = to_json($obj); $self->_debug("JSON created: $json") } })
89 3 5 if ($@)
108 20 0 unless (eval { do { $obj = from_json($json); $self->_debug('Deserializing successful:', Dumper($obj)) } })
109 3 17 if ($@)
122 1 31 unless $base_url
138 1 30 $base_url =~ m[^https://] ? :
139 27 4 unless $server =~ /:\d+$/
140 3 3 if $ua_opts{'realm'} and $ua_opts{'user'} and $ua_opts{'pass'}
149 2 10 if ($data)
188 4 1 !$self->was_success ? :
194 5 2 $$self{'has_error'} ? :