MetaAPI/API.pm

filter: Statementstmt 100% 19 / 19 Branchbran 100% 6 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod 0.0% 0 / 1 totaltotal 96.5% 28 / 29 CC 4 SCAR 11.0
CC
4
Cov
100%
get_service
4.0
BEGIN
1.0
BEGIN
1.0
CRAP 3.0
« MetaAPI/API/Service.pm ↑ Summary MetaAPI/Helpers/DataAsYaml.pm »
1 package OpenStack::MetaAPI::API;
2  
3 19 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 19 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 #use Moo::Role;
7 #use Moo;
8  
9 38 ▶sub get_service {
Subroutine get_service: called CC=4 SCAR=13.9
Pod undocumented
10 38 my (%opts) = @_;
11  
12 38 ▶ my $name = $opts{name} or die "name required";
Branch: 1 branch
BranchTrueFalseTotal
my $name = $opts{"name"} or die "name required" 37 1 38
13 37 ▶ my $auth = ref($opts{auth}) or die "auth required";
Branch: 1 branch
BranchTrueFalseTotal
my $auth = ref $opts{"auth"} or die "auth required" 35 2 37
14  
15 35 my $pkg = ucfirst $name;
16 35 $pkg = __PACKAGE__ . "::$pkg";
17  
18 35 (my $file = $pkg) =~ s{::}{/}g;
19 35 $file .= '.pm';
20 35 ▶ eval { require $file; 1 } or die "Failed to load $pkg: $@";
Branch: 1 branch
BranchTrueFalseTotal
eval { do { require $file; 1 } } or die "Failed to load ${pkg}: $@" 34 1 35
21  
22 34 delete $opts{name};
23  
24 34 return $pkg->new(%opts);
25 }
26  
27 19 1;
28  
29 __END__
« MetaAPI/API/Service.pm ↑ Summary MetaAPI/Helpers/DataAsYaml.pm »