RFXCOM/Decoder.pm

filter: Statementstmt 100% 32 / 32 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 10 / 10 Podpod 100% 4 / 4 totaltotal 100% 46 / 46 SCAR 6.9
CC
2
Cov
100%
nibble_sum
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.0
« RFXCOM/Response/X10.pm ↑ Summary RFXCOM/Response/HomeEasy.pm »
1 5 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 5 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 package Device::RFXCOM::Decoder;
4 5 $Device::RFXCOM::Decoder::VERSION = '1.142010';
5 # ABSTRACT: Device::RFXCOM::Decoder base class for decoding RF messages
6  
7  
8 5 ▶use 5.006;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 5 ▶use constant DEBUG => $ENV{DEVICE_RFXCOM_DECODER_DEBUG};
Subroutine BEGIN: called CC=1 SCAR=0.0
10 5 ▶use Carp qw/croak/;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 5 ▶use Exporter;
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 5 our @ISA = qw(Exporter);
15 5 our %EXPORT_TAGS = ( 'all' => [ qw(lo_nibble hi_nibble nibble_sum) ] );
16 5 our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
17 5 our @EXPORT = qw();
18  
19  
20 sub new {
21 72 ▶ my $pkg = shift;
Subroutine new: called CC=1 SCAR=0.0
Pod documented
22 72 bless { @_ }, $pkg;
23 }
24  
25  
26 sub lo_nibble {
27 96 ▶ $_[0]&0xf;
Subroutine lo_nibble: called CC=1 SCAR=0.0
Pod documented
28 }
29  
30  
31 sub hi_nibble {
32 100 ▶ ($_[0]&0xf0)>>4;
Subroutine hi_nibble: called CC=1 SCAR=0.0
Pod documented
33 }
34  
35  
36 sub nibble_sum {
37 171 ▶ my $s = 0;
Subroutine nibble_sum: called CC=2 SCAR=6.9
Pod documented
38 171 foreach (0..$_[0]-1) {
39 3137 $s += $_[1]->[$_];
40 }
41 171 return $s;
42 }
43  
44 5 1;
45  
46 __END__
« RFXCOM/Response/X10.pm ↑ Summary RFXCOM/Response/HomeEasy.pm »