JSON/Response.pm

filter: Statementstmt 90.9% 20 / 22 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 85.7% 6 / 7 Podpod n/a totaltotal 89.6% 26 / 29 CC 1 SCAR 1.3
CC
1
Cov
91%
__ANON__
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.1
« JSON.pm ↑ Summary
1 package UserAgent::Any::JSON::Response;
2  
3 4 ▶use 5.036;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 4 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 4 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 4 ▶use Scalar::Util 'blessed';
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 4 ▶use namespace::clean;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 4 our $VERSION = 0.03;
12  
13 4 extends 'UserAgent::Any::Response';
14  
15 has _converter => (
16 init_arg => 'converter',
17 is => 'ro',
18 lazy => 1,
19 0 ▶ default => sub { require JSON; JSON->new },
Subroutine __ANON__: not called CC=1 SCAR=6.9
20 4 );
21  
22 has json => (
23 is => 'ro',
24 lazy => 1,
25 # TODO: here we should maybe check the Content-Type header of the response
26 # (for application/json) before proceeding.
27 1 ▶ default => sub ($self) { return $self->_converter->decode($self->content) },
Subroutine __ANON__: called CC=1 SCAR=0.0
28 4 );
29  
30 4 1;
31  
32 __END__
« JSON.pm ↑ Summary