WebSocket/Base/DataFrame.pm

filter: Statementstmt 80.7% 21 / 26 Branchbran 75.0% 3 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 83.3% 5 / 6 Podpod 0.0% 0 / 1 totaltotal 78.3% 29 / 37 CC 3 SCAR 6.5
CC
3
Cov
80%
_assemble_length
3.1
set_fin
2.0
BEGIN
1.0
CRAP 1.9
« WebSocket/X/UnfinishedStream.pm ↑ Summary WebSocket/Handshake/Extension.pm »
1 package Net::WebSocket::Base::DataFrame;
2  
3 6 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 6 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 6 use parent qw(
7 Net::WebSocket::Frame
8 Net::WebSocket::Base::Typed
9 6 ▶);
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 6 ▶use constant is_control_frame => 0;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 sub _assemble_length {
14 59 ▶ my ($class, $payload_sr) = @_;
Subroutine _assemble_length: called CC=3 SCAR=11.3
15  
16 59 my ($byte2, $len_len);
17  
18 59 ▶ if (length $$payload_sr < 126) {
Branch: 2 branches
BranchTrueFalseTotal
if (length $$payload_sr < 126) { } 57 2 59
elsif (length $$payload_sr < 65536) { } 2 0 2
19 57 $byte2 = chr(length $$payload_sr);
20 57 $len_len = q<>;
21 }
22 elsif (length $$payload_sr < 65536) {
23 2 $byte2 = "\x7e"; #126
24 2 $len_len = pack 'n', length $$payload_sr;
25 }
26 else {
27 0 $byte2 = "\x7f"; #127
28 0 $len_len = pack 'Q>', length $$payload_sr;
29 }
30  
31 59 return ($byte2, $len_len);
32 }
33  
34 sub set_fin {
35 0 ▶ my ($self) = @_;
Subroutine set_fin: not called CC=1 SCAR=6.9
Pod undocumented
36  
37 0 $self->_activate_highest_bit( $self->[$self->FIRST2], 0 );
38  
39 0 return $self;
40 }
41  
42 6 1;
« WebSocket/X/UnfinishedStream.pm ↑ Summary WebSocket/Handshake/Extension.pm »