Branch Coverage

blib/lib/JSON/RPC2/Client.pm
Criterion Covered Total %
branch 72 72 100.0


line true false branch
29 2 9 unless @requests
36 1 10 unless defined $method
37 2 8 !@params ? :
48 1 12 unless defined $method
49 2 10 if @params % 2
51 2 8 !@params ? :
62 2 42 unless defined $method
64 18 24 !@params ? :
72 30 12 wantarray ? :
77 2 26 unless defined $method
78 2 24 if @params % 2
81 5 19 !@params ? :
89 21 3 wantarray ? :
94 12 54 @{$self->{'free_id'};} ? :
109 4 9 unless delete $self->{'call'}{&refaddr($call)}
115 2 16 if @_ != 2
118 1 15 ref $json ? :
119 5 11 if ($@)
122 4 7 if ($response and ref $response eq 'HASH')
125 2 5 if (not $response or ref $response ne 'ARRAY')
128 1 4 unless (@{$response;})
137 2 78 if @_ != 2
140 13 65 ref $json ? :
141 5 73 if ($@)
144 3 70 if (ref $response ne 'HASH')
147 11 59 if (not defined $response->{'jsonrpc'} or $response->{'jsonrpc'} ne '2.0')
150 5 50 if (not exists $response->{'id'} or ref $response->{'id'} or not defined $response->{'id'})
153 4 46 unless (exists $self->{'id'}{$response->{'id'}})
156 2 44 unless (exists $response->{'result'} xor exists $response->{'error'})
159 26 18 if (exists $response->{'error'})
161 6 20 if (ref $e ne 'HASH')
164 5 12 if (not defined $e->{'code'} or ref $e->{'code'} or not $e->{'code'} =~ /\A-?\d+\z/msx)
167 6 6 if (not defined $e->{'message'} or ref $e->{'message'})
171 2 4 if (3 == keys %{$e;} and not exists $e->{'data'} or 3 < keys %{$e;})
179 20 2 if ($call)
182 4 18 unless ($call)