StorageSystem/Disk.pm

filter: Statementstmt 67.8% 19 / 28 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 66.6% 4 / 6 Podpod 0.0% 0 / 1 totaltotal 58.9% 23 / 39 CC 4 SCAR 16.9
CC
4
Cov
59%
new
12.0
__ANON__
4.3
BEGIN
1.0
CRAP 5.4
« StorageSystem/Snapshot.pm ↑ Summary StorageSystem/Drive.pm »
1 package IBM::StorageSystem::Disk;
2  
3 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 2 ▶use Carp qw(croak);
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 2 our $VERSION = '0.01';
9 2 our @ATTR = qw(Name File_system Failure_group Type Pool Status Availability Timestamp Block_properties);
10  
11 2 foreach my $attr ( map lc, @ATTR ) {
12 {
13 2 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
14 18 ▶ *{ __PACKAGE__ .'::'. $attr } = sub {
Subroutine __ANON__: not called CC=2 SCAR=14.6
15 0 my( $self, $val ) = @_;
16 0 ▶ $self->{$attr} = $val if $val;
Branch: 1 branch
BranchTrueFalseTotal
if $val 0 0 0
17 0 return $self->{$attr}
18 }
19 18 }
20 }
21  
22 0 ▶sub new {
Subroutine new: not called CC=3 SCAR=24.8
Pod undocumented
23 0 my( $class, $ibm, %args ) = @_;
24 0 my $self = bless {}, $class;
25 0 ▶ defined $args{Name} or croak 'Constructor failed: mandatory Name argument not supplied';
Branch: 1 branch
BranchTrueFalseTotal
defined $args{"Name"} or croak("Constructor failed: mandatory Name argument not supplied") 0 0 0
26  
27 0 foreach my $attr ( @ATTR ) { $self->{lc $attr} = $args{$attr} }
28  
29 0 return $self
30 }
31  
32 2 1;
33  
34 __END__
« StorageSystem/Snapshot.pm ↑ Summary StorageSystem/Drive.pm »