Branch Coverage

blib/lib/JSON/RPC2/Server.pm
Criterion Covered Total %
branch 52 52 100.0


line true false branch
52 3 72 if 3 != @_
53 4 68 if ref $cb ne 'CODE'
56 4 64 ref $json ? :
57 5 63 if ($@)
60 54 9 if (ref $request eq 'HASH')
63 2 7 if (ref $request ne 'ARRAY')
66 2 5 unless (@{$request;})
74 13 8 if ($json_response)
77 5 16 unless (--$pending)
78 4 1 if (@responses) { }
100 9 62 if (not defined $request->{'jsonrpc'} or ref $request->{'jsonrpc'} or $request->{'jsonrpc'} ne '2.0')
106 48 14 if (exists $request->{'id'})
108 4 44 if (ref $request->{'id'})
115 5 53 if (not defined $request->{'method'} or ref $request->{'method'})
119 3 50 unless ($handler)
125 2 48 unless (exists $request->{'params'})
126 1 1 $is_named ? :
128 5 45 if (ref $request->{'params'} ne 'ARRAY' and ref $request->{'params'} ne 'HASH')
131 21 24 $is_named ? :
15 30 if (ref $request->{'params'} ne ($is_named ? 'HASH' : 'ARRAY'))
132 8 7 $is_named ? :
134 13 17 $is_named ? :
137 10 20 unless (exists $request->{'id'})
144 21 9 if ($is_blocking) { }
158 9 11 if (defined $code)
166 1 62 defined $data ? :