| 1 | package Net::Amazon::S3::Operation::Bucket::Location::Response; | ||||||||||||||||||||||||||||
| 2 | # ABSTRACT: An internal class to handle bucket location response | ||||||||||||||||||||||||||||
| 3 | 99 | $Net::Amazon::S3::Operation::Bucket::Location::Response::VERSION = '0.992'; | |||||||||||||||||||||||||||
| 4 | 99 | ▶ | use Moose; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||
| 6 | 99 | extends 'Net::Amazon::S3::Response'; | |||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||
| 8 | 0 | ▶ | sub location { | ||||||||||||||||||||||||||
|
Subroutine
location: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 9 | 0 | $_[0]->_data->{location}; | |||||||||||||||||||||||||||
| 10 | } | ||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | 0 | ▶ | sub _parse_data { | ||||||||||||||||||||||||||
|
Subroutine
_parse_data: not called CC=3 SCAR=24.8
| |||||||||||||||||||||||||||||
| 13 | 0 | my ($self) = @_; | |||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||
| 15 | 0 | my $xpc = $self->xpath_context; | |||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | 0 | my $data = { | |||||||||||||||||||||||||||
| 18 | location => scalar $xpc->findvalue ("//s3:LocationConstraint"), | ||||||||||||||||||||||||||||
| 19 | }; | ||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||
| 21 | # S3 documentation: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketGETlocation.html | ||||||||||||||||||||||||||||
| 22 | # When the bucket's region is US East (N. Virginia), | ||||||||||||||||||||||||||||
| 23 | # Amazon S3 returns an empty string for the bucket's region | ||||||||||||||||||||||||||||
| 24 | $data->{location} = 'us-east-1' | ||||||||||||||||||||||||||||
| 25 | 0 | ▶ | if defined $data->{location} && $data->{location} eq ''; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $data->{"location"} and $data->{"location"} eq ""
MC/DC0%0/2
defined $data->{"location"} and $data->{"location"} eq ""
defined $data->{"location"}
$data->{"location"} eq ""
Truth table0%0/3
A and B
A= defined $data->{"location"}B= $data->{"location"} eq ""
| |||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||
| 27 | 0 | return $data; | |||||||||||||||||||||||||||
| 28 | } | ||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||
| 30 | 99 | 1; | |||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||
| 32 | __END__ | ||||||||||||||||||||||||||||