APIClient/Utils/JSON.pm

filter: Statementstmt 100% 13 / 13 Branchbran n/a Conditioncond 66.6% 2 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 1 totaltotal 83.3% 20 / 24 CC 2 SCAR 3.0
CC
2
Cov
94%
_json
2.1
BEGIN
1.0
BEGIN
1.0
CRAP 1.4
« APIClient/Response/UAPI.pm ↑ Summary APIClient/Service/cpanel.pm »
1 package cPanel::APIClient::Utils::JSON;
2  
3 # Copyright 2020 cPanel, L. L. C.
4 # All rights reserved.
5 # http://cpanel.net
6 #
7 # This is free software; you can redistribute it and/or modify it under the
8 # same terms as Perl itself. See L<perlartistic>.
9  
10 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 3 ▶use JSON ();
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 3 my $json;
16  
17 5 ▶sub _json {
Subroutine _json: called CC=2 SCAR=7.2
18 5 ▶ return $json ||= JSON->new()->utf8(0);
Condition66%2/3
$json ||= "JSON"->new->utf8(0)
l!l&&r!l&&!r
410
MC/DC0%0/2
$json ||= "JSON"->new->utf8(0)
$json "JSON"->new->utf8(0)
Truth table66%2/3
A ||= B
A= $jsonB= "JSON"->new->utf8(0)
ABresult
1X1
011
000
19 }
20  
21 5 ▶sub decode {
Subroutine decode: called CC=1 SCAR=0.0
Pod undocumented
22 5 return _json()->decode( $_[0] );
23 }
24  
25 3 1;
« APIClient/Response/UAPI.pm ↑ Summary APIClient/Service/cpanel.pm »