blib/lib/PLS/JSON.pm

filter: Statementstmt 62.9% 17 / 27 Branchbran 25.0% 1 / 4 Conditioncond 11.1% 1 / 9 MC/DCmcdc 0.0% 0 / 5 Subroutinesub 80.0% 4 / 5 Podpod 0.0% 0 / 1 totaltotal 45.1% 23 / 51 CC 6 SCAR 25.6
CC
6
Cov
48%
BEGIN
20.6
new
2.0
BEGIN
1.0
CRAP 12.9
« blib/lib/PLS/Server/Method/TextDocument.pm ↑ Summary blib/lib/PLS/Parser/Pod/Variable.pm »
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
BranchTrueFalseTotal
if ($INC{'Cpanel/JSON/XS.pm'} or eval { do { require Cpanel::JSON::XS; 1 } }) { } 15 0 15
elsif ($INC{'JSON/XS.pm'} || eval { do { require JSON::XS; 1 } } and eval { do { 'JSON::XS'->VERSION(3.0); 1 } }) { } 0 0 0
Condition33%1/3
$INC{"Cpanel/JSON/XS.pm"} or eval { do { require Cpanel::JSON::XS; 1 } }
l!l&&r!l&&!r
1500
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 } }
ABresult
1X1
011
000
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 } }
!ll&&!rl&&r
000
$INC{"JSON/XS.pm"} or eval { do { require JSON::XS; 1 } }
l!l&&r!l&&!r
000
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 } }
ABCresult
00X0
1X00
0100
1X11
0111
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;
« blib/lib/PLS/Server/Method/TextDocument.pm ↑ Summary blib/lib/PLS/Parser/Pod/Variable.pm »