Format/Json.pm

filter: Statementstmt 100% 16 / 16 Branchbran 100% 4 / 4 Conditioncond 100% 3 / 3 MC/DCmcdc 100% 2 / 2 Subroutinesub 100% 5 / 5 Podpod 100% 2 / 2 totaltotal 100% 32 / 32 CC 3 SCAR 4.5
CC
3
Cov
100%
to_json
2.0
from_json
2.0
BEGIN
1.0
CRAP 1.6
« Format/Yaml.pm ↑ Summary
1 package Aion::Format::Json;
2  
3 1 ▶use common::sense;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use JSON::XS qw//;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 ▶use Exporter qw/import/;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 our @EXPORT = our @EXPORT_OK = grep {
8 1 ▶ *{$Aion::Format::Json::{$_}}{CODE} && !/^(_|(NaN|import)\z)/n
Condition100%3/3
*{$Aion::Format::Json::{$_};}{'CODE'} && !/^(_|(NaN|import)\z)/nu
!ll&&!rl&&r
412
MC/DC100%2/2
*{$Aion::Format::Json::{$_};}{'CODE'} && !/^(_|(NaN|import)\z)/nu
*{$Aion::Format::Json::{$_};}{'CODE'} !/^(_|(NaN|import)\z)/nu
Truth table100%3/3
A && not(B)
A= *{$Aion::Format::Json::{$_};}{'CODE'}B= !/^(_|(NaN|import)\z)/nu
ABresult
0X0
100
111
9 } keys %Aion::Format::Json::;
10  
11 #@category json
12  
13 # Настраиваем json
14 1 our $JSON = JSON::XS->new->allow_nonref->indent(1)->space_after(1)->canonical(1);
15  
16 # В json
17 3 ▶sub to_json(;$) {
Subroutine to_json: called CC=2 SCAR=6.9
Pod documented
18 3 ▶ $JSON->encode(@_ == 0? $_: @_)
Branch: 1 branch
BranchTrueFalseTotal
@_ == 0 ? : 1 2 3
19 }
20  
21 # Из json
22 4 ▶sub from_json(;$) {
Subroutine from_json: called CC=2 SCAR=6.9
Pod documented
23 4 ▶ $JSON->decode(@_ == 0? $_: @_)
Branch: 1 branch
BranchTrueFalseTotal
@_ == 0 ? : 2 2 4
24 }
25  
26 1 1;
27  
28 __END__
« Format/Yaml.pm ↑ Summary