lib/Rex/Virtualization/Base.pm

filter: Statementstmt 72.0% 18 / 25 Branchbran 50.0% 1 / 2 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 83.3% 5 / 6 Podpod 0.0% 0 / 2 totaltotal 60.0% 24 / 40 CC 3 SCAR 9.2
CC
3
Cov
63%
new
6.0
execute
2.0
BEGIN
1.0
CRAP 2.5
« lib/Rex/Resource/firewall/Provider/base.pm ↑ Summary lib/Rex/Service/OpenBSD.pm »
1 #
2 # (c) Jan Gehring <jan.gehring@gmail.com>
3 #
4  
5 package Rex::Virtualization::Base;
6  
7 3 ▶use v5.14.4;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 3 our $VERSION = '1.16.1'; # VERSION
11  
12 0 ▶sub new {
Subroutine new: not called CC=2 SCAR=17.9
Pod undocumented
13 0 my $that = shift;
14 0 ▶ my $proto = ref($that) || $that;
Condition0%0/3
ref $that || $that
l!l&&r!l&&!r
000
MC/DC0%0/2
ref $that || $that
ref $that $that
Truth table0%0/3
A || B
A= ref $thatB= $that
ABresult
1X1
011
000
15 0 my $self = {@_};
16  
17 0 bless( $self, $proto );
18  
19 0 return $self;
20 }
21  
22 2 ▶sub execute {
Subroutine execute: called CC=2 SCAR=7.1
Pod undocumented
23 2 my ( $self, $action, $vmname, @opt ) = @_;
24  
25 2 my $mod = ref($self) . "::$action";
26 2 ▶ eval "use $mod;";
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
27  
28 2 ▶ if ($@) {
Branch: 1 branch
BranchTrueFalseTotal
if ($@) 0 2 2
29 0 Rex::Logger::info("No action $action available.");
30 0 die("No action $action available.");
31 }
32  
33 2 return $mod->execute( $vmname, @opt );
34  
35 }
36  
37 3 1;
« lib/Rex/Resource/firewall/Provider/base.pm ↑ Summary lib/Rex/Service/OpenBSD.pm »