Zoom5341/Get.pm

filter: Statementstmt 100% 38 / 38 Branchbran 81.2% 13 / 16 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 9 / 9 Podpod 0.0% 0 / 2 totaltotal 92.3% 60 / 65 CC 9 SCAR 8.8
CC
9
Cov
94%
get_up_stats
3.0
__ANON__
3.0
__ANON__
3.0
CRAP 2.4
« Zoom5341/Parse.pm ↑ Summary Zoom5341/Test.pm »
1 7 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 7 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 7 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6  
7 =head1 NAME
8  
9 Device::CableModem::Zoom5341::Get
10  
11 =head1 NOTA BENE
12  
13 This is part of the guts of Device::CableModem::Zoom5341. If you're
14 reading this, you're either developing the module, writing tests, or
15 coloring outside the lines; consider yourself warned.
16  
17 =cut
18  
19  
20 =head2 ->get_down_stats
21  
22 Return all the downstream stats as a hashref.
23 =cut
24 sub get_down_stats
25 2 ▶{
Subroutine get_down_stats: called CC=3 SCAR=11.0
Pod undocumented
26 2 my $self = shift;
27  
28 2 ▶ $self->parse_conn_stats unless $self->{conn_stats};
Branch: 1 branch
BranchTrueFalseTotal
unless $self->{"conn_stats"} 1 1 2
29 2 ▶ croak "No downstats" unless $self->{conn_stats}{down};
Branch: 1 branch
BranchTrueFalseTotal
unless $self->{"conn_stats"}{"down"} 1 1 2
30 1 return $self->{conn_stats}{down};
31 }
32  
33 =head2 ->get_up_stats
34  
35 Return all the upstream stats as a hashref.
36 =cut
37 sub get_up_stats
38 2 ▶{
Subroutine get_up_stats: called CC=3 SCAR=11.0
Pod undocumented
39 2 my $self = shift;
40  
41 2 ▶ $self->parse_conn_stats unless $self->{conn_stats};
Branch: 1 branch
BranchTrueFalseTotal
unless $self->{"conn_stats"} 0 2 2
42 2 ▶ croak "No upstats" unless $self->{conn_stats}{up};
Branch: 1 branch
BranchTrueFalseTotal
unless $self->{"conn_stats"}{"up"} 1 1 2
43 1 return $self->{conn_stats}{up};
44 }
45  
46  
47 =head2 ->get_down_freq
48  
49 Return an arrayref of downstream frequencies.
50  
51 =head2 ->get_down_mod
52  
53 Return an arrayref of downstream modulation schemata.
54  
55 =head2 ->get_down_power
56  
57 Return an arrayref of downstream power levels (dBmV).
58  
59 =head2 ->get_down_snr
60  
61 Return an arrayref of downstream SNRs (dB).
62 =cut
63  
64 7 for my $k (qw(freq mod power snr))
65 {
66 7 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
67 28 ▶ *{"get_down_$k"} = sub {
Subroutine __ANON__: called CC=3 SCAR=11.0
68 6 my $self = shift;
69 6 ▶ $self->parse_conn_stats unless $self->{conn_stats};
Branch: 1 branch
BranchTrueFalseTotal
unless $self->{"conn_stats"} 0 6 6
70 6 ▶ croak "No down ${k}stats" unless $self->{conn_stats}{down}{$k};
Branch: 1 branch
BranchTrueFalseTotal
unless $self->{"conn_stats"}{"down"}{$k} 1 5 6
71 5 return $self->{conn_stats}{down}{$k};
72 28 };
73 }
74  
75  
76 =head2 ->get_up_chanid
77  
78 Return an arrayref of upstream channel ids.
79  
80 =head2 ->get_up_freq
81  
82 Return an arrayref of upstream frequencies.
83  
84 =head2 ->get_up_bw
85  
86 Return an arrayref of upstream bandwidths (in the physical sense of the
87 width of the channel, not the logical sense of a data rate).
88  
89 =head2 ->get_up_power
90  
91 Return an arrayref of upstream power levels (dBmV).
92 =cut
93  
94 7 for my $k (qw(chanid freq bw power))
95 {
96 7 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
97 28 ▶ *{"get_up_$k"} = sub {
Subroutine __ANON__: called CC=3 SCAR=11.0
98 6 my $self = shift;
99 6 ▶ $self->parse_conn_stats unless $self->{conn_stats};
Branch: 1 branch
BranchTrueFalseTotal
unless $self->{"conn_stats"} 0 6 6
100 6 ▶ croak "No up ${k}stats" unless $self->{conn_stats}{up}{$k};
Branch: 1 branch
BranchTrueFalseTotal
unless $self->{"conn_stats"}{"up"}{$k} 1 5 6
101 5 return $self->{conn_stats}{up}{$k};
102 28 };
103 }
104  
105  
106  
107 7 1;
108 __END__
« Zoom5341/Parse.pm ↑ Summary Zoom5341/Test.pm »