Twilio/Json.pm

filter: Statementstmt 100% 18 / 18 Branchbran n/a Conditioncond 66.6% 2 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 5 / 5 Podpod 100% 2 / 2 totaltotal 90.0% 27 / 30 CC 2 SCAR 2.9
CC
2
Cov
95%
_new_codec
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« Twilio/Rest/Trusthub/V1/ComplianceRegistrationInquiries.pm ↑ Summary Twilio/Rest/Chat/V3.pm »
1 package Twilio::Json;
2  
3 33 ▶use 5.016;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 33 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 33 our $VERSION = '2.001';
7  
8 33 my $codec = _new_codec();
9  
10 2410 ▶sub encode {
Subroutine encode: called CC=1 SCAR=0.0
Pod documented
11 2410 my ($value) = @_;
12 2410 return $codec->encode($value);
13 }
14  
15 2081 ▶sub decode {
Subroutine decode: called CC=1 SCAR=0.0
Pod documented
16 2081 my ($text) = @_;
17 2081 return $codec->decode($text);
18 }
19  
20 33 ▶sub _new_codec {
Subroutine _new_codec: called CC=2 SCAR=7.0
21 my $backend =
22 33 ▶ eval { require Cpanel::JSON::XS; 'Cpanel::JSON::XS' } // do { require JSON::PP; 'JSON::PP' };
Condition66%2/3
eval { do { require Cpanel::JSON::XS; "Cpanel::JSON::XS" } } // do { require JSON::PP; "JSON::PP" }
l!l&&r!l&&!r
3210
MC/DC0%0/2
eval { do { require Cpanel::JSON::XS; "Cpanel::JSON::XS" } } // do { require JSON::PP; "JSON::PP" }
eval { do { require Cpanel::JSON::XS; "Cpanel::JSON::XS" } } do { require JSON::PP; "JSON::PP" }
Truth table66%2/3
A // B
A= eval { do { require Cpanel::JSON::XS; "Cpanel::JSON::XS" } }B= do { require JSON::PP; "JSON::PP" }
ABresult
1X1
011
000
23  
24 # Canonical key order keeps request bodies reproducible in tests and logs.
25 33 return $backend->new->utf8->canonical->allow_nonref;
26 }
27  
28 33 1;
29  
30 __END__
« Twilio/Rest/Trusthub/V1/ComplianceRegistrationInquiries.pm ↑ Summary Twilio/Rest/Chat/V3.pm »