UCS/FEX.pm

filter: Statementstmt 65.0% 26 / 40 Branchbran 25.0% 2 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 62.5% 5 / 8 Podpod 0.0% 0 / 1 totaltotal 57.8% 33 / 57 CC 4 SCAR 20.7
CC
4
Cov
58%
new
20.0
__ANON__
1.3
__ANON__
1.3
CRAP 8.0
« UCS/Interconnect.pm ↑ Summary UCS/Fault.pm »
1 package Cisco::UCS::FEX;
2  
3 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 2 ▶use Carp qw(croak);
Subroutine BEGIN: called CC=1 SCAR=0.0
7 2 ▶use Scalar::Util qw(weaken);
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 2 our $VERSION = '0.51';
10  
11 2 our @ATTRIBUTES = qw(discovery dn id model operability perf power presence
12 revision serial side thermal vendor voltage);
13  
14 2 our %ATTRIBUTES = (
15 chassis_id => 'chassisId',
16 config_state => 'configState',
17 oper_state => 'operState',
18 peer_status => 'peerCommStatus',
19 switch_id => 'switchId',
20 );
21  
22 {
23 2 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
24  
25 2 ▶ while ( my ( $pseudo, $attribute ) = each %ATTRIBUTES ) {
Branch: 1 branch
BranchTrueFalseTotal
if (() = each %Cisco::UCS::FEX::ATTRIBUTES) 10 2 12
26 10 ▶ *{ __PACKAGE__ . '::' . $pseudo } = sub {
Subroutine __ANON__: not called CC=1 SCAR=2.6
27 0 my $self = shift;
28 0 return $self->{$attribute}
29 }
30 10 }
31  
32 2 foreach my $attribute ( @ATTRIBUTES ) {
33 28 ▶ *{ __PACKAGE__ . '::' . $attribute } = sub {
Subroutine __ANON__: not called CC=1 SCAR=2.6
34 0 my $self = shift;
35 0 return $self->{$attribute}
36 }
37 28 }
38  
39 }
40  
41 0 ▶sub new {
Subroutine new: not called CC=4 SCAR=30.0
Pod undocumented
42 0 my ( $class, %args ) = @_;
43  
44 0 my $self = {};
45 0 bless $self, $class;
46  
47 defined $args{dn}
48 ? $self->{dn} = $args{dn}
49 0 ▶ : croak 'dn not defined';
Branch: 1 branch
BranchTrueFalseTotal
defined $args{'dn'} ? : 0 0 0
50  
51 defined $args{ucs}
52 ? weaken($self->{ucs} = $args{ucs})
53 0 ▶ : croak 'ucs not defined';
Branch: 1 branch
BranchTrueFalseTotal
defined $args{'ucs'} ? : 0 0 0
54  
55 0 my %attr = %{ $self->{ucs}->resolve_dn(
56 dn => $self->{dn}
57 0 )->{outConfig}->{equipmentIOCard}};
58
59 0 ▶ while ( my ($k, $v) = each %attr ) { $self->{$k} = $v }
Branch: 1 branch
BranchTrueFalseTotal
if (() = each %attr) 0 0 0
60
61 0 return $self;
62 }
63  
64 2 1;
65  
66 __END__
« UCS/Interconnect.pm ↑ Summary UCS/Fault.pm »