Net/Amazon/S3/Role/Bucket.pm

filter: Statementstmt 100% 21 / 21 Branchbran 100% 8 / 8 Conditioncond 83.3% 10 / 12 MC/DCmcdc 66.6% 4 / 6 Subroutinesub 100% 4 / 4 Podpod n/a totaltotal 92.1% 47 / 51 CC 9 SCAR 19.5
CC
9
Cov
95%
__ANON__
9.0
BEGIN
1.0
BEGIN
1.0
CRAP 7.0
« Net/Amazon/S3/Operation/Bucket/Location/Response.pm ↑ Summary Net/Amazon/S3/Request/Role/XML/Content.pm »
1 package Net::Amazon::S3::Role::Bucket;
2 # ABSTRACT: Bucket role
3 99 $Net::Amazon::S3::Role::Bucket::VERSION = '0.992';
4 99 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 99 ▶use Scalar::Util;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 99 ▶use Safe::Isa ();
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 708 ▶around BUILDARGS => sub {
Subroutine __ANON__: called CC=9 SCAR=22.0
9 708 my ($orig, $class, %params) = @_;
10  
11 # bucket can be optional in HTTPRequest
12 708 ▶ if ($params{bucket}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($params{"bucket"}) 695 13 708
13 695 my $region = $params{region};
14 $region = $params{bucket}->region
15 if $params{bucket}
16 and Scalar::Util::blessed( $params{bucket} )
17 and ! $params{region}
18 and $params{bucket}->has_region
19 695 ▶ ;
Branch: 1 branch
BranchTrueFalseTotal
if $params{"bucket"} and builtin::blessed($params{"bucket"}) and not $params{"region"} and $params{"bucket"}->has_region 8 687 695
Condition88%8/9
$params{"bucket"} and builtin::blessed($params{"bucket"}) and not $params{"region"} and $params{"bucket"}->has_region
!ll&&!rl&&r
2644238
$params{"bucket"} and builtin::blessed($params{"bucket"}) and not $params{"region"}
!ll&&!rl&&r
19569431
$params{"bucket"} and builtin::blessed($params{"bucket"})
!ll&&!rl&&r
0195500
MC/DC75%3/4
$params{"bucket"} and builtin::blessed($params{"bucket"}) and not $params{"region"} and $params{"bucket"}->has_region
$params{"bucket"} builtin::blessed($params{"bucket"}) not $params{"region"} $params{"bucket"}->has_region
Truth table80%4/5
A and B and not(C) and D
A= $params{"bucket"}B= builtin::blessed($params{"bucket"})C= not $params{"region"}D= $params{"bucket"}->has_region
ABCDresult
0XXX0
10XX0
110X0
11100
11111
20  
21 $params{bucket} = $params{bucket}->name
22 695 ▶ if $params{bucket}->$Safe::Isa::_isa ('Net::Amazon::S3::Client::Bucket');
Branch: 1 branch
BranchTrueFalseTotal
if $params{"bucket"}->$Safe::Isa::_isa("Net::Amazon::S3::Client::Bucket") 4 691 695
23  
24 $params{bucket} = Net::Amazon::S3::Bucket->new(
25 bucket => $params{bucket},
26 account => $params{s3},
27 (region => $region) x!! $region,
28 695 ▶ ) if $params{bucket} and ! ref $params{bucket};
Branch: 1 branch
BranchTrueFalseTotal
if $params{"bucket"} and not ref $params{"bucket"} 199 496 695
Condition66%2/3
$params{"bucket"} and not ref $params{"bucket"}
!ll&&!rl&&r
0496199
MC/DC50%1/2
$params{"bucket"} and not ref $params{"bucket"}
$params{"bucket"} not ref $params{"bucket"}
Truth table66%2/3
A and not(B)
A= $params{"bucket"}B= not ref $params{"bucket"}
ABresult
0X0
100
111
29  
30 695 delete $params{region};
31 }
32  
33 708 $class->$orig( %params );
34 99 };
35  
36 99 has bucket => (
37 is => 'ro',
38 isa => 'Net::Amazon::S3::Bucket',
39 required => 1,
40 );
41  
42 99 1;
43  
44 __END__
« Net/Amazon/S3/Operation/Bucket/Location/Response.pm ↑ Summary Net/Amazon/S3/Request/Role/XML/Content.pm »