WebSocket/Base/ControlFrame.pm

filter: Statementstmt 92.3% 24 / 26 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 8 / 8 Podpod 0.0% 0 / 1 totaltotal 89.1% 33 / 37 SCAR 7.0
CC
2
Cov
89%
_assemble_length
2.3
BEGIN
1.0
BEGIN
1.0
CRAP 2.0
« WebSocket/Handshake/Extension.pm ↑ Summary WebSocket/Endpoint/Client.pm »
1 package Net::WebSocket::Base::ControlFrame;
2  
3 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 4 use parent qw(
7 Net::WebSocket::Frame
8 Net::WebSocket::Base::Typed
9 4 ▶);
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 4 ▶use Net::WebSocket::X ();
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 4 ▶use constant get_fin => 1;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 4 ▶use constant is_control_frame => 1;
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 sub _assemble_length {
17 6 ▶ my ($class, $payload_sr) = @_;
Subroutine _assemble_length: called CC=2 SCAR=8.4
18  
19 6 ▶ if (length $$payload_sr > 125) {
Branch: 1 branch
BranchTrueFalseTotal
if (length $$payload_sr > 125) 0 6 6
20 0 my $type = $class->get_type();
21  
22 0 die Net::WebSocket::X->create('ControlPayloadTooLong', $type, $$payload_sr);
23 }
24  
25 6 return( chr(length $$payload_sr), q<> );
26 }
27  
28 sub new {
29 6 ▶ my ($class, @opts) = @_;
Subroutine new: called CC=1 SCAR=0.0
Pod undocumented
30  
31 6 return $class->SUPER::new(
32 @opts,
33 fin => 1,
34 );
35 }
36  
37 4 1;
« WebSocket/Handshake/Extension.pm ↑ Summary WebSocket/Endpoint/Client.pm »