| 1 | package PLS::JSON; | ||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||
| 3 | 15 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||
| 4 | 15 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||||||||||||
| 6 | 15 | ▶ | use Exporter qw(import); | ||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||||||||||||
| 8 | 15 | my $package; | |||||||||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||||||||
| 10 | BEGIN | ||||||||||||||||||||||||||||||||||||||
| 11 | 15 | ▶ | { | ||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=6 SCAR=30.3
| |||||||||||||||||||||||||||||||||||||||
| 12 | 0 | ▶ | if ($INC{'Cpanel/JSON/XS.pm'} or eval { require Cpanel::JSON::XS; 1 }) | ||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition33%1/3
$INC{"Cpanel/JSON/XS.pm"} or eval {
do {
require Cpanel::JSON::XS;
1
}
}
MC/DC0%0/2
$INC{"Cpanel/JSON/XS.pm"} or eval {
do {
require Cpanel::JSON::XS;
1
}
}
$INC{"Cpanel/JSON/XS.pm"}
eval {
do {
require Cpanel::JSON::XS;
1
}
}
Truth table33%1/3
A or B
A= $INC{"Cpanel/JSON/XS.pm"}B= eval {
do {
require Cpanel::JSON::XS;
1
}
}
| |||||||||||||||||||||||||||||||||||||||
| 13 | { | ||||||||||||||||||||||||||||||||||||||
| 14 | 15 | $package = 'Cpanel::JSON::XS'; | |||||||||||||||||||||||||||||||||||||
| 15 | } | ||||||||||||||||||||||||||||||||||||||
| 16 | 0 | ▶ | elsif (($INC{'JSON/XS.pm'} or eval { require JSON::XS; 1 }) and eval { JSON::XS->VERSION(3.0); 1 }) | ||||||||||||||||||||||||||||||||||||
|
Condition0%0/6
$INC{"JSON/XS.pm"} || eval {
do {
require JSON::XS;
1
}
} and eval {
do {
"JSON::XS"->VERSION(3);
1
}
}
$INC{"JSON/XS.pm"} or eval {
do {
require JSON::XS;
1
}
}
MC/DC0%0/3
$INC{"JSON/XS.pm"} || eval {
do {
require JSON::XS;
1
}
} and eval {
do {
"JSON::XS"->VERSION(3);
1
}
}
$INC{"JSON/XS.pm"}
eval {
do {
require JSON::XS;
1
}
}
eval {
do {
"JSON::XS"->VERSION(3);
1
}
}
Truth table0%0/5
A or B and C
A= $INC{"JSON/XS.pm"}B= eval {
do {
require JSON::XS;
1
}
}C= eval {
do {
"JSON::XS"->VERSION(3);
1
}
}
| |||||||||||||||||||||||||||||||||||||||
| 17 | { | ||||||||||||||||||||||||||||||||||||||
| 18 | 0 | $package = 'JSON::XS'; | |||||||||||||||||||||||||||||||||||||
| 19 | } | ||||||||||||||||||||||||||||||||||||||
| 20 | else | ||||||||||||||||||||||||||||||||||||||
| 21 | { | ||||||||||||||||||||||||||||||||||||||
| 22 | 0 | require JSON::PP; | |||||||||||||||||||||||||||||||||||||
| 23 | 0 | $package = 'JSON::PP'; | |||||||||||||||||||||||||||||||||||||
| 24 | } | ||||||||||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||||||||||
| 26 | 15 | $package->import(qw(encode_json decode_json)); | |||||||||||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||||||||||||
| 28 | 15 | *PLS::JSON::true = $package->can('true'); | |||||||||||||||||||||||||||||||||||||
| 29 | 15 | *PLS::JSON::false = $package->can('false'); | |||||||||||||||||||||||||||||||||||||
| 30 | } ## end BEGIN | ||||||||||||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||||||||||||
| 32 | 15 | our @EXPORT = qw(encode_json decode_json); ## no critic (ProhibitAutomaticExportation) | |||||||||||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||||||||||||
| 34 | sub new | ||||||||||||||||||||||||||||||||||||||
| 35 | 0 | ▶ | { | ||||||||||||||||||||||||||||||||||||
|
Subroutine
new: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||
| 36 | 0 | return $package->new(); | |||||||||||||||||||||||||||||||||||||
| 37 | } | ||||||||||||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||||||||||||
| 39 | 15 | 1; | |||||||||||||||||||||||||||||||||||||