SDK/Core/Policy/Headers.pm

filter: Statementstmt 100% 21 / 21 Branchbran 75.0% 3 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 100% 1 / 1 totaltotal 96.7% 30 / 31 CC 5 SCAR 11.7
CC
5
Cov
96%
send
5.0
BEGIN
1.0
BEGIN
1.0
CRAP 3.2
« SDK/Storage/Tables/TransactionError.pm ↑ Summary SDK/Core/Error.pm »
1 13 ▶use v5.36;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 13 ▶use feature 'class';
Subroutine BEGIN: called CC=1 SCAR=0.0
3 13 ▶no warnings 'experimental::class';
Subroutine BEGIN: called CC=1 SCAR=0.0
4
5 13 ▶use Azure::SDK::Core::Policy;
Subroutine BEGIN: called CC=1 SCAR=0.0
6
7 13 class Azure::SDK::Core::Policy::Headers :isa(Azure::SDK::Core::Policy) {
8 13 field $headers :param :reader = {};
9
10 114 ▶ method send ($context, $request, $next) {
Subroutine send: called CC=5 SCAR=16.1
Pod documented
11 114 for my $name ( keys $headers->%* ) {
12 151 ▶ $request->set_header($name, $headers->{$name})
Branch: 1 branch
BranchTrueFalseTotal
unless defined $request->header($name) 142 9 151
13 unless defined $request->header($name);
14 }
15
16 114 my $per_call = $context->options_for('headers', {});
17 114 ▶ if ( ref $per_call eq 'HASH' ) {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $per_call eq "HASH") 114 0 114
18 114 for my $name ( keys $per_call->%* ) {
19 1 $request->set_header($name, $per_call->{$name});
20 }
21 }
22
23 114 return $next->($context, $request);
24 }
25 }
26
27 13 1;
28
29 __END__
« SDK/Storage/Tables/TransactionError.pm ↑ Summary SDK/Core/Error.pm »