SDK/Core/Response.pm

filter: Statementstmt 100% 30 / 30 Branchbran 75.0% 3 / 4 Conditioncond 55.5% 5 / 9 MC/DCmcdc 33.3% 2 / 6 Subroutinesub 100% 11 / 11 Podpod 100% 4 / 4 totaltotal 85.9% 55 / 64 CC 6 SCAR 6.8
CC
6
Cov
88%
__ANON__
3.5
decoded_json
3.0
is_success
2.1
CRAP 2.0
« SDK/Core/ClientOptions.pm ↑ Summary SDK/Core/Context.pm »
1 21 ▶use v5.36;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 21 ▶use feature 'class';
Subroutine BEGIN: called CC=1 SCAR=0.0
3 21 ▶no warnings 'experimental::class';
Subroutine BEGIN: called CC=1 SCAR=0.0
4
5 21 ▶use Azure::SDK::Core::Headers;
Subroutine BEGIN: called CC=1 SCAR=0.0
6
7 21 class Azure::SDK::Core::Response {
8 21 ▶ use Carp qw(croak);
Subroutine BEGIN: called CC=1 SCAR=0.0
9 21 ▶ use JSON::PP ();
Subroutine BEGIN: called CC=1 SCAR=0.0
10
11 21 field $status :param :reader = undef;
12 21 field $headers :param = {};
13 21 field $body :param :reader = undef;
14
15 195 ▶ ADJUST {
Subroutine __ANON__: called CC=3 SCAR=12.5
16 195 ▶ croak 'Azure::SDK::Core::Response requires a numeric status'
Branch: 1 branch
BranchTrueFalseTotal
unless defined $status and $status =~ /\A[0-9]+\z/u 0 195 195
Condition33%1/3
defined $status and $status =~ /\A[0-9]+\z/u
!ll&&!rl&&r
00195
MC/DC0%0/2
defined $status and $status =~ /\A[0-9]+\z/u
defined $status $status =~ /\A[0-9]+\z/u
Truth table33%1/3
A and B
A= defined $statusB= $status =~ /\A[0-9]+\z/u
ABresult
0X0
100
111
17 unless defined $status && $status =~ /\A[0-9]+\z/;
18 195 $status = 0 + $status;
19 195 $headers = Azure::SDK::Core::Headers->new(headers => $headers);
20 }
21
22 3 ▶ method headers () {
Subroutine headers: called CC=1 SCAR=0.0
Pod documented
23 3 return $headers->as_hashref;
24 }
25
26 127 ▶ method header ($name) {
Subroutine header: called CC=1 SCAR=0.0
Pod documented
27 127 return $headers->get($name);
28 }
29
30 111 ▶ method is_success () {
Subroutine is_success: called CC=2 SCAR=7.2
Pod documented
31 111 ▶ return $status >= 200 && $status < 300;
Condition66%2/3
$status >= 200 && $status < 300
!ll&&!rl&&r
03576
MC/DC50%1/2
$status >= 200 && $status < 300
$status >= 200 $status < 300
Truth table66%2/3
A && B
A= $status >= 200B= $status < 300
ABresult
0X0
100
111
32 }
33
34 36 ▶ method decoded_json () {
Subroutine decoded_json: called CC=3 SCAR=11.1
Pod documented
35 36 ▶ return undef unless defined $body && length $body;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $body and length $body 5 31 36
Condition66%2/3
defined $body and length $body
!ll&&!rl&&r
5031
MC/DC50%1/2
defined $body and length $body
defined $body length $body
Truth table66%2/3
A and B
A= defined $bodyB= length $body
ABresult
0X0
100
111
36 31 return JSON::PP->new->utf8->decode($body);
37 }
38 }
39
40 21 1;
41
42 __END__
« SDK/Core/ClientOptions.pm ↑ Summary SDK/Core/Context.pm »