blib/lib/Rex/Interface/Cache.pm

filter: Statementstmt 94.4% 17 / 18 Branchbran 50.0% 2 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod 0.0% 0 / 1 totaltotal 85.1% 23 / 27 CC 3 SCAR 5.7
CC
3
Cov
86%
create
3.1
BEGIN
1.0
BEGIN
1.0
CRAP 1.8
« lib/Rex/Interface/File/Base.pm ↑ Summary lib/Rex/Interface/Cache/Base.pm »
1 #
2 # (c) Jan Gehring <jan.gehring@gmail.com>
3 #
4  
5 package Rex::Interface::Cache;
6  
7 144 ▶use v5.14.4;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 144 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 105 our $VERSION = '1.16.1'; # VERSION
11  
12 115 ▶sub create {
Subroutine create: called CC=3 SCAR=11.2
Pod undocumented
13 121 my ( $class, $type ) = @_;
14  
15 115 ▶ unless ($type) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($type) 115 0 115
16 115 $type = Rex::Config->get_cache_type;
17 }
18  
19 115 my $class_name = "Rex::Interface::Cache::$type";
20 115 ▶ eval "use $class_name;";
Subroutine BEGIN: called CC=1 SCAR=0.0
21 0 ▶ if ($@) { die("Error loading connection interface $type.\n$@"); }
Branch: 1 branch
BranchTrueFalseTotal
if ($@) 0 115 115
22  
23 115 return $class_name->new;
24 }
25  
26 105 1;
« lib/Rex/Interface/File/Base.pm ↑ Summary lib/Rex/Interface/Cache/Base.pm »