ACME2/HTTP/Response.pm

filter: Statementstmt 90.4% 19 / 21 Branchbran n/a Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 85.7% 6 / 7 Podpod 0.0% 0 / 2 totaltotal 74.2% 26 / 35 SCAR 7.0
CC
2
Cov
83%
content_struct
2.1
die_because_unexpected
2.0
BEGIN
1.0
CRAP 2.0
« ACME2/Challenge/dns_01.pm ↑ Summary ACME2/JWTMaker/ECC.pm »
1 package Net::ACME2::HTTP::Response;
2  
3 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 2 ▶use parent qw( HTTP::Tiny::UA::Response );
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 2 ▶use JSON ();
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 2 ▶use Net::ACME2::X ();
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 sub die_because_unexpected {
13 0 ▶ my ($self) = @_;
Subroutine die_because_unexpected: not called CC=1 SCAR=6.9
Pod undocumented
14  
15 0 die Net::ACME2::X->create(
16 'UnexpectedResponse',
17 {
18 uri => $self->url(),
19 status => $self->status(),
20 reason => $self->reason(),
21 headers => $self->headers(),
22 },
23 );
24 }
25  
26 #Useful for everything but certificate issuance, apparently?
27 sub content_struct {
28 2 ▶ my ($self) = @_;
Subroutine content_struct: called CC=2 SCAR=7.6
Pod undocumented
29  
30 2 ▶ my $json = ($self->{'_json'} ||= JSON->new()->allow_nonref());
Condition33%1/3
$self->{"_json"} ||= "JSON"->new->allow_nonref
l!l&&r!l&&!r
020
MC/DC0%0/2
$self->{"_json"} ||= "JSON"->new->allow_nonref
$self->{"_json"} "JSON"->new->allow_nonref
Truth table33%1/3
A ||= B
A= $self->{"_json"}B= "JSON"->new->allow_nonref
ABresult
1X1
011
000
31  
32 2 return $json->decode( $self->content() );
33 }
34  
35 2 1;
« ACME2/Challenge/dns_01.pm ↑ Summary ACME2/JWTMaker/ECC.pm »