HTTP/Message/JSON.pm

filter: Statementstmt 100% 15 / 15 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod 100% 1 / 1 totaltotal 100% 22 / 22 CC 2 SCAR 3.4
CC
2
Cov
100%
content_is_text
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.4
« HTTP/Response/JSON.pm ↑ Summary HTTP/Request/JSON.pm »
1 package HTTP::Message::JSON;
2  
3 5 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 5 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 5 ▶no warnings 'uninitialized';
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 5 our $VERSION = $LWP::JSON::Tiny::VERSION;
8  
9 =head1 NAME
10  
11 HTTP::Message::JSON - a very simple superclass for JSON HTTP messages
12  
13 =head1 DESCRIPTION
14  
15 This is a very simple superclass used by HTTP::Request::JSON and
16 HTTP::Response::JSON. It overrides the default behaviour of the HTTP::Headers
17 method content_is_text.
18  
19 =head2 content_is_text
20  
21 Returns TRUE if this is a message with content type application/json.
22 Otherwise uses the default behaviour of HTTP::Headers.
23  
24 =cut
25  
26 90 ▶sub content_is_text {
Subroutine content_is_text: called CC=2 SCAR=6.9
Pod documented
27 90 my ($self) = @_;
28  
29 90 ▶ if ($self->content_type eq 'application/json') {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->content_type eq 'application/json') { } 85 5 90
30 85 return 1;
31 } else {
32 5 return HTTP::Headers::content_is_text($self);
33 }
34 }
35  
36 5 1;
« HTTP/Response/JSON.pm ↑ Summary HTTP/Request/JSON.pm »