SDK/Core/Request.pm

filter: Statementstmt 100% 38 / 38 Branchbran 100% 10 / 10 Conditioncond 66.6% 6 / 9 MC/DCmcdc 50.0% 3 / 6 Subroutinesub 100% 12 / 12 Podpod 100% 5 / 5 totaltotal 92.5% 74 / 80 CC 9 SCAR 12.3
CC
9
Cov
95%
__ANON__
7.0
set_url
3.0
BEGIN
1.0
CRAP 3.4
« SDK/Storage/Blobs/BlobItem.pm ↑ Summary SDK/Storage/Tables/TransactionError.pm »
1 20 ▶use v5.36;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 20 ▶use feature 'class';
Subroutine BEGIN: called CC=1 SCAR=0.0
3 20 ▶no warnings 'experimental::class';
Subroutine BEGIN: called CC=1 SCAR=0.0
4
5 20 ▶use Azure::SDK::Core::Headers;
Subroutine BEGIN: called CC=1 SCAR=0.0
6
7 20 class Azure::SDK::Core::Request {
8 20 ▶ use Carp qw(croak);
Subroutine BEGIN: called CC=1 SCAR=0.0
9
10 # The :reader on $method generates an accessor literally named "method",
11 # which the parser flags as ambiguous with the class-feature "method" keyword
12 # used to declare the methods below. The keyword always wins (the accessor is
13 # only reachable as $request->method), so silence the advisory noise locally.
14 20 ▶ no warnings 'ambiguous';
Subroutine BEGIN: called CC=1 SCAR=0.0
15
16 20 field $method :param :reader = undef;
17 20 field $url :param :reader = undef;
18 20 field $headers :param = {};
19 20 field $body :param :reader = undef;
20
21 198 ▶ ADJUST {
Subroutine __ANON__: called CC=7 SCAR=19.5
22 198 ▶ croak 'Azure::SDK::Core::Request requires a method'
Branch: 1 branch
BranchTrueFalseTotal
unless defined $method and length $method 1 197 198
Condition66%2/3
defined $method and length $method
!ll&&!rl&&r
10197
MC/DC50%1/2
defined $method and length $method
defined $method length $method
Truth table66%2/3
A and B
A= defined $methodB= length $method
ABresult
0X0
100
111
23 unless defined $method && length $method;
24 197 ▶ croak 'Azure::SDK::Core::Request requires a url'
Branch: 1 branch
BranchTrueFalseTotal
unless defined $url and length $url 1 196 197
Condition66%2/3
defined $url and length $url
!ll&&!rl&&r
10196
MC/DC50%1/2
defined $url and length $url
defined $url length $url
Truth table66%2/3
A and B
A= defined $urlB= length $url
ABresult
0X0
100
111
25 unless defined $url && length $url;
26 196 $method = uc $method;
27 196 ▶ croak 'invalid HTTP method'
Branch: 1 branch
BranchTrueFalseTotal
if $method =~ /[^A-Z]/u 2 194 196
28 if $method =~ /[^A-Z]/;
29 194 ▶ croak 'invalid characters in url'
Branch: 1 branch
BranchTrueFalseTotal
if $url =~ /[\x00-\x20\x7f]/u 1 193 194
30 if $url =~ /[\x00-\x20\x7f]/;
31 193 $headers = Azure::SDK::Core::Headers->new(headers => $headers);
32 }
33
34 69 ▶ method headers () {
Subroutine headers: called CC=1 SCAR=0.0
Pod documented
35 69 return $headers->as_hashref;
36 }
37
38 1190 ▶ method header ($name) {
Subroutine header: called CC=1 SCAR=0.0
Pod documented
39 1190 return $headers->get($name);
40 }
41
42 628 ▶ method set_header ($name, $value) {
Subroutine set_header: called CC=1 SCAR=0.0
Pod documented
43 628 $headers->set($name, $value);
44 621 return $self;
45 }
46
47 38 ▶ method set_url ($new_url) {
Subroutine set_url: called CC=3 SCAR=11.0
Pod documented
48 38 ▶ croak 'invalid characters in url'
Branch: 1 branch
BranchTrueFalseTotal
if defined $new_url and $new_url =~ /[\x00-\x20\x7f]/u 1 37 38
Condition66%2/3
defined $new_url and $new_url =~ /[\x00-\x20\x7f]/u
!ll&&!rl&&r
0371
MC/DC50%1/2
defined $new_url and $new_url =~ /[\x00-\x20\x7f]/u
defined $new_url $new_url =~ /[\x00-\x20\x7f]/u
Truth table66%2/3
A and B
A= defined $new_urlB= $new_url =~ /[\x00-\x20\x7f]/u
ABresult
0X0
100
111
49 if defined $new_url && $new_url =~ /[\x00-\x20\x7f]/;
50 37 $url = $new_url;
51 37 return $self;
52 }
53
54 1 ▶ method with_body ($new_body) {
Subroutine with_body: called CC=1 SCAR=0.0
Pod documented
55 1 $body = $new_body;
56 1 return $self;
57 }
58 }
59
60 20 1;
61
62 __END__
« SDK/Storage/Blobs/BlobItem.pm ↑ Summary SDK/Storage/Tables/TransactionError.pm »