| 1 | package JSON::RPC2::Server; | ||||||||||||||||||||||||||||||||||||||||||
| 2 | 3 | ▶ | use 5.010001; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 3 | 3 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 4 | 3 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 5 | 3 | ▶ | use utf8; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 6 | 3 | ▶ | use Carp; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||||||||||||||||
| 8 | 3 | our $VERSION = 'v2.1.1'; | |||||||||||||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||||||||||||
| 10 | 3 | ▶ | use JSON::MaybeXS; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||||||||||||||
| 12 | 3 | ▶ | use constant ERR_PARSE => -32700; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 13 | 3 | ▶ | use constant ERR_REQ => -32600; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 14 | 3 | ▶ | use constant ERR_METHOD => -32601; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 15 | 3 | ▶ | use constant ERR_PARAMS => -32602; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||||||||||||||||
| 18 | sub new { | ||||||||||||||||||||||||||||||||||||||||||
| 19 | 2 | ▶ | my ($class) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 20 | 2 | my $self = { | |||||||||||||||||||||||||||||||||||||||||
| 21 | method => {}, | ||||||||||||||||||||||||||||||||||||||||||
| 22 | }; | ||||||||||||||||||||||||||||||||||||||||||
| 23 | 2 | return bless $self, $class; | |||||||||||||||||||||||||||||||||||||||||
| 24 | } | ||||||||||||||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||||||||||||||
| 26 | sub register { | ||||||||||||||||||||||||||||||||||||||||||
| 27 | 4 | ▶ | my ($self, $name, $cb) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
register: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 28 | 4 | $self->{method}{ $name } = [ $cb, 1, 0 ]; | |||||||||||||||||||||||||||||||||||||||||
| 29 | 4 | return; | |||||||||||||||||||||||||||||||||||||||||
| 30 | } | ||||||||||||||||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||||||||||||||||
| 32 | sub register_named { | ||||||||||||||||||||||||||||||||||||||||||
| 33 | 0 | ▶ | my ($self, $name, $cb) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
register_named: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 34 | 0 | $self->{method}{ $name } = [ $cb, 1, 1 ]; | |||||||||||||||||||||||||||||||||||||||||
| 35 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 36 | } | ||||||||||||||||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||||||||||||||||
| 38 | sub register_nb { | ||||||||||||||||||||||||||||||||||||||||||
| 39 | 0 | ▶ | my ($self, $name, $cb) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
register_nb: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 40 | 0 | $self->{method}{ $name } = [ $cb, 0, 0 ]; | |||||||||||||||||||||||||||||||||||||||||
| 41 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 42 | } | ||||||||||||||||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||||||||||||||||
| 44 | sub register_named_nb { | ||||||||||||||||||||||||||||||||||||||||||
| 45 | 0 | ▶ | my ($self, $name, $cb) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
register_named_nb: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 46 | 0 | $self->{method}{ $name } = [ $cb, 0, 1 ]; | |||||||||||||||||||||||||||||||||||||||||
| 47 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 48 | } | ||||||||||||||||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||||||||||||||||
| 50 | sub execute { | ||||||||||||||||||||||||||||||||||||||||||
| 51 | 4 | ▶ | my ($self, $json, $cb) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
execute: called CC=9 SCAR=36.2
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 52 | 4 | ▶ | croak 'require 2 params' if 1+2 != @_; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 53 | 4 | ▶ | croak 'second param must be callback' if ref $cb ne 'CODE'; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||||||||||||||||
| 55 | 4 | undef $@; | |||||||||||||||||||||||||||||||||||||||||
| 56 | 4 | ▶ | my $request = ref $json ? $json : eval { decode_json($json) }; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 57 | 4 | ▶ | if ($@) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 58 | 0 | return _error($cb, undef, ERR_PARSE, 'Parse error.'); | |||||||||||||||||||||||||||||||||||||||||
| 59 | } | ||||||||||||||||||||||||||||||||||||||||||
| 60 | 4 | ▶ | if (ref $request eq 'HASH') { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 61 | 4 | return $self->_execute($request, $cb); | |||||||||||||||||||||||||||||||||||||||||
| 62 | } | ||||||||||||||||||||||||||||||||||||||||||
| 63 | 0 | ▶ | if (ref $request ne 'ARRAY') { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 64 | 0 | return _error($cb, undef, ERR_REQ, 'Invalid Request: expect Array or Object.'); | |||||||||||||||||||||||||||||||||||||||||
| 65 | } | ||||||||||||||||||||||||||||||||||||||||||
| 66 | 0 | ▶ | if (!@{$request}) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 67 | 0 | return _error($cb, undef, ERR_REQ, 'Invalid Request: empty Array.'); | |||||||||||||||||||||||||||||||||||||||||
| 68 | } | ||||||||||||||||||||||||||||||||||||||||||
| 69 | |||||||||||||||||||||||||||||||||||||||||||
| 70 | 0 | my $pending = @{$request}; | |||||||||||||||||||||||||||||||||||||||||
| 71 | 0 | my @responses; | |||||||||||||||||||||||||||||||||||||||||
| 72 | my $cb_acc = sub { | ||||||||||||||||||||||||||||||||||||||||||
| 73 | 0 | ▶ | my ($json_response) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=4 SCAR=30.0
| |||||||||||||||||||||||||||||||||||||||||||
| 74 | 0 | ▶ | if ($json_response) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 75 | 0 | push @responses, $json_response; | |||||||||||||||||||||||||||||||||||||||||
| 76 | } | ||||||||||||||||||||||||||||||||||||||||||
| 77 | 0 | ▶ | if (!--$pending) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 78 | 0 | ▶ | if (@responses) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 79 | 0 | $cb->( '[' . join(q{,}, @responses) . ']' ); | |||||||||||||||||||||||||||||||||||||||||
| 80 | } else { | ||||||||||||||||||||||||||||||||||||||||||
| 81 | 0 | $cb->( q{} ); | |||||||||||||||||||||||||||||||||||||||||
| 82 | } | ||||||||||||||||||||||||||||||||||||||||||
| 83 | } | ||||||||||||||||||||||||||||||||||||||||||
| 84 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 85 | 0 | }; | |||||||||||||||||||||||||||||||||||||||||
| 86 | 0 | for (@{$request}) { | |||||||||||||||||||||||||||||||||||||||||
| 87 | 0 | $self->_execute($_, $cb_acc); | |||||||||||||||||||||||||||||||||||||||||
| 88 | } | ||||||||||||||||||||||||||||||||||||||||||
| 89 | |||||||||||||||||||||||||||||||||||||||||||
| 90 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 91 | } | ||||||||||||||||||||||||||||||||||||||||||
| 92 | |||||||||||||||||||||||||||||||||||||||||||
| 93 | sub _execute { | ||||||||||||||||||||||||||||||||||||||||||
| 94 | 4 | ▶ | my ($self, $request, $cb) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_execute: called CC=19 SCAR=41.1
| |||||||||||||||||||||||||||||||||||||||||||
| 95 | |||||||||||||||||||||||||||||||||||||||||||
| 96 | 4 | my $error = \&_error; | |||||||||||||||||||||||||||||||||||||||||
| 97 | 4 | my $done = \&_done; | |||||||||||||||||||||||||||||||||||||||||
| 98 | |||||||||||||||||||||||||||||||||||||||||||
| 99 | # jsonrpc => | ||||||||||||||||||||||||||||||||||||||||||
| 100 | 4 | ▶ | if (!defined $request->{jsonrpc} || ref $request->{jsonrpc} || $request->{jsonrpc} ne '2.0') { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%2/6
not defined $request->{"jsonrpc"} or ref $request->{"jsonrpc"} or $request->{"jsonrpc"} ne "2.0"
not defined $request->{"jsonrpc"} or ref $request->{"jsonrpc"}
MC/DC0%0/3
not defined $request->{"jsonrpc"} or ref $request->{"jsonrpc"} or $request->{"jsonrpc"} ne "2.0"
not defined $request->{"jsonrpc"}
ref $request->{"jsonrpc"}
$request->{"jsonrpc"} ne "2.0"
Truth table25%1/4
not(A) or B or C
A= not defined $request->{"jsonrpc"}B= ref $request->{"jsonrpc"}C= $request->{"jsonrpc"} ne "2.0"
| |||||||||||||||||||||||||||||||||||||||||||
| 101 | 0 | return $error->($cb, undef, ERR_REQ, 'Invalid Request: expect {jsonrpc}="2.0".'); | |||||||||||||||||||||||||||||||||||||||||
| 102 | } | ||||||||||||||||||||||||||||||||||||||||||
| 103 | |||||||||||||||||||||||||||||||||||||||||||
| 104 | # id => | ||||||||||||||||||||||||||||||||||||||||||
| 105 | 4 | my $id; | |||||||||||||||||||||||||||||||||||||||||
| 106 | 4 | ▶ | if (exists $request->{id}) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 107 | # Request | ||||||||||||||||||||||||||||||||||||||||||
| 108 | 4 | ▶ | if (ref $request->{id}) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 109 | 0 | return $error->($cb, undef, ERR_REQ, 'Invalid Request: expect {id} is scalar.'); | |||||||||||||||||||||||||||||||||||||||||
| 110 | } | ||||||||||||||||||||||||||||||||||||||||||
| 111 | 4 | $id = $request->{id}; | |||||||||||||||||||||||||||||||||||||||||
| 112 | } | ||||||||||||||||||||||||||||||||||||||||||
| 113 | |||||||||||||||||||||||||||||||||||||||||||
| 114 | # method => | ||||||||||||||||||||||||||||||||||||||||||
| 115 | 4 | ▶ | if (!defined $request->{method} || ref $request->{method}) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
not defined $request->{"method"} or ref $request->{"method"}
MC/DC0%0/2
not defined $request->{"method"} or ref $request->{"method"}
not defined $request->{"method"}
ref $request->{"method"}
Truth table33%1/3
not(A) or B
A= not defined $request->{"method"}B= ref $request->{"method"}
| |||||||||||||||||||||||||||||||||||||||||||
| 116 | 0 | return $error->($cb, $id, ERR_REQ, 'Invalid Request: expect {method} is String.'); | |||||||||||||||||||||||||||||||||||||||||
| 117 | } | ||||||||||||||||||||||||||||||||||||||||||
| 118 | 4 | my $handler = $self->{method}{ $request->{method} }; | |||||||||||||||||||||||||||||||||||||||||
| 119 | 4 | ▶ | if (!$handler) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 120 | 0 | return $error->($cb, $id, ERR_METHOD, 'Method not found.'); | |||||||||||||||||||||||||||||||||||||||||
| 121 | } | ||||||||||||||||||||||||||||||||||||||||||
| 122 | 4 | my ($method, $is_blocking, $is_named) = @{$handler}; | |||||||||||||||||||||||||||||||||||||||||
| 123 | |||||||||||||||||||||||||||||||||||||||||||
| 124 | # params => | ||||||||||||||||||||||||||||||||||||||||||
| 125 | 4 | ▶ | if (!exists $request->{params}) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 126 | 0 | ▶ | $request->{params} = $is_named ? {} : []; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 127 | } | ||||||||||||||||||||||||||||||||||||||||||
| 128 | 4 | ▶ | if (ref $request->{params} ne 'ARRAY' && ref $request->{params} ne 'HASH') { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
ref $request->{"params"} ne "ARRAY" and ref $request->{"params"} ne "HASH"
MC/DC0%0/2
ref $request->{"params"} ne "ARRAY" and ref $request->{"params"} ne "HASH"
ref $request->{"params"} ne "ARRAY"
ref $request->{"params"} ne "HASH"
Truth table33%1/3
A and B
A= ref $request->{"params"} ne "ARRAY"B= ref $request->{"params"} ne "HASH"
| |||||||||||||||||||||||||||||||||||||||||||
| 129 | 0 | return $error->($cb, $id, ERR_REQ, 'Invalid Request: expect {params} is Array or Object.'); | |||||||||||||||||||||||||||||||||||||||||
| 130 | } | ||||||||||||||||||||||||||||||||||||||||||
| 131 | 4 | ▶ | if (ref $request->{params} ne ($is_named ? 'HASH' : 'ARRAY')) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 132 | 0 | ▶ | return $error->($cb, $id, ERR_PARAMS, 'This method expect '.($is_named ? 'named' : 'positional').' params.'); | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 133 | } | ||||||||||||||||||||||||||||||||||||||||||
| 134 | 4 | ▶ | my @params = $is_named ? %{ $request->{params} } : @{ $request->{params} }; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 135 | |||||||||||||||||||||||||||||||||||||||||||
| 136 | # id => (continue) | ||||||||||||||||||||||||||||||||||||||||||
| 137 | 4 | ▶ | if (!exists $request->{id}) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 138 | # Notification | ||||||||||||||||||||||||||||||||||||||||||
| 139 | 0 | $error = \&_nothing; | |||||||||||||||||||||||||||||||||||||||||
| 140 | 0 | $done = \&_nothing; | |||||||||||||||||||||||||||||||||||||||||
| 141 | } | ||||||||||||||||||||||||||||||||||||||||||
| 142 | |||||||||||||||||||||||||||||||||||||||||||
| 143 | # execute | ||||||||||||||||||||||||||||||||||||||||||
| 144 | 4 | ▶ | if ($is_blocking) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 145 | 4 | my @returns = $method->( @params ); | |||||||||||||||||||||||||||||||||||||||||
| 146 | 4 | $done->($cb, $id, \@returns); | |||||||||||||||||||||||||||||||||||||||||
| 147 | } | ||||||||||||||||||||||||||||||||||||||||||
| 148 | else { | ||||||||||||||||||||||||||||||||||||||||||
| 149 | 0 | ▶ | my $cb_done = sub { $done->($cb, $id, \@_) }; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||
| 150 | 0 | $method->( $cb_done, @params ); | |||||||||||||||||||||||||||||||||||||||||
| 151 | } | ||||||||||||||||||||||||||||||||||||||||||
| 152 | 4 | return; | |||||||||||||||||||||||||||||||||||||||||
| 153 | } | ||||||||||||||||||||||||||||||||||||||||||
| 154 | |||||||||||||||||||||||||||||||||||||||||||
| 155 | sub _done { | ||||||||||||||||||||||||||||||||||||||||||
| 156 | 4 | ▶ | my ($cb, $id, $returns) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_done: called CC=2 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||
| 157 | 4 | my ($result, $code, $msg, $data) = @{$returns}; | |||||||||||||||||||||||||||||||||||||||||
| 158 | 4 | ▶ | if (defined $code) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 159 | 2 | return _error($cb, $id, $code, $msg, $data); | |||||||||||||||||||||||||||||||||||||||||
| 160 | } | ||||||||||||||||||||||||||||||||||||||||||
| 161 | 2 | return _result($cb, $id, $result); | |||||||||||||||||||||||||||||||||||||||||
| 162 | } | ||||||||||||||||||||||||||||||||||||||||||
| 163 | |||||||||||||||||||||||||||||||||||||||||||
| 164 | sub _error { | ||||||||||||||||||||||||||||||||||||||||||
| 165 | 2 | ▶ | my ($cb, $id, $code, $message, $data) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_error: called CC=2 SCAR=7.1
| |||||||||||||||||||||||||||||||||||||||||||
| 166 | 2 | ▶ | $cb->( encode_json({ | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 167 | jsonrpc => '2.0', | ||||||||||||||||||||||||||||||||||||||||||
| 168 | id => $id, | ||||||||||||||||||||||||||||||||||||||||||
| 169 | error => { | ||||||||||||||||||||||||||||||||||||||||||
| 170 | code => $code, | ||||||||||||||||||||||||||||||||||||||||||
| 171 | message => $message, | ||||||||||||||||||||||||||||||||||||||||||
| 172 | (defined $data ? ( data => $data ) : ()), | ||||||||||||||||||||||||||||||||||||||||||
| 173 | }, | ||||||||||||||||||||||||||||||||||||||||||
| 174 | }) ); | ||||||||||||||||||||||||||||||||||||||||||
| 175 | 2 | return; | |||||||||||||||||||||||||||||||||||||||||
| 176 | } | ||||||||||||||||||||||||||||||||||||||||||
| 177 | |||||||||||||||||||||||||||||||||||||||||||
| 178 | sub _result { | ||||||||||||||||||||||||||||||||||||||||||
| 179 | 2 | ▶ | my ($cb, $id, $result) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_result: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 180 | 2 | $cb->( encode_json({ | |||||||||||||||||||||||||||||||||||||||||
| 181 | jsonrpc => '2.0', | ||||||||||||||||||||||||||||||||||||||||||
| 182 | id => $id, | ||||||||||||||||||||||||||||||||||||||||||
| 183 | result => $result, | ||||||||||||||||||||||||||||||||||||||||||
| 184 | }) ); | ||||||||||||||||||||||||||||||||||||||||||
| 185 | 2 | return; | |||||||||||||||||||||||||||||||||||||||||
| 186 | } | ||||||||||||||||||||||||||||||||||||||||||
| 187 | |||||||||||||||||||||||||||||||||||||||||||
| 188 | sub _nothing { | ||||||||||||||||||||||||||||||||||||||||||
| 189 | 0 | ▶ | my ($cb) = @_; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_nothing: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||
| 190 | 0 | $cb->( q{} ); | |||||||||||||||||||||||||||||||||||||||||
| 191 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 192 | } | ||||||||||||||||||||||||||||||||||||||||||
| 193 | |||||||||||||||||||||||||||||||||||||||||||
| 194 | |||||||||||||||||||||||||||||||||||||||||||
| 195 | 3 | 1; # Magic true value required at end of module | |||||||||||||||||||||||||||||||||||||||||
| 196 | __END__ | ||||||||||||||||||||||||||||||||||||||||||