lib/Rex/Inventory/Hal/Object/Volume.pm

filter: Statementstmt 44.7% 17 / 38 Branchbran 0.0% 0 / 10 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 45.4% 5 / 11 Podpod 0.0% 0 / 6 totaltotal 31.4% 22 / 70 CC 7 SCAR 15.1
CC
7
Cov
33%
new
6.0
is_parition
6.0
is_mounted
6.0
CRAP 4.5
« lib/Rex/Report/Base.pm ↑ Summary lib/Rex/Interface/Shell/Base.pm »
1 #
2 # (c) Jan Gehring <jan.gehring@gmail.com>
3 #
4  
5 package Rex::Inventory::Hal::Object::Volume;
6  
7 1 ▶use v5.14.4;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶use Data::Dumper;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 1 our $VERSION = '1.16.1'; # VERSION
12  
13 1 ▶use Rex::Inventory::Hal::Object;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 1 ▶use base qw(Rex::Inventory::Hal::Object);
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 1 __PACKAGE__->has(
17 [
18  
19 { key => "block.device", accessor => "dev", },
20 { key => "volume.size", accessor => "size", },
21 { key => "volume.fstype", accessor => "fstype" },
22 { key => "volume.uuid", accessor => "uuid" },
23  
24 ]
25 );
26  
27 0 ▶sub new {
Subroutine new: not called CC=2 SCAR=17.9
Pod undocumented
28 0 my $that = shift;
29 0 ▶ my $proto = ref($that) || $that;
Condition0%0/3
ref $that || $that
l!l&&r!l&&!r
000
MC/DC0%0/2
ref $that || $that
ref $that $that
Truth table0%0/3
A || B
A= ref $thatB= $that
ABresult
1X1
011
000
30 0 my $self = {@_};
31  
32 0 bless( $self, $proto );
33  
34 0 return $self;
35 }
36  
37 0 ▶sub is_parition {
Subroutine is_parition: not called CC=2 SCAR=17.9
Pod undocumented
38  
39 0 my ($self) = @_;
40 0 ▶ return $self->get('volume.is_partition') eq "true" ? 1 : 0;
Branch: 1 branch
BranchTrueFalseTotal
$self->get('volume.is_partition') eq 'true' ? : 0 0 0
41  
42 }
43  
44 0 ▶sub is_mounted {
Subroutine is_mounted: not called CC=2 SCAR=17.9
Pod undocumented
45  
46 0 my ($self) = @_;
47 0 ▶ return $self->get('volume.is_mounted') eq "true" ? 1 : 0;
Branch: 1 branch
BranchTrueFalseTotal
$self->get('volume.is_mounted') eq 'true' ? : 0 0 0
48  
49 }
50  
51 0 ▶sub is_cdrom {
Subroutine is_cdrom: not called CC=2 SCAR=17.9
Pod undocumented
52  
53 0 my ($self) = @_;
54 0 ▶ if ( grep { /^storage\.cdrom$/ } $self->get('info.capabilities') ) {
Branch: 1 branch
BranchTrueFalseTotal
if (grep {/^storage\.cdrom$/u;} $self->get("info.capabilities")) 0 0 0
55 0 return 1;
56 }
57  
58 }
59  
60 0 ▶sub is_volume {
Subroutine is_volume: not called CC=2 SCAR=17.9
Pod undocumented
61  
62 0 my ($self) = @_;
63 0 ▶ if ( grep { !/^false$/ } $self->get('block.is_volume') ) {
Branch: 1 branch
BranchTrueFalseTotal
if (grep {not /^false$/u;} $self->get("block.is_volume")) 0 0 0
64 0 return 1;
65 }
66  
67 }
68  
69 0 ▶sub is_floppy {
Subroutine is_floppy: not called CC=2 SCAR=17.9
Pod undocumented
70  
71 0 my ($self) = @_;
72 0 ▶ if ( grep { /^floppy$/ } $self->get('storage.drive_type') ) {
Branch: 1 branch
BranchTrueFalseTotal
if (grep {/^floppy$/u;} $self->get("storage.drive_type")) 0 0 0
73 0 return 1;
74 }
75  
76 }
77  
78 1 1;
« lib/Rex/Report/Base.pm ↑ Summary lib/Rex/Interface/Shell/Base.pm »