| 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
Condition33%1/3
defined $status and $status =~ /\A[0-9]+\z/u
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
| |||||||||||||||||||||||||||||
| 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
MC/DC50%1/2
$status >= 200 && $status < 300
$status >= 200
$status < 300
Truth table66%2/3
A && B
A= $status >= 200B= $status < 300
| |||||||||||||||||||||||||||||
| 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
Condition66%2/3
defined $body and length $body
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
| |||||||||||||||||||||||||||||
| 36 | 31 | return JSON::PP->new->utf8->decode($body); | |||||||||||||||||||||||||||
| 37 | } | ||||||||||||||||||||||||||||
| 38 | } | ||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||
| 40 | 21 | 1; | |||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||
| 42 | __END__ | ||||||||||||||||||||||||||||