blib/lib/Clustericious/Coder/JSON.pm

filter: Statementstmt 94.4% 17 / 18 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 85.7% 6 / 7 Podpod 0.0% 0 / 1 totaltotal 88.4% 23 / 26 CC 1 SCAR 1.3
CC
1
Cov
94%
__ANON__
2.0
coder
1.0
BEGIN
1.0
CRAP 1.1
« blib/lib/Clustericious/HelloWorld.pm ↑ Summary corpus/log_commandline/SampleModule.pm »
1 package Clustericious::Coder::JSON;
2  
3 46 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 46 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 46 ▶use JSON::MaybeXS ();
Subroutine BEGIN: called CC=1 SCAR=0.0
6 46 ▶use 5.010;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 # ABSTRACT: JSON encoder for AutodataHandler
9 46 our $VERSION = '1.29'; # VERSION
10  
11 sub coder
12 100 ▶{
Subroutine coder: called CC=1 SCAR=0.1
Pod undocumented
13 100 my $json = JSON::MaybeXS->new
14 ->allow_nonref
15 ->allow_blessed
16 ->convert_blessed;
17  
18 my %coder = (
19 type => 'application/json',
20 format => 'json',
21 8 ▶ encode => sub { $json->encode($_[0]) },
Subroutine __ANON__: called CC=1 SCAR=0.0
22 0 ▶ decode => sub { $json->decode($_[0]) },
Subroutine __ANON__: not called CC=1 SCAR=6.9
23 100 );
24
25 100 \%coder;
26 }
27  
28 46 1;
29  
30 __END__
« blib/lib/Clustericious/HelloWorld.pm ↑ Summary corpus/log_commandline/SampleModule.pm »