lib/Rex/Helper/File/Stat/Win32.pm

filter: Statementstmt 33.3% 13 / 39 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 33.3% 4 / 12 Podpod 0.0% 0 / 8 totaltotal 26.9% 17 / 63 CC 3 SCAR 10.5
CC
3
Cov
30%
S_ISLNK
6.0
S_ISSOCK
6.0
S_ISDIR
2.0
CRAP 2.9
« lib/Rex/Commands/MD5.pm ↑ Summary lib/Rex/Interface/Shell/Idrac.pm »
1 #
2 # (c) Jan Gehring <jan.gehring@gmail.com>
3 #
4  
5 package Rex::Helper::File::Stat::Win32;
6  
7 52 ▶use v5.14.4;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 52 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 52 our $VERSION = '1.16.1'; # VERSION
11  
12 52 ▶use Fcntl;
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 52 ▶use Rex::Interface::Exec;
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 0 ▶sub S_ISDIR {
Subroutine S_ISDIR: not called CC=1 SCAR=6.9
Pod undocumented
17 0 shift;
18 0 Fcntl::S_ISDIR(@_);
19 }
20  
21 0 ▶sub S_ISREG {
Subroutine S_ISREG: not called CC=1 SCAR=6.9
Pod undocumented
22 0 shift;
23 0 Fcntl::S_ISREG(@_);
24 }
25  
26 0 ▶sub S_ISLNK {
Subroutine S_ISLNK: not called CC=2 SCAR=17.9
Pod undocumented
27 0 shift;
28 0 ▶ if ( Rex::is_ssh() ) {
Branch: 1 branch
BranchTrueFalseTotal
if (Rex::is_ssh()) { } 0 0 0
29 0 my $exec = Rex::Interface::Exec->create;
30 0 $exec->exec("perl -le 'use Fcntl; exit Fcntl::S_ISLNK($_[0])'");
31 0 return $?;
32 }
33 else {
34 0 Rex::Logger::info( "S_ISLNK not supported on your platform.", "warn" );
35 0 return 0;
36 }
37 }
38  
39 0 ▶sub S_ISBLK {
Subroutine S_ISBLK: not called CC=1 SCAR=6.9
Pod undocumented
40 0 shift;
41 0 Fcntl::S_ISBLK(@_);
42 }
43  
44 0 ▶sub S_ISCHR {
Subroutine S_ISCHR: not called CC=1 SCAR=6.9
Pod undocumented
45 0 shift;
46 0 Fcntl::S_ISCHR(@_);
47 }
48  
49 0 ▶sub S_ISFIFO {
Subroutine S_ISFIFO: not called CC=1 SCAR=6.9
Pod undocumented
50 0 shift;
51 0 Fcntl::S_ISFIFO(@_);
52 }
53  
54 0 ▶sub S_ISSOCK {
Subroutine S_ISSOCK: not called CC=2 SCAR=17.9
Pod undocumented
55 0 shift;
56  
57 0 ▶ if ( Rex::is_ssh() ) {
Branch: 1 branch
BranchTrueFalseTotal
if (Rex::is_ssh()) { } 0 0 0
58 0 my $exec = Rex::Interface::Exec->create;
59 0 $exec->exec("perl -le 'use Fcntl; exit Fcntl::S_ISSOCK($_[0])'");
60 0 return $?;
61 }
62 else {
63 0 Rex::Logger::info( "S_ISSOCK not supported on your platform.", "warn" );
64 0 return 0;
65 }
66 }
67  
68 0 ▶sub S_IMODE {
Subroutine S_IMODE: not called CC=1 SCAR=6.9
Pod undocumented
69 0 shift;
70 0 Fcntl::S_IMODE(@_);
71 }
72  
73 52 1;
« lib/Rex/Commands/MD5.pm ↑ Summary lib/Rex/Interface/Shell/Idrac.pm »