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 CC 2 SCAR 2.6
CC
2
Cov
89%
_assemble_length
2.3
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« WebSocket/X/BadToken.pm ↑ Summary WebSocket/Message.pm »
1 package Net::WebSocket::Base::ControlFrame;
2  
3 16 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 16 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 16 ▶use parent qw(
Subroutine BEGIN: called CC=1 SCAR=0.0
7 Net::WebSocket::Frame
8 16 );
9  
10 16 ▶use Net::WebSocket::X ();
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 16 ▶use constant get_fin => 1;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 16 ▶use constant is_control => 1;
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 63 ▶sub _assemble_length {
Subroutine _assemble_length: called CC=2 SCAR=8.4
16 63 my ($class, $payload_sr) = @_;
17  
18 63 ▶ if (length $$payload_sr > 125) {
Branch: 1 branch
BranchTrueFalseTotal
if (length $$payload_sr > 125) 0 63 63
19 0 my $type = $class->get_type();
20  
21 0 die Net::WebSocket::X->create('ControlPayloadTooLong', $type, $$payload_sr);
22 }
23  
24 63 return( chr(length $$payload_sr), q<> );
25 }
26  
27 63 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
Pod undocumented
28 63 my ($class, @opts) = @_;
29  
30 63 return $class->SUPER::new(
31 @opts,
32 fin => 1,
33 );
34 }
35  
36 16 1;
« WebSocket/X/BadToken.pm ↑ Summary WebSocket/Message.pm »