lib/MetaPOD/Format/JSON/Decoder/v1.pm

filter: Statementstmt 91.6% 22 / 24 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 87.5% 7 / 8 Podpod 100% 1 / 1 totaltotal 90.9% 30 / 33 CC 1 SCAR 1.2
CC
1
Cov
92%
__ANON__
2.0
decode
1.0
BEGIN
1.0
CRAP 1.1
« lib/MetaPOD/Format/JSON/PostCheck/v1.pm ↑ Summary blib/lib/MetaPOD/Format/JSON/v1_1.pm »
1 6 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 6 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 package MetaPOD::Format::JSON::Decoder::v1;
5 6 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
6 6 $MetaPOD::Format::JSON::Decoder::v1::AUTHORITY = 'cpan:KENTNL';
7 }
8 {
9 6 $MetaPOD::Format::JSON::Decoder::v1::VERSION = '0.3.0';
10 }
11  
12 # ABSTRACT: C<JSON> to Structure translation layer
13  
14  
15 6 ▶use Moo::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
16 6 ▶use Try::Tiny qw( try catch );
Subroutine BEGIN: called CC=1 SCAR=0.0
17  
18  
19 13 ▶sub decode {
Subroutine decode: called CC=1 SCAR=0.2
Pod documented
20 13 my ( $self, $data ) = @_;
21 13 require JSON;
22 13 my $return;
23 13 ▶ try {
Subroutine __ANON__: called CC=1 SCAR=0.0
24 13 $return = JSON->new->decode($data);
25 }
26 0 ▶ catch {
Subroutine __ANON__: not called CC=1 SCAR=6.9
27 0 require MetaPOD::Exception::Decode::Data;
28 0 MetaPOD::Exception::Decode::Data->throw(
29 {
30 internal_message => $_,
31 data => $data,
32 previous_exception => $_,
33 }
34 );
35 13 };
36 13 return $return;
37 }
38  
39 6 1;
40  
41 __END__
« lib/MetaPOD/Format/JSON/PostCheck/v1.pm ↑ Summary blib/lib/MetaPOD/Format/JSON/v1_1.pm »