Branch Coverage

blib/lib/JSON/RPC2/TwoWay/Connection.pm
Criterion Covered Total %
branch 42 70 60.0


line true false branch
22 0 2 unless $opt{'rpc'} and $opt{'rpc'}->isa("JSON::RPC2::TwoWay")
24 1 1 unless $opt{'write'} and ref $opt{'write'} eq "CODE"
36 0 1 $opt{'debug'} ? :
0 1 ref $opt{'debug'} eq 'CODE' ? :
43 0 5 unless $self
44 1 4 unless ref $args eq "ARRAY" or ref $args eq "HASH"
46 1 3 unless $cb
47 1 2 if ref $cb ne "CODE"
49 0 2 if $self->{'calls'}{$id}
64 0 0 unless $self
65 0 0 unless ref $request eq "HASH"
67 0 0 if ref $cb ne "CODE"
69 0 0 if $self->{'calls'}{$id}
81 0 0 unless $self
82 0 0 unless ref $args eq "ARRAY" or ref $args eq "HASH"
97 5 12 if $err[0]
103 0 17 if $self->{'debug'}
106 1 16 if $@
107 1 15 if ref $r ne "HASH"
108 1 14 unless defined $r->{'jsonrpc'} and $r->{'jsonrpc'} eq "2.0"
110 1 13 if exists $r->{'id'} and ref $r->{'id'}
111 9 4 if (defined $r->{'method'}) { }
3 1 elsif (exists $r->{'id'} and exists $r->{'result'} || defined $r->{'error'}) { }
125 3 0 if $id
126 1 2 unless $cb
128 1 1 if (defined $r->{'error'}) { }
130 0 1 unless ref $e eq "HASH"
131 0 1 unless defined $e->{'code'} and $e->{'code'} =~ /^-?\d+$/
132 0 1 if ref $e->{'message'}
133 0 1 if keys %$e == 3 and not exists $e->{'data'} or keys %$e > 2
134 0 1 if ($raw) { }
140 0 1 if ($raw) { }
151 0 16 if $self->{'debug'}
157 0 0 if @_
163 1 3 if @_