WebSocket/Handshake.pm

filter: Statementstmt 95.4% 21 / 22 Branchbran 75.0% 3 / 4 Conditioncond 66.6% 4 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 88.8% 8 / 9 Podpod 100% 5 / 5 totaltotal 82.0% 41 / 50 CC 5 SCAR 5.4
CC
5
Cov
88%
req
2.1
res
2.1
new
2.0
CRAP 1.7
« WebSocket.pm ↑ Summary
1 package Protocol::WebSocket::Handshake;
2  
3 9 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 9 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 9 ▶use Protocol::WebSocket::Request;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 9 ▶use Protocol::WebSocket::Response;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 28 ▶sub new {
Subroutine new: called CC=2 SCAR=7.0
Pod documented
10 28 my $class = shift;
11 28 ▶ $class = ref $class if ref $class;
Branch: 1 branch
BranchTrueFalseTotal
if ref $class 0 28 28
12  
13 28 my $self = {@_};
14 28 bless $self, $class;
15  
16 28 return $self;
17 }
18  
19 17 ▶sub error { @_ > 1 ? $_[0]->{error} = $_[1] : $_[0]->{error} }
Subroutine error: called CC=2 SCAR=6.9
Pod documented
Branch: 1 branch
BranchTrueFalseTotal
@_ > 1 ? : 3 14 17
20  
21 0 ▶sub version { $_[0]->req->version }
Subroutine version: not called CC=1 SCAR=6.9
Pod documented
22  
23 188 ▶sub req { shift->{req} ||= Protocol::WebSocket::Request->new }
Subroutine req: called CC=2 SCAR=7.2
Pod documented
Condition66%2/3
+(shift())->{"req"} ||= "Protocol::WebSocket::Request"->new
l!l&&r!l&&!r
162260
MC/DC0%0/2
+(shift())->{"req"} ||= "Protocol::WebSocket::Request"->new
+(shift())->{"req"} "Protocol::WebSocket::Request"->new
Truth table66%2/3
A ||= B
A= +(shift())->{"req"}B= "Protocol::WebSocket::Request"->new
ABresult
1X1
011
000
24 97 ▶sub res { shift->{res} ||= Protocol::WebSocket::Response->new }
Subroutine res: called CC=2 SCAR=7.2
Pod documented
Condition66%2/3
+(shift())->{"res"} ||= "Protocol::WebSocket::Response"->new
l!l&&r!l&&!r
76210
MC/DC0%0/2
+(shift())->{"res"} ||= "Protocol::WebSocket::Response"->new
+(shift())->{"res"} "Protocol::WebSocket::Response"->new
Truth table66%2/3
A ||= B
A= +(shift())->{"res"}B= "Protocol::WebSocket::Response"->new
ABresult
1X1
011
000
25  
26 9 1;
27 __END__
« WebSocket.pm ↑ Summary