lib/Rex/User.pm

filter: Statementstmt 78.1% 25 / 32 Branchbran 50.0% 6 / 12 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod 0.0% 0 / 1 totaltotal 73.0% 38 / 52 CC 7 SCAR 18.2
CC
7
Cov
70%
get
10.6
BEGIN
1.0
BEGIN
1.0
CRAP 6.2
« blib/lib/Rex/Config.pm ↑ Summary lib/Rex/Interface/Fs/Sudo.pm »
1 #
2 # (c) Jan Gehring <jan.gehring@gmail.com>
3 #
4  
5 package Rex::User;
6  
7 33 ▶use v5.14.4;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 33 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 33 our $VERSION = '1.16.1'; # VERSION
11  
12 33 ▶use Rex::Commands::Gather;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 33 ▶use Rex::Logger;
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 2 ▶sub get {
Subroutine get: called CC=7 SCAR=23.6
Pod undocumented
16  
17 2 my $user_o = "Linux";
18 2 ▶ if (is_freebsd) {
Branch: 5 branches
BranchTrueFalseTotal
if (is_freebsd()) { } 0 2 2
elsif (is_netbsd()) { } 0 2 2
elsif (is_openbsd()) { } 0 2 2
elsif (operating_system_is('SunOS')) { } 0 2 2
elsif (is_openwrt()) { } 0 2 2
19 0 $user_o = "FreeBSD";
20 }
21 elsif (is_netbsd) {
22 0 $user_o = "NetBSD";
23 }
24 elsif (is_openbsd) {
25 0 $user_o = "OpenBSD";
26 }
27 elsif ( operating_system_is("SunOS") ) {
28 0 $user_o = "SunOS";
29 }
30 elsif (is_openwrt) {
31 0 $user_o = "OpenWrt";
32 }
33  
34 2 my $class = "Rex::User::" . $user_o;
35 2 ▶ eval "use $class";
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
36  
37 2 ▶ if ($@) {
Branch: 1 branch
BranchTrueFalseTotal
if ($@) 0 2 2
38  
39 0 Rex::Logger::info("OS not supported");
40 0 die("OS not supported");
41  
42 }
43  
44 2 return $class->new;
45  
46 }
47  
48 33 1;
« blib/lib/Rex/Config.pm ↑ Summary lib/Rex/Interface/Fs/Sudo.pm »