Client/Response.pm

filter: Statementstmt 68.4% 13 / 19 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 42.8% 3 / 7 Podpod 0.0% 0 / 2 totaltotal 45.7% 16 / 35 CC 3 SCAR 16.1
CC
3
Cov
54%
__ANON__
12.0
__ANON__
2.0
data
2.0
CRAP 5.0
↑ Summary Client.pm »
1 package WebService::Client::Response;
2 3 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 3 our $VERSION = '1.0100'; # VERSION
5  
6 3 ▶use JSON::MaybeXS ();
Subroutine BEGIN: called CC=1 SCAR=0.0
7 3 ▶use Scalar::Util qw(blessed);
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 has res => (
10 is => 'ro',
11 0 ▶ isa => sub {
Subroutine __ANON__: not called CC=3 SCAR=24.8
12 0 ▶ die 'res must be a HTTP::Response object'
Branch: 1 branch
BranchTrueFalseTotal
unless builtin::blessed($_[0]) and $_[0]->isa("HTTP::Response") 0 0 0
Condition0%0/3
builtin::blessed($_[0]) and $_[0]->isa("HTTP::Response")
!ll&&!rl&&r
000
MC/DC0%0/2
builtin::blessed($_[0]) and $_[0]->isa("HTTP::Response")
builtin::blessed($_[0]) $_[0]->isa("HTTP::Response")
Truth table0%0/3
A and B
A= builtin::blessed($_[0])B= $_[0]->isa("HTTP::Response")
ABresult
0X0
100
111
13 unless blessed($_[0]) && $_[0]->isa('HTTP::Response');
14 },
15 3 required => 1,
16 handles => [qw(
17 code
18 content
19 decoded_content
20 is_error
21 is_success
22 status_line
23 )],
24 );
25  
26 has json => (
27 is => 'ro',
28 lazy => 1,
29 0 ▶ default => sub { JSON::MaybeXS->new() },
Subroutine __ANON__: not called CC=1 SCAR=6.9
30 3 );
31  
32 0 ▶sub data {
Subroutine data: not called CC=1 SCAR=6.9
Pod undocumented
33 0 my ($self) = @_;
34 0 return $self->json->decode($self->decoded_content);
35 }
36  
37 0 ▶sub ok {
Subroutine ok: not called CC=1 SCAR=6.9
Pod undocumented
38 0 my ($self) = @_;
39 0 return $self->is_success;
40 }
41  
42 3 1;
43  
44 __END__
↑ Summary Client.pm »