WebSocket/Base/DataFrame.pm

filter: Statementstmt 73.0% 19 / 26 Branchbran 25.0% 1 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 83.3% 5 / 6 Podpod 0.0% 0 / 1 totaltotal 67.5% 25 / 37 CC 3 SCAR 8.3
CC
3
Cov
67%
_assemble_length
4.1
set_fin
2.0
BEGIN
1.0
CRAP 2.3
« WebSocket/PingStore.pm ↑ Summary WebSocket/Streamer.pm »
1 package Net::WebSocket::Base::DataFrame;
2  
3 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 3 use parent qw(
7 Net::WebSocket::Frame
8 Net::WebSocket::Base::Typed
9 3 ▶);
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 3 ▶use constant is_control_frame => 0;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 sub _assemble_length {
14 53 ▶ my ($class, $payload_sr) = @_;
Subroutine _assemble_length: called CC=3 SCAR=14.2
15  
16 53 my ($byte2, $len_len);
17  
18 53 ▶ if (length $$payload_sr < 126) {
Branch: 2 branches
BranchTrueFalseTotal
if (length $$payload_sr < 126) { } 53 0 53
elsif (length $$payload_sr < 65536) { } 0 0 0
19 53 $byte2 = chr(length $$payload_sr);
20 53 $len_len = q<>;
21 }
22 elsif (length $$payload_sr < 65536) {
23 0 $byte2 = "\x7e"; #126
24 0 $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 53 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 3 1;
« WebSocket/PingStore.pm ↑ Summary WebSocket/Streamer.pm »