Common/Procedure/Return/Version_1_0/Error.pm

filter: Statementstmt 70.0% 14 / 20 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 60.0% 3 / 5 Podpod 0.0% 0 / 2 totaltotal 54.8% 17 / 31 CC 3 SCAR 13.5
CC
3
Cov
58%
make_data
6.0
deflate
6.0
BEGIN
1.0
CRAP 3.9
« Common/Marshal/HTTP.pm ↑ Summary Common/Message.pm »
1 #!/usr/bin/perl
2  
3 package JSON::RPC::Common::Procedure::Return::Version_1_0::Error;
4 3 $JSON::RPC::Common::Procedure::Return::Version_1_0::Error::VERSION = '0.11';
5 3 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 # ABSTRACT: JSON-RPC 1.0 error class.
7  
8 3 ▶use JSON::RPC::Common::TypeConstraints qw(JSONDefined);
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 3 ▶use namespace::clean -except => [qw(meta)];
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 3 extends qw(JSON::RPC::Common::Procedure::Return::Error);
13  
14 3 has '+data' => (
15 isa => JSONDefined,
16 );
17  
18 0 ▶sub make_data {
Subroutine make_data: not called CC=2 SCAR=17.9
Pod undocumented
19 0 my $self = shift;
20  
21 return {
22 0 ▶ message => ( $self->has_message ? $self->message : "Unknown error" ),
Branch: 1 branch
BranchTrueFalseTotal
$self->has_message ? : 0 0 0
23 code => $self->code, # might be null
24 };
25 }
26  
27 0 ▶sub deflate {
Subroutine deflate: not called CC=2 SCAR=17.9
Pod undocumented
28 0 my $self = shift;
29  
30 0 ▶ if ( $self->has_data ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->has_data) { } 0 0 0
31 0 return $self->data;
32 } else {
33 0 return $self->make_data;
34 }
35 }
36  
37 3 __PACKAGE__->meta->make_immutable();
38  
39 3 __PACKAGE__
40  
41 __END__
« Common/Marshal/HTTP.pm ↑ Summary Common/Message.pm »