Net/Amazon/S3/Role/Bucket.pm

filter: Statementstmt 100% 21 / 21 Branchbran 87.5% 7 / 8 Conditioncond 83.3% 10 / 12 MC/DCmcdc 66.6% 4 / 6 Subroutinesub 100% 4 / 4 Podpod n/a totaltotal 90.2% 46 / 51 SCAR 22.0
CC
9
Cov
93%
__ANON__
9.1
BEGIN
1.0
BEGIN
1.0
CRAP 9.0
« Net/Amazon/S3/Request.pm ↑ Summary Net/Amazon/S3/Signature/V4.pm »
1 package Net::Amazon::S3::Role::Bucket;
2 # ABSTRACT: Bucket role
3 99 $Net::Amazon::S3::Role::Bucket::VERSION = '0.99';
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 around BUILDARGS => sub {
9 708 ▶ my ($orig, $class, %params) = @_;
Subroutine __ANON__: called CC=9 SCAR=22.1
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
2684198
$params{"bucket"} and builtin::blessed($params{"bucket"}) and not $params{"region"}
!ll&&!rl&&r
19969427
$params{"bucket"} and builtin::blessed($params{"bucket"})
!ll&&!rl&&r
0199496
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") 0 695 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__
45  
46 =pod
47  
48 =encoding UTF-8
49  
50 =head1 NAME
51  
52 Net::Amazon::S3::Role::Bucket - Bucket role
53  
54 =head1 VERSION
55  
56 version 0.99
57  
58 =head1 AUTHOR
59  
60 Branislav Zahradník <barney@cpan.org>
61  
62 =head1 COPYRIGHT AND LICENSE
63  
64 This software is copyright (c) 2021 by Amazon Digital Services, Leon Brocard, Brad Fitzpatrick, Pedro Figueiredo, Rusty Conover, Branislav Zahradník.
65  
66 This is free software; you can redistribute it and/or modify it under
67 the same terms as the Perl 5 programming language system itself.
68  
69 =cut
« Net/Amazon/S3/Request.pm ↑ Summary Net/Amazon/S3/Signature/V4.pm »