Message/ConnAck.pm

filter: Statementstmt 100% 27 / 27 Branchbran 100% 4 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 10 / 10 Podpod 100% 3 / 3 totaltotal 100% 44 / 44 CC 3 SCAR 2.9
CC
3
Cov
100%
connack_reserved
2.0
return_code
2.0
BEGIN
1.0
CRAP 1.3
« Message/Publish.pm ↑ Summary Message/SubAck.pm »
1 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 package Net::MQTT::Message::ConnAck;
4 3 $Net::MQTT::Message::ConnAck::VERSION = '1.143250';
5 # ABSTRACT: Perl module to represent an MQTT ConnAck message
6  
7  
8 3 ▶use base 'Net::MQTT::Message';
Subroutine BEGIN: called CC=1 SCAR=0.0
9 3 ▶use Net::MQTT::Constants qw/:all/;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 sub message_type {
12 11 ▶ 2
Subroutine message_type: called CC=1 SCAR=0.0
Pod documented
13 }
14  
15  
16 4 ▶sub connack_reserved { shift->{connack_reserved} || 0 }
Subroutine connack_reserved: called CC=2 SCAR=6.9
Pod documented
Branch: 1 branch
BranchTrueFalseTotal
+(shift())->{"connack_reserved"} or 0 2 2 4
17  
18  
19 8 ▶sub return_code { shift->{return_code} || MQTT_CONNECT_ACCEPTED }
Subroutine return_code: called CC=2 SCAR=6.9
Pod documented
Branch: 1 branch
BranchTrueFalseTotal
+(shift())->{"return_code"} or 0 4 4 8
20  
21 sub _remaining_string {
22 4 ▶ my ($self, $prefix) = @_;
Subroutine _remaining_string: called CC=1 SCAR=0.0
23 4 connect_return_code_string($self->return_code).
24 ' '.$self->SUPER::_remaining_string($prefix)
25 }
26  
27 sub _parse_remaining {
28 2 ▶ my $self = shift;
Subroutine _parse_remaining: called CC=1 SCAR=0.0
29 2 my $offset = 0;
30 2 $self->{connack_reserved} = decode_byte($self->{remaining}, \$offset);
31 2 $self->{return_code} = decode_byte($self->{remaining}, \$offset);
32 2 substr $self->{remaining}, 0, $offset, '';
33 }
34  
35 sub _remaining_bytes {
36 4 ▶ my $self = shift;
Subroutine _remaining_bytes: called CC=1 SCAR=0.0
37 4 my $o = encode_byte($self->connack_reserved);
38 4 $o .= encode_byte($self->return_code);
39 }
40  
41 3 1;
42  
43 __END__
« Message/Publish.pm ↑ Summary Message/SubAck.pm »