UCS/Chassis/Stats.pm

filter: Statementstmt 73.0% 19 / 26 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 66.6% 4 / 6 Podpod 0.0% 0 / 1 totaltotal 71.4% 25 / 35 CC 2 SCAR 9.0
CC
2
Cov
75%
new
6.0
__ANON__
1.3
BEGIN
1.0
CRAP 2.5
« UCS/Chassis.pm ↑ Summary UCS/Common/EnvironmentalStats.pm »
1 package Cisco::UCS::Chassis::Stats;
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 Scalar::Util qw(weaken);
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 2 our $VERSION = '0.51';
9  
10 2 our %V_MAP = (
11 inputPower => 'input_power',
12 inputPowerAvg => 'input_power_avg',
13 inputPowerMax => 'input_power_max',
14 inputPowerMin => 'input_power_min',
15 outputPower => 'output_power',
16 outputPowerAvg => 'output_power_avg',
17 outputPowerMax => 'output_power_max',
18 outputPowerMin => 'output_power_min',
19 thresholded => 'thresholded',
20 suspect => 'suspect',
21 timeCollected => 'time_collected',
22 );
23  
24 2 ▶{ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
25  
26 2 ▶ while ( my ($attribute, $pseudo) = each %V_MAP ) {
Branch: 1 branch
BranchTrueFalseTotal
if (() = each %Cisco::UCS::Chassis::Stats::V_MAP) 22 2 24
27 22 ▶ *{ __PACKAGE__ .'::'. $pseudo } = sub {
Subroutine __ANON__: not called CC=1 SCAR=2.6
28 0 my $self = shift;
29 0 return $self->{$attribute}
30 }
31 22 }
32 }
33  
34 0 ▶sub new {
Subroutine new: not called CC=2 SCAR=17.9
Pod undocumented
35 0 my ( $class, $args ) = @_;
36  
37 0 my $self = bless {}, $class;
38
39 0 foreach my $var ( keys %$args ) {
40 0 $self->{ $var } = $args->{ $var };
41 }
42  
43 0 return $self
44 }
45  
46 2 1;
47  
48 __END__
« UCS/Chassis.pm ↑ Summary UCS/Common/EnvironmentalStats.pm »