Net/Amazon/S3/Signature.pm

filter: Statementstmt 66.6% 20 / 30 Branchbran 41.6% 5 / 12 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 57.1% 4 / 7 Podpod 100% 2 / 2 totaltotal 60.7% 31 / 51 CC 7 SCAR 15.0
CC
7
Cov
60%
_populate_default_query_param
12.0
_populate_default_header
3.1
_append_authorization_query_params
2.1
CRAP 4.5
« Net/Amazon/S3/ACL/Set.pm ↑ Summary Shared/Examples/Net/Amazon/S3.pm »
1 package Net::Amazon::S3::Signature;
2 # ABSTRACT: S3 Signature implementation base class
3 99 $Net::Amazon::S3::Signature::VERSION = '0.992';
4 99 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 99 has http_request => (
7 is => 'ro',
8 isa => 'Net::Amazon::S3::HTTPRequest',
9 );
10  
11 210 ▶sub _append_authorization_headers {
Subroutine _append_authorization_headers: called CC=2 SCAR=6.9
12 210 my ($self, $request) = @_;
13  
14 210 my %headers = $self->http_request->s3->authorization_context->authorization_headers;
15  
16 210 ▶ while (my ($key, $value) = each %headers) {
Branch: 1 branch
BranchTrueFalseTotal
if (() = each %headers) 1 210 211
17 1 $self->_populate_default_header ($request, $key => $value);
18 }
19  
20 210 ();
21 }
22  
23 6 ▶sub _append_authorization_query_params {
Subroutine _append_authorization_query_params: called CC=2 SCAR=7.4
24 6 my ($self, $request) = @_;
25  
26 6 my %headers = $self->http_request->s3->authorization_context->authorization_headers;
27  
28 6 ▶ while (my ($key, $value) = each %headers) {
Branch: 1 branch
BranchTrueFalseTotal
if (() = each %headers) 0 6 6
29 0 $self->_populate_default_query_param ($request, $key => $value);
30 }
31  
32 6 ();
33 }
34  
35 1 ▶sub _populate_default_header {
Subroutine _populate_default_header: called CC=3 SCAR=11.3
36 1 my ($self, $request, $key, $value) = @_;
37  
38 1 ▶ return unless defined $value;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $value 0 1 1
39 1 ▶ return if defined $request->header ($key);
Branch: 1 branch
BranchTrueFalseTotal
if defined $request->header($key) 0 1 1
40  
41 1 $request->header ($key => $value);
42  
43 1 ();
44 }
45  
46 0 ▶sub _populate_default_query_param {
Subroutine _populate_default_query_param: not called CC=3 SCAR=24.8
47 0 my ($self, $request, $key, $value) = @_;
48  
49 0 ▶ return unless defined $value;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $value 0 0 0
50 0 ▶ return if defined $request->uri->query_param ($key);
Branch: 1 branch
BranchTrueFalseTotal
if defined $request->uri->query_param($key) 0 0 0
51  
52 0 $request->uri->query_param ($key => $value);
53  
54 0 ();
55 }
56  
57 0 ▶sub sign_request {
Subroutine sign_request: not called CC=1 SCAR=6.9
Pod documented
58 0 my ($self, $request);
59  
60 0 return;
61 }
62  
63 0 ▶sub sign_uri {
Subroutine sign_uri: not called CC=1 SCAR=6.9
Pod documented
64 0 my ($self, $uri, $expires_at);
65  
66 0 return;
67 }
68  
69 99 1;
70  
71 __END__
« Net/Amazon/S3/ACL/Set.pm ↑ Summary Shared/Examples/Net/Amazon/S3.pm »