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 18 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 18 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 #use Moo::Role;
7 #use Moo;
8  
9 sub get_service {
10 38 ▶ my (%opts) = @_;
Subroutine get_service: called CC=4 SCAR=13.9
Pod undocumented
11  
12 38 ▶ my $name = $opts{name} or die "name required";
Branch: 1 branch
BranchTrueFalseTotal
my $name = $opts{"name"} or die "name required" 1 37 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" 2 35 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}: $@" 1 34 35
21  
22 34 delete $opts{name};
23  
24 34 return $pkg->new(%opts);
25 }
26  
27 18 1;
28  
29 __END__
30  
31 =pod
32  
33 =encoding UTF-8
34  
35 =head1 NAME
36  
37 OpenStack::MetaAPI::API
38  
39 =head1 VERSION
40  
41 version 0.004
42  
43 =head1 AUTHOR
44  
45 Nicolas R <atoomic@cpan.org>
46  
47 =head1 COPYRIGHT AND LICENSE
48  
49 This software is copyright (c) 2019 by cPanel, Inc.
50  
51 This is free software; you can redistribute it and/or modify it under
52 the same terms as the Perl 5 programming language system itself.
53  
54 =cut
« MetaAPI/API/Service.pm ↑ Summary MetaAPI/Helpers/DataAsYaml.pm »