WebSocket/Message.pm

filter: Statementstmt 95.8% 23 / 24 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 9 / 9 Podpod 0.0% 0 / 6 totaltotal 80.4% 33 / 41 CC 2 SCAR 2.2
CC
2
Cov
92%
new
2.3
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« WebSocket/Base/ControlFrame.pm ↑ Summary WebSocket/PingStore.pm »
1 package Net::WebSocket::Message;
2  
3 15 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 15 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 15 ▶use Call::Context ();
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 15 ▶sub new {
Subroutine new: called CC=2 SCAR=8.1
Pod undocumented
9 15 ▶ if (!$_[1]->isa('Net::WebSocket::Frame')) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($_[1]->isa("Net::WebSocket::Frame")) 0 15 15
10 0 die( (caller 0)[3] . ' needs at least one Net::WebSocket::Frame object!' );
11 }
12  
13 15 return bless \@_, shift;
14 }
15  
16 6 ▶sub get_frames {
Subroutine get_frames: called CC=1 SCAR=0.0
Pod undocumented
17 6 my ($self) = @_;
18  
19 6 Call::Context::must_be_list();
20  
21 6 return @$self;
22 }
23  
24 18 ▶sub get_payload {
Subroutine get_payload: called CC=1 SCAR=0.0
Pod undocumented
25 18 my ($self) = @_;
26  
27 18 return join( q<>, map { $_->get_payload() } @$self );
28 }
29  
30 5 ▶sub get_type {
Subroutine get_type: called CC=1 SCAR=0.0
Pod undocumented
31 5 return $_[0][0]->get_type();
32 }
33  
34 1 ▶sub is_control {
Subroutine is_control: called CC=1 SCAR=0.0
Pod undocumented
35 1 return $_[0][0]->is_control();
36 }
37  
38 1 ▶sub to_bytes {
Subroutine to_bytes: called CC=1 SCAR=0.0
Pod undocumented
39 1 my ($self) = @_;
40  
41 1 return join( q<>, map { $_->to_bytes() } @$self );
42 }
43  
44 15 1;
« WebSocket/Base/ControlFrame.pm ↑ Summary WebSocket/PingStore.pm »