blib/lib/Amazon/Credentials/Utils.pm

filter: Statementstmt 88.2% 15 / 17 Branchbran 75.0% 3 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod 0.0% 0 / 1 totaltotal 84.6% 22 / 26 CC 3 SCAR 7.5
CC
3
Cov
86%
choose
3.2
BEGIN
1.0
BEGIN
1.0
CRAP 2.1
« blib/lib/Amazon/Credentials/Provider.pm ↑ Summary blib/lib/Amazon/Credentials/HTTP/Response.pm »
1 package Amazon::Credentials::Utils;
2  
3 20 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 20 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 20 ▶use parent qw(Exporter);
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 20 our @EXPORT_OK = qw(choose);
9  
10 ########################################################################
11 202 ▶sub choose(&) { ## no critic
Subroutine choose: called CC=3 SCAR=11.8
Pod undocumented
12 ########################################################################
13 202 my $code = shift;
14  
15 # Pass the correct context down to the block
16 202 ▶ if (wantarray) {
Branch: 2 branches
BranchTrueFalseTotal
if (wantarray) { } 8 194 202
elsif (defined wantarray) { } 194 0 194
17 8 return $code->();
18 }
19 elsif ( defined wantarray ) {
20 194 return scalar $code->();
21 }
22 else {
23 0 $code->();
24 0 return;
25 }
26 }
27  
28 20 1;
« blib/lib/Amazon/Credentials/Provider.pm ↑ Summary blib/lib/Amazon/Credentials/HTTP/Response.pm »