Branch Coverage

blib/lib/JSON/RPC/Simple/Dispatcher.pm
Criterion Covered Total %
branch 40 74 54.0


line true false branch
13 1 0 unless ref $args eq 'HASH'
27 0 12 if @_
33 0 3 if @_
39 0 6 if @_
46 0 3 unless ref $targets eq 'HASH'
49 1 1 unless ($target->isa('JSON::RPC::Simple'))
64 0 3 unless defined $message
66 0 3 defined $id ? :
76 0 3 if ($error_obj) { }
85 0 3 if ($target and $target->can('JSONRPC_ERROR'))
90 3 0 unless $new_error_obj
91 0 3 if ($self->error_handler and not $new_error_obj)
97 0 3 if $new_error_obj
100 1 2 $HTTP_ERROR_CODE == 200 ? :
132 0 6 unless ($request->method eq 'POST')
137 0 6 unless ($request->content_type =~ m[^application/json])
145 0 6 if ($@)
147 0 0 if $request->can('headers_in')
150 0 0 if not defined $content_length and $request->can('headers')
153 0 6 unless (defined $content_length)
173 0 6 if ($@)
183 0 6 unless (defined $version)
189 0 6 unless ($version eq '1.1')
197 0 6 unless ($method)
204 0 6 unless ($params)
208 0 6 unless (ref $params eq 'HASH' or ref $params eq 'ARRAY')
215 0 6 unless ($target)
224 5 1 if ($cv) { }
227 0 5 unless (@attrs)
237 1 0 if ($cv = $target->can('JSONRPC_AUTOLOAD')) { }
242 1 0 if (my $attrs_cv = $target->can('JSONRPC_AUTOLOAD_ATTRS'))
244 0 1 unless (@attrs)
262 1 5 if ($check_attrs and @$check_attrs and ref $params eq 'ARRAY')
273 3 3 if ($@)
276 0 3 if ref $@ eq 'ARRAY'
282 0 3 defined $id ? :
288 0 3 if ($@)