lib/Rex/Inventory/Proc.pm

filter: Statementstmt 100% 21 / 21 Branchbran n/a Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 2 totaltotal 82.3% 28 / 34 CC 2 SCAR 2.6
CC
2
Cov
92%
new
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« lib/Rex/Inventory/Bios.pm ↑ Summary lib/Rex/Helper/Encode.pm »
1 #
2 # (c) Jan Gehring <jan.gehring@gmail.com>
3 #
4  
5 package Rex::Inventory::Proc;
6  
7 2 ▶use v5.14.4;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 2 our $VERSION = '1.16.1'; # VERSION
11  
12 2 ▶use Rex::Inventory::Proc::Cpuinfo;
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 2 ▶sub new {
Subroutine new: called CC=2 SCAR=7.1
Pod undocumented
15 2 my $that = shift;
16 2 ▶ my $proto = ref($that) || $that;
Condition33%1/3
ref $that || $that
l!l&&r!l&&!r
020
MC/DC0%0/2
ref $that || $that
ref $that $that
Truth table33%1/3
A || B
A= ref $thatB= $that
ABresult
1X1
011
000
17 2 my $self = {@_};
18  
19 2 bless( $self, $proto );
20  
21 2 $self->_read_proc();
22  
23 2 return $self;
24 }
25  
26 2 ▶sub _read_proc {
Subroutine _read_proc: called CC=1 SCAR=0.0
27 2 my ($self) = @_;
28  
29 2 my $p_cpu = Rex::Inventory::Proc::Cpuinfo->new;
30  
31 2 $self->{__proc__} = { cpus => $p_cpu->get, };
32 }
33  
34 1 ▶sub get_cpus {
Subroutine get_cpus: called CC=1 SCAR=0.0
Pod undocumented
35 1 my ($self) = @_;
36 1 return $self->{__proc__}->{cpus};
37 }
38  
39 2 1;
« lib/Rex/Inventory/Bios.pm ↑ Summary lib/Rex/Helper/Encode.pm »