Branch Coverage

blib/lib/JSON/RPC2/TwoWay/Connection.pm
Criterion Covered Total %
branch 40 66 60.6


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'
42 0 5 unless $self
43 1 4 unless ref $args eq 'ARRAY' or ref $args eq 'HASH'
45 1 3 unless $cb
46 1 2 if ref $cb ne 'CODE'
48 0 2 if $self->{'calls'}{$id}
63 0 0 unless $self
64 0 0 unless ref $request eq 'HASH'
66 0 0 if ref $cb ne 'CODE'
68 0 0 if $self->{'calls'}{$id}
80 0 0 unless $self
81 0 0 unless ref $args eq 'ARRAY' or ref $args eq 'HASH'
96 5 12 if $err[0]
102 0 17 if $self->{'debug'}
105 1 16 if $@
106 1 15 if ref $r ne 'HASH'
107 1 14 unless defined $r->{'jsonrpc'} and $r->{'jsonrpc'} eq '2.0'
109 1 13 if exists $r->{'id'} and ref $r->{'id'}
110 9 4 if (defined $r->{'method'}) { }
3 1 elsif (exists $r->{'id'} and exists $r->{'result'} || defined $r->{'error'}) { }
124 3 0 if $id
125 1 2 unless $cb
127 1 1 if (defined $r->{'error'}) { }
129 0 1 unless ref $e eq 'HASH'
130 0 1 unless defined $e->{'code'} and $e->{'code'} =~ /^-?\d+$/
131 0 1 if ref $e->{'message'}
132 0 1 if keys %$e == 3 and not exists $e->{'data'} or keys %$e > 2
133 0 1 if ($raw) { }
139 0 1 if ($raw) { }
150 0 16 if $self->{'debug'}
156 0 0 if @_
162 1 3 if @_