NetApp/Aggregate/Plex.pm

filter: Statementstmt 58.3% 28 / 48 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 63.6% 7 / 11 Podpod 75.0% 3 / 4 totaltotal 60.3% 38 / 63 CC 2 SCAR 7.3
CC
2
Cov
58%
BUILD
6.0
get_raidgroups
2.0
get_states
2.0
CRAP 2.1
« NetApp/Snapmirror.pm ↑ Summary NetApp.pm »
1  
2 package NetApp::Aggregate::Plex;
3  
4 1 our $VERSION = '500.002';
5 1 $VERSION = eval $VERSION; ## no critic: StringyEval
6  
7 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶use English;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 1 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 1 ▶use Class::Std;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 1 ▶use Params::Validate qw( :all );
Subroutine BEGIN: called CC=1 SCAR=0.0
14 1 ▶use Regexp::Common;
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 {
17  
18 1 my %name_of :ATTR( get => 'name' );
19 1 my %state_of :ATTR;
20  
21 1 my %raidgroups_of :ATTR;
22  
23 0 ▶ sub BUILD {
Subroutine BUILD: not called CC=2 SCAR=17.9
Pod undocumented
24  
25 0 my ($self,$ident,$args_ref) = @_;
26  
27 0 my @args = %$args_ref;
28  
29 0 my (%args) = validate( @args, {
30 name => { type => SCALAR },
31 state => { type => HASHREF },
32 raidgroups => { type => ARRAYREF },
33 });
34  
35 0 $name_of{$ident} = $args{name};
36 0 $state_of{$ident} = $args{state};
37  
38 0 $raidgroups_of{$ident} = [];
39  
40 0 foreach my $raidgroup ( @{ $args{raidgroups} } ) {
41 0 push @{ $raidgroups_of{$ident} },
42 NetApp::Aggregate::RAIDGroup->new( $raidgroup );
43 }
44  
45 }
46  
47 0 ▶ sub get_raidgroups {
Subroutine get_raidgroups: not called CC=1 SCAR=6.9
Pod documented
48 0 my $self = shift;
49 0 my $ident = ident $self;
50 0 return @{ $raidgroups_of{$ident} };
51 }
52  
53 0 ▶ sub get_states {
Subroutine get_states: not called CC=1 SCAR=6.9
Pod documented
54 0 return keys %{ $state_of{ident shift} };
55 }
56  
57 0 ▶ sub get_state {
Subroutine get_state: not called CC=1 SCAR=6.9
Pod documented
58
59 0 my $self = shift;
60 0 my $ident = ident $self;
61 0 my $state = shift;
62  
63 0 return $state_of{$ident}->{$state};
64  
65 }
66  
67 }
68  
69 1 1;
« NetApp/Snapmirror.pm ↑ Summary NetApp.pm »