lib/Rex/Interface/Shell/Idrac.pm

filter: Statementstmt 67.8% 19 / 28 Branchbran 50.0% 1 / 2 Conditioncond 16.6% 1 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 71.4% 5 / 7 Podpod 0.0% 0 / 3 totaltotal 52.0% 26 / 50 CC 4 SCAR 10.5
CC
4
Cov
58%
new
6.0
detect
3.5
exec
2.0
CRAP 2.9
« lib/Rex/Helper/File/Stat/Win32.pm ↑ Summary lib/Rex/Inventory/Proc/Cpuinfo.pm »
1 #
2 # (c) Ferenc Erki <erkiferenc@gmail.com>, adjust GmbH
3 #
4  
5 package Rex::Interface::Shell::Idrac;
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 3 ▶use Rex::Interface::Shell::Default;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 3 ▶use base qw(Rex::Interface::Shell::Default);
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 0 ▶sub new {
Subroutine new: not called CC=2 SCAR=17.9
Pod undocumented
16 0 my $class = shift;
17 0 ▶ my $proto = ref($class) || $class;
Condition0%0/3
ref $class || $class
l!l&&r!l&&!r
000
MC/DC0%0/2
ref $class || $class
ref $class $class
Truth table0%0/3
A || B
A= ref $classB= $class
ABresult
1X1
011
000
18 0 my $self = $proto->SUPER::new(@_);
19  
20 0 bless( $self, $class );
21  
22 0 return $self;
23 }
24  
25 2 ▶sub detect {
Subroutine detect: called CC=3 SCAR=12.6
Pod undocumented
26 2 my ( $self, $con ) = @_;
27  
28 2 my ($output);
29 2 eval {
30 2 ($output) = $con->direct_exec('version');
31 0 1;
32 };
33 2 ▶ if ( $output && $output =~ m/SM CLP Version: / ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($output and $output =~ /SM CLP Version: /u) 0 2 2
Condition33%1/3
$output and $output =~ /SM CLP Version: /u
!ll&&!rl&&r
200
MC/DC0%0/2
$output and $output =~ /SM CLP Version: /u
$output $output =~ /SM CLP Version: /u
Truth table33%1/3
A and B
A= $outputB= $output =~ /SM CLP Version: /u
ABresult
0X0
100
111
34 0 return 1;
35 }
36  
37 2 return 0;
38 }
39  
40 0 ▶sub exec {
Subroutine exec: not called CC=1 SCAR=6.9
Pod undocumented
41 0 my ( $self, $cmd, $option ) = @_;
42 0 return $cmd;
43 }
44  
45 3 1;
« lib/Rex/Helper/File/Stat/Win32.pm ↑ Summary lib/Rex/Inventory/Proc/Cpuinfo.pm »