lib/Rex/Inventory/DMIDecode/Memory.pm

filter: Statementstmt 85.1% 23 / 27 Branchbran 25.0% 1 / 4 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 2 totaltotal 70.4% 31 / 44 CC 4 SCAR 9.8
CC
4
Cov
74%
get
5.3
new
2.1
BEGIN
1.0
CRAP 2.7
« lib/Rex/Group/Lookup/File.pm ↑ Summary lib/Rex/Hook.pm »
1 #
2 # (c) Jan Gehring <jan.gehring@gmail.com>
3 #
4  
5 package Rex::Inventory::DMIDecode::Memory;
6  
7 40 ▶use v5.14.4;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 40 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 40 our $VERSION = '1.16.1'; # VERSION
11  
12 40 ▶use Rex::Inventory::DMIDecode::Section;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 40 ▶use base qw(Rex::Inventory::DMIDecode::Section);
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 40 __PACKAGE__->section("Memory Device");
16  
17 40 __PACKAGE__->has(
18 [
19 'Part Number', 'Serial Number', 'Type', 'Speed',
20 'Size', 'Manufacturer', 'Bank Locator', 'Form Factor',
21 'Locator',
22 ],
23 1
24 ); # is_array 1
25  
26 3 ▶sub new {
Subroutine new: called CC=2 SCAR=7.2
Pod undocumented
27 3 my $that = shift;
28 3 ▶ my $proto = ref($that) || $that;
Condition33%1/3
ref $that || $that
l!l&&r!l&&!r
030
MC/DC0%0/2
ref $that || $that
ref $that $that
Truth table33%1/3
A || B
A= ref $thatB= $that
ABresult
1X1
011
000
29 3 my $self = $that->SUPER::new(@_);
30  
31 3 bless( $self, $proto );
32  
33 3 return $self;
34 }
35  
36 3 ▶sub get {
Subroutine get: called CC=3 SCAR=16.7
Pod undocumented
37  
38 3 my ( $self, $key, $is_array ) = @_;
39 3 ▶ if ( $key eq "Type" ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($key eq "Type") 0 3 3
40 0 my $ret = $self->_search_for( $key, $is_array );
41 0 ▶ if ( $ret eq "<OUT OF SPEC>" ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($ret eq "<OUT OF SPEC>") 0 0 0
42 0 return "";
43 }
44  
45 0 return $ret;
46 }
47  
48 3 return $self->SUPER::get( $key, $is_array );
49  
50 }
51  
52 40 1;
« lib/Rex/Group/Lookup/File.pm ↑ Summary lib/Rex/Hook.pm »