blib/lib/MarpaX/ESLIF/ECMA404.pm

filter: Statementstmt 85.1% 23 / 27 Branchbran 25.0% 1 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 77.7% 7 / 9 Podpod 100% 2 / 2 totaltotal 78.5% 33 / 42 CC 3 SCAR 7.9
CC
3
Cov
77%
encode
6.0
decode
2.1
_JSONRelaxed
2.0
CRAP 2.2
↑ Summary
1  
2 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 2 ▶use warnings FATAL => 'all';
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use feature 'state';
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 package MarpaX::ESLIF::ECMA404;
7 2 ▶use Log::Any qw/$log/;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 2 ▶use MarpaX::ESLIF 3.0.32;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 2 my $ESLIF = MarpaX::ESLIF->new($log);
11  
12 # ABSTRACT: JSON Data Interchange Format following ECMA-404 specification
13  
14 2 our $VERSION = '0.014'; # VERSION
15  
16 2 our $AUTHORITY = 'cpan:JDDPAUSE'; # AUTHORITY
17  
18  
19  
20 354 ▶sub decode {
Subroutine decode: called CC=2 SCAR=7.2
Pod documented
21 354 my ($self, $input, %options) = @_;
22  
23 354 ▶ return $options{strict} ? _JSONStrict()->decode($input, %options) : _JSONRelaxed()->decode($input, %options)
Branch: 1 branch
BranchTrueFalseTotal
$options{'strict'} ? : 354 0 354
24 }
25  
26  
27 0 ▶sub encode {
Subroutine encode: not called CC=2 SCAR=17.9
Pod documented
28 0 my ($self, $input, %options) = @_;
29  
30 0 ▶ return $options{strict} ? _JSONStrict()->encode($input, %options) : _JSONRelaxed()->encode($input, %options)
Branch: 1 branch
BranchTrueFalseTotal
$options{'strict'} ? : 0 0 0
31 }
32  
33 # -------------
34 # Private stubs
35 # -------------
36 354 ▶sub _JSONStrict {
Subroutine _JSONStrict: called CC=1 SCAR=0.0
37 354 state $JSONStrict = MarpaX::ESLIF::JSON->new($ESLIF, 1);
38  
39 354 return $JSONStrict
40 }
41  
42 0 ▶sub _JSONRelaxed {
Subroutine _JSONRelaxed: not called CC=1 SCAR=6.9
43 0 state $JSONRelaxed = MarpaX::ESLIF::JSON->new($ESLIF, 0);
44  
45 0 return $JSONRelaxed
46 }
47  
48  
49 2 1;
50  
51 __END__
↑ Summary