WebSocket/Connection.pm

filter: Statementstmt 11.8% 211 / 1778 Branchbran 0.0% 1 / 2074 Conditioncond 0.0% 0 / 751 MC/DCmcdc 0.0% 0 / 382 Subroutinesub 38.3% 69 / 180 Podpod 100% 38 / 38 totaltotal 6.1% 319 / 5203 CC 1298 SCAR 127.3
CC
1298
Cov
5%
recv
603671.0
disconnect
9814.7
send
9042.1
CRAP 336099.9
↑ Summary WebSocket/Client.pm »
1 ##----------------------------------------------------------------------------
2 ## WebSocket Client & Server - ~/lib/WebSocket/Connection.pm
3 ## Version v0.1.3
4 ## Copyright(c) 2023 DEGUEST Pte. Ltd.
5 ## Author: Jacques Deguest <jack@deguest.jp>
6 ## Created 2021/09/13
7 ## Modified 2023/04/23
8 ## You can use, copy, modify and redistribute this package and associated
9 ## files under the same terms as Perl itself.
10 ##----------------------------------------------------------------------------
11 package WebSocket::Connection;
12 BEGIN
13 2 ▶{
Subroutine BEGIN: called CC=1 SCAR=0.0
14 2 ▶ use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
15 2 ▶ use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
16 2 ▶ use vars qw( $VERSION );
Subroutine BEGIN: called CC=1 SCAR=0.0
17 # Import constants
18 2 ▶ use WebSocket qw( :ws );
Subroutine BEGIN: called CC=1 SCAR=0.0
19 2 ▶ use parent qw( WebSocket );
Subroutine BEGIN: called CC=1 SCAR=0.0
20 2 ▶ use Encode;
Subroutine BEGIN: called CC=1 SCAR=0.0
21 2 ▶ use HTTP::Status ();
Subroutine BEGIN: called CC=1 SCAR=0.0
22 2 ▶ use JSON ();
Subroutine BEGIN: called CC=1 SCAR=0.0
23 2 ▶ use Nice::Try;
Subroutine BEGIN: called CC=1 SCAR=0.0
24 2 ▶ use Socket qw( IPPROTO_TCP TCP_NODELAY );
Subroutine BEGIN: called CC=1 SCAR=0.0
25 2 ▶ use URI;
Subroutine BEGIN: called CC=1 SCAR=0.0
26 2 ▶ use WebSocket::Handshake::Server;
Subroutine BEGIN: called CC=1 SCAR=0.0
27 2 ▶ use WebSocket::Frame;
Subroutine BEGIN: called CC=1 SCAR=0.0
28 2 ▶ use WebSocket::Response;
Subroutine BEGIN: called CC=1 SCAR=0.0
29 2 our $VERSION = 'v0.1.3';
30 };
31  
32 sub init
33 0 ▶{
Subroutine init: not called CC=26 SCAR=65.5
Pod documented
34 0 my $self = shift( @_ );
35 0 ▶ $self->{do_pong} = \&pong unless( defined( $self->{do_pong} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless defined $self->{"do_pong"} 0 0 0
36 # Need to have this setup before, because calls to subprotocol depend on it
37 0 ▶ $self->{handshake} = WebSocket::Handshake::Server->new unless( defined( $self->{handshake} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless defined $self->{"handshake"} 0 0 0
38 0 ▶ unless( defined( $self->{max_recv_size} ) )
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $self->{"max_recv_size"}) 0 0 0
39 {
40 0 ▶ $self->{max_recv_size} = eval{ WebSocket::Frame->new->max_payload_size } || 65536;
Condition0%0/2
eval { do { 'WebSocket::Frame'->new->max_payload_size } } || 65536
l!l
00
MC/DC0%0/1
eval { do { 'WebSocket::Frame'->new->max_payload_size } } || 65536
eval { do { 'WebSocket::Frame'->new->max_payload_size } }
Truth table0%0/2
A
A= eval { do { 'WebSocket::Frame'->new->max_payload_size } }
Aresult
11
00
41 }
42 0 ▶ unless( defined( $self->{max_send_size} ) )
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $self->{"max_send_size"}) 0 0 0
43 {
44 0 ▶ $self->{max_send_size} = eval{ WebSocket::Frame->new->max_payload_size } || 65536;
Condition0%0/2
eval { do { 'WebSocket::Frame'->new->max_payload_size } } || 65536
l!l
00
MC/DC0%0/1
eval { do { 'WebSocket::Frame'->new->max_payload_size } } || 65536
eval { do { 'WebSocket::Frame'->new->max_payload_size } }
Truth table0%0/2
A
A= eval { do { 'WebSocket::Frame'->new->max_payload_size } }
Aresult
11
00
45 }
46 0 ▶ $self->{metadata} = undef unless( defined( $self->{metadata} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless defined $self->{"metadata"} 0 0 0
47 0 ▶ $self->{nodelay} = 1 unless( defined( $self->{nodelay} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless defined $self->{"nodelay"} 0 0 0
48 0 ▶ $self->{on_binary} = sub{} unless( defined( $self->{on_binary} ) );
Subroutine __ANON__: not called CC=1 SCAR=6.9
Branch: 1 branch
BranchTrueFalseTotal
unless defined $self->{"on_binary"} 0 0 0
49 0 ▶ $self->{on_disconnect} = sub{} unless( defined( $self->{on_disconnect} ) );
Subroutine __ANON__: not called CC=1 SCAR=6.9
Branch: 1 branch
BranchTrueFalseTotal
unless defined $self->{"on_disconnect"} 0 0 0
50 0 ▶ $self->{on_handshake} = sub{} unless( defined( $self->{on_handshake} ) );
Subroutine __ANON__: not called CC=1 SCAR=6.9
Branch: 1 branch
BranchTrueFalseTotal
unless defined $self->{"on_handshake"} 0 0 0
51 0 ▶ $self->{on_origin} = sub{1} unless( defined( $self->{on_origin} ) );
Subroutine __ANON__: not called CC=1 SCAR=6.9
Branch: 1 branch
BranchTrueFalseTotal
unless defined $self->{"on_origin"} 0 0 0
52 0 ▶ $self->{on_ping} = sub{} unless( defined( $self->{on_ping} ) );
Subroutine __ANON__: not called CC=1 SCAR=6.9
Branch: 1 branch
BranchTrueFalseTotal
unless defined $self->{"on_ping"} 0 0 0
53 0 ▶ $self->{on_pong} = sub{} unless( defined( $self->{on_pong} ) );
Subroutine __ANON__: not called CC=1 SCAR=6.9
Branch: 1 branch
BranchTrueFalseTotal
unless defined $self->{"on_pong"} 0 0 0
54 0 ▶ $self->{on_ready} = sub{} unless( defined( $self->{on_ready} ) );
Subroutine __ANON__: not called CC=1 SCAR=6.9
Branch: 1 branch
BranchTrueFalseTotal
unless defined $self->{"on_ready"} 0 0 0
55 0 ▶ $self->{on_utf8} = sub{} unless( defined( $self->{on_utf8} ) );
Subroutine __ANON__: not called CC=1 SCAR=6.9
Branch: 1 branch
BranchTrueFalseTotal
unless defined $self->{"on_utf8"} 0 0 0
56 0 ▶ $self->{server} = undef unless( defined( $self->{server} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless defined $self->{"server"} 0 0 0
57 0 ▶ $self->{socket} = undef unless( defined( $self->{socket} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless defined $self->{"socket"} 0 0 0
58 0 ▶ $self->{subprotocol} = [] unless( defined( $self->{subprotocol} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless defined $self->{"subprotocol"} 0 0 0
59 0 ▶ $self->{_exception_class} = 'WebSocket::Exception' unless( defined( $self->{_exception_class} ) );
Branch: 1 branch
BranchTrueFalseTotal
unless defined $self->{"_exception_class"} 0 0 0
60 0 $self->{_init_strict_use_sub} = 1;
61 0 ▶ $self->SUPER::init( @_ ) || return( $self->pass_error );
Branch: 1 branch
BranchTrueFalseTotal
$self->SUPER::init(@_) or return $self->pass_error 0 0 0
62 0 ▶ return( $self->error( "socket parameter is required." ) ) if( !$self->{socket} );
Branch: 1 branch
BranchTrueFalseTotal
unless $self->{"socket"} 0 0 0
63 0 ▶ return( $self->error( "server parameter is required." ) ) if( !$self->{server} );
Branch: 1 branch
BranchTrueFalseTotal
unless $self->{"server"} 0 0 0
64 0 $self->{handshake}->debug( $self->debug );
65 0 $self->{disconnecting} = 0;
66 0 $self->{disconnected} = 0;
67 0 $self->{ip} = $self->{socket}->peerhost;
68 0 $self->{port} = $self->{socket}->peerport;
69  
70 # only attempt to start SSL if this is an IO::Socket::SSL-like socket that also has not completed its SSL handshake (SSL_startHandshake => 0)
71 0 ▶ $self->{needs_ssl} = 1 if( $self->{socket}->can( 'accept_SSL' ) && !$self->{socket}->opened );
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"socket"}->can("accept_SSL") and not $self->{"socket"}->opened 0 0 0
Condition0%0/3
$self->{"socket"}->can("accept_SSL") and not $self->{"socket"}->opened
!ll&&!rl&&r
000
MC/DC0%0/2
$self->{"socket"}->can("accept_SSL") and not $self->{"socket"}->opened
$self->{"socket"}->can("accept_SSL") not $self->{"socket"}->opened
Truth table0%0/3
A and not(B)
A= $self->{"socket"}->can("accept_SSL")B= not $self->{"socket"}->opened
ABresult
0X0
100
111
72 0 return( $self );
73 }
74  
75 sub disconnect
76 0 ▶{
Subroutine disconnect: not called CC=104 SCAR=91.9
Pod documented
77 0 my( $self, $code, $reason ) = @_;
78 0 ▶ return( $self ) if( $self->disconnecting || $self->disconnected );
Branch: 1 branch
BranchTrueFalseTotal
if $self->disconnecting or $self->disconnected 0 0 0
Condition0%0/3
$self->disconnecting or $self->disconnected
l!l&&r!l&&!r
000
MC/DC0%0/2
$self->disconnecting or $self->disconnected
$self->disconnecting $self->disconnected
Truth table0%0/3
A or B
A= $self->disconnectingB= $self->disconnected
ABresult
1X1
011
000
79 0 $self->disconnecting(1);
80
81 0 ▶ my $disconnect_cb = $self->on_disconnect || sub{};
Subroutine __ANON__: not called CC=1 SCAR=6.9
Condition0%0/3
$self->on_disconnect || sub { }
l!l&&r!l&&!r
000
MC/DC0%0/2
$self->on_disconnect || sub { }
$self->on_disconnect sub { }
Truth table0%0/3
A || B
A= $self->on_disconnectB= sub { }
ABresult
1X1
011
000
82 0 ▶ try
Subroutine __ANON__: not called CC=2 SCAR=17.9
Subroutine __ANON__: not called CC=17 SCAR=56.2
Branch: 3 branches
BranchTrueFalseTotal
unless defined $Nice::Try::NEED_TO_RETURN 0 0 0
if ($INC{"threads.pm"} and not exists $INC{"forks.pm"}) 0 0 0
wantarray ? : 0 0 0
Condition0%0/3
$INC{"threads.pm"} and not exists $INC{"forks.pm"}
!ll&&!rl&&r
000
MC/DC0%0/2
$INC{"threads.pm"} and not exists $INC{"forks.pm"}
$INC{"threads.pm"} not exists $INC{"forks.pm"}
Truth table0%0/3
A and not(B)
A= $INC{"threads.pm"}B= not exists $INC{"forks.pm"}
ABresult
0X0
100
111
83 0 {
84 0 $disconnect_cb->( $self, $code, $reason );
85 }
86 0 ▶ catch( $e )
Subroutine BEGIN: called CC=1 SCAR=6.3
Subroutine BEGIN: called CC=1 SCAR=6.3
Subroutine __ANON__: not called CC=1 SCAR=6.3
Subroutine __ANON__: not called CC=1 SCAR=6.3
Subroutine __ANON__: not called CC=4 SCAR=29.0
Branch: 34 branches
BranchTrueFalseTotal
if (defined $Nice::Try::WANT and length $Nice::Try::WANT) { } 0 0 0
if ($Nice::Try::WANT eq 'OBJECT') { } 0 0 0
elsif ($Nice::Try::WANT eq 'CODE') { } 0 0 0
elsif ($Nice::Try::WANT eq 'HASH') { } 0 0 0
elsif ($Nice::Try::WANT eq 'ARRAY') { } 0 0 0
elsif ($Nice::Try::WANT eq 'REFSCALAR') { } 0 0 0
elsif ($Nice::Try::WANT eq 'GLOB') { } 0 0 0
elsif ($Nice::Try::WANT eq 'LIST') { } 0 0 0
elsif ($Nice::Try::WANT eq 'BOOLEAN') { } 0 0 0
elsif ($Nice::Try::WANT eq 'VOID') { } 0 0 0
elsif ($Nice::Try::WANT eq 'SCALAR') { } 0 0 0
&$Nice::Try::TRY ? : 0 0 0
if scalar @Nice::Try::VOID 0 0 0
if ($Nice::Try::WANTARRAY) { } 0 0 0
elsif (defined $Nice::Try::WANTARRAY) { } 0 0 0
if defined $Nice::Try::LAST_VAL 0 0 0
length $@ ? : 0 0 0
unless builtin::blessed($@) 0 0 0
if ($Nice::Try::DIED) 0 0 0
if ($Nice::Try::HAS_CATCH) 0 0 0
if not defined $Nice::Try::WANTARRAY and scalar @Nice::Try::LAST_VAL 0 0 0
if (defined $Nice::Try::WANT and length $Nice::Try::WANT) { } 0 0 0
if ($Nice::Try::WANT eq 'OBJECT') { } 0 0 0
elsif ($Nice::Try::WANT eq 'CODE') { } 0 0 0
elsif ($Nice::Try::WANT eq 'HASH') { } 0 0 0
elsif ($Nice::Try::WANT eq 'ARRAY') { } 0 0 0
elsif ($Nice::Try::WANT eq 'REFSCALAR') { } 0 0 0
elsif ($Nice::Try::WANT eq 'GLOB') { } 0 0 0
elsif ($Nice::Try::WANT eq 'LIST') { } 0 0 0
elsif ($Nice::Try::WANT eq 'BOOLEAN') { } 0 0 0
elsif ($Nice::Try::WANT eq 'VOID') { } 0 0 0
elsif ($Nice::Try::WANT eq 'SCALAR') { } 0 0 0
if ($Nice::Try::WANTARRAY) { } 0 0 0
elsif (defined $Nice::Try::WANTARRAY) { } 0 0 0
Condition0%0/8
defined $Nice::Try::WANT and length $Nice::Try::WANT
!ll&&!rl&&r
000
not defined $Nice::Try::WANTARRAY and scalar @Nice::Try::LAST_VAL
!ll
00
defined $Nice::Try::WANT and length $Nice::Try::WANT
!ll&&!rl&&r
000
MC/DC0%0/2
defined $Nice::Try::WANT and length $Nice::Try::WANT
defined $Nice::Try::WANT length $Nice::Try::WANT
MC/DC0%0/1
not defined $Nice::Try::WANTARRAY and scalar @Nice::Try::LAST_VAL
not defined $Nice::Try::WANTARRAY
MC/DC0%0/2
defined $Nice::Try::WANT and length $Nice::Try::WANT
defined $Nice::Try::WANT length $Nice::Try::WANT
Truth table0%0/3
A and B
A= defined $Nice::Try::WANTB= length $Nice::Try::WANT
ABresult
0X0
100
111
Truth table0%0/2
not(A)
A= not defined $Nice::Try::WANTARRAY
Aresult
00
11
Truth table0%0/3
A and B
A= defined $Nice::Try::WANTB= length $Nice::Try::WANT
ABresult
0X0
100
111
87 0 {
88 0 ▶ warn( "Error with disconnect callback: $e" ) if( $self->_warnings_is_enabled( $self->server ) );
Branch: 1 branch
BranchTrueFalseTotal
if $self->_warnings_is_enabled($self->server) 0 0 0
89 0 ▶ }
Subroutine BEGIN: called CC=1 SCAR=6.3
Subroutine BEGIN: called CC=1 SCAR=6.3
Subroutine BEGIN: called CC=1 SCAR=6.3
Branch: 56 branches
BranchTrueFalseTotal
if (defined $Nice::Try::WANT and length $Nice::Try::WANT) { } 0 0 0
if ($Nice::Try::WANT eq 'OBJECT') { } 0 0 0
elsif ($Nice::Try::WANT eq 'CODE') { } 0 0 0
elsif ($Nice::Try::WANT eq 'HASH') { } 0 0 0
elsif ($Nice::Try::WANT eq 'ARRAY') { } 0 0 0
elsif ($Nice::Try::WANT eq 'REFSCALAR') { } 0 0 0
elsif ($Nice::Try::WANT eq 'GLOB') { } 0 0 0
elsif ($Nice::Try::WANT eq 'LIST') { } 0 0 0
elsif ($Nice::Try::WANT eq 'BOOLEAN') { } 0 0 0
elsif ($Nice::Try::WANT eq 'VOID') { } 0 0 0
elsif ($Nice::Try::WANT eq 'SCALAR') { } 0 0 0
&$Nice::Try::CATCH ? : 0 0 0
if scalar @Nice::Try::VOID 0 0 0
if ($Nice::Try::WANTARRAY) { } 0 0 0
elsif (defined $Nice::Try::WANTARRAY) { } 0 0 0
if $@ 0 0 0
if (defined $Nice::Try::CATCH_DIED) 0 0 0
if (defined $Nice::Try::WANTARRAY || defined $Nice::Try::BREAK && $Nice::Try::BREAK eq 'return' and !builtin::blessed($Nice::Try::RETVAL[0]) || builtin::blessed($Nice::Try::RETVAL[0]) && !$Nice::Try::RETVAL[0]->isa('Nice::Try::SENTINEL')) { } 0 0 0
elsif (scalar @Nice::Try::VOID and !builtin::blessed($Nice::Try::VOID[0]) || builtin::blessed($Nice::Try::VOID[0]) && !$Nice::Try::VOID[0]->isa('Nice::Try::SENTINEL')) { } 0 0 0
if defined $Nice::Try::BREAK and $Nice::Try::BREAK eq "return" 0 0 0
if (not defined $Nice::Try::BREAK or $Nice::Try::BREAK eq "return") 0 0 0
if (defined $Nice::Try::WANT and length $Nice::Try::WANT) { } 0 0 0
if ($Nice::Try::WANT eq 'LIST') { } 0 0 0
elsif ($Nice::Try::WANT eq 'VOID') { } 0 0 0
elsif ($Nice::Try::WANT eq 'OBJECT') { } 0 0 0
elsif ($Nice::Try::WANT eq 'REFSCALAR') { } 0 0 0
elsif ($Nice::Try::WANT eq 'SCALAR') { } 0 0 0
elsif ($Nice::Try::WANT eq 'BOOLEAN') { } 0 0 0
elsif ($Nice::Try::WANT eq 'CODE') { } 0 0 0
elsif ($Nice::Try::WANT eq 'HASH') { } 0 0 0
elsif ($Nice::Try::WANT eq 'ARRAY') { } 0 0 0
elsif ($Nice::Try::WANT eq 'GLOB') { } 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
if (defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq '__NEXT__') { } 0 0 0
elsif (defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq '__LAST__') { } 0 0 0
elsif (defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq '__REDO__') { } 0 0 0
elsif (defined $Nice::Try::BREAK and $Nice::Try::BREAK eq 'return') { } 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::WANTARRAY ? : 0 0 0
$Nice::Try::WANTARRAY ? : 0 0 0
scalar @Nice::Try::VOID > 1 ? : 0 0 0
if (defined $Nice::Try::BREAK) 0 0 0
if ($Nice::Try::BREAK eq 'next') { } 0 0 0
elsif ($Nice::Try::BREAK eq 'last') { } 0 0 0
elsif ($Nice::Try::BREAK eq 'redo') { } 0 0 0
scalar @Nice::Try::LAST_VAL > 1 ? : 0 0 0
if not defined $Nice::Try::WANTARRAY and scalar @Nice::Try::LAST_VAL 0 0 0
Condition0%0/50
defined $Nice::Try::WANT and length $Nice::Try::WANT
!ll&&!rl&&r
000
defined $Nice::Try::WANTARRAY || defined $Nice::Try::BREAK && $Nice::Try::BREAK eq "return" and !builtin::blessed($Nice::Try::RETVAL[0]) || builtin::blessed($Nice::Try::RETVAL[0]) && !$Nice::Try::RETVAL[0]->isa("Nice::Try::SENTINEL")
!ll&&!rl&&r
000
defined $Nice::Try::WANTARRAY or defined $Nice::Try::BREAK and $Nice::Try::BREAK eq "return"
l!l&&r!l&&!r
000
defined $Nice::Try::BREAK and $Nice::Try::BREAK eq "return"
!ll&&!rl&&r
000
not builtin::blessed($Nice::Try::RETVAL[0]) or builtin::blessed($Nice::Try::RETVAL[0]) and not $Nice::Try::RETVAL[0]->isa("Nice::Try::SENTINEL")
l!l&&r!l&&!r
000
builtin::blessed($Nice::Try::RETVAL[0]) and not $Nice::Try::RETVAL[0]->isa("Nice::Try::SENTINEL")
!ll&&!rl&&r
000
defined $Nice::Try::BREAK and $Nice::Try::BREAK eq "return"
!ll&&!rl&&r
000
not defined $Nice::Try::BREAK or $Nice::Try::BREAK eq "return"
l!l&&r!l&&!r
000
defined $Nice::Try::WANT and length $Nice::Try::WANT
!ll&&!rl&&r
000
defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq "__NEXT__"
!ll&&!rl&&r
000
defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq "__LAST__"
!ll&&!rl&&r
000
defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq "__REDO__"
!ll&&!rl&&r
000
defined $Nice::Try::BREAK and $Nice::Try::BREAK eq "return"
!ll&&!rl&&r
000
scalar @Nice::Try::VOID and !builtin::blessed($Nice::Try::VOID[0]) || builtin::blessed($Nice::Try::VOID[0]) && !$Nice::Try::VOID[0]->isa("Nice::Try::SENTINEL")
!ll&&!rl&&r
000
not builtin::blessed($Nice::Try::VOID[0]) or builtin::blessed($Nice::Try::VOID[0]) and not $Nice::Try::VOID[0]->isa("Nice::Try::SENTINEL")
l!l&&r!l&&!r
000
builtin::blessed($Nice::Try::VOID[0]) and not $Nice::Try::VOID[0]->isa("Nice::Try::SENTINEL")
!ll&&!rl&&r
000
not defined $Nice::Try::WANTARRAY and scalar @Nice::Try::LAST_VAL
!ll
00
MC/DC0%0/2
defined $Nice::Try::WANT and length $Nice::Try::WANT
defined $Nice::Try::WANT length $Nice::Try::WANT
MC/DC0%0/6
defined $Nice::Try::WANTARRAY || defined $Nice::Try::BREAK && $Nice::Try::BREAK eq "return" and !builtin::blessed($Nice::Try::RETVAL[0]) || builtin::blessed($Nice::Try::RETVAL[0]) && !$Nice::Try::RETVAL[0]->isa("Nice::Try::SENTINEL")
defined $Nice::Try::WANTARRAY defined $Nice::Try::BREAK $Nice::Try::BREAK eq "return" not builtin::blessed($Nice::Try::RETVAL[0]) builtin::blessed($Nice::Try::RETVAL[0]) not $Nice::Try::RETVAL[0]->isa("Nice::Try::SENTINEL")
MC/DC0%0/2
not defined $Nice::Try::BREAK or $Nice::Try::BREAK eq "return"
not defined $Nice::Try::BREAK $Nice::Try::BREAK eq "return"
MC/DC0%0/2
defined $Nice::Try::WANT and length $Nice::Try::WANT
defined $Nice::Try::WANT length $Nice::Try::WANT
MC/DC0%0/2
defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq "__NEXT__"
defined $Nice::Try::RETVAL[0] $Nice::Try::RETVAL[0] eq "__NEXT__"
MC/DC0%0/2
defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq "__LAST__"
defined $Nice::Try::RETVAL[0] $Nice::Try::RETVAL[0] eq "__LAST__"
MC/DC0%0/2
defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq "__REDO__"
defined $Nice::Try::RETVAL[0] $Nice::Try::RETVAL[0] eq "__REDO__"
MC/DC0%0/4
scalar @Nice::Try::VOID and !builtin::blessed($Nice::Try::VOID[0]) || builtin::blessed($Nice::Try::VOID[0]) && !$Nice::Try::VOID[0]->isa("Nice::Try::SENTINEL")
scalar @Nice::Try::VOID not builtin::blessed($Nice::Try::VOID[0]) builtin::blessed($Nice::Try::VOID[0]) not $Nice::Try::VOID[0]->isa("Nice::Try::SENTINEL")
MC/DC0%0/1
not defined $Nice::Try::WANTARRAY and scalar @Nice::Try::LAST_VAL
not defined $Nice::Try::WANTARRAY
Truth table0%0/3
A and B
A= defined $Nice::Try::WANTB= length $Nice::Try::WANT
ABresult
0X0
100
111
Truth table0%0/10
A or B and C and not(D) or E and not(F)
A= defined $Nice::Try::WANTARRAYB= defined $Nice::Try::BREAKC= $Nice::Try::BREAK eq "return"D= not builtin::blessed($Nice::Try::RETVAL[0])E= builtin::blessed($Nice::Try::RETVAL[0])F= not $Nice::Try::RETVAL[0]->isa("Nice::Try::SENTINEL")
ABCDEFresult
00XXXX0
010XXX0
1XX00X0
1XX0100
01100X0
0110100
1XX1XX1
1XX0111
0111XX1
0110111
Truth table0%0/3
not(A) or B
A= not defined $Nice::Try::BREAKB= $Nice::Try::BREAK eq "return"
ABresult
1X1
011
000
Truth table0%0/3
A and B
A= defined $Nice::Try::WANTB= length $Nice::Try::WANT
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= defined $Nice::Try::RETVAL[0]B= $Nice::Try::RETVAL[0] eq "__NEXT__"
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= defined $Nice::Try::RETVAL[0]B= $Nice::Try::RETVAL[0] eq "__LAST__"
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= defined $Nice::Try::RETVAL[0]B= $Nice::Try::RETVAL[0] eq "__REDO__"
ABresult
0X0
100
111
Truth table0%0/5
A and not(B) or C and not(D)
A= scalar @Nice::Try::VOIDB= not builtin::blessed($Nice::Try::VOID[0])C= builtin::blessed($Nice::Try::VOID[0])D= not $Nice::Try::VOID[0]->isa("Nice::Try::SENTINEL")
ABCDresult
0XXX0
100X0
10100
11XX1
10111
Truth table0%0/2
not(A)
A= not defined $Nice::Try::WANTARRAY
Aresult
00
11
90  
91 0 my $data = '';
92 0 ▶ if( defined( $code ) || defined( $reason ) )
Branch: 1 branch
BranchTrueFalseTotal
if (defined $code or defined $reason) 0 0 0
Condition0%0/3
defined $code or defined $reason
l!l&&r!l&&!r
000
MC/DC0%0/2
defined $code or defined $reason
defined $code defined $reason
Truth table0%0/3
A or B
A= defined $codeB= defined $reason
ABresult
1X1
011
000
93 {
94 0 ▶ $code ||= 1000;
Condition0%0/2
$code ||= 1000
l!l
00
MC/DC0%0/1
$code ||= 1000
$code
Truth table0%0/2
A
A= $code
Aresult
11
00
95 0 ▶ $reason = '' unless( defined( $reason ) );
Branch: 1 branch
BranchTrueFalseTotal
unless defined $reason 0 0 0
96 0 $data = pack( "na*", $code, $reason );
97 }
98 # During handshake, still under http protocol, we just close the connection.
99 0 ▶ $self->send( close => $data ) unless( !$self->handshake->is_done );
Branch: 1 branch
BranchTrueFalseTotal
if $self->handshake->is_done 0 0 0
100 # Now we wait a reasonable amount of time until the client acknowledges and send us too a close confirmation according to rfc6455 section 5.1.1
101 local $SIG{ALRM} = sub
102 0 ▶ {
Subroutine __ANON__: not called CC=1 SCAR=6.9
103 0 $self->shutdown;
104 0 };
105 0 alarm(3);
106 # $self->server->disconnect( $self->{socket} );
107 0 return( $self );
108 }
109  
110 0 ▶sub disconnected { return( shift->_set_get_boolean( 'disconnected', @_ ) ); }
Subroutine disconnected: not called CC=1 SCAR=6.9
Pod documented
111  
112 0 ▶sub disconnecting { return( shift->_set_get_boolean( 'disconnecting', @_ ) ); }
Subroutine disconnecting: not called CC=1 SCAR=6.9
Pod documented
113  
114 0 ▶sub do_pong { return( shift->_set_get_code( 'do_pong', @_ ) ); }
Subroutine do_pong: not called CC=1 SCAR=6.9
Pod documented
115  
116 0 ▶sub frame { return( shift->_set_get_object_without_init( 'frame', 'WebSocket::Frame', @_ ) ); }
Subroutine frame: not called CC=1 SCAR=6.9
Pod documented
117  
118 0 ▶sub handshake { return( shift->_set_get_object_without_init( 'handshake', 'WebSocket::Handshake::Server', @_ ) ); }
Subroutine handshake: not called CC=1 SCAR=6.9
Pod documented
119  
120 # $conn->http_error( 400, "Bad Request", "You missed something in your request" );
121 # $conn->http_error( 400 => "Bad Request" );
122 # $conn->http_error( 400, status => "Bad Request", message => "You missed something in your request" );
123 # $conn->http_error( 400, { status => "Bad Request", message => "You missed something in your request" });
124 # $conn->http_error( code => 400, status => "Bad Request", message => "You missed something in your request" );
125 # $conn->http_error({ code => 400, status => "Bad Request", message => "You missed something in your request" });
126 sub http_error
127 0 ▶{
Subroutine http_error: not called CC=25 SCAR=64.8
Pod documented
128 0 my $self = shift( @_ );
129 0 ▶ if( $self->handshake->is_done )
Branch: 1 branch
BranchTrueFalseTotal
if ($self->handshake->is_done) 0 0 0
130 {
131 0 return( $self->error( "You cannot call http_error after the handshake is completed." ) );
132 }
133 0 my( $code, $msg );
134 0 ▶ if( ( @_ == 1 && ref( $_[0] ) ne 'HASH' ) ||
Branch: 1 branch
BranchTrueFalseTotal
if (@_ == 1 and ref $_[0] ne "HASH" or @_ == 2 and ref $_[1] eq "HASH" or @_ == 2 and not ref $_[1] or @_ > 2 and @_ % 2) 0 0 0
Condition0%0/21
@_ == 1 and ref $_[0] ne "HASH" or @_ == 2 and ref $_[1] eq "HASH" or @_ == 2 and not ref $_[1] or @_ > 2 and @_ % 2
l!l&&r!l&&!r
000
@_ == 1 and ref $_[0] ne "HASH" or @_ == 2 and ref $_[1] eq "HASH" or @_ == 2 and not ref $_[1]
l!l&&r!l&&!r
000
@_ == 1 and ref $_[0] ne "HASH" or @_ == 2 and ref $_[1] eq "HASH"
l!l&&r!l&&!r
000
@_ == 1 and ref $_[0] ne "HASH"
!ll&&!rl&&r
000
@_ == 2 and ref $_[1] eq "HASH"
!ll&&!rl&&r
000
@_ == 2 and not ref $_[1]
!ll&&!rl&&r
000
@_ > 2 and @_ % 2
!ll&&!rl&&r
000
MC/DC0%0/8
@_ == 1 and ref $_[0] ne "HASH" or @_ == 2 and ref $_[1] eq "HASH" or @_ == 2 and not ref $_[1] or @_ > 2 and @_ % 2
@_ == 1 ref $_[0] ne "HASH" @_ == 2 ref $_[1] eq "HASH" @_ == 2 not ref $_[1] @_ > 2 @_ % 2
Truth table0%0/31
A and B or C and D or E and not(F) or G and H
A= @_ == 1B= ref $_[0] ne "HASH"C= @_ == 2D= ref $_[1] eq "HASH"E= @_ == 2F= not ref $_[1]G= @_ > 2H= @_ % 2
ABCDEFGHresult
11XXXXXX1
0X11XXXX1
1011XXXX1
0X0X11XX1
0X1011XX1
100X11XX1
101011XX1
0X0X0X111
0X0X10111
0X100X111
0X1010111
100X0X111
100X10111
10100X111
101010111
0X0X0X0X0
0X0X0X100
0X0X100X0
0X0X10100
0X100X0X0
0X100X100
0X10100X0
0X1010100
100X0X0X0
100X0X100
100X100X0
100X10100
10100X0X0
10100X100
1010100X0
101010100
135 # e.g.: 500 => { status => 'Oh my', message => 'Something went wrong' }
136 ( @_ == 2 && ref( $_[1] ) eq 'HASH' ) ||
137 # e.g. 500 => 'Internal error'
138 ( @_ == 2 && !ref( $_[1] ) ) ||
139 # e.g.: 500, status => 'Oh my!', message => 'Something went wrong'
140 ( @_ > 2 && ( @_ % 2 ) ) )
141 {
142 0 $code = shift( @_ );
143 }
144 0 ▶ $msg = shift( @_ ) if( @_ == 1 && !ref( $_[0] ) );
Branch: 1 branch
BranchTrueFalseTotal
if @_ == 1 and not ref $_[0] 0 0 0
Condition0%0/3
@_ == 1 and not ref $_[0]
!ll&&!rl&&r
000
MC/DC0%0/2
@_ == 1 and not ref $_[0]
@_ == 1 not ref $_[0]
Truth table0%0/3
A and not(B)
A= @_ == 1B= not ref $_[0]
ABresult
0X0
100
111
145 0 my $opts = $self->_get_args_as_hash( @_ );
146 0 ▶ $code = $opts->{code} if( exists( $opts->{code} ) && length( $opts->{code} ) );
Branch: 1 branch
BranchTrueFalseTotal
if exists $opts->{"code"} and length $opts->{"code"} 0 0 0
Condition0%0/3
exists $opts->{"code"} and length $opts->{"code"}
!ll&&!rl&&r
000
MC/DC0%0/2
exists $opts->{"code"} and length $opts->{"code"}
exists $opts->{"code"} length $opts->{"code"}
Truth table0%0/3
A and B
A= exists $opts->{"code"}B= length $opts->{"code"}
ABresult
0X0
100
111
147 0 ▶ return( $self->error( "No http code provided." ) ) if( !defined( $code ) || !length( $code ) );
Branch: 1 branch
BranchTrueFalseTotal
unless defined $code and length $code 0 0 0
Condition0%0/3
defined $code and length $code
!ll&&!rl&&r
000
MC/DC0%0/2
defined $code and length $code
defined $code length $code
Truth table0%0/3
A and B
A= defined $codeB= length $code
ABresult
0X0
100
111
148 # If status line is missing, WebSocket::Response will get the default value
149 0 ▶ my $status = $opts->{status} || $self->status_message( $code );
Condition0%0/3
$opts->{'status'} || $self->status_message($code)
l!l&&r!l&&!r
000
MC/DC0%0/2
$opts->{'status'} || $self->status_message($code)
$opts->{'status'} $self->status_message($code)
Truth table0%0/3
A || B
A= $opts->{'status'}B= $self->status_message($code)
ABresult
1X1
011
000
150 0 ▶ my $header = $opts->{headers} // [];
Condition0%0/2
$opts->{"headers"} // []
l!l
00
MC/DC0%0/1
$opts->{"headers"} // []
$opts->{"headers"}
Truth table0%0/2
A
A= $opts->{"headers"}
Aresult
11
00
151 0 ▶ my $data = $msg || $opts->{data} || $status;
Condition0%0/6
$msg || $opts->{'data'} || $status
l!l&&r!l&&!r
000
$msg or $opts->{"data"}
l!l&&r!l&&!r
000
MC/DC0%0/3
$msg || $opts->{'data'} || $status
$msg $opts->{"data"} $status
Truth table0%0/4
A or B || C
A= $msgB= $opts->{"data"}C= $status
ABCresult
1XX1
01X1
0011
0000
152 0 ▶ unless( ref( $data ) eq 'HASH' )
Branch: 1 branch
BranchTrueFalseTotal
unless (ref $data eq "HASH") 0 0 0
153 {
154 0 $data =
155 {
156 code => $code,
157 message => $data,
158 status => $status,
159 };
160 }
161 0 $data = JSON->new->convert_blessed->relaxed->utf8->encode( $data );
162 0 my $resp = WebSocket::Response->new( $code, $status, $header, $data,
163 extensions => $self->server->extensions.
164 versions => $self->server->versions
165 );
166 0 $resp->protocol( $self->handshake->request->protocol->scalar );
167 0 my $h = $resp->headers;
168 0 ▶ $h->header( Upgrade => 'websocket' ) unless( $h->header( 'Upgrade' ) );
Branch: 1 branch
BranchTrueFalseTotal
unless $h->header("Upgrade") 0 0 0
169 0 ▶ $h->header( Connection => 'Upgrade' ) unless( $h->header( 'Connection' ) );
Branch: 1 branch
BranchTrueFalseTotal
unless $h->header("Connection") 0 0 0
170 0 my $version = $self->server->version;
171 0 $h->date( time() );
172 0 $h->expires( time() );
173 0 $h->header( Pragma => 'no-cache' );
174 0 $h->header(
175 'Content-Language' => 'en_GB',
176 'Cache-Control' => 'no-cache',
177 'Strict-Transport-Security' => 'max-age=0',
178 'X-Content-Type-Options' => 'nosniff',
179 'X-Frame-Options' => 'sameorigin',
180 'X-XSS-Protection' => '1; mode=block',
181 );
182 # $resp->content( $data ) if( $data );
183 0 ▶ my $socket = $self->socket || return( $self->error( "No socket found to print the http error to" ) );
Condition0%0/2
$self->socket || (return $self->error('No socket found to print the http error to'))
l!l
00
MC/DC0%0/1
$self->socket || (return $self->error('No socket found to print the http error to'))
$self->socket
Truth table0%0/2
A
A= $self->socket
Aresult
11
00
184 0 my $rv = $socket->syswrite( $resp->as_string );
185 0 ▶ return( $self->error( "Unable to write to socket: $!" ) ) if( !defined( $rv ) );
Branch: 1 branch
BranchTrueFalseTotal
unless defined $rv 0 0 0
186 0 $self->server->disconnect( $socket );
187 0 return( $rv );
188 }
189  
190 0 ▶sub ip { return( shift->_set_get_ip( 'ip', @_ ) ); }
Subroutine ip: not called CC=1 SCAR=6.9
Pod documented
191  
192 0 ▶sub is_ready { return( shift->handshake->is_done ); }
Subroutine is_ready: not called CC=1 SCAR=6.9
Pod documented
193  
194 sub max_recv_size
195 0 ▶{
Subroutine max_recv_size: not called CC=3 SCAR=24.8
Pod documented
196 0 my $self = shift( @_ );
197 0 ▶ if( @_ )
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 0 0 0
198 {
199 0 ▶ return( $self->error( "Cannot change max_recv_size; handshake is already complete" ) ) if( $self->frame );
Branch: 1 branch
BranchTrueFalseTotal
if $self->frame 0 0 0
200 0 $self->_set_get_number( 'max_recv_size', @_ );
201 }
202 0 return( $self->_set_get_number( 'max_recv_size' ) );
203 }
204  
205 0 ▶sub max_send_size { return( shift->_set_get_number( 'max_send_size', @_ ) ); }
Subroutine max_send_size: not called CC=1 SCAR=6.9
Pod documented
206  
207 0 ▶sub metadata { return( shift->_set_get_hash_as_mix_object( 'metadata', @_ ) ); }
Subroutine metadata: not called CC=1 SCAR=6.9
Pod documented
208  
209 0 ▶sub needs_ssl { return( shift->_set_get_boolean( 'needs_ssl', @_ ) ); }
Subroutine needs_ssl: not called CC=1 SCAR=6.9
Pod documented
210  
211 sub nodelay
212 0 ▶{
Subroutine nodelay: not called CC=4 SCAR=30.0
Pod documented
213 0 my $self = shift( @_ );
214 0 ▶ if( @_ )
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 0 0 0
215 {
216 0 $self->_set_get_boolean( 'nodelay', @_ );
217 0 ▶ $self->socket->setsockopt( IPPROTO_TCP, TCP_NODELAY, $self->{nodelay} ? 1 : 0 ) unless( $self->{handshake} );
Branch: 2 branches
BranchTrueFalseTotal
unless $self->{"handshake"} 0 0 0
$self->{'nodelay'} ? : 0 0 0
218 }
219 0 return( $self->_set_get_boolean( 'nodelay' ) );
220 }
221  
222 sub on
223 0 ▶{
Subroutine on: not called CC=5 SCAR=34.0
Pod documented
224 0 my $self = shift( @_ );
225 0 my $opts = $self->_get_args_as_hash( @_ );
226 0 ▶ while( my( $key, $value ) = each( %$opts ) )
Branch: 1 branch
BranchTrueFalseTotal
if (() = each %$opts) 0 0 0
227 {
228 0 my $method = $self->can( "on_${key}" );
229 0 ▶ return( $self->error( "Invalid event '$key'" ) ) if( !defined( $method ) );
Branch: 1 branch
BranchTrueFalseTotal
unless defined $method 0 0 0
230 0 ▶ return( $self->error( "Expected a code reference for event '$key', but got '", overload::StrVal( $value ), "'." ) ) if( ref( $value ) ne 'CODE' );
Branch: 1 branch
BranchTrueFalseTotal
if ref $value ne "CODE" 0 0 0
231 0 ▶ $method->( $self, $value ) || return( $self->pass_error );
Branch: 1 branch
BranchTrueFalseTotal
&$method($self, $value) or return $self->pass_error 0 0 0
232 }
233 0 return( $self );
234 }
235  
236 0 ▶sub on_binary { return( shift->_set_get_code( 'on_binary', @_ ) ); }
Subroutine on_binary: not called CC=1 SCAR=6.9
Pod documented
237  
238 0 ▶sub on_disconnect { return( shift->_set_get_code( 'on_disconnect', @_ ) ); }
Subroutine on_disconnect: not called CC=1 SCAR=6.9
Pod documented
239  
240 0 ▶sub on_handshake { return( shift->_set_get_code( 'on_handshake', @_ ) ); }
Subroutine on_handshake: not called CC=1 SCAR=6.9
Pod documented
241  
242 0 ▶sub on_origin { return( shift->_set_get_code( 'on_origin', @_ ) ); }
Subroutine on_origin: not called CC=1 SCAR=6.9
Pod documented
243  
244 0 ▶sub on_ping { return( shift->_set_get_code( 'on_ping', @_ ) ); }
Subroutine on_ping: not called CC=1 SCAR=6.9
Pod documented
245  
246 0 ▶sub on_pong { return( shift->_set_get_code( 'on_pong', @_ ) ); }
Subroutine on_pong: not called CC=1 SCAR=6.9
Pod documented
247  
248 0 ▶sub on_ready { return( shift->_set_get_code( 'on_ready', @_ ) ); }
Subroutine on_ready: not called CC=1 SCAR=6.9
Pod documented
249  
250 0 ▶sub on_utf8 { return( shift->_set_get_code( 'on_utf8', @_ ) ); }
Subroutine on_utf8: not called CC=1 SCAR=6.9
Pod documented
251  
252 0 ▶sub origin { return( shift->_set_get_uri( 'origin', @_ ) ); }
Subroutine origin: not called CC=1 SCAR=6.9
Pod documented
253  
254 0 ▶sub ping { return( shift->send( 'ping', @_ ) ); }
Subroutine ping: not called CC=1 SCAR=6.9
Pod documented
255  
256 0 ▶sub pong { return( shift->send( 'pong', @_ ) ); }
Subroutine pong: not called CC=1 SCAR=6.9
Pod documented
257  
258 0 ▶sub port { return( shift->_set_get_number( 'port', @_ ) ); }
Subroutine port: not called CC=1 SCAR=6.9
Pod documented
259  
260 # Called by WebSocket::Server
261 sub recv
262 0 ▶{
Subroutine recv: not called CC=819 SCAR=133.1
Pod documented
263 0 my $self = shift( @_ );
264
265 0 my $socket = $self->socket;
266 0 my $hs = $self->handshake;
267 0 ▶ if( $self->needs_ssl )
Branch: 1 branch
BranchTrueFalseTotal
if ($self->needs_ssl) 0 0 0
268 {
269 0 my $ssl_done = $socket->accept_SSL;
270 0 ▶ if( $socket->errstr )
Branch: 1 branch
BranchTrueFalseTotal
if ($socket->errstr) 0 0 0
271 {
272 0 ▶ warn( "SSL socket error: ", $socket->errstr ) if( $self->_warnings_is_enabled( $self->server ) );
Branch: 1 branch
BranchTrueFalseTotal
if $self->_warnings_is_enabled($self->server) 0 0 0
273 0 ▶ if( $hs )
Branch: 1 branch
BranchTrueFalseTotal
if ($hs) { } 0 0 0
274 {
275 0 $self->http_error({ code => 500, message => 'SSL socket error' });
276 }
277 else
278 {
279 0 $self->disconnect( WS_INTERNAL_SERVER_ERROR, 'SSL socket error' );
280 }
281 0 return( $self->pass_error( $socket->errstr ) );
282 }
283 0 ▶ unless( $ssl_done )
Branch: 1 branch
BranchTrueFalseTotal
unless ($ssl_done) 0 0 0
284 {
285 0 ▶ warn( "SSL is needed, but socket is not accepting ssl.") if( $self->_warnings_is_enabled( $self->server ) );
Branch: 1 branch
BranchTrueFalseTotal
if $self->_warnings_is_enabled($self->server) 0 0 0
286 0 return( $self->error({ code => 417, message => "SSL is needed, but socket is not accepting ssl." }) );
287 }
288 0 $self->needs_ssl(0);
289 }
290  
291 0 my( $len, $data ) = ( 0, '' );
292 0 ▶ if( !( $len = $socket->sysread( $data, 8192 ) ) )
Branch: 1 branch
BranchTrueFalseTotal
unless ($len = $socket->sysread($data, 8192)) 0 0 0
293 {
294 0 ▶ warn( "Unable to read from socket, disconnecting: $!") if( $self->_warnings_is_enabled( $self->server ) );
Branch: 1 branch
BranchTrueFalseTotal
if $self->_warnings_is_enabled($self->server) 0 0 0
295 0 ▶ if( $hs )
Branch: 1 branch
BranchTrueFalseTotal
if ($hs) { } 0 0 0
296 {
297 0 $self->http_error({ code => 500, message => 'Unable to read from socket' });
298 }
299 else
300 {
301 0 $self->disconnect( WS_INTERNAL_SERVER_ERROR, 'Unable to read from socket' );
302 }
303 0 return( $self->error( "Unable to read from socket: $!" ) );
304 }
305  
306 # read remaining data
307 0 ▶ $len = $socket->sysread( $data, 8192, length( $data ) ) while( $len >= 8192 );
Branch: 1 branch
BranchTrueFalseTotal
$len >= 8192 and do { $len = $socket->sysread($data, 8192, length $data) } 0 0 0
308  
309
310 0 ▶ if( $hs && !$hs->is_done )
Branch: 1 branch
BranchTrueFalseTotal
if ($hs and not $hs->is_done) 0 0 0
Condition0%0/3
$hs and not $hs->is_done
!ll&&!rl&&r
000
MC/DC0%0/2
$hs and not $hs->is_done
$hs not $hs->is_done
Truth table0%0/3
A and not(B)
A= $hsB= not $hs->is_done
ABresult
0X0
100
111
311 {
312 0 $hs->debug( $self->debug );
313 0 my $rv = $hs->parse( $data );
314 0 ▶ if( !defined( $rv ) )
Branch: 2 branches
BranchTrueFalseTotal
if (not defined $rv) { } 0 0 0
elsif ($hs->is_done) { } 0 0 0
315 {
316 # $self->disconnect( WS_PROTOCOL_ERROR ); # 1002, protocol error
317 0 $self->http_error({ code => 400, message => 'Handshake error' });
318 0 return( $self->pass_error( $hs->error ) );
319 }
320 # Done parsing
321 elsif( $hs->is_done )
322 {
323 0 my $req_path = $hs->request->uri->path;
324 0 my $req_host = $hs->request->host;
325 0 ▶ my $uri = URI->new( ( $self->needs_ssl ? 'wss' : 'ws' ) . '://' . ( $req_host || $self->server->ip ) );
Branch: 1 branch
BranchTrueFalseTotal
$self->needs_ssl ? : 0 0 0
Condition0%0/3
$req_host || $self->server->ip
l!l&&r!l&&!r
000
MC/DC0%0/2
$req_host || $self->server->ip
$req_host $self->server->ip
Truth table0%0/3
A || B
A= $req_hostB= $self->server->ip
ABresult
1X1
011
000
326 # rfc6455 says those are the standard ports
327 0 ▶ if( ( $self->needs_ssl && $self->server->port != 443 ) ||
Branch: 1 branch
BranchTrueFalseTotal
if ($self->needs_ssl and $self->server->port != 443 or not $self->needs_ssl and $self->server->port != 80) 0 0 0
Condition0%0/9
$self->needs_ssl and $self->server->port != 443 or not $self->needs_ssl and $self->server->port != 80
l!l&&r!l&&!r
000
$self->needs_ssl and $self->server->port != 443
!ll&&!rl&&r
000
not $self->needs_ssl and $self->server->port != 80
!ll&&!rl&&r
000
MC/DC0%0/4
$self->needs_ssl and $self->server->port != 443 or not $self->needs_ssl and $self->server->port != 80
$self->needs_ssl $self->server->port != 443 not $self->needs_ssl $self->server->port != 80
Truth table0%0/7
A and B or not(C) and D
A= $self->needs_sslB= $self->server->port != 443C= not $self->needs_sslD= $self->server->port != 80
ABCDresult
11XX1
0X111
10111
0X0X0
0X100
100X0
10100
328 ( !$self->needs_ssl && $self->server->port != 80 ) )
329 {
330 0 $uri->port( $self->server->port );
331 }
332 0 $uri->path( $req_path );
333 0 $self->request_uri( $uri );
334
335 0 my $orig = URI->new( $hs->request->origin );
336 0 $orig->fragment( undef );
337 0 $orig->query( undef );
338 0 $self->origin( $orig );
339 0 ▶ my $origin_cb = $self->on_origin || sub{1};
Subroutine __ANON__: not called CC=1 SCAR=6.9
Condition0%0/3
$self->on_origin || sub { 1; }
l!l&&r!l&&!r
000
MC/DC0%0/2
$self->on_origin || sub { 1; }
$self->on_origin sub { 1; }
Truth table0%0/3
A || B
A= $self->on_originB= sub { 1; }
ABresult
1X1
011
000
340 # Callback as the user may reject connection with 403 Forbidden if origin is not satisfactory
341 # rfc6455, section 4.2.2 <https://datatracker.ietf.org/doc/html/rfc6455#section-4.2.2>
342 0 ▶ try
Subroutine __ANON__: not called CC=2 SCAR=17.9
Subroutine __ANON__: not called CC=19 SCAR=58.4
Branch: 3 branches
BranchTrueFalseTotal
unless defined $Nice::Try::NEED_TO_RETURN 0 0 0
if ($INC{"threads.pm"} and not exists $INC{"forks.pm"}) 0 0 0
wantarray ? : 0 0 0
Condition0%0/3
$INC{"threads.pm"} and not exists $INC{"forks.pm"}
!ll&&!rl&&r
000
MC/DC0%0/2
$INC{"threads.pm"} and not exists $INC{"forks.pm"}
$INC{"threads.pm"} not exists $INC{"forks.pm"}
Truth table0%0/3
A and not(B)
A= $INC{"threads.pm"}B= not exists $INC{"forks.pm"}
ABresult
0X0
100
111
343 0 {
344 0 ▶ local $SIG{ALRM} = sub{ die( "timeout\n" ); };
Subroutine __ANON__: not called CC=1 SCAR=6.9
345 0 alarm(2);
346 0 my $orig_rv = $origin_cb->( $self, $orig, $hs );
347 0 ▶ if( defined( $orig_rv ) && !$orig_rv )
Branch: 1 branch
BranchTrueFalseTotal
if (defined $orig_rv and not $orig_rv) 0 0 0
Condition0%0/3
defined $orig_rv and not $orig_rv
!ll&&!rl&&r
000
MC/DC0%0/2
defined $orig_rv and not $orig_rv
defined $orig_rv not $orig_rv
Truth table0%0/3
A and not(B)
A= defined $orig_rvB= not $orig_rv
ABresult
0X0
100
111
348 {
349 0 $self->http_error({
350 code => 403,
351 message => "Unacceptable origin \"$orig\""
352 });
353 0 return( $self->error({ code => 403, message => "origin callback did not return a true value." }) );
354 }
355 0 alarm(0);
356 }
357 0 ▶ catch( $e )
Subroutine BEGIN: called CC=1 SCAR=6.3
Subroutine BEGIN: called CC=1 SCAR=6.3
Subroutine __ANON__: not called CC=1 SCAR=6.3
Subroutine __ANON__: not called CC=1 SCAR=6.3
Subroutine __ANON__: not called CC=5 SCAR=33.0
Branch: 34 branches
BranchTrueFalseTotal
if (defined $Nice::Try::WANT and length $Nice::Try::WANT) { } 0 0 0
if ($Nice::Try::WANT eq 'OBJECT') { } 0 0 0
elsif ($Nice::Try::WANT eq 'CODE') { } 0 0 0
elsif ($Nice::Try::WANT eq 'HASH') { } 0 0 0
elsif ($Nice::Try::WANT eq 'ARRAY') { } 0 0 0
elsif ($Nice::Try::WANT eq 'REFSCALAR') { } 0 0 0
elsif ($Nice::Try::WANT eq 'GLOB') { } 0 0 0
elsif ($Nice::Try::WANT eq 'LIST') { } 0 0 0
elsif ($Nice::Try::WANT eq 'BOOLEAN') { } 0 0 0
elsif ($Nice::Try::WANT eq 'VOID') { } 0 0 0
elsif ($Nice::Try::WANT eq 'SCALAR') { } 0 0 0
&$Nice::Try::TRY ? : 0 0 0
if scalar @Nice::Try::VOID 0 0 0
if ($Nice::Try::WANTARRAY) { } 0 0 0
elsif (defined $Nice::Try::WANTARRAY) { } 0 0 0
if defined $Nice::Try::LAST_VAL 0 0 0
length $@ ? : 0 0 0
unless builtin::blessed($@) 0 0 0
if ($Nice::Try::DIED) 0 0 0
if ($Nice::Try::HAS_CATCH) 0 0 0
if not defined $Nice::Try::WANTARRAY and scalar @Nice::Try::LAST_VAL 0 0 0
if (defined $Nice::Try::WANT and length $Nice::Try::WANT) { } 0 0 0
if ($Nice::Try::WANT eq 'OBJECT') { } 0 0 0
elsif ($Nice::Try::WANT eq 'CODE') { } 0 0 0
elsif ($Nice::Try::WANT eq 'HASH') { } 0 0 0
elsif ($Nice::Try::WANT eq 'ARRAY') { } 0 0 0
elsif ($Nice::Try::WANT eq 'REFSCALAR') { } 0 0 0
elsif ($Nice::Try::WANT eq 'GLOB') { } 0 0 0
elsif ($Nice::Try::WANT eq 'LIST') { } 0 0 0
elsif ($Nice::Try::WANT eq 'BOOLEAN') { } 0 0 0
elsif ($Nice::Try::WANT eq 'VOID') { } 0 0 0
elsif ($Nice::Try::WANT eq 'SCALAR') { } 0 0 0
if ($Nice::Try::WANTARRAY) { } 0 0 0
elsif (defined $Nice::Try::WANTARRAY) { } 0 0 0
Condition0%0/8
defined $Nice::Try::WANT and length $Nice::Try::WANT
!ll&&!rl&&r
000
not defined $Nice::Try::WANTARRAY and scalar @Nice::Try::LAST_VAL
!ll
00
defined $Nice::Try::WANT and length $Nice::Try::WANT
!ll&&!rl&&r
000
MC/DC0%0/2
defined $Nice::Try::WANT and length $Nice::Try::WANT
defined $Nice::Try::WANT length $Nice::Try::WANT
MC/DC0%0/1
not defined $Nice::Try::WANTARRAY and scalar @Nice::Try::LAST_VAL
not defined $Nice::Try::WANTARRAY
MC/DC0%0/2
defined $Nice::Try::WANT and length $Nice::Try::WANT
defined $Nice::Try::WANT length $Nice::Try::WANT
Truth table0%0/3
A and B
A= defined $Nice::Try::WANTB= length $Nice::Try::WANT
ABresult
0X0
100
111
Truth table0%0/2
not(A)
A= not defined $Nice::Try::WANTARRAY
Aresult
00
11
Truth table0%0/3
A and B
A= defined $Nice::Try::WANTB= length $Nice::Try::WANT
ABresult
0X0
100
111
358 0 {
359 0 ▶ warn( "Error calling the origin callback: $e" ) if( $self->_warnings_is_enabled( $self->server ) );
Branch: 1 branch
BranchTrueFalseTotal
if $self->_warnings_is_enabled($self->server) 0 0 0
360 0 ▶ if( $e =~ /timeout/ )
Branch: 1 branch
BranchTrueFalseTotal
if ($e =~ /timeout/) { } 0 0 0
361 {
362 0 $self->http_error({
363 code => 408,
364 message => "Timeout checking for origin"
365 });
366 0 return( $self->error({ code => 408, message => "Timeout checking for origin" }) );
367 }
368 else
369 {
370 0 $self->http_error({
371 code => 500,
372 message => "Unexpected server error occurred"
373 });
374 0 return( $self->error({ code => 500, message => "Unexpected error while calling origin callback: $e" }) );
375 }
376 0 ▶ }
Subroutine BEGIN: called CC=1 SCAR=6.3
Subroutine BEGIN: called CC=1 SCAR=6.3
Subroutine BEGIN: called CC=1 SCAR=6.3
Branch: 56 branches
BranchTrueFalseTotal
if (defined $Nice::Try::WANT and length $Nice::Try::WANT) { } 0 0 0
if ($Nice::Try::WANT eq 'OBJECT') { } 0 0 0
elsif ($Nice::Try::WANT eq 'CODE') { } 0 0 0
elsif ($Nice::Try::WANT eq 'HASH') { } 0 0 0
elsif ($Nice::Try::WANT eq 'ARRAY') { } 0 0 0
elsif ($Nice::Try::WANT eq 'REFSCALAR') { } 0 0 0
elsif ($Nice::Try::WANT eq 'GLOB') { } 0 0 0
elsif ($Nice::Try::WANT eq 'LIST') { } 0 0 0
elsif ($Nice::Try::WANT eq 'BOOLEAN') { } 0 0 0
elsif ($Nice::Try::WANT eq 'VOID') { } 0 0 0
elsif ($Nice::Try::WANT eq 'SCALAR') { } 0 0 0
&$Nice::Try::CATCH ? : 0 0 0
if scalar @Nice::Try::VOID 0 0 0
if ($Nice::Try::WANTARRAY) { } 0 0 0
elsif (defined $Nice::Try::WANTARRAY) { } 0 0 0
if $@ 0 0 0
if (defined $Nice::Try::CATCH_DIED) 0 0 0
if (defined $Nice::Try::WANTARRAY || defined $Nice::Try::BREAK && $Nice::Try::BREAK eq 'return' and !builtin::blessed($Nice::Try::RETVAL[0]) || builtin::blessed($Nice::Try::RETVAL[0]) && !$Nice::Try::RETVAL[0]->isa('Nice::Try::SENTINEL')) { } 0 0 0
elsif (scalar @Nice::Try::VOID and !builtin::blessed($Nice::Try::VOID[0]) || builtin::blessed($Nice::Try::VOID[0]) && !$Nice::Try::VOID[0]->isa('Nice::Try::SENTINEL')) { } 0 0 0
if defined $Nice::Try::BREAK and $Nice::Try::BREAK eq "return" 0 0 0
if (not defined $Nice::Try::BREAK or $Nice::Try::BREAK eq "return") 0 0 0
if (defined $Nice::Try::WANT and length $Nice::Try::WANT) { } 0 0 0
if ($Nice::Try::WANT eq 'LIST') { } 0 0 0
elsif ($Nice::Try::WANT eq 'VOID') { } 0 0 0
elsif ($Nice::Try::WANT eq 'OBJECT') { } 0 0 0
elsif ($Nice::Try::WANT eq 'REFSCALAR') { } 0 0 0
elsif ($Nice::Try::WANT eq 'SCALAR') { } 0 0 0
elsif ($Nice::Try::WANT eq 'BOOLEAN') { } 0 0 0
elsif ($Nice::Try::WANT eq 'CODE') { } 0 0 0
elsif ($Nice::Try::WANT eq 'HASH') { } 0 0 0
elsif ($Nice::Try::WANT eq 'ARRAY') { } 0 0 0
elsif ($Nice::Try::WANT eq 'GLOB') { } 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
if (defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq '__NEXT__') { } 0 0 0
elsif (defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq '__LAST__') { } 0 0 0
elsif (defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq '__REDO__') { } 0 0 0
elsif (defined $Nice::Try::BREAK and $Nice::Try::BREAK eq 'return') { } 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::WANTARRAY ? : 0 0 0
$Nice::Try::WANTARRAY ? : 0 0 0
scalar @Nice::Try::VOID > 1 ? : 0 0 0
if (defined $Nice::Try::BREAK) 0 0 0
if ($Nice::Try::BREAK eq 'next') { } 0 0 0
elsif ($Nice::Try::BREAK eq 'last') { } 0 0 0
elsif ($Nice::Try::BREAK eq 'redo') { } 0 0 0
scalar @Nice::Try::LAST_VAL > 1 ? : 0 0 0
if not defined $Nice::Try::WANTARRAY and scalar @Nice::Try::LAST_VAL 0 0 0
Condition0%0/50
defined $Nice::Try::WANT and length $Nice::Try::WANT
!ll&&!rl&&r
000
defined $Nice::Try::WANTARRAY || defined $Nice::Try::BREAK && $Nice::Try::BREAK eq "return" and !builtin::blessed($Nice::Try::RETVAL[0]) || builtin::blessed($Nice::Try::RETVAL[0]) && !$Nice::Try::RETVAL[0]->isa("Nice::Try::SENTINEL")
!ll&&!rl&&r
000
defined $Nice::Try::WANTARRAY or defined $Nice::Try::BREAK and $Nice::Try::BREAK eq "return"
l!l&&r!l&&!r
000
defined $Nice::Try::BREAK and $Nice::Try::BREAK eq "return"
!ll&&!rl&&r
000
not builtin::blessed($Nice::Try::RETVAL[0]) or builtin::blessed($Nice::Try::RETVAL[0]) and not $Nice::Try::RETVAL[0]->isa("Nice::Try::SENTINEL")
l!l&&r!l&&!r
000
builtin::blessed($Nice::Try::RETVAL[0]) and not $Nice::Try::RETVAL[0]->isa("Nice::Try::SENTINEL")
!ll&&!rl&&r
000
defined $Nice::Try::BREAK and $Nice::Try::BREAK eq "return"
!ll&&!rl&&r
000
not defined $Nice::Try::BREAK or $Nice::Try::BREAK eq "return"
l!l&&r!l&&!r
000
defined $Nice::Try::WANT and length $Nice::Try::WANT
!ll&&!rl&&r
000
defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq "__NEXT__"
!ll&&!rl&&r
000
defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq "__LAST__"
!ll&&!rl&&r
000
defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq "__REDO__"
!ll&&!rl&&r
000
defined $Nice::Try::BREAK and $Nice::Try::BREAK eq "return"
!ll&&!rl&&r
000
scalar @Nice::Try::VOID and !builtin::blessed($Nice::Try::VOID[0]) || builtin::blessed($Nice::Try::VOID[0]) && !$Nice::Try::VOID[0]->isa("Nice::Try::SENTINEL")
!ll&&!rl&&r
000
not builtin::blessed($Nice::Try::VOID[0]) or builtin::blessed($Nice::Try::VOID[0]) and not $Nice::Try::VOID[0]->isa("Nice::Try::SENTINEL")
l!l&&r!l&&!r
000
builtin::blessed($Nice::Try::VOID[0]) and not $Nice::Try::VOID[0]->isa("Nice::Try::SENTINEL")
!ll&&!rl&&r
000
not defined $Nice::Try::WANTARRAY and scalar @Nice::Try::LAST_VAL
!ll
00
MC/DC0%0/2
defined $Nice::Try::WANT and length $Nice::Try::WANT
defined $Nice::Try::WANT length $Nice::Try::WANT
MC/DC0%0/6
defined $Nice::Try::WANTARRAY || defined $Nice::Try::BREAK && $Nice::Try::BREAK eq "return" and !builtin::blessed($Nice::Try::RETVAL[0]) || builtin::blessed($Nice::Try::RETVAL[0]) && !$Nice::Try::RETVAL[0]->isa("Nice::Try::SENTINEL")
defined $Nice::Try::WANTARRAY defined $Nice::Try::BREAK $Nice::Try::BREAK eq "return" not builtin::blessed($Nice::Try::RETVAL[0]) builtin::blessed($Nice::Try::RETVAL[0]) not $Nice::Try::RETVAL[0]->isa("Nice::Try::SENTINEL")
MC/DC0%0/2
not defined $Nice::Try::BREAK or $Nice::Try::BREAK eq "return"
not defined $Nice::Try::BREAK $Nice::Try::BREAK eq "return"
MC/DC0%0/2
defined $Nice::Try::WANT and length $Nice::Try::WANT
defined $Nice::Try::WANT length $Nice::Try::WANT
MC/DC0%0/2
defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq "__NEXT__"
defined $Nice::Try::RETVAL[0] $Nice::Try::RETVAL[0] eq "__NEXT__"
MC/DC0%0/2
defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq "__LAST__"
defined $Nice::Try::RETVAL[0] $Nice::Try::RETVAL[0] eq "__LAST__"
MC/DC0%0/2
defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq "__REDO__"
defined $Nice::Try::RETVAL[0] $Nice::Try::RETVAL[0] eq "__REDO__"
MC/DC0%0/4
scalar @Nice::Try::VOID and !builtin::blessed($Nice::Try::VOID[0]) || builtin::blessed($Nice::Try::VOID[0]) && !$Nice::Try::VOID[0]->isa("Nice::Try::SENTINEL")
scalar @Nice::Try::VOID not builtin::blessed($Nice::Try::VOID[0]) builtin::blessed($Nice::Try::VOID[0]) not $Nice::Try::VOID[0]->isa("Nice::Try::SENTINEL")
MC/DC0%0/1
not defined $Nice::Try::WANTARRAY and scalar @Nice::Try::LAST_VAL
not defined $Nice::Try::WANTARRAY
Truth table0%0/3
A and B
A= defined $Nice::Try::WANTB= length $Nice::Try::WANT
ABresult
0X0
100
111
Truth table0%0/10
A or B and C and not(D) or E and not(F)
A= defined $Nice::Try::WANTARRAYB= defined $Nice::Try::BREAKC= $Nice::Try::BREAK eq "return"D= not builtin::blessed($Nice::Try::RETVAL[0])E= builtin::blessed($Nice::Try::RETVAL[0])F= not $Nice::Try::RETVAL[0]->isa("Nice::Try::SENTINEL")
ABCDEFresult
00XXXX0
010XXX0
1XX00X0
1XX0100
01100X0
0110100
1XX1XX1
1XX0111
0111XX1
0110111
Truth table0%0/3
not(A) or B
A= not defined $Nice::Try::BREAKB= $Nice::Try::BREAK eq "return"
ABresult
1X1
011
000
Truth table0%0/3
A and B
A= defined $Nice::Try::WANTB= length $Nice::Try::WANT
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= defined $Nice::Try::RETVAL[0]B= $Nice::Try::RETVAL[0] eq "__NEXT__"
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= defined $Nice::Try::RETVAL[0]B= $Nice::Try::RETVAL[0] eq "__LAST__"
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= defined $Nice::Try::RETVAL[0]B= $Nice::Try::RETVAL[0] eq "__REDO__"
ABresult
0X0
100
111
Truth table0%0/5
A and not(B) or C and not(D)
A= scalar @Nice::Try::VOIDB= not builtin::blessed($Nice::Try::VOID[0])C= builtin::blessed($Nice::Try::VOID[0])D= not $Nice::Try::VOID[0]->isa("Nice::Try::SENTINEL")
ABCDresult
0XXX0
100X0
10100
11XX1
10111
Truth table0%0/2
not(A)
A= not defined $Nice::Try::WANTARRAY
Aresult
00
11
377
378 0 ▶ if( $self->server->versions->length )
Branch: 1 branch
BranchTrueFalseTotal
if ($self->server->versions->length) 0 0 0
379 {
380 # Servers can have multiple supported versions
381 # but client has only one
382 0 my $ok_versions = $self->server->versions;
383 0 my $client_version = $hs->request->version;
384 0 ▶ if( !defined( $client_version ) || !length( "$client_version" ) )
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $client_version and length "$client_version") 0 0 0
Condition0%0/3
defined $client_version and length "$client_version"
!ll&&!rl&&r
000
MC/DC0%0/2
defined $client_version and length "$client_version"
defined $client_version length "$client_version"
Truth table0%0/3
A and B
A= defined $client_versionB= length "$client_version"
ABresult
0X0
100
111
385 {
386 0 $self->http_error({
387 code => 400,
388 message => "Missing version header",
389 });
390 0 return( $self->error({ code => 400, message => "Missing version header" }) );
391 }
392 # If there is only one version supported and it does not match the client requested one,
393 # as per the rfc6455 section 4.2.2, we abort the connection
394 0 ▶ if( $ok_versions->length == 1 &&
Branch: 1 branch
BranchTrueFalseTotal
if ($ok_versions->length == 1 and $ok_versions->first != $client_version) 0 0 0
Condition0%0/3
$ok_versions->length == 1 and $ok_versions->first != $client_version
!ll&&!rl&&r
000
MC/DC0%0/2
$ok_versions->length == 1 and $ok_versions->first != $client_version
$ok_versions->length == 1 $ok_versions->first != $client_version
Truth table0%0/3
A and B
A= $ok_versions->length == 1B= $ok_versions->first != $client_version
ABresult
0X0
100
111
395 $ok_versions->first != $client_version )
396 {
397 0 $self->http_error({
398 code => 400,
399 message => "Protocol version $client_version unsupported",
400 });
401 0 return( $self->error({ code => 400, message => "Protocol version $client_version unsupported" }) );
402 }
403
404 # Check each server supported version to see if the one requested by the client is among them
405 0 my $found = 0;
406 0 my $do_version_negotiation = 0;
407 $ok_versions->foreach(sub
408 0 ▶ {
Subroutine __ANON__: not called CC=4 SCAR=30.0
409 0 my $v = shift( @_ );
410 0 ▶ if( $v == $client_version )
Branch: 2 branches
BranchTrueFalseTotal
if ($v == $client_version) { } 0 0 0
elsif ($v->type eq 'hybi' and $v->revision >= 15) { } 0 0 0
411 {
412 0 $found++;
413 0 return;
414 }
415 ▶ elsif( $v->type eq 'hybi' && $v->revision >= 15 )
Condition0%0/3
$v->type eq "hybi" and $v->revision >= 15
!ll&&!rl&&r
000
MC/DC0%0/2
$v->type eq "hybi" and $v->revision >= 15
$v->type eq "hybi" $v->revision >= 15
Truth table0%0/3
A and B
A= $v->type eq "hybi"B= $v->revision >= 15
ABresult
0X0
100
111
416 {
417 0 $do_version_negotiation++;
418 }
419 0 });
420 # Nothing was found, so we enter in version negotiation as per rfc6455 revision
421 0 ▶ if( !$found )
Branch: 1 branch
BranchTrueFalseTotal
unless ($found) 0 0 0
422 {
423 0 ▶ if( $do_version_negotiation )
Branch: 1 branch
BranchTrueFalseTotal
if ($do_version_negotiation) 0 0 0
424 {
425 # The necessary headers based on protocol version will be set by http_error()
426 0 $self->http_error({ code => 426, message => "Unsupported version \"${client_version}\"" });
427 0 return( $self->error({ code => 426, message => "Unsupported version \"${client_version}\"" }) );
428 }
429 }
430 }
431
432 # Client has provided extension and we have some that we support.
433 # Let's check
434 0 my $client_ext = $hs->request->extensions;
435 0 ▶ if( $client_ext->length &&
Branch: 1 branch
BranchTrueFalseTotal
if ($client_ext->length and $self->server->extensions->length) 0 0 0
Condition0%0/3
$client_ext->length and $self->server->extensions->length
!ll&&!rl&&r
000
MC/DC0%0/2
$client_ext->length and $self->server->extensions->length
$client_ext->length $self->server->extensions->length
Truth table0%0/3
A and B
A= $client_ext->lengthB= $self->server->extensions->length
ABresult
0X0
100
111
436 $self->server->extensions->length )
437 {
438 0 my $server_ext = $self->server->extensions;
439 0 my $ok_extensions = $self->new_array;
440 $client_ext->foreach(sub
441 0 ▶ {
Subroutine __ANON__: not called CC=1 SCAR=6.9
442 0 my $ext = shift( @_ );
443 $server_ext->foreach(sub
444 0 ▶ {
Subroutine __ANON__: not called CC=2 SCAR=17.9
445 0 my $candidate_ext = shift( @_ );
446 0 ▶ if( $candidate_ext->extension eq $ext->extension )
Branch: 1 branch
BranchTrueFalseTotal
if ($candidate_ext->extension eq $ext->extension) 0 0 0
447 {
448 0 $ok_extensions->push( $candidate_ext );
449 0 return;
450 }
451 0 });
452 0 });
453 0 ▶ if( scalar( @$ok_extensions ) )
Branch: 1 branch
BranchTrueFalseTotal
if (scalar @$ok_extensions) 0 0 0
454 {
455 0 $hs->response->extensions( $ok_extensions );
456 }
457 }
458
459 0 my $client_proto = $hs->request->subprotocol;
460 0 ▶ if( $client_proto->length &&
Branch: 1 branch
BranchTrueFalseTotal
if ($client_proto->length and $self->server->subprotocol->length) 0 0 0
Condition0%0/3
$client_proto->length and $self->server->subprotocol->length
!ll&&!rl&&r
000
MC/DC0%0/2
$client_proto->length and $self->server->subprotocol->length
$client_proto->length $self->server->subprotocol->length
Truth table0%0/3
A and B
A= $client_proto->lengthB= $self->server->subprotocol->length
ABresult
0X0
100
111
461 $self->server->subprotocol->length )
462 {
463 0 my $ok_proto = $client_proto->intersection( $self->server->subprotocol );
464 0 $self->subprotocol( $ok_proto );
465 }
466
467 # NOTE: handshake callback
468 0 ▶ my $handshake_cb = $self->on_handshake || sub{};
Subroutine __ANON__: not called CC=1 SCAR=6.9
Condition0%0/3
$self->on_handshake || sub { }
l!l&&r!l&&!r
000
MC/DC0%0/2
$self->on_handshake || sub { }
$self->on_handshake sub { }
Truth table0%0/3
A || B
A= $self->on_handshakeB= sub { }
ABresult
1X1
011
000
469 0 ▶ try
Subroutine __ANON__: not called CC=2 SCAR=17.9
Subroutine __ANON__: not called CC=19 SCAR=58.4
Branch: 3 branches
BranchTrueFalseTotal
unless defined $Nice::Try::NEED_TO_RETURN 0 0 0
if ($INC{"threads.pm"} and not exists $INC{"forks.pm"}) 0 0 0
wantarray ? : 0 0 0
Condition0%0/3
$INC{"threads.pm"} and not exists $INC{"forks.pm"}
!ll&&!rl&&r
000
MC/DC0%0/2
$INC{"threads.pm"} and not exists $INC{"forks.pm"}
$INC{"threads.pm"} not exists $INC{"forks.pm"}
Truth table0%0/3
A and not(B)
A= $INC{"threads.pm"}B= not exists $INC{"forks.pm"}
ABresult
0X0
100
111
470 0 {
471 0 my $rv = $handshake_cb->( $self, $hs );
472 0 ▶ if( defined( $rv ) && !$rv )
Branch: 1 branch
BranchTrueFalseTotal
if (defined $rv and not $rv) 0 0 0
Condition0%0/3
defined $rv and not $rv
!ll&&!rl&&r
000
MC/DC0%0/2
defined $rv and not $rv
defined $rv not $rv
Truth table0%0/3
A and not(B)
A= defined $rvB= not $rv
ABresult
0X0
100
111
473 {
474 0 $self->http_error({
475 code => 403,
476 message => "You are forbidden from accessing this websocket."
477 });
478 0 return( $self->error({ code => 403, message => "You are forbidden from accessing this websocket." }) );
479 }
480 }
481 0 ▶ catch( $e )
Subroutine BEGIN: called CC=1 SCAR=6.3
Subroutine BEGIN: called CC=1 SCAR=6.3
Subroutine __ANON__: not called CC=1 SCAR=6.3
Subroutine __ANON__: not called CC=1 SCAR=6.3
Subroutine __ANON__: not called CC=4 SCAR=29.0
Branch: 34 branches
BranchTrueFalseTotal
if (defined $Nice::Try::WANT and length $Nice::Try::WANT) { } 0 0 0
if ($Nice::Try::WANT eq 'OBJECT') { } 0 0 0
elsif ($Nice::Try::WANT eq 'CODE') { } 0 0 0
elsif ($Nice::Try::WANT eq 'HASH') { } 0 0 0
elsif ($Nice::Try::WANT eq 'ARRAY') { } 0 0 0
elsif ($Nice::Try::WANT eq 'REFSCALAR') { } 0 0 0
elsif ($Nice::Try::WANT eq 'GLOB') { } 0 0 0
elsif ($Nice::Try::WANT eq 'LIST') { } 0 0 0
elsif ($Nice::Try::WANT eq 'BOOLEAN') { } 0 0 0
elsif ($Nice::Try::WANT eq 'VOID') { } 0 0 0
elsif ($Nice::Try::WANT eq 'SCALAR') { } 0 0 0
&$Nice::Try::TRY ? : 0 0 0
if scalar @Nice::Try::VOID 0 0 0
if ($Nice::Try::WANTARRAY) { } 0 0 0
elsif (defined $Nice::Try::WANTARRAY) { } 0 0 0
if defined $Nice::Try::LAST_VAL 0 0 0
length $@ ? : 0 0 0
unless builtin::blessed($@) 0 0 0
if ($Nice::Try::DIED) 0 0 0
if ($Nice::Try::HAS_CATCH) 0 0 0
if not defined $Nice::Try::WANTARRAY and scalar @Nice::Try::LAST_VAL 0 0 0
if (defined $Nice::Try::WANT and length $Nice::Try::WANT) { } 0 0 0
if ($Nice::Try::WANT eq 'OBJECT') { } 0 0 0
elsif ($Nice::Try::WANT eq 'CODE') { } 0 0 0
elsif ($Nice::Try::WANT eq 'HASH') { } 0 0 0
elsif ($Nice::Try::WANT eq 'ARRAY') { } 0 0 0
elsif ($Nice::Try::WANT eq 'REFSCALAR') { } 0 0 0
elsif ($Nice::Try::WANT eq 'GLOB') { } 0 0 0
elsif ($Nice::Try::WANT eq 'LIST') { } 0 0 0
elsif ($Nice::Try::WANT eq 'BOOLEAN') { } 0 0 0
elsif ($Nice::Try::WANT eq 'VOID') { } 0 0 0
elsif ($Nice::Try::WANT eq 'SCALAR') { } 0 0 0
if ($Nice::Try::WANTARRAY) { } 0 0 0
elsif (defined $Nice::Try::WANTARRAY) { } 0 0 0
Condition0%0/8
defined $Nice::Try::WANT and length $Nice::Try::WANT
!ll&&!rl&&r
000
not defined $Nice::Try::WANTARRAY and scalar @Nice::Try::LAST_VAL
!ll
00
defined $Nice::Try::WANT and length $Nice::Try::WANT
!ll&&!rl&&r
000
MC/DC0%0/2
defined $Nice::Try::WANT and length $Nice::Try::WANT
defined $Nice::Try::WANT length $Nice::Try::WANT
MC/DC0%0/1
not defined $Nice::Try::WANTARRAY and scalar @Nice::Try::LAST_VAL
not defined $Nice::Try::WANTARRAY
MC/DC0%0/2
defined $Nice::Try::WANT and length $Nice::Try::WANT
defined $Nice::Try::WANT length $Nice::Try::WANT
Truth table0%0/3
A and B
A= defined $Nice::Try::WANTB= length $Nice::Try::WANT
ABresult
0X0
100
111
Truth table0%0/2
not(A)
A= not defined $Nice::Try::WANTARRAY
Aresult
00
11
Truth table0%0/3
A and B
A= defined $Nice::Try::WANTB= length $Nice::Try::WANT
ABresult
0X0
100
111
482 0 {
483 0 ▶ warn( "Error calling the handshake callback: $e" ) if( $self->_warnings_is_enabled( $self->server ) );
Branch: 1 branch
BranchTrueFalseTotal
if $self->_warnings_is_enabled($self->server) 0 0 0
484 0 $self->http_error({ code => 500, message => 'Internal error' });
485 0 return( $self->error({ code => 500, message => "Error calling the handshake callback: $e" }) );
486 0 ▶ }
Subroutine BEGIN: called CC=1 SCAR=6.3
Subroutine BEGIN: called CC=1 SCAR=6.3
Subroutine BEGIN: called CC=1 SCAR=6.3
Branch: 56 branches
BranchTrueFalseTotal
if (defined $Nice::Try::WANT and length $Nice::Try::WANT) { } 0 0 0
if ($Nice::Try::WANT eq 'OBJECT') { } 0 0 0
elsif ($Nice::Try::WANT eq 'CODE') { } 0 0 0
elsif ($Nice::Try::WANT eq 'HASH') { } 0 0 0
elsif ($Nice::Try::WANT eq 'ARRAY') { } 0 0 0
elsif ($Nice::Try::WANT eq 'REFSCALAR') { } 0 0 0
elsif ($Nice::Try::WANT eq 'GLOB') { } 0 0 0
elsif ($Nice::Try::WANT eq 'LIST') { } 0 0 0
elsif ($Nice::Try::WANT eq 'BOOLEAN') { } 0 0 0
elsif ($Nice::Try::WANT eq 'VOID') { } 0 0 0
elsif ($Nice::Try::WANT eq 'SCALAR') { } 0 0 0
&$Nice::Try::CATCH ? : 0 0 0
if scalar @Nice::Try::VOID 0 0 0
if ($Nice::Try::WANTARRAY) { } 0 0 0
elsif (defined $Nice::Try::WANTARRAY) { } 0 0 0
if $@ 0 0 0
if (defined $Nice::Try::CATCH_DIED) 0 0 0
if (defined $Nice::Try::WANTARRAY || defined $Nice::Try::BREAK && $Nice::Try::BREAK eq 'return' and !builtin::blessed($Nice::Try::RETVAL[0]) || builtin::blessed($Nice::Try::RETVAL[0]) && !$Nice::Try::RETVAL[0]->isa('Nice::Try::SENTINEL')) { } 0 0 0
elsif (scalar @Nice::Try::VOID and !builtin::blessed($Nice::Try::VOID[0]) || builtin::blessed($Nice::Try::VOID[0]) && !$Nice::Try::VOID[0]->isa('Nice::Try::SENTINEL')) { } 0 0 0
if defined $Nice::Try::BREAK and $Nice::Try::BREAK eq "return" 0 0 0
if (not defined $Nice::Try::BREAK or $Nice::Try::BREAK eq "return") 0 0 0
if (defined $Nice::Try::WANT and length $Nice::Try::WANT) { } 0 0 0
if ($Nice::Try::WANT eq 'LIST') { } 0 0 0
elsif ($Nice::Try::WANT eq 'VOID') { } 0 0 0
elsif ($Nice::Try::WANT eq 'OBJECT') { } 0 0 0
elsif ($Nice::Try::WANT eq 'REFSCALAR') { } 0 0 0
elsif ($Nice::Try::WANT eq 'SCALAR') { } 0 0 0
elsif ($Nice::Try::WANT eq 'BOOLEAN') { } 0 0 0
elsif ($Nice::Try::WANT eq 'CODE') { } 0 0 0
elsif ($Nice::Try::WANT eq 'HASH') { } 0 0 0
elsif ($Nice::Try::WANT eq 'ARRAY') { } 0 0 0
elsif ($Nice::Try::WANT eq 'GLOB') { } 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
if (defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq '__NEXT__') { } 0 0 0
elsif (defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq '__LAST__') { } 0 0 0
elsif (defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq '__REDO__') { } 0 0 0
elsif (defined $Nice::Try::BREAK and $Nice::Try::BREAK eq 'return') { } 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::WANTARRAY ? : 0 0 0
$Nice::Try::WANTARRAY ? : 0 0 0
scalar @Nice::Try::VOID > 1 ? : 0 0 0
if (defined $Nice::Try::BREAK) 0 0 0
if ($Nice::Try::BREAK eq 'next') { } 0 0 0
elsif ($Nice::Try::BREAK eq 'last') { } 0 0 0
elsif ($Nice::Try::BREAK eq 'redo') { } 0 0 0
scalar @Nice::Try::LAST_VAL > 1 ? : 0 0 0
if not defined $Nice::Try::WANTARRAY and scalar @Nice::Try::LAST_VAL 0 0 0
Condition0%0/50
defined $Nice::Try::WANT and length $Nice::Try::WANT
!ll&&!rl&&r
000
defined $Nice::Try::WANTARRAY || defined $Nice::Try::BREAK && $Nice::Try::BREAK eq "return" and !builtin::blessed($Nice::Try::RETVAL[0]) || builtin::blessed($Nice::Try::RETVAL[0]) && !$Nice::Try::RETVAL[0]->isa("Nice::Try::SENTINEL")
!ll&&!rl&&r
000
defined $Nice::Try::WANTARRAY or defined $Nice::Try::BREAK and $Nice::Try::BREAK eq "return"
l!l&&r!l&&!r
000
defined $Nice::Try::BREAK and $Nice::Try::BREAK eq "return"
!ll&&!rl&&r
000
not builtin::blessed($Nice::Try::RETVAL[0]) or builtin::blessed($Nice::Try::RETVAL[0]) and not $Nice::Try::RETVAL[0]->isa("Nice::Try::SENTINEL")
l!l&&r!l&&!r
000
builtin::blessed($Nice::Try::RETVAL[0]) and not $Nice::Try::RETVAL[0]->isa("Nice::Try::SENTINEL")
!ll&&!rl&&r
000
defined $Nice::Try::BREAK and $Nice::Try::BREAK eq "return"
!ll&&!rl&&r
000
not defined $Nice::Try::BREAK or $Nice::Try::BREAK eq "return"
l!l&&r!l&&!r
000
defined $Nice::Try::WANT and length $Nice::Try::WANT
!ll&&!rl&&r
000
defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq "__NEXT__"
!ll&&!rl&&r
000
defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq "__LAST__"
!ll&&!rl&&r
000
defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq "__REDO__"
!ll&&!rl&&r
000
defined $Nice::Try::BREAK and $Nice::Try::BREAK eq "return"
!ll&&!rl&&r
000
scalar @Nice::Try::VOID and !builtin::blessed($Nice::Try::VOID[0]) || builtin::blessed($Nice::Try::VOID[0]) && !$Nice::Try::VOID[0]->isa("Nice::Try::SENTINEL")
!ll&&!rl&&r
000
not builtin::blessed($Nice::Try::VOID[0]) or builtin::blessed($Nice::Try::VOID[0]) and not $Nice::Try::VOID[0]->isa("Nice::Try::SENTINEL")
l!l&&r!l&&!r
000
builtin::blessed($Nice::Try::VOID[0]) and not $Nice::Try::VOID[0]->isa("Nice::Try::SENTINEL")
!ll&&!rl&&r
000
not defined $Nice::Try::WANTARRAY and scalar @Nice::Try::LAST_VAL
!ll
00
MC/DC0%0/2
defined $Nice::Try::WANT and length $Nice::Try::WANT
defined $Nice::Try::WANT length $Nice::Try::WANT
MC/DC0%0/6
defined $Nice::Try::WANTARRAY || defined $Nice::Try::BREAK && $Nice::Try::BREAK eq "return" and !builtin::blessed($Nice::Try::RETVAL[0]) || builtin::blessed($Nice::Try::RETVAL[0]) && !$Nice::Try::RETVAL[0]->isa("Nice::Try::SENTINEL")
defined $Nice::Try::WANTARRAY defined $Nice::Try::BREAK $Nice::Try::BREAK eq "return" not builtin::blessed($Nice::Try::RETVAL[0]) builtin::blessed($Nice::Try::RETVAL[0]) not $Nice::Try::RETVAL[0]->isa("Nice::Try::SENTINEL")
MC/DC0%0/2
not defined $Nice::Try::BREAK or $Nice::Try::BREAK eq "return"
not defined $Nice::Try::BREAK $Nice::Try::BREAK eq "return"
MC/DC0%0/2
defined $Nice::Try::WANT and length $Nice::Try::WANT
defined $Nice::Try::WANT length $Nice::Try::WANT
MC/DC0%0/2
defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq "__NEXT__"
defined $Nice::Try::RETVAL[0] $Nice::Try::RETVAL[0] eq "__NEXT__"
MC/DC0%0/2
defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq "__LAST__"
defined $Nice::Try::RETVAL[0] $Nice::Try::RETVAL[0] eq "__LAST__"
MC/DC0%0/2
defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq "__REDO__"
defined $Nice::Try::RETVAL[0] $Nice::Try::RETVAL[0] eq "__REDO__"
MC/DC0%0/4
scalar @Nice::Try::VOID and !builtin::blessed($Nice::Try::VOID[0]) || builtin::blessed($Nice::Try::VOID[0]) && !$Nice::Try::VOID[0]->isa("Nice::Try::SENTINEL")
scalar @Nice::Try::VOID not builtin::blessed($Nice::Try::VOID[0]) builtin::blessed($Nice::Try::VOID[0]) not $Nice::Try::VOID[0]->isa("Nice::Try::SENTINEL")
MC/DC0%0/1
not defined $Nice::Try::WANTARRAY and scalar @Nice::Try::LAST_VAL
not defined $Nice::Try::WANTARRAY
Truth table0%0/3
A and B
A= defined $Nice::Try::WANTB= length $Nice::Try::WANT
ABresult
0X0
100
111
Truth table0%0/10
A or B and C and not(D) or E and not(F)
A= defined $Nice::Try::WANTARRAYB= defined $Nice::Try::BREAKC= $Nice::Try::BREAK eq "return"D= not builtin::blessed($Nice::Try::RETVAL[0])E= builtin::blessed($Nice::Try::RETVAL[0])F= not $Nice::Try::RETVAL[0]->isa("Nice::Try::SENTINEL")
ABCDEFresult
00XXXX0
010XXX0
1XX00X0
1XX0100
01100X0
0110100
1XX1XX1
1XX0111
0111XX1
0110111
Truth table0%0/3
not(A) or B
A= not defined $Nice::Try::BREAKB= $Nice::Try::BREAK eq "return"
ABresult
1X1
011
000
Truth table0%0/3
A and B
A= defined $Nice::Try::WANTB= length $Nice::Try::WANT
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= defined $Nice::Try::RETVAL[0]B= $Nice::Try::RETVAL[0] eq "__NEXT__"
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= defined $Nice::Try::RETVAL[0]B= $Nice::Try::RETVAL[0] eq "__LAST__"
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= defined $Nice::Try::RETVAL[0]B= $Nice::Try::RETVAL[0] eq "__REDO__"
ABresult
0X0
100
111
Truth table0%0/5
A and not(B) or C and not(D)
A= scalar @Nice::Try::VOIDB= not builtin::blessed($Nice::Try::VOID[0])C= builtin::blessed($Nice::Try::VOID[0])D= not $Nice::Try::VOID[0]->isa("Nice::Try::SENTINEL")
ABCDresult
0XXX0
100X0
10100
11XX1
10111
Truth table0%0/2
not(A)
A= not defined $Nice::Try::WANTARRAY
Aresult
00
11
487
488 0 ▶ unless( do{ local $SIG{__WARN__} = sub{}; $socket->connected } )
Subroutine __ANON__: not called CC=1 SCAR=6.9
Branch: 1 branch
BranchTrueFalseTotal
unless (do { local $SIG{"__WARN__"} = sub { } ; $socket->connected }) 0 0 0
489 {
490 0 $self->http_error({ code => 410, message => "Connection gone" });
491 0 return( $self->error( "Socket is not connected." ) );
492 }
493
494 0 my $len = $socket->syswrite( $hs->as_string );
495 0 ▶ if( !defined( $len ) )
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $len) 0 0 0
496 {
497 0 return( $self->error({ code => 500, message => "Unable to write handshake response to socket: $!" }) );
498 }
499  
500 # Set frame object for this connection
501 my $frame = WebSocket::Frame->new( max_payload_size => $self->max_recv_size, debug => $self->debug ) || do
502 0 ▶ {
Condition0%0/3
'WebSocket::Frame'->new('max_payload_size', $self->max_recv_size, 'debug', $self->debug) || do { $self->disconnect('WS_INTERNAL_SERVER_ERROR', 'Internal error'); return $self->pass_error('WebSocket::Frame'->error) }
l!l&&r!l&&!r
000
MC/DC0%0/2
'WebSocket::Frame'->new('max_payload_size', $self->max_recv_size, 'debug', $self->debug) || do { $self->disconnect('WS_INTERNAL_SERVER_ERROR', 'Internal error'); return $self->pass_error('WebSocket::Frame'->error) }
'WebSocket::Frame'->new('max_payload_size', $self->max_recv_size, 'debug', $self->debug) do { $self->disconnect('WS_INTERNAL_SERVER_ERROR', 'Internal error'); return $self->pass_error('WebSocket::Frame'->error) }
Truth table0%0/3
A || B
A= 'WebSocket::Frame'->new('max_payload_size', $self->max_recv_size, 'debug', $self->debug)B= do { $self->disconnect('WS_INTERNAL_SERVER_ERROR', 'Internal error'); return $self->pass_error('WebSocket::Frame'->error) }
ABresult
1X1
011
000
503 0 $self->disconnect( WS_INTERNAL_SERVER_ERROR => 'Internal error' );
504 0 return( $self->pass_error( WebSocket::Frame->error ) );
505 };
506 0 $self->frame( $frame );
507 0 ▶ $socket->setsockopt( IPPROTO_TCP, TCP_NODELAY, 1 ) if( $self->nodelay );
Branch: 1 branch
BranchTrueFalseTotal
if $self->nodelay 0 0 0
508 0 ▶ my $ready_cb = $self->on_ready || sub{};
Subroutine __ANON__: not called CC=1 SCAR=6.9
Condition0%0/3
$self->on_ready || sub { }
l!l&&r!l&&!r
000
MC/DC0%0/2
$self->on_ready || sub { }
$self->on_ready sub { }
Truth table0%0/3
A || B
A= $self->on_readyB= sub { }
ABresult
1X1
011
000
509 0 ▶ try
Subroutine __ANON__: not called CC=2 SCAR=17.9
Subroutine __ANON__: not called CC=17 SCAR=56.2
Branch: 3 branches
BranchTrueFalseTotal
unless defined $Nice::Try::NEED_TO_RETURN 0 0 0
if ($INC{"threads.pm"} and not exists $INC{"forks.pm"}) 0 0 0
wantarray ? : 0 0 0
Condition0%0/3
$INC{"threads.pm"} and not exists $INC{"forks.pm"}
!ll&&!rl&&r
000
MC/DC0%0/2
$INC{"threads.pm"} and not exists $INC{"forks.pm"}
$INC{"threads.pm"} not exists $INC{"forks.pm"}
Truth table0%0/3
A and not(B)
A= $INC{"threads.pm"}B= not exists $INC{"forks.pm"}
ABresult
0X0
100
111
510 0 {
511 0 $ready_cb->( $self );
512 }
513 0 ▶ catch( $e )
Subroutine BEGIN: called CC=1 SCAR=6.3
Subroutine BEGIN: called CC=1 SCAR=6.3
Subroutine __ANON__: not called CC=1 SCAR=6.3
Subroutine __ANON__: not called CC=1 SCAR=6.3
Subroutine __ANON__: not called CC=4 SCAR=29.0
Branch: 34 branches
BranchTrueFalseTotal
if (defined $Nice::Try::WANT and length $Nice::Try::WANT) { } 0 0 0
if ($Nice::Try::WANT eq 'OBJECT') { } 0 0 0
elsif ($Nice::Try::WANT eq 'CODE') { } 0 0 0
elsif ($Nice::Try::WANT eq 'HASH') { } 0 0 0
elsif ($Nice::Try::WANT eq 'ARRAY') { } 0 0 0
elsif ($Nice::Try::WANT eq 'REFSCALAR') { } 0 0 0
elsif ($Nice::Try::WANT eq 'GLOB') { } 0 0 0
elsif ($Nice::Try::WANT eq 'LIST') { } 0 0 0
elsif ($Nice::Try::WANT eq 'BOOLEAN') { } 0 0 0
elsif ($Nice::Try::WANT eq 'VOID') { } 0 0 0
elsif ($Nice::Try::WANT eq 'SCALAR') { } 0 0 0
&$Nice::Try::TRY ? : 0 0 0
if scalar @Nice::Try::VOID 0 0 0
if ($Nice::Try::WANTARRAY) { } 0 0 0
elsif (defined $Nice::Try::WANTARRAY) { } 0 0 0
if defined $Nice::Try::LAST_VAL 0 0 0
length $@ ? : 0 0 0
unless builtin::blessed($@) 0 0 0
if ($Nice::Try::DIED) 0 0 0
if ($Nice::Try::HAS_CATCH) 0 0 0
if not defined $Nice::Try::WANTARRAY and scalar @Nice::Try::LAST_VAL 0 0 0
if (defined $Nice::Try::WANT and length $Nice::Try::WANT) { } 0 0 0
if ($Nice::Try::WANT eq 'OBJECT') { } 0 0 0
elsif ($Nice::Try::WANT eq 'CODE') { } 0 0 0
elsif ($Nice::Try::WANT eq 'HASH') { } 0 0 0
elsif ($Nice::Try::WANT eq 'ARRAY') { } 0 0 0
elsif ($Nice::Try::WANT eq 'REFSCALAR') { } 0 0 0
elsif ($Nice::Try::WANT eq 'GLOB') { } 0 0 0
elsif ($Nice::Try::WANT eq 'LIST') { } 0 0 0
elsif ($Nice::Try::WANT eq 'BOOLEAN') { } 0 0 0
elsif ($Nice::Try::WANT eq 'VOID') { } 0 0 0
elsif ($Nice::Try::WANT eq 'SCALAR') { } 0 0 0
if ($Nice::Try::WANTARRAY) { } 0 0 0
elsif (defined $Nice::Try::WANTARRAY) { } 0 0 0
Condition0%0/8
defined $Nice::Try::WANT and length $Nice::Try::WANT
!ll&&!rl&&r
000
not defined $Nice::Try::WANTARRAY and scalar @Nice::Try::LAST_VAL
!ll
00
defined $Nice::Try::WANT and length $Nice::Try::WANT
!ll&&!rl&&r
000
MC/DC0%0/2
defined $Nice::Try::WANT and length $Nice::Try::WANT
defined $Nice::Try::WANT length $Nice::Try::WANT
MC/DC0%0/1
not defined $Nice::Try::WANTARRAY and scalar @Nice::Try::LAST_VAL
not defined $Nice::Try::WANTARRAY
MC/DC0%0/2
defined $Nice::Try::WANT and length $Nice::Try::WANT
defined $Nice::Try::WANT length $Nice::Try::WANT
Truth table0%0/3
A and B
A= defined $Nice::Try::WANTB= length $Nice::Try::WANT
ABresult
0X0
100
111
Truth table0%0/2
not(A)
A= not defined $Nice::Try::WANTARRAY
Aresult
00
11
Truth table0%0/3
A and B
A= defined $Nice::Try::WANTB= length $Nice::Try::WANT
ABresult
0X0
100
111
514 0 {
515 0 ▶ warn( "An error occurred while trying to call the ready callback: $e" ) if( $self->_warnings_is_enabled( $self->server ) );
Branch: 1 branch
BranchTrueFalseTotal
if $self->_warnings_is_enabled($self->server) 0 0 0
516 0 ▶ }
Subroutine BEGIN: called CC=1 SCAR=6.3
Subroutine BEGIN: called CC=1 SCAR=6.3
Subroutine BEGIN: called CC=1 SCAR=6.3
Branch: 56 branches
BranchTrueFalseTotal
if (defined $Nice::Try::WANT and length $Nice::Try::WANT) { } 0 0 0
if ($Nice::Try::WANT eq 'OBJECT') { } 0 0 0
elsif ($Nice::Try::WANT eq 'CODE') { } 0 0 0
elsif ($Nice::Try::WANT eq 'HASH') { } 0 0 0
elsif ($Nice::Try::WANT eq 'ARRAY') { } 0 0 0
elsif ($Nice::Try::WANT eq 'REFSCALAR') { } 0 0 0
elsif ($Nice::Try::WANT eq 'GLOB') { } 0 0 0
elsif ($Nice::Try::WANT eq 'LIST') { } 0 0 0
elsif ($Nice::Try::WANT eq 'BOOLEAN') { } 0 0 0
elsif ($Nice::Try::WANT eq 'VOID') { } 0 0 0
elsif ($Nice::Try::WANT eq 'SCALAR') { } 0 0 0
&$Nice::Try::CATCH ? : 0 0 0
if scalar @Nice::Try::VOID 0 0 0
if ($Nice::Try::WANTARRAY) { } 0 0 0
elsif (defined $Nice::Try::WANTARRAY) { } 0 0 0
if $@ 0 0 0
if (defined $Nice::Try::CATCH_DIED) 0 0 0
if (defined $Nice::Try::WANTARRAY || defined $Nice::Try::BREAK && $Nice::Try::BREAK eq 'return' and !builtin::blessed($Nice::Try::RETVAL[0]) || builtin::blessed($Nice::Try::RETVAL[0]) && !$Nice::Try::RETVAL[0]->isa('Nice::Try::SENTINEL')) { } 0 0 0
elsif (scalar @Nice::Try::VOID and !builtin::blessed($Nice::Try::VOID[0]) || builtin::blessed($Nice::Try::VOID[0]) && !$Nice::Try::VOID[0]->isa('Nice::Try::SENTINEL')) { } 0 0 0
if defined $Nice::Try::BREAK and $Nice::Try::BREAK eq "return" 0 0 0
if (not defined $Nice::Try::BREAK or $Nice::Try::BREAK eq "return") 0 0 0
if (defined $Nice::Try::WANT and length $Nice::Try::WANT) { } 0 0 0
if ($Nice::Try::WANT eq 'LIST') { } 0 0 0
elsif ($Nice::Try::WANT eq 'VOID') { } 0 0 0
elsif ($Nice::Try::WANT eq 'OBJECT') { } 0 0 0
elsif ($Nice::Try::WANT eq 'REFSCALAR') { } 0 0 0
elsif ($Nice::Try::WANT eq 'SCALAR') { } 0 0 0
elsif ($Nice::Try::WANT eq 'BOOLEAN') { } 0 0 0
elsif ($Nice::Try::WANT eq 'CODE') { } 0 0 0
elsif ($Nice::Try::WANT eq 'HASH') { } 0 0 0
elsif ($Nice::Try::WANT eq 'ARRAY') { } 0 0 0
elsif ($Nice::Try::WANT eq 'GLOB') { } 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
if (defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq '__NEXT__') { } 0 0 0
elsif (defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq '__LAST__') { } 0 0 0
elsif (defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq '__REDO__') { } 0 0 0
elsif (defined $Nice::Try::BREAK and $Nice::Try::BREAK eq 'return') { } 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::WANTARRAY ? : 0 0 0
$Nice::Try::WANTARRAY ? : 0 0 0
scalar @Nice::Try::VOID > 1 ? : 0 0 0
if (defined $Nice::Try::BREAK) 0 0 0
if ($Nice::Try::BREAK eq 'next') { } 0 0 0
elsif ($Nice::Try::BREAK eq 'last') { } 0 0 0
elsif ($Nice::Try::BREAK eq 'redo') { } 0 0 0
scalar @Nice::Try::LAST_VAL > 1 ? : 0 0 0
if not defined $Nice::Try::WANTARRAY and scalar @Nice::Try::LAST_VAL 0 0 0
Condition0%0/50
defined $Nice::Try::WANT and length $Nice::Try::WANT
!ll&&!rl&&r
000
defined $Nice::Try::WANTARRAY || defined $Nice::Try::BREAK && $Nice::Try::BREAK eq "return" and !builtin::blessed($Nice::Try::RETVAL[0]) || builtin::blessed($Nice::Try::RETVAL[0]) && !$Nice::Try::RETVAL[0]->isa("Nice::Try::SENTINEL")
!ll&&!rl&&r
000
defined $Nice::Try::WANTARRAY or defined $Nice::Try::BREAK and $Nice::Try::BREAK eq "return"
l!l&&r!l&&!r
000
defined $Nice::Try::BREAK and $Nice::Try::BREAK eq "return"
!ll&&!rl&&r
000
not builtin::blessed($Nice::Try::RETVAL[0]) or builtin::blessed($Nice::Try::RETVAL[0]) and not $Nice::Try::RETVAL[0]->isa("Nice::Try::SENTINEL")
l!l&&r!l&&!r
000
builtin::blessed($Nice::Try::RETVAL[0]) and not $Nice::Try::RETVAL[0]->isa("Nice::Try::SENTINEL")
!ll&&!rl&&r
000
defined $Nice::Try::BREAK and $Nice::Try::BREAK eq "return"
!ll&&!rl&&r
000
not defined $Nice::Try::BREAK or $Nice::Try::BREAK eq "return"
l!l&&r!l&&!r
000
defined $Nice::Try::WANT and length $Nice::Try::WANT
!ll&&!rl&&r
000
defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq "__NEXT__"
!ll&&!rl&&r
000
defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq "__LAST__"
!ll&&!rl&&r
000
defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq "__REDO__"
!ll&&!rl&&r
000
defined $Nice::Try::BREAK and $Nice::Try::BREAK eq "return"
!ll&&!rl&&r
000
scalar @Nice::Try::VOID and !builtin::blessed($Nice::Try::VOID[0]) || builtin::blessed($Nice::Try::VOID[0]) && !$Nice::Try::VOID[0]->isa("Nice::Try::SENTINEL")
!ll&&!rl&&r
000
not builtin::blessed($Nice::Try::VOID[0]) or builtin::blessed($Nice::Try::VOID[0]) and not $Nice::Try::VOID[0]->isa("Nice::Try::SENTINEL")
l!l&&r!l&&!r
000
builtin::blessed($Nice::Try::VOID[0]) and not $Nice::Try::VOID[0]->isa("Nice::Try::SENTINEL")
!ll&&!rl&&r
000
not defined $Nice::Try::WANTARRAY and scalar @Nice::Try::LAST_VAL
!ll
00
MC/DC0%0/2
defined $Nice::Try::WANT and length $Nice::Try::WANT
defined $Nice::Try::WANT length $Nice::Try::WANT
MC/DC0%0/6
defined $Nice::Try::WANTARRAY || defined $Nice::Try::BREAK && $Nice::Try::BREAK eq "return" and !builtin::blessed($Nice::Try::RETVAL[0]) || builtin::blessed($Nice::Try::RETVAL[0]) && !$Nice::Try::RETVAL[0]->isa("Nice::Try::SENTINEL")
defined $Nice::Try::WANTARRAY defined $Nice::Try::BREAK $Nice::Try::BREAK eq "return" not builtin::blessed($Nice::Try::RETVAL[0]) builtin::blessed($Nice::Try::RETVAL[0]) not $Nice::Try::RETVAL[0]->isa("Nice::Try::SENTINEL")
MC/DC0%0/2
not defined $Nice::Try::BREAK or $Nice::Try::BREAK eq "return"
not defined $Nice::Try::BREAK $Nice::Try::BREAK eq "return"
MC/DC0%0/2
defined $Nice::Try::WANT and length $Nice::Try::WANT
defined $Nice::Try::WANT length $Nice::Try::WANT
MC/DC0%0/2
defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq "__NEXT__"
defined $Nice::Try::RETVAL[0] $Nice::Try::RETVAL[0] eq "__NEXT__"
MC/DC0%0/2
defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq "__LAST__"
defined $Nice::Try::RETVAL[0] $Nice::Try::RETVAL[0] eq "__LAST__"
MC/DC0%0/2
defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq "__REDO__"
defined $Nice::Try::RETVAL[0] $Nice::Try::RETVAL[0] eq "__REDO__"
MC/DC0%0/4
scalar @Nice::Try::VOID and !builtin::blessed($Nice::Try::VOID[0]) || builtin::blessed($Nice::Try::VOID[0]) && !$Nice::Try::VOID[0]->isa("Nice::Try::SENTINEL")
scalar @Nice::Try::VOID not builtin::blessed($Nice::Try::VOID[0]) builtin::blessed($Nice::Try::VOID[0]) not $Nice::Try::VOID[0]->isa("Nice::Try::SENTINEL")
MC/DC0%0/1
not defined $Nice::Try::WANTARRAY and scalar @Nice::Try::LAST_VAL
not defined $Nice::Try::WANTARRAY
Truth table0%0/3
A and B
A= defined $Nice::Try::WANTB= length $Nice::Try::WANT
ABresult
0X0
100
111
Truth table0%0/10
A or B and C and not(D) or E and not(F)
A= defined $Nice::Try::WANTARRAYB= defined $Nice::Try::BREAKC= $Nice::Try::BREAK eq "return"D= not builtin::blessed($Nice::Try::RETVAL[0])E= builtin::blessed($Nice::Try::RETVAL[0])F= not $Nice::Try::RETVAL[0]->isa("Nice::Try::SENTINEL")
ABCDEFresult
00XXXX0
010XXX0
1XX00X0
1XX0100
01100X0
0110100
1XX1XX1
1XX0111
0111XX1
0110111
Truth table0%0/3
not(A) or B
A= not defined $Nice::Try::BREAKB= $Nice::Try::BREAK eq "return"
ABresult
1X1
011
000
Truth table0%0/3
A and B
A= defined $Nice::Try::WANTB= length $Nice::Try::WANT
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= defined $Nice::Try::RETVAL[0]B= $Nice::Try::RETVAL[0] eq "__NEXT__"
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= defined $Nice::Try::RETVAL[0]B= $Nice::Try::RETVAL[0] eq "__LAST__"
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= defined $Nice::Try::RETVAL[0]B= $Nice::Try::RETVAL[0] eq "__REDO__"
ABresult
0X0
100
111
Truth table0%0/5
A and not(B) or C and not(D)
A= scalar @Nice::Try::VOIDB= not builtin::blessed($Nice::Try::VOID[0])C= builtin::blessed($Nice::Try::VOID[0])D= not $Nice::Try::VOID[0]->isa("Nice::Try::SENTINEL")
ABCDresult
0XXX0
100X0
10100
11XX1
10111
Truth table0%0/2
not(A)
A= not defined $Nice::Try::WANTARRAY
Aresult
00
11
517 }
518 # return( $self->error( "Client handshake parsed, but still not marked as done? Should not get here." ) );
519 0 return( $self );
520 }
521 # End of handshake
522  
523 0 my $frame = $self->frame;
524 0 $frame->append( $data );
525  
526 0 my $bytes;
527 0 ▶ my $binary_cb = $self->on_binary || sub{};
Subroutine __ANON__: not called CC=1 SCAR=6.9
Condition0%0/3
$self->on_binary || sub { }
l!l&&r!l&&!r
000
MC/DC0%0/2
$self->on_binary || sub { }
$self->on_binary sub { }
Truth table0%0/3
A || B
A= $self->on_binaryB= sub { }
ABresult
1X1
011
000
528 0 ▶ my $msg_cb = $self->on_utf8 || sub{};
Subroutine __ANON__: not called CC=1 SCAR=6.9
Condition0%0/3
$self->on_utf8 || sub { }
l!l&&r!l&&!r
000
MC/DC0%0/2
$self->on_utf8 || sub { }
$self->on_utf8 sub { }
Truth table0%0/3
A || B
A= $self->on_utf8B= sub { }
ABresult
1X1
011
000
529 0 ▶ my $ping_cb = $self->on_ping || sub{};
Subroutine __ANON__: not called CC=1 SCAR=6.9
Condition0%0/3
$self->on_ping || sub { }
l!l&&r!l&&!r
000
MC/DC0%0/2
$self->on_ping || sub { }
$self->on_ping sub { }
Truth table0%0/3
A || B
A= $self->on_pingB= sub { }
ABresult
1X1
011
000
530 0 ▶ my $pong_cb = $self->on_pong || sub{};
Subroutine __ANON__: not called CC=1 SCAR=6.9
Condition0%0/3
$self->on_pong || sub { }
l!l&&r!l&&!r
000
MC/DC0%0/2
$self->on_pong || sub { }
$self->on_pong sub { }
Truth table0%0/3
A || B
A= $self->on_pongB= sub { }
ABresult
1X1
011
000
531 0 ▶ my $do_pong = $self->do_pong || sub{};
Subroutine __ANON__: not called CC=1 SCAR=6.9
Condition0%0/3
$self->do_pong || sub { }
l!l&&r!l&&!r
000
MC/DC0%0/2
$self->do_pong || sub { }
$self->do_pong sub { }
Truth table0%0/3
A || B
A= $self->do_pongB= sub { }
ABresult
1X1
011
000
532 0 ▶ while( defined( $bytes = $frame->next_bytes ) )
Branch: 1 branch
BranchTrueFalseTotal
if (defined($bytes = $frame->next_bytes)) 0 0 0
533 {
534 0 ▶ if( $frame->is_binary )
Branch: 5 branches
BranchTrueFalseTotal
if ($frame->is_binary) { } 0 0 0
elsif ($frame->is_text) { } 0 0 0
elsif ($frame->is_ping) { } 0 0 0
elsif ($frame->is_pong) { } 0 0 0
elsif ($frame->is_close) { } 0 0 0
535 {
536 0 ▶ try
Subroutine __ANON__: not called CC=2 SCAR=17.9
Subroutine __ANON__: not called CC=17 SCAR=56.2
Branch: 3 branches
BranchTrueFalseTotal
unless defined $Nice::Try::NEED_TO_RETURN 0 0 0
if ($INC{"threads.pm"} and not exists $INC{"forks.pm"}) 0 0 0
wantarray ? : 0 0 0
Condition0%0/3
$INC{"threads.pm"} and not exists $INC{"forks.pm"}
!ll&&!rl&&r
000
MC/DC0%0/2
$INC{"threads.pm"} and not exists $INC{"forks.pm"}
$INC{"threads.pm"} not exists $INC{"forks.pm"}
Truth table0%0/3
A and not(B)
A= $INC{"threads.pm"}B= not exists $INC{"forks.pm"}
ABresult
0X0
100
111
537 0 {
538 0 $binary_cb->( $self, $bytes );
539 }
540 0 ▶ catch( $e )
Subroutine BEGIN: called CC=1 SCAR=6.3
Subroutine BEGIN: called CC=1 SCAR=6.3
Subroutine __ANON__: not called CC=1 SCAR=6.3
Subroutine __ANON__: not called CC=1 SCAR=6.3
Subroutine __ANON__: not called CC=4 SCAR=29.0
Branch: 34 branches
BranchTrueFalseTotal
if (defined $Nice::Try::WANT and length $Nice::Try::WANT) { } 0 0 0
if ($Nice::Try::WANT eq 'OBJECT') { } 0 0 0
elsif ($Nice::Try::WANT eq 'CODE') { } 0 0 0
elsif ($Nice::Try::WANT eq 'HASH') { } 0 0 0
elsif ($Nice::Try::WANT eq 'ARRAY') { } 0 0 0
elsif ($Nice::Try::WANT eq 'REFSCALAR') { } 0 0 0
elsif ($Nice::Try::WANT eq 'GLOB') { } 0 0 0
elsif ($Nice::Try::WANT eq 'LIST') { } 0 0 0
elsif ($Nice::Try::WANT eq 'BOOLEAN') { } 0 0 0
elsif ($Nice::Try::WANT eq 'VOID') { } 0 0 0
elsif ($Nice::Try::WANT eq 'SCALAR') { } 0 0 0
&$Nice::Try::TRY ? : 0 0 0
if scalar @Nice::Try::VOID 0 0 0
if ($Nice::Try::WANTARRAY) { } 0 0 0
elsif (defined $Nice::Try::WANTARRAY) { } 0 0 0
if defined $Nice::Try::LAST_VAL 0 0 0
length $@ ? : 0 0 0
unless builtin::blessed($@) 0 0 0
if ($Nice::Try::DIED) 0 0 0
if ($Nice::Try::HAS_CATCH) 0 0 0
if not defined $Nice::Try::WANTARRAY and scalar @Nice::Try::LAST_VAL 0 0 0
if (defined $Nice::Try::WANT and length $Nice::Try::WANT) { } 0 0 0
if ($Nice::Try::WANT eq 'OBJECT') { } 0 0 0
elsif ($Nice::Try::WANT eq 'CODE') { } 0 0 0
elsif ($Nice::Try::WANT eq 'HASH') { } 0 0 0
elsif ($Nice::Try::WANT eq 'ARRAY') { } 0 0 0
elsif ($Nice::Try::WANT eq 'REFSCALAR') { } 0 0 0
elsif ($Nice::Try::WANT eq 'GLOB') { } 0 0 0
elsif ($Nice::Try::WANT eq 'LIST') { } 0 0 0
elsif ($Nice::Try::WANT eq 'BOOLEAN') { } 0 0 0
elsif ($Nice::Try::WANT eq 'VOID') { } 0 0 0
elsif ($Nice::Try::WANT eq 'SCALAR') { } 0 0 0
if ($Nice::Try::WANTARRAY) { } 0 0 0
elsif (defined $Nice::Try::WANTARRAY) { } 0 0 0
Condition0%0/8
defined $Nice::Try::WANT and length $Nice::Try::WANT
!ll&&!rl&&r
000
not defined $Nice::Try::WANTARRAY and scalar @Nice::Try::LAST_VAL
!ll
00
defined $Nice::Try::WANT and length $Nice::Try::WANT
!ll&&!rl&&r
000
MC/DC0%0/2
defined $Nice::Try::WANT and length $Nice::Try::WANT
defined $Nice::Try::WANT length $Nice::Try::WANT
MC/DC0%0/1
not defined $Nice::Try::WANTARRAY and scalar @Nice::Try::LAST_VAL
not defined $Nice::Try::WANTARRAY
MC/DC0%0/2
defined $Nice::Try::WANT and length $Nice::Try::WANT
defined $Nice::Try::WANT length $Nice::Try::WANT
Truth table0%0/3
A and B
A= defined $Nice::Try::WANTB= length $Nice::Try::WANT
ABresult
0X0
100
111
Truth table0%0/2
not(A)
A= not defined $Nice::Try::WANTARRAY
Aresult
00
11
Truth table0%0/3
A and B
A= defined $Nice::Try::WANTB= length $Nice::Try::WANT
ABresult
0X0
100
111
541 0 {
542 0 ▶ warn( "Error with callback to process binary message: $e" ) if( $self->_warnings_is_enabled( $self->server ) );
Branch: 1 branch
BranchTrueFalseTotal
if $self->_warnings_is_enabled($self->server) 0 0 0
543 0 ▶ }
Subroutine BEGIN: called CC=1 SCAR=6.3
Subroutine BEGIN: called CC=1 SCAR=6.3
Subroutine BEGIN: called CC=1 SCAR=6.3
Branch: 56 branches
BranchTrueFalseTotal
if (defined $Nice::Try::WANT and length $Nice::Try::WANT) { } 0 0 0
if ($Nice::Try::WANT eq 'OBJECT') { } 0 0 0
elsif ($Nice::Try::WANT eq 'CODE') { } 0 0 0
elsif ($Nice::Try::WANT eq 'HASH') { } 0 0 0
elsif ($Nice::Try::WANT eq 'ARRAY') { } 0 0 0
elsif ($Nice::Try::WANT eq 'REFSCALAR') { } 0 0 0
elsif ($Nice::Try::WANT eq 'GLOB') { } 0 0 0
elsif ($Nice::Try::WANT eq 'LIST') { } 0 0 0
elsif ($Nice::Try::WANT eq 'BOOLEAN') { } 0 0 0
elsif ($Nice::Try::WANT eq 'VOID') { } 0 0 0
elsif ($Nice::Try::WANT eq 'SCALAR') { } 0 0 0
&$Nice::Try::CATCH ? : 0 0 0
if scalar @Nice::Try::VOID 0 0 0
if ($Nice::Try::WANTARRAY) { } 0 0 0
elsif (defined $Nice::Try::WANTARRAY) { } 0 0 0
if $@ 0 0 0
if (defined $Nice::Try::CATCH_DIED) 0 0 0
if (defined $Nice::Try::WANTARRAY || defined $Nice::Try::BREAK && $Nice::Try::BREAK eq 'return' and !builtin::blessed($Nice::Try::RETVAL[0]) || builtin::blessed($Nice::Try::RETVAL[0]) && !$Nice::Try::RETVAL[0]->isa('Nice::Try::SENTINEL')) { } 0 0 0
elsif (scalar @Nice::Try::VOID and !builtin::blessed($Nice::Try::VOID[0]) || builtin::blessed($Nice::Try::VOID[0]) && !$Nice::Try::VOID[0]->isa('Nice::Try::SENTINEL')) { } 0 0 0
if defined $Nice::Try::BREAK and $Nice::Try::BREAK eq "return" 0 0 0
if (not defined $Nice::Try::BREAK or $Nice::Try::BREAK eq "return") 0 0 0
if (defined $Nice::Try::WANT and length $Nice::Try::WANT) { } 0 0 0
if ($Nice::Try::WANT eq 'LIST') { } 0 0 0
elsif ($Nice::Try::WANT eq 'VOID') { } 0 0 0
elsif ($Nice::Try::WANT eq 'OBJECT') { } 0 0 0
elsif ($Nice::Try::WANT eq 'REFSCALAR') { } 0 0 0
elsif ($Nice::Try::WANT eq 'SCALAR') { } 0 0 0
elsif ($Nice::Try::WANT eq 'BOOLEAN') { } 0 0 0
elsif ($Nice::Try::WANT eq 'CODE') { } 0 0 0
elsif ($Nice::Try::WANT eq 'HASH') { } 0 0 0
elsif ($Nice::Try::WANT eq 'ARRAY') { } 0 0 0
elsif ($Nice::Try::WANT eq 'GLOB') { } 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
if (defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq '__NEXT__') { } 0 0 0
elsif (defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq '__LAST__') { } 0 0 0
elsif (defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq '__REDO__') { } 0 0 0
elsif (defined $Nice::Try::BREAK and $Nice::Try::BREAK eq 'return') { } 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::WANTARRAY ? : 0 0 0
$Nice::Try::WANTARRAY ? : 0 0 0
scalar @Nice::Try::VOID > 1 ? : 0 0 0
if (defined $Nice::Try::BREAK) 0 0 0
if ($Nice::Try::BREAK eq 'next') { } 0 0 0
elsif ($Nice::Try::BREAK eq 'last') { } 0 0 0
elsif ($Nice::Try::BREAK eq 'redo') { } 0 0 0
scalar @Nice::Try::LAST_VAL > 1 ? : 0 0 0
if not defined $Nice::Try::WANTARRAY and scalar @Nice::Try::LAST_VAL 0 0 0
Condition0%0/50
defined $Nice::Try::WANT and length $Nice::Try::WANT
!ll&&!rl&&r
000
defined $Nice::Try::WANTARRAY || defined $Nice::Try::BREAK && $Nice::Try::BREAK eq "return" and !builtin::blessed($Nice::Try::RETVAL[0]) || builtin::blessed($Nice::Try::RETVAL[0]) && !$Nice::Try::RETVAL[0]->isa("Nice::Try::SENTINEL")
!ll&&!rl&&r
000
defined $Nice::Try::WANTARRAY or defined $Nice::Try::BREAK and $Nice::Try::BREAK eq "return"
l!l&&r!l&&!r
000
defined $Nice::Try::BREAK and $Nice::Try::BREAK eq "return"
!ll&&!rl&&r
000
not builtin::blessed($Nice::Try::RETVAL[0]) or builtin::blessed($Nice::Try::RETVAL[0]) and not $Nice::Try::RETVAL[0]->isa("Nice::Try::SENTINEL")
l!l&&r!l&&!r
000
builtin::blessed($Nice::Try::RETVAL[0]) and not $Nice::Try::RETVAL[0]->isa("Nice::Try::SENTINEL")
!ll&&!rl&&r
000
defined $Nice::Try::BREAK and $Nice::Try::BREAK eq "return"
!ll&&!rl&&r
000
not defined $Nice::Try::BREAK or $Nice::Try::BREAK eq "return"
l!l&&r!l&&!r
000
defined $Nice::Try::WANT and length $Nice::Try::WANT
!ll&&!rl&&r
000
defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq "__NEXT__"
!ll&&!rl&&r
000
defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq "__LAST__"
!ll&&!rl&&r
000
defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq "__REDO__"
!ll&&!rl&&r
000
defined $Nice::Try::BREAK and $Nice::Try::BREAK eq "return"
!ll&&!rl&&r
000
scalar @Nice::Try::VOID and !builtin::blessed($Nice::Try::VOID[0]) || builtin::blessed($Nice::Try::VOID[0]) && !$Nice::Try::VOID[0]->isa("Nice::Try::SENTINEL")
!ll&&!rl&&r
000
not builtin::blessed($Nice::Try::VOID[0]) or builtin::blessed($Nice::Try::VOID[0]) and not $Nice::Try::VOID[0]->isa("Nice::Try::SENTINEL")
l!l&&r!l&&!r
000
builtin::blessed($Nice::Try::VOID[0]) and not $Nice::Try::VOID[0]->isa("Nice::Try::SENTINEL")
!ll&&!rl&&r
000
not defined $Nice::Try::WANTARRAY and scalar @Nice::Try::LAST_VAL
!ll
00
MC/DC0%0/2
defined $Nice::Try::WANT and length $Nice::Try::WANT
defined $Nice::Try::WANT length $Nice::Try::WANT
MC/DC0%0/6
defined $Nice::Try::WANTARRAY || defined $Nice::Try::BREAK && $Nice::Try::BREAK eq "return" and !builtin::blessed($Nice::Try::RETVAL[0]) || builtin::blessed($Nice::Try::RETVAL[0]) && !$Nice::Try::RETVAL[0]->isa("Nice::Try::SENTINEL")
defined $Nice::Try::WANTARRAY defined $Nice::Try::BREAK $Nice::Try::BREAK eq "return" not builtin::blessed($Nice::Try::RETVAL[0]) builtin::blessed($Nice::Try::RETVAL[0]) not $Nice::Try::RETVAL[0]->isa("Nice::Try::SENTINEL")
MC/DC0%0/2
not defined $Nice::Try::BREAK or $Nice::Try::BREAK eq "return"
not defined $Nice::Try::BREAK $Nice::Try::BREAK eq "return"
MC/DC0%0/2
defined $Nice::Try::WANT and length $Nice::Try::WANT
defined $Nice::Try::WANT length $Nice::Try::WANT
MC/DC0%0/2
defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq "__NEXT__"
defined $Nice::Try::RETVAL[0] $Nice::Try::RETVAL[0] eq "__NEXT__"
MC/DC0%0/2
defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq "__LAST__"
defined $Nice::Try::RETVAL[0] $Nice::Try::RETVAL[0] eq "__LAST__"
MC/DC0%0/2
defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq "__REDO__"
defined $Nice::Try::RETVAL[0] $Nice::Try::RETVAL[0] eq "__REDO__"
MC/DC0%0/4
scalar @Nice::Try::VOID and !builtin::blessed($Nice::Try::VOID[0]) || builtin::blessed($Nice::Try::VOID[0]) && !$Nice::Try::VOID[0]->isa("Nice::Try::SENTINEL")
scalar @Nice::Try::VOID not builtin::blessed($Nice::Try::VOID[0]) builtin::blessed($Nice::Try::VOID[0]) not $Nice::Try::VOID[0]->isa("Nice::Try::SENTINEL")
MC/DC0%0/1
not defined $Nice::Try::WANTARRAY and scalar @Nice::Try::LAST_VAL
not defined $Nice::Try::WANTARRAY
Truth table0%0/3
A and B
A= defined $Nice::Try::WANTB= length $Nice::Try::WANT
ABresult
0X0
100
111
Truth table0%0/10
A or B and C and not(D) or E and not(F)
A= defined $Nice::Try::WANTARRAYB= defined $Nice::Try::BREAKC= $Nice::Try::BREAK eq "return"D= not builtin::blessed($Nice::Try::RETVAL[0])E= builtin::blessed($Nice::Try::RETVAL[0])F= not $Nice::Try::RETVAL[0]->isa("Nice::Try::SENTINEL")
ABCDEFresult
00XXXX0
010XXX0
1XX00X0
1XX0100
01100X0
0110100
1XX1XX1
1XX0111
0111XX1
0110111
Truth table0%0/3
not(A) or B
A= not defined $Nice::Try::BREAKB= $Nice::Try::BREAK eq "return"
ABresult
1X1
011
000
Truth table0%0/3
A and B
A= defined $Nice::Try::WANTB= length $Nice::Try::WANT
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= defined $Nice::Try::RETVAL[0]B= $Nice::Try::RETVAL[0] eq "__NEXT__"
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= defined $Nice::Try::RETVAL[0]B= $Nice::Try::RETVAL[0] eq "__LAST__"
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= defined $Nice::Try::RETVAL[0]B= $Nice::Try::RETVAL[0] eq "__REDO__"
ABresult
0X0
100
111
Truth table0%0/5
A and not(B) or C and not(D)
A= scalar @Nice::Try::VOIDB= not builtin::blessed($Nice::Try::VOID[0])C= builtin::blessed($Nice::Try::VOID[0])D= not $Nice::Try::VOID[0]->isa("Nice::Try::SENTINEL")
ABCDresult
0XXX0
100X0
10100
11XX1
10111
Truth table0%0/2
not(A)
A= not defined $Nice::Try::WANTARRAY
Aresult
00
11
544 }
545 elsif( $frame->is_text )
546 {
547 0 ▶ try
Subroutine __ANON__: not called CC=2 SCAR=17.9
Subroutine __ANON__: not called CC=17 SCAR=56.2
Branch: 3 branches
BranchTrueFalseTotal
unless defined $Nice::Try::NEED_TO_RETURN 0 0 0
if ($INC{"threads.pm"} and not exists $INC{"forks.pm"}) 0 0 0
wantarray ? : 0 0 0
Condition0%0/3
$INC{"threads.pm"} and not exists $INC{"forks.pm"}
!ll&&!rl&&r
000
MC/DC0%0/2
$INC{"threads.pm"} and not exists $INC{"forks.pm"}
$INC{"threads.pm"} not exists $INC{"forks.pm"}
Truth table0%0/3
A and not(B)
A= $INC{"threads.pm"}B= not exists $INC{"forks.pm"}
ABresult
0X0
100
111
548 0 {
549 0 $msg_cb->( $self, Encode::decode( 'UTF-8', $bytes ) );
550 }
551 0 ▶ catch( $e )
Subroutine BEGIN: called CC=1 SCAR=6.3
Subroutine BEGIN: called CC=1 SCAR=6.3
Subroutine __ANON__: not called CC=1 SCAR=6.3
Subroutine __ANON__: not called CC=1 SCAR=6.3
Subroutine __ANON__: not called CC=4 SCAR=29.0
Branch: 34 branches
BranchTrueFalseTotal
if (defined $Nice::Try::WANT and length $Nice::Try::WANT) { } 0 0 0
if ($Nice::Try::WANT eq 'OBJECT') { } 0 0 0
elsif ($Nice::Try::WANT eq 'CODE') { } 0 0 0
elsif ($Nice::Try::WANT eq 'HASH') { } 0 0 0
elsif ($Nice::Try::WANT eq 'ARRAY') { } 0 0 0
elsif ($Nice::Try::WANT eq 'REFSCALAR') { } 0 0 0
elsif ($Nice::Try::WANT eq 'GLOB') { } 0 0 0
elsif ($Nice::Try::WANT eq 'LIST') { } 0 0 0
elsif ($Nice::Try::WANT eq 'BOOLEAN') { } 0 0 0
elsif ($Nice::Try::WANT eq 'VOID') { } 0 0 0
elsif ($Nice::Try::WANT eq 'SCALAR') { } 0 0 0
&$Nice::Try::TRY ? : 0 0 0
if scalar @Nice::Try::VOID 0 0 0
if ($Nice::Try::WANTARRAY) { } 0 0 0
elsif (defined $Nice::Try::WANTARRAY) { } 0 0 0
if defined $Nice::Try::LAST_VAL 0 0 0
length $@ ? : 0 0 0
unless builtin::blessed($@) 0 0 0
if ($Nice::Try::DIED) 0 0 0
if ($Nice::Try::HAS_CATCH) 0 0 0
if not defined $Nice::Try::WANTARRAY and scalar @Nice::Try::LAST_VAL 0 0 0
if (defined $Nice::Try::WANT and length $Nice::Try::WANT) { } 0 0 0
if ($Nice::Try::WANT eq 'OBJECT') { } 0 0 0
elsif ($Nice::Try::WANT eq 'CODE') { } 0 0 0
elsif ($Nice::Try::WANT eq 'HASH') { } 0 0 0
elsif ($Nice::Try::WANT eq 'ARRAY') { } 0 0 0
elsif ($Nice::Try::WANT eq 'REFSCALAR') { } 0 0 0
elsif ($Nice::Try::WANT eq 'GLOB') { } 0 0 0
elsif ($Nice::Try::WANT eq 'LIST') { } 0 0 0
elsif ($Nice::Try::WANT eq 'BOOLEAN') { } 0 0 0
elsif ($Nice::Try::WANT eq 'VOID') { } 0 0 0
elsif ($Nice::Try::WANT eq 'SCALAR') { } 0 0 0
if ($Nice::Try::WANTARRAY) { } 0 0 0
elsif (defined $Nice::Try::WANTARRAY) { } 0 0 0
Condition0%0/8
defined $Nice::Try::WANT and length $Nice::Try::WANT
!ll&&!rl&&r
000
not defined $Nice::Try::WANTARRAY and scalar @Nice::Try::LAST_VAL
!ll
00
defined $Nice::Try::WANT and length $Nice::Try::WANT
!ll&&!rl&&r
000
MC/DC0%0/2
defined $Nice::Try::WANT and length $Nice::Try::WANT
defined $Nice::Try::WANT length $Nice::Try::WANT
MC/DC0%0/1
not defined $Nice::Try::WANTARRAY and scalar @Nice::Try::LAST_VAL
not defined $Nice::Try::WANTARRAY
MC/DC0%0/2
defined $Nice::Try::WANT and length $Nice::Try::WANT
defined $Nice::Try::WANT length $Nice::Try::WANT
Truth table0%0/3
A and B
A= defined $Nice::Try::WANTB= length $Nice::Try::WANT
ABresult
0X0
100
111
Truth table0%0/2
not(A)
A= not defined $Nice::Try::WANTARRAY
Aresult
00
11
Truth table0%0/3
A and B
A= defined $Nice::Try::WANTB= length $Nice::Try::WANT
ABresult
0X0
100
111
552 0 {
553 0 ▶ warn( "Error with callback to process text message: $e" ) if( $self->_warnings_is_enabled( $self->server ) );
Branch: 1 branch
BranchTrueFalseTotal
if $self->_warnings_is_enabled($self->server) 0 0 0
554 0 ▶ }
Subroutine BEGIN: called CC=1 SCAR=6.3
Subroutine BEGIN: called CC=1 SCAR=6.3
Subroutine BEGIN: called CC=1 SCAR=6.3
Branch: 56 branches
BranchTrueFalseTotal
if (defined $Nice::Try::WANT and length $Nice::Try::WANT) { } 0 0 0
if ($Nice::Try::WANT eq 'OBJECT') { } 0 0 0
elsif ($Nice::Try::WANT eq 'CODE') { } 0 0 0
elsif ($Nice::Try::WANT eq 'HASH') { } 0 0 0
elsif ($Nice::Try::WANT eq 'ARRAY') { } 0 0 0
elsif ($Nice::Try::WANT eq 'REFSCALAR') { } 0 0 0
elsif ($Nice::Try::WANT eq 'GLOB') { } 0 0 0
elsif ($Nice::Try::WANT eq 'LIST') { } 0 0 0
elsif ($Nice::Try::WANT eq 'BOOLEAN') { } 0 0 0
elsif ($Nice::Try::WANT eq 'VOID') { } 0 0 0
elsif ($Nice::Try::WANT eq 'SCALAR') { } 0 0 0
&$Nice::Try::CATCH ? : 0 0 0
if scalar @Nice::Try::VOID 0 0 0
if ($Nice::Try::WANTARRAY) { } 0 0 0
elsif (defined $Nice::Try::WANTARRAY) { } 0 0 0
if $@ 0 0 0
if (defined $Nice::Try::CATCH_DIED) 0 0 0
if (defined $Nice::Try::WANTARRAY || defined $Nice::Try::BREAK && $Nice::Try::BREAK eq 'return' and !builtin::blessed($Nice::Try::RETVAL[0]) || builtin::blessed($Nice::Try::RETVAL[0]) && !$Nice::Try::RETVAL[0]->isa('Nice::Try::SENTINEL')) { } 0 0 0
elsif (scalar @Nice::Try::VOID and !builtin::blessed($Nice::Try::VOID[0]) || builtin::blessed($Nice::Try::VOID[0]) && !$Nice::Try::VOID[0]->isa('Nice::Try::SENTINEL')) { } 0 0 0
if defined $Nice::Try::BREAK and $Nice::Try::BREAK eq "return" 0 0 0
if (not defined $Nice::Try::BREAK or $Nice::Try::BREAK eq "return") 0 0 0
if (defined $Nice::Try::WANT and length $Nice::Try::WANT) { } 0 0 0
if ($Nice::Try::WANT eq 'LIST') { } 0 0 0
elsif ($Nice::Try::WANT eq 'VOID') { } 0 0 0
elsif ($Nice::Try::WANT eq 'OBJECT') { } 0 0 0
elsif ($Nice::Try::WANT eq 'REFSCALAR') { } 0 0 0
elsif ($Nice::Try::WANT eq 'SCALAR') { } 0 0 0
elsif ($Nice::Try::WANT eq 'BOOLEAN') { } 0 0 0
elsif ($Nice::Try::WANT eq 'CODE') { } 0 0 0
elsif ($Nice::Try::WANT eq 'HASH') { } 0 0 0
elsif ($Nice::Try::WANT eq 'ARRAY') { } 0 0 0
elsif ($Nice::Try::WANT eq 'GLOB') { } 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
if (defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq '__NEXT__') { } 0 0 0
elsif (defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq '__LAST__') { } 0 0 0
elsif (defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq '__REDO__') { } 0 0 0
elsif (defined $Nice::Try::BREAK and $Nice::Try::BREAK eq 'return') { } 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::WANTARRAY ? : 0 0 0
$Nice::Try::WANTARRAY ? : 0 0 0
scalar @Nice::Try::VOID > 1 ? : 0 0 0
if (defined $Nice::Try::BREAK) 0 0 0
if ($Nice::Try::BREAK eq 'next') { } 0 0 0
elsif ($Nice::Try::BREAK eq 'last') { } 0 0 0
elsif ($Nice::Try::BREAK eq 'redo') { } 0 0 0
scalar @Nice::Try::LAST_VAL > 1 ? : 0 0 0
if not defined $Nice::Try::WANTARRAY and scalar @Nice::Try::LAST_VAL 0 0 0
Condition0%0/50
defined $Nice::Try::WANT and length $Nice::Try::WANT
!ll&&!rl&&r
000
defined $Nice::Try::WANTARRAY || defined $Nice::Try::BREAK && $Nice::Try::BREAK eq "return" and !builtin::blessed($Nice::Try::RETVAL[0]) || builtin::blessed($Nice::Try::RETVAL[0]) && !$Nice::Try::RETVAL[0]->isa("Nice::Try::SENTINEL")
!ll&&!rl&&r
000
defined $Nice::Try::WANTARRAY or defined $Nice::Try::BREAK and $Nice::Try::BREAK eq "return"
l!l&&r!l&&!r
000
defined $Nice::Try::BREAK and $Nice::Try::BREAK eq "return"
!ll&&!rl&&r
000
not builtin::blessed($Nice::Try::RETVAL[0]) or builtin::blessed($Nice::Try::RETVAL[0]) and not $Nice::Try::RETVAL[0]->isa("Nice::Try::SENTINEL")
l!l&&r!l&&!r
000
builtin::blessed($Nice::Try::RETVAL[0]) and not $Nice::Try::RETVAL[0]->isa("Nice::Try::SENTINEL")
!ll&&!rl&&r
000
defined $Nice::Try::BREAK and $Nice::Try::BREAK eq "return"
!ll&&!rl&&r
000
not defined $Nice::Try::BREAK or $Nice::Try::BREAK eq "return"
l!l&&r!l&&!r
000
defined $Nice::Try::WANT and length $Nice::Try::WANT
!ll&&!rl&&r
000
defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq "__NEXT__"
!ll&&!rl&&r
000
defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq "__LAST__"
!ll&&!rl&&r
000
defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq "__REDO__"
!ll&&!rl&&r
000
defined $Nice::Try::BREAK and $Nice::Try::BREAK eq "return"
!ll&&!rl&&r
000
scalar @Nice::Try::VOID and !builtin::blessed($Nice::Try::VOID[0]) || builtin::blessed($Nice::Try::VOID[0]) && !$Nice::Try::VOID[0]->isa("Nice::Try::SENTINEL")
!ll&&!rl&&r
000
not builtin::blessed($Nice::Try::VOID[0]) or builtin::blessed($Nice::Try::VOID[0]) and not $Nice::Try::VOID[0]->isa("Nice::Try::SENTINEL")
l!l&&r!l&&!r
000
builtin::blessed($Nice::Try::VOID[0]) and not $Nice::Try::VOID[0]->isa("Nice::Try::SENTINEL")
!ll&&!rl&&r
000
not defined $Nice::Try::WANTARRAY and scalar @Nice::Try::LAST_VAL
!ll
00
MC/DC0%0/2
defined $Nice::Try::WANT and length $Nice::Try::WANT
defined $Nice::Try::WANT length $Nice::Try::WANT
MC/DC0%0/6
defined $Nice::Try::WANTARRAY || defined $Nice::Try::BREAK && $Nice::Try::BREAK eq "return" and !builtin::blessed($Nice::Try::RETVAL[0]) || builtin::blessed($Nice::Try::RETVAL[0]) && !$Nice::Try::RETVAL[0]->isa("Nice::Try::SENTINEL")
defined $Nice::Try::WANTARRAY defined $Nice::Try::BREAK $Nice::Try::BREAK eq "return" not builtin::blessed($Nice::Try::RETVAL[0]) builtin::blessed($Nice::Try::RETVAL[0]) not $Nice::Try::RETVAL[0]->isa("Nice::Try::SENTINEL")
MC/DC0%0/2
not defined $Nice::Try::BREAK or $Nice::Try::BREAK eq "return"
not defined $Nice::Try::BREAK $Nice::Try::BREAK eq "return"
MC/DC0%0/2
defined $Nice::Try::WANT and length $Nice::Try::WANT
defined $Nice::Try::WANT length $Nice::Try::WANT
MC/DC0%0/2
defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq "__NEXT__"
defined $Nice::Try::RETVAL[0] $Nice::Try::RETVAL[0] eq "__NEXT__"
MC/DC0%0/2
defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq "__LAST__"
defined $Nice::Try::RETVAL[0] $Nice::Try::RETVAL[0] eq "__LAST__"
MC/DC0%0/2
defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq "__REDO__"
defined $Nice::Try::RETVAL[0] $Nice::Try::RETVAL[0] eq "__REDO__"
MC/DC0%0/4
scalar @Nice::Try::VOID and !builtin::blessed($Nice::Try::VOID[0]) || builtin::blessed($Nice::Try::VOID[0]) && !$Nice::Try::VOID[0]->isa("Nice::Try::SENTINEL")
scalar @Nice::Try::VOID not builtin::blessed($Nice::Try::VOID[0]) builtin::blessed($Nice::Try::VOID[0]) not $Nice::Try::VOID[0]->isa("Nice::Try::SENTINEL")
MC/DC0%0/1
not defined $Nice::Try::WANTARRAY and scalar @Nice::Try::LAST_VAL
not defined $Nice::Try::WANTARRAY
Truth table0%0/3
A and B
A= defined $Nice::Try::WANTB= length $Nice::Try::WANT
ABresult
0X0
100
111
Truth table0%0/10
A or B and C and not(D) or E and not(F)
A= defined $Nice::Try::WANTARRAYB= defined $Nice::Try::BREAKC= $Nice::Try::BREAK eq "return"D= not builtin::blessed($Nice::Try::RETVAL[0])E= builtin::blessed($Nice::Try::RETVAL[0])F= not $Nice::Try::RETVAL[0]->isa("Nice::Try::SENTINEL")
ABCDEFresult
00XXXX0
010XXX0
1XX00X0
1XX0100
01100X0
0110100
1XX1XX1
1XX0111
0111XX1
0110111
Truth table0%0/3
not(A) or B
A= not defined $Nice::Try::BREAKB= $Nice::Try::BREAK eq "return"
ABresult
1X1
011
000
Truth table0%0/3
A and B
A= defined $Nice::Try::WANTB= length $Nice::Try::WANT
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= defined $Nice::Try::RETVAL[0]B= $Nice::Try::RETVAL[0] eq "__NEXT__"
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= defined $Nice::Try::RETVAL[0]B= $Nice::Try::RETVAL[0] eq "__LAST__"
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= defined $Nice::Try::RETVAL[0]B= $Nice::Try::RETVAL[0] eq "__REDO__"
ABresult
0X0
100
111
Truth table0%0/5
A and not(B) or C and not(D)
A= scalar @Nice::Try::VOIDB= not builtin::blessed($Nice::Try::VOID[0])C= builtin::blessed($Nice::Try::VOID[0])D= not $Nice::Try::VOID[0]->isa("Nice::Try::SENTINEL")
ABCDresult
0XXX0
100X0
10100
11XX1
10111
Truth table0%0/2
not(A)
A= not defined $Nice::Try::WANTARRAY
Aresult
00
11
555 }
556 elsif( $frame->is_ping )
557 {
558 0 my $rv;
559 0 ▶ try
Subroutine __ANON__: not called CC=2 SCAR=17.9
Subroutine __ANON__: not called CC=17 SCAR=56.2
Branch: 3 branches
BranchTrueFalseTotal
unless defined $Nice::Try::NEED_TO_RETURN 0 0 0
if ($INC{"threads.pm"} and not exists $INC{"forks.pm"}) 0 0 0
wantarray ? : 0 0 0
Condition0%0/3
$INC{"threads.pm"} and not exists $INC{"forks.pm"}
!ll&&!rl&&r
000
MC/DC0%0/2
$INC{"threads.pm"} and not exists $INC{"forks.pm"}
$INC{"threads.pm"} not exists $INC{"forks.pm"}
Truth table0%0/3
A and not(B)
A= $INC{"threads.pm"}B= not exists $INC{"forks.pm"}
ABresult
0X0
100
111
560 0 {
561 0 $rv = $ping_cb->( $self, $bytes );
562 }
563 0 ▶ catch( $e )
Subroutine BEGIN: called CC=1 SCAR=6.3
Subroutine BEGIN: called CC=1 SCAR=6.3
Subroutine __ANON__: not called CC=1 SCAR=6.3
Subroutine __ANON__: not called CC=1 SCAR=6.3
Subroutine __ANON__: not called CC=4 SCAR=29.0
Branch: 34 branches
BranchTrueFalseTotal
if (defined $Nice::Try::WANT and length $Nice::Try::WANT) { } 0 0 0
if ($Nice::Try::WANT eq 'OBJECT') { } 0 0 0
elsif ($Nice::Try::WANT eq 'CODE') { } 0 0 0
elsif ($Nice::Try::WANT eq 'HASH') { } 0 0 0
elsif ($Nice::Try::WANT eq 'ARRAY') { } 0 0 0
elsif ($Nice::Try::WANT eq 'REFSCALAR') { } 0 0 0
elsif ($Nice::Try::WANT eq 'GLOB') { } 0 0 0
elsif ($Nice::Try::WANT eq 'LIST') { } 0 0 0
elsif ($Nice::Try::WANT eq 'BOOLEAN') { } 0 0 0
elsif ($Nice::Try::WANT eq 'VOID') { } 0 0 0
elsif ($Nice::Try::WANT eq 'SCALAR') { } 0 0 0
&$Nice::Try::TRY ? : 0 0 0
if scalar @Nice::Try::VOID 0 0 0
if ($Nice::Try::WANTARRAY) { } 0 0 0
elsif (defined $Nice::Try::WANTARRAY) { } 0 0 0
if defined $Nice::Try::LAST_VAL 0 0 0
length $@ ? : 0 0 0
unless builtin::blessed($@) 0 0 0
if ($Nice::Try::DIED) 0 0 0
if ($Nice::Try::HAS_CATCH) 0 0 0
if not defined $Nice::Try::WANTARRAY and scalar @Nice::Try::LAST_VAL 0 0 0
if (defined $Nice::Try::WANT and length $Nice::Try::WANT) { } 0 0 0
if ($Nice::Try::WANT eq 'OBJECT') { } 0 0 0
elsif ($Nice::Try::WANT eq 'CODE') { } 0 0 0
elsif ($Nice::Try::WANT eq 'HASH') { } 0 0 0
elsif ($Nice::Try::WANT eq 'ARRAY') { } 0 0 0
elsif ($Nice::Try::WANT eq 'REFSCALAR') { } 0 0 0
elsif ($Nice::Try::WANT eq 'GLOB') { } 0 0 0
elsif ($Nice::Try::WANT eq 'LIST') { } 0 0 0
elsif ($Nice::Try::WANT eq 'BOOLEAN') { } 0 0 0
elsif ($Nice::Try::WANT eq 'VOID') { } 0 0 0
elsif ($Nice::Try::WANT eq 'SCALAR') { } 0 0 0
if ($Nice::Try::WANTARRAY) { } 0 0 0
elsif (defined $Nice::Try::WANTARRAY) { } 0 0 0
Condition0%0/8
defined $Nice::Try::WANT and length $Nice::Try::WANT
!ll&&!rl&&r
000
not defined $Nice::Try::WANTARRAY and scalar @Nice::Try::LAST_VAL
!ll
00
defined $Nice::Try::WANT and length $Nice::Try::WANT
!ll&&!rl&&r
000
MC/DC0%0/2
defined $Nice::Try::WANT and length $Nice::Try::WANT
defined $Nice::Try::WANT length $Nice::Try::WANT
MC/DC0%0/1
not defined $Nice::Try::WANTARRAY and scalar @Nice::Try::LAST_VAL
not defined $Nice::Try::WANTARRAY
MC/DC0%0/2
defined $Nice::Try::WANT and length $Nice::Try::WANT
defined $Nice::Try::WANT length $Nice::Try::WANT
Truth table0%0/3
A and B
A= defined $Nice::Try::WANTB= length $Nice::Try::WANT
ABresult
0X0
100
111
Truth table0%0/2
not(A)
A= not defined $Nice::Try::WANTARRAY
Aresult
00
11
Truth table0%0/3
A and B
A= defined $Nice::Try::WANTB= length $Nice::Try::WANT
ABresult
0X0
100
111
564 0 {
565 0 ▶ warn( "Error with callback to process ping received from server: $e" ) if( $self->_warnings_is_enabled( $self->server ) );
Branch: 1 branch
BranchTrueFalseTotal
if $self->_warnings_is_enabled($self->server) 0 0 0
566 0 return( $self->error({ code => WS_INTERNAL_SERVER_ERROR, message => "Internal error" }) );
567 0 ▶ }
Subroutine BEGIN: called CC=1 SCAR=6.3
Subroutine BEGIN: called CC=1 SCAR=6.3
Subroutine BEGIN: called CC=1 SCAR=6.3
Branch: 56 branches
BranchTrueFalseTotal
if (defined $Nice::Try::WANT and length $Nice::Try::WANT) { } 0 0 0
if ($Nice::Try::WANT eq 'OBJECT') { } 0 0 0
elsif ($Nice::Try::WANT eq 'CODE') { } 0 0 0
elsif ($Nice::Try::WANT eq 'HASH') { } 0 0 0
elsif ($Nice::Try::WANT eq 'ARRAY') { } 0 0 0
elsif ($Nice::Try::WANT eq 'REFSCALAR') { } 0 0 0
elsif ($Nice::Try::WANT eq 'GLOB') { } 0 0 0
elsif ($Nice::Try::WANT eq 'LIST') { } 0 0 0
elsif ($Nice::Try::WANT eq 'BOOLEAN') { } 0 0 0
elsif ($Nice::Try::WANT eq 'VOID') { } 0 0 0
elsif ($Nice::Try::WANT eq 'SCALAR') { } 0 0 0
&$Nice::Try::CATCH ? : 0 0 0
if scalar @Nice::Try::VOID 0 0 0
if ($Nice::Try::WANTARRAY) { } 0 0 0
elsif (defined $Nice::Try::WANTARRAY) { } 0 0 0
if $@ 0 0 0
if (defined $Nice::Try::CATCH_DIED) 0 0 0
if (defined $Nice::Try::WANTARRAY || defined $Nice::Try::BREAK && $Nice::Try::BREAK eq 'return' and !builtin::blessed($Nice::Try::RETVAL[0]) || builtin::blessed($Nice::Try::RETVAL[0]) && !$Nice::Try::RETVAL[0]->isa('Nice::Try::SENTINEL')) { } 0 0 0
elsif (scalar @Nice::Try::VOID and !builtin::blessed($Nice::Try::VOID[0]) || builtin::blessed($Nice::Try::VOID[0]) && !$Nice::Try::VOID[0]->isa('Nice::Try::SENTINEL')) { } 0 0 0
if defined $Nice::Try::BREAK and $Nice::Try::BREAK eq "return" 0 0 0
if (not defined $Nice::Try::BREAK or $Nice::Try::BREAK eq "return") 0 0 0
if (defined $Nice::Try::WANT and length $Nice::Try::WANT) { } 0 0 0
if ($Nice::Try::WANT eq 'LIST') { } 0 0 0
elsif ($Nice::Try::WANT eq 'VOID') { } 0 0 0
elsif ($Nice::Try::WANT eq 'OBJECT') { } 0 0 0
elsif ($Nice::Try::WANT eq 'REFSCALAR') { } 0 0 0
elsif ($Nice::Try::WANT eq 'SCALAR') { } 0 0 0
elsif ($Nice::Try::WANT eq 'BOOLEAN') { } 0 0 0
elsif ($Nice::Try::WANT eq 'CODE') { } 0 0 0
elsif ($Nice::Try::WANT eq 'HASH') { } 0 0 0
elsif ($Nice::Try::WANT eq 'ARRAY') { } 0 0 0
elsif ($Nice::Try::WANT eq 'GLOB') { } 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
if (defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq '__NEXT__') { } 0 0 0
elsif (defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq '__LAST__') { } 0 0 0
elsif (defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq '__REDO__') { } 0 0 0
elsif (defined $Nice::Try::BREAK and $Nice::Try::BREAK eq 'return') { } 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::WANTARRAY ? : 0 0 0
$Nice::Try::WANTARRAY ? : 0 0 0
scalar @Nice::Try::VOID > 1 ? : 0 0 0
if (defined $Nice::Try::BREAK) 0 0 0
if ($Nice::Try::BREAK eq 'next') { } 0 0 0
elsif ($Nice::Try::BREAK eq 'last') { } 0 0 0
elsif ($Nice::Try::BREAK eq 'redo') { } 0 0 0
scalar @Nice::Try::LAST_VAL > 1 ? : 0 0 0
if not defined $Nice::Try::WANTARRAY and scalar @Nice::Try::LAST_VAL 0 0 0
Condition0%0/50
defined $Nice::Try::WANT and length $Nice::Try::WANT
!ll&&!rl&&r
000
defined $Nice::Try::WANTARRAY || defined $Nice::Try::BREAK && $Nice::Try::BREAK eq "return" and !builtin::blessed($Nice::Try::RETVAL[0]) || builtin::blessed($Nice::Try::RETVAL[0]) && !$Nice::Try::RETVAL[0]->isa("Nice::Try::SENTINEL")
!ll&&!rl&&r
000
defined $Nice::Try::WANTARRAY or defined $Nice::Try::BREAK and $Nice::Try::BREAK eq "return"
l!l&&r!l&&!r
000
defined $Nice::Try::BREAK and $Nice::Try::BREAK eq "return"
!ll&&!rl&&r
000
not builtin::blessed($Nice::Try::RETVAL[0]) or builtin::blessed($Nice::Try::RETVAL[0]) and not $Nice::Try::RETVAL[0]->isa("Nice::Try::SENTINEL")
l!l&&r!l&&!r
000
builtin::blessed($Nice::Try::RETVAL[0]) and not $Nice::Try::RETVAL[0]->isa("Nice::Try::SENTINEL")
!ll&&!rl&&r
000
defined $Nice::Try::BREAK and $Nice::Try::BREAK eq "return"
!ll&&!rl&&r
000
not defined $Nice::Try::BREAK or $Nice::Try::BREAK eq "return"
l!l&&r!l&&!r
000
defined $Nice::Try::WANT and length $Nice::Try::WANT
!ll&&!rl&&r
000
defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq "__NEXT__"
!ll&&!rl&&r
000
defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq "__LAST__"
!ll&&!rl&&r
000
defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq "__REDO__"
!ll&&!rl&&r
000
defined $Nice::Try::BREAK and $Nice::Try::BREAK eq "return"
!ll&&!rl&&r
000
scalar @Nice::Try::VOID and !builtin::blessed($Nice::Try::VOID[0]) || builtin::blessed($Nice::Try::VOID[0]) && !$Nice::Try::VOID[0]->isa("Nice::Try::SENTINEL")
!ll&&!rl&&r
000
not builtin::blessed($Nice::Try::VOID[0]) or builtin::blessed($Nice::Try::VOID[0]) and not $Nice::Try::VOID[0]->isa("Nice::Try::SENTINEL")
l!l&&r!l&&!r
000
builtin::blessed($Nice::Try::VOID[0]) and not $Nice::Try::VOID[0]->isa("Nice::Try::SENTINEL")
!ll&&!rl&&r
000
not defined $Nice::Try::WANTARRAY and scalar @Nice::Try::LAST_VAL
!ll
00
MC/DC0%0/2
defined $Nice::Try::WANT and length $Nice::Try::WANT
defined $Nice::Try::WANT length $Nice::Try::WANT
MC/DC0%0/6
defined $Nice::Try::WANTARRAY || defined $Nice::Try::BREAK && $Nice::Try::BREAK eq "return" and !builtin::blessed($Nice::Try::RETVAL[0]) || builtin::blessed($Nice::Try::RETVAL[0]) && !$Nice::Try::RETVAL[0]->isa("Nice::Try::SENTINEL")
defined $Nice::Try::WANTARRAY defined $Nice::Try::BREAK $Nice::Try::BREAK eq "return" not builtin::blessed($Nice::Try::RETVAL[0]) builtin::blessed($Nice::Try::RETVAL[0]) not $Nice::Try::RETVAL[0]->isa("Nice::Try::SENTINEL")
MC/DC0%0/2
not defined $Nice::Try::BREAK or $Nice::Try::BREAK eq "return"
not defined $Nice::Try::BREAK $Nice::Try::BREAK eq "return"
MC/DC0%0/2
defined $Nice::Try::WANT and length $Nice::Try::WANT
defined $Nice::Try::WANT length $Nice::Try::WANT
MC/DC0%0/2
defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq "__NEXT__"
defined $Nice::Try::RETVAL[0] $Nice::Try::RETVAL[0] eq "__NEXT__"
MC/DC0%0/2
defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq "__LAST__"
defined $Nice::Try::RETVAL[0] $Nice::Try::RETVAL[0] eq "__LAST__"
MC/DC0%0/2
defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq "__REDO__"
defined $Nice::Try::RETVAL[0] $Nice::Try::RETVAL[0] eq "__REDO__"
MC/DC0%0/4
scalar @Nice::Try::VOID and !builtin::blessed($Nice::Try::VOID[0]) || builtin::blessed($Nice::Try::VOID[0]) && !$Nice::Try::VOID[0]->isa("Nice::Try::SENTINEL")
scalar @Nice::Try::VOID not builtin::blessed($Nice::Try::VOID[0]) builtin::blessed($Nice::Try::VOID[0]) not $Nice::Try::VOID[0]->isa("Nice::Try::SENTINEL")
MC/DC0%0/1
not defined $Nice::Try::WANTARRAY and scalar @Nice::Try::LAST_VAL
not defined $Nice::Try::WANTARRAY
Truth table0%0/3
A and B
A= defined $Nice::Try::WANTB= length $Nice::Try::WANT
ABresult
0X0
100
111
Truth table0%0/10
A or B and C and not(D) or E and not(F)
A= defined $Nice::Try::WANTARRAYB= defined $Nice::Try::BREAKC= $Nice::Try::BREAK eq "return"D= not builtin::blessed($Nice::Try::RETVAL[0])E= builtin::blessed($Nice::Try::RETVAL[0])F= not $Nice::Try::RETVAL[0]->isa("Nice::Try::SENTINEL")
ABCDEFresult
00XXXX0
010XXX0
1XX00X0
1XX0100
01100X0
0110100
1XX1XX1
1XX0111
0111XX1
0110111
Truth table0%0/3
not(A) or B
A= not defined $Nice::Try::BREAKB= $Nice::Try::BREAK eq "return"
ABresult
1X1
011
000
Truth table0%0/3
A and B
A= defined $Nice::Try::WANTB= length $Nice::Try::WANT
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= defined $Nice::Try::RETVAL[0]B= $Nice::Try::RETVAL[0] eq "__NEXT__"
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= defined $Nice::Try::RETVAL[0]B= $Nice::Try::RETVAL[0] eq "__LAST__"
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= defined $Nice::Try::RETVAL[0]B= $Nice::Try::RETVAL[0] eq "__REDO__"
ABresult
0X0
100
111
Truth table0%0/5
A and not(B) or C and not(D)
A= scalar @Nice::Try::VOIDB= not builtin::blessed($Nice::Try::VOID[0])C= builtin::blessed($Nice::Try::VOID[0])D= not $Nice::Try::VOID[0]->isa("Nice::Try::SENTINEL")
ABCDresult
0XXX0
100X0
10100
11XX1
10111
Truth table0%0/2
not(A)
A= not defined $Nice::Try::WANTARRAY
Aresult
00
11
568  
569 # RFC says we should perform a pong as soon as possible and return whatever they were sent
570 0 ▶ unless( defined( $rv ) && !$rv )
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $rv and not $rv) 0 0 0
Condition0%0/3
defined $rv and not $rv
!ll&&!rl&&r
000
MC/DC0%0/2
defined $rv and not $rv
defined $rv not $rv
Truth table0%0/3
A and not(B)
A= defined $rvB= not $rv
ABresult
0X0
100
111
571 {
572 0 ▶ try
Subroutine __ANON__: not called CC=2 SCAR=17.9
Subroutine __ANON__: not called CC=17 SCAR=56.2
Branch: 3 branches
BranchTrueFalseTotal
unless defined $Nice::Try::NEED_TO_RETURN 0 0 0
if ($INC{"threads.pm"} and not exists $INC{"forks.pm"}) 0 0 0
wantarray ? : 0 0 0
Condition0%0/3
$INC{"threads.pm"} and not exists $INC{"forks.pm"}
!ll&&!rl&&r
000
MC/DC0%0/2
$INC{"threads.pm"} and not exists $INC{"forks.pm"}
$INC{"threads.pm"} not exists $INC{"forks.pm"}
Truth table0%0/3
A and not(B)
A= $INC{"threads.pm"}B= not exists $INC{"forks.pm"}
ABresult
0X0
100
111
573 0 {
574 0 $do_pong->( $self, $bytes );
575 }
576 0 ▶ catch( $e )
Subroutine BEGIN: called CC=1 SCAR=6.3
Subroutine BEGIN: called CC=1 SCAR=6.3
Subroutine __ANON__: not called CC=1 SCAR=6.3
Subroutine __ANON__: not called CC=1 SCAR=6.3
Subroutine __ANON__: not called CC=4 SCAR=29.0
Branch: 34 branches
BranchTrueFalseTotal
if (defined $Nice::Try::WANT and length $Nice::Try::WANT) { } 0 0 0
if ($Nice::Try::WANT eq 'OBJECT') { } 0 0 0
elsif ($Nice::Try::WANT eq 'CODE') { } 0 0 0
elsif ($Nice::Try::WANT eq 'HASH') { } 0 0 0
elsif ($Nice::Try::WANT eq 'ARRAY') { } 0 0 0
elsif ($Nice::Try::WANT eq 'REFSCALAR') { } 0 0 0
elsif ($Nice::Try::WANT eq 'GLOB') { } 0 0 0
elsif ($Nice::Try::WANT eq 'LIST') { } 0 0 0
elsif ($Nice::Try::WANT eq 'BOOLEAN') { } 0 0 0
elsif ($Nice::Try::WANT eq 'VOID') { } 0 0 0
elsif ($Nice::Try::WANT eq 'SCALAR') { } 0 0 0
&$Nice::Try::TRY ? : 0 0 0
if scalar @Nice::Try::VOID 0 0 0
if ($Nice::Try::WANTARRAY) { } 0 0 0
elsif (defined $Nice::Try::WANTARRAY) { } 0 0 0
if defined $Nice::Try::LAST_VAL 0 0 0
length $@ ? : 0 0 0
unless builtin::blessed($@) 0 0 0
if ($Nice::Try::DIED) 0 0 0
if ($Nice::Try::HAS_CATCH) 0 0 0
if not defined $Nice::Try::WANTARRAY and scalar @Nice::Try::LAST_VAL 0 0 0
if (defined $Nice::Try::WANT and length $Nice::Try::WANT) { } 0 0 0
if ($Nice::Try::WANT eq 'OBJECT') { } 0 0 0
elsif ($Nice::Try::WANT eq 'CODE') { } 0 0 0
elsif ($Nice::Try::WANT eq 'HASH') { } 0 0 0
elsif ($Nice::Try::WANT eq 'ARRAY') { } 0 0 0
elsif ($Nice::Try::WANT eq 'REFSCALAR') { } 0 0 0
elsif ($Nice::Try::WANT eq 'GLOB') { } 0 0 0
elsif ($Nice::Try::WANT eq 'LIST') { } 0 0 0
elsif ($Nice::Try::WANT eq 'BOOLEAN') { } 0 0 0
elsif ($Nice::Try::WANT eq 'VOID') { } 0 0 0
elsif ($Nice::Try::WANT eq 'SCALAR') { } 0 0 0
if ($Nice::Try::WANTARRAY) { } 0 0 0
elsif (defined $Nice::Try::WANTARRAY) { } 0 0 0
Condition0%0/8
defined $Nice::Try::WANT and length $Nice::Try::WANT
!ll&&!rl&&r
000
not defined $Nice::Try::WANTARRAY and scalar @Nice::Try::LAST_VAL
!ll
00
defined $Nice::Try::WANT and length $Nice::Try::WANT
!ll&&!rl&&r
000
MC/DC0%0/2
defined $Nice::Try::WANT and length $Nice::Try::WANT
defined $Nice::Try::WANT length $Nice::Try::WANT
MC/DC0%0/1
not defined $Nice::Try::WANTARRAY and scalar @Nice::Try::LAST_VAL
not defined $Nice::Try::WANTARRAY
MC/DC0%0/2
defined $Nice::Try::WANT and length $Nice::Try::WANT
defined $Nice::Try::WANT length $Nice::Try::WANT
Truth table0%0/3
A and B
A= defined $Nice::Try::WANTB= length $Nice::Try::WANT
ABresult
0X0
100
111
Truth table0%0/2
not(A)
A= not defined $Nice::Try::WANTARRAY
Aresult
00
11
Truth table0%0/3
A and B
A= defined $Nice::Try::WANTB= length $Nice::Try::WANT
ABresult
0X0
100
111
577 0 {
578 0 ▶ warn( "Error with callback to execute a pong to the client in response to ping received: $e" ) if( $self->_warnings_is_enabled( $self->server ) );
Branch: 1 branch
BranchTrueFalseTotal
if $self->_warnings_is_enabled($self->server) 0 0 0
579 0 return( $self->error({ code => WS_INTERNAL_SERVER_ERROR, message => "Internal error" }) );
580 0 ▶ }
Subroutine BEGIN: called CC=1 SCAR=6.3
Subroutine BEGIN: called CC=1 SCAR=6.3
Subroutine BEGIN: called CC=1 SCAR=6.3
Branch: 56 branches
BranchTrueFalseTotal
if (defined $Nice::Try::WANT and length $Nice::Try::WANT) { } 0 0 0
if ($Nice::Try::WANT eq 'OBJECT') { } 0 0 0
elsif ($Nice::Try::WANT eq 'CODE') { } 0 0 0
elsif ($Nice::Try::WANT eq 'HASH') { } 0 0 0
elsif ($Nice::Try::WANT eq 'ARRAY') { } 0 0 0
elsif ($Nice::Try::WANT eq 'REFSCALAR') { } 0 0 0
elsif ($Nice::Try::WANT eq 'GLOB') { } 0 0 0
elsif ($Nice::Try::WANT eq 'LIST') { } 0 0 0
elsif ($Nice::Try::WANT eq 'BOOLEAN') { } 0 0 0
elsif ($Nice::Try::WANT eq 'VOID') { } 0 0 0
elsif ($Nice::Try::WANT eq 'SCALAR') { } 0 0 0
&$Nice::Try::CATCH ? : 0 0 0
if scalar @Nice::Try::VOID 0 0 0
if ($Nice::Try::WANTARRAY) { } 0 0 0
elsif (defined $Nice::Try::WANTARRAY) { } 0 0 0
if $@ 0 0 0
if (defined $Nice::Try::CATCH_DIED) 0 0 0
if (defined $Nice::Try::WANTARRAY || defined $Nice::Try::BREAK && $Nice::Try::BREAK eq 'return' and !builtin::blessed($Nice::Try::RETVAL[0]) || builtin::blessed($Nice::Try::RETVAL[0]) && !$Nice::Try::RETVAL[0]->isa('Nice::Try::SENTINEL')) { } 0 0 0
elsif (scalar @Nice::Try::VOID and !builtin::blessed($Nice::Try::VOID[0]) || builtin::blessed($Nice::Try::VOID[0]) && !$Nice::Try::VOID[0]->isa('Nice::Try::SENTINEL')) { } 0 0 0
if defined $Nice::Try::BREAK and $Nice::Try::BREAK eq "return" 0 0 0
if (not defined $Nice::Try::BREAK or $Nice::Try::BREAK eq "return") 0 0 0
if (defined $Nice::Try::WANT and length $Nice::Try::WANT) { } 0 0 0
if ($Nice::Try::WANT eq 'LIST') { } 0 0 0
elsif ($Nice::Try::WANT eq 'VOID') { } 0 0 0
elsif ($Nice::Try::WANT eq 'OBJECT') { } 0 0 0
elsif ($Nice::Try::WANT eq 'REFSCALAR') { } 0 0 0
elsif ($Nice::Try::WANT eq 'SCALAR') { } 0 0 0
elsif ($Nice::Try::WANT eq 'BOOLEAN') { } 0 0 0
elsif ($Nice::Try::WANT eq 'CODE') { } 0 0 0
elsif ($Nice::Try::WANT eq 'HASH') { } 0 0 0
elsif ($Nice::Try::WANT eq 'ARRAY') { } 0 0 0
elsif ($Nice::Try::WANT eq 'GLOB') { } 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
if (defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq '__NEXT__') { } 0 0 0
elsif (defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq '__LAST__') { } 0 0 0
elsif (defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq '__REDO__') { } 0 0 0
elsif (defined $Nice::Try::BREAK and $Nice::Try::BREAK eq 'return') { } 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::WANTARRAY ? : 0 0 0
$Nice::Try::WANTARRAY ? : 0 0 0
scalar @Nice::Try::VOID > 1 ? : 0 0 0
if (defined $Nice::Try::BREAK) 0 0 0
if ($Nice::Try::BREAK eq 'next') { } 0 0 0
elsif ($Nice::Try::BREAK eq 'last') { } 0 0 0
elsif ($Nice::Try::BREAK eq 'redo') { } 0 0 0
scalar @Nice::Try::LAST_VAL > 1 ? : 0 0 0
if not defined $Nice::Try::WANTARRAY and scalar @Nice::Try::LAST_VAL 0 0 0
Condition0%0/50
defined $Nice::Try::WANT and length $Nice::Try::WANT
!ll&&!rl&&r
000
defined $Nice::Try::WANTARRAY || defined $Nice::Try::BREAK && $Nice::Try::BREAK eq "return" and !builtin::blessed($Nice::Try::RETVAL[0]) || builtin::blessed($Nice::Try::RETVAL[0]) && !$Nice::Try::RETVAL[0]->isa("Nice::Try::SENTINEL")
!ll&&!rl&&r
000
defined $Nice::Try::WANTARRAY or defined $Nice::Try::BREAK and $Nice::Try::BREAK eq "return"
l!l&&r!l&&!r
000
defined $Nice::Try::BREAK and $Nice::Try::BREAK eq "return"
!ll&&!rl&&r
000
not builtin::blessed($Nice::Try::RETVAL[0]) or builtin::blessed($Nice::Try::RETVAL[0]) and not $Nice::Try::RETVAL[0]->isa("Nice::Try::SENTINEL")
l!l&&r!l&&!r
000
builtin::blessed($Nice::Try::RETVAL[0]) and not $Nice::Try::RETVAL[0]->isa("Nice::Try::SENTINEL")
!ll&&!rl&&r
000
defined $Nice::Try::BREAK and $Nice::Try::BREAK eq "return"
!ll&&!rl&&r
000
not defined $Nice::Try::BREAK or $Nice::Try::BREAK eq "return"
l!l&&r!l&&!r
000
defined $Nice::Try::WANT and length $Nice::Try::WANT
!ll&&!rl&&r
000
defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq "__NEXT__"
!ll&&!rl&&r
000
defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq "__LAST__"
!ll&&!rl&&r
000
defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq "__REDO__"
!ll&&!rl&&r
000
defined $Nice::Try::BREAK and $Nice::Try::BREAK eq "return"
!ll&&!rl&&r
000
scalar @Nice::Try::VOID and !builtin::blessed($Nice::Try::VOID[0]) || builtin::blessed($Nice::Try::VOID[0]) && !$Nice::Try::VOID[0]->isa("Nice::Try::SENTINEL")
!ll&&!rl&&r
000
not builtin::blessed($Nice::Try::VOID[0]) or builtin::blessed($Nice::Try::VOID[0]) and not $Nice::Try::VOID[0]->isa("Nice::Try::SENTINEL")
l!l&&r!l&&!r
000
builtin::blessed($Nice::Try::VOID[0]) and not $Nice::Try::VOID[0]->isa("Nice::Try::SENTINEL")
!ll&&!rl&&r
000
not defined $Nice::Try::WANTARRAY and scalar @Nice::Try::LAST_VAL
!ll
00
MC/DC0%0/2
defined $Nice::Try::WANT and length $Nice::Try::WANT
defined $Nice::Try::WANT length $Nice::Try::WANT
MC/DC0%0/6
defined $Nice::Try::WANTARRAY || defined $Nice::Try::BREAK && $Nice::Try::BREAK eq "return" and !builtin::blessed($Nice::Try::RETVAL[0]) || builtin::blessed($Nice::Try::RETVAL[0]) && !$Nice::Try::RETVAL[0]->isa("Nice::Try::SENTINEL")
defined $Nice::Try::WANTARRAY defined $Nice::Try::BREAK $Nice::Try::BREAK eq "return" not builtin::blessed($Nice::Try::RETVAL[0]) builtin::blessed($Nice::Try::RETVAL[0]) not $Nice::Try::RETVAL[0]->isa("Nice::Try::SENTINEL")
MC/DC0%0/2
not defined $Nice::Try::BREAK or $Nice::Try::BREAK eq "return"
not defined $Nice::Try::BREAK $Nice::Try::BREAK eq "return"
MC/DC0%0/2
defined $Nice::Try::WANT and length $Nice::Try::WANT
defined $Nice::Try::WANT length $Nice::Try::WANT
MC/DC0%0/2
defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq "__NEXT__"
defined $Nice::Try::RETVAL[0] $Nice::Try::RETVAL[0] eq "__NEXT__"
MC/DC0%0/2
defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq "__LAST__"
defined $Nice::Try::RETVAL[0] $Nice::Try::RETVAL[0] eq "__LAST__"
MC/DC0%0/2
defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq "__REDO__"
defined $Nice::Try::RETVAL[0] $Nice::Try::RETVAL[0] eq "__REDO__"
MC/DC0%0/4
scalar @Nice::Try::VOID and !builtin::blessed($Nice::Try::VOID[0]) || builtin::blessed($Nice::Try::VOID[0]) && !$Nice::Try::VOID[0]->isa("Nice::Try::SENTINEL")
scalar @Nice::Try::VOID not builtin::blessed($Nice::Try::VOID[0]) builtin::blessed($Nice::Try::VOID[0]) not $Nice::Try::VOID[0]->isa("Nice::Try::SENTINEL")
MC/DC0%0/1
not defined $Nice::Try::WANTARRAY and scalar @Nice::Try::LAST_VAL
not defined $Nice::Try::WANTARRAY
Truth table0%0/3
A and B
A= defined $Nice::Try::WANTB= length $Nice::Try::WANT
ABresult
0X0
100
111
Truth table0%0/10
A or B and C and not(D) or E and not(F)
A= defined $Nice::Try::WANTARRAYB= defined $Nice::Try::BREAKC= $Nice::Try::BREAK eq "return"D= not builtin::blessed($Nice::Try::RETVAL[0])E= builtin::blessed($Nice::Try::RETVAL[0])F= not $Nice::Try::RETVAL[0]->isa("Nice::Try::SENTINEL")
ABCDEFresult
00XXXX0
010XXX0
1XX00X0
1XX0100
01100X0
0110100
1XX1XX1
1XX0111
0111XX1
0110111
Truth table0%0/3
not(A) or B
A= not defined $Nice::Try::BREAKB= $Nice::Try::BREAK eq "return"
ABresult
1X1
011
000
Truth table0%0/3
A and B
A= defined $Nice::Try::WANTB= length $Nice::Try::WANT
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= defined $Nice::Try::RETVAL[0]B= $Nice::Try::RETVAL[0] eq "__NEXT__"
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= defined $Nice::Try::RETVAL[0]B= $Nice::Try::RETVAL[0] eq "__LAST__"
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= defined $Nice::Try::RETVAL[0]B= $Nice::Try::RETVAL[0] eq "__REDO__"
ABresult
0X0
100
111
Truth table0%0/5
A and not(B) or C and not(D)
A= scalar @Nice::Try::VOIDB= not builtin::blessed($Nice::Try::VOID[0])C= builtin::blessed($Nice::Try::VOID[0])D= not $Nice::Try::VOID[0]->isa("Nice::Try::SENTINEL")
ABCDresult
0XXX0
100X0
10100
11XX1
10111
Truth table0%0/2
not(A)
A= not defined $Nice::Try::WANTARRAY
Aresult
00
11
581 }
582 }
583 elsif( $frame->is_pong )
584 {
585 0 ▶ try
Subroutine __ANON__: not called CC=2 SCAR=17.9
Subroutine __ANON__: not called CC=17 SCAR=56.2
Branch: 3 branches
BranchTrueFalseTotal
unless defined $Nice::Try::NEED_TO_RETURN 0 0 0
if ($INC{"threads.pm"} and not exists $INC{"forks.pm"}) 0 0 0
wantarray ? : 0 0 0
Condition0%0/3
$INC{"threads.pm"} and not exists $INC{"forks.pm"}
!ll&&!rl&&r
000
MC/DC0%0/2
$INC{"threads.pm"} and not exists $INC{"forks.pm"}
$INC{"threads.pm"} not exists $INC{"forks.pm"}
Truth table0%0/3
A and not(B)
A= $INC{"threads.pm"}B= not exists $INC{"forks.pm"}
ABresult
0X0
100
111
586 0 {
587 0 $pong_cb->( $self, $bytes );
588 }
589 0 ▶ catch( $e )
Subroutine BEGIN: called CC=1 SCAR=6.3
Subroutine BEGIN: called CC=1 SCAR=6.3
Subroutine __ANON__: not called CC=1 SCAR=6.3
Subroutine __ANON__: not called CC=1 SCAR=6.3
Subroutine __ANON__: not called CC=4 SCAR=29.0
Branch: 34 branches
BranchTrueFalseTotal
if (defined $Nice::Try::WANT and length $Nice::Try::WANT) { } 0 0 0
if ($Nice::Try::WANT eq 'OBJECT') { } 0 0 0
elsif ($Nice::Try::WANT eq 'CODE') { } 0 0 0
elsif ($Nice::Try::WANT eq 'HASH') { } 0 0 0
elsif ($Nice::Try::WANT eq 'ARRAY') { } 0 0 0
elsif ($Nice::Try::WANT eq 'REFSCALAR') { } 0 0 0
elsif ($Nice::Try::WANT eq 'GLOB') { } 0 0 0
elsif ($Nice::Try::WANT eq 'LIST') { } 0 0 0
elsif ($Nice::Try::WANT eq 'BOOLEAN') { } 0 0 0
elsif ($Nice::Try::WANT eq 'VOID') { } 0 0 0
elsif ($Nice::Try::WANT eq 'SCALAR') { } 0 0 0
&$Nice::Try::TRY ? : 0 0 0
if scalar @Nice::Try::VOID 0 0 0
if ($Nice::Try::WANTARRAY) { } 0 0 0
elsif (defined $Nice::Try::WANTARRAY) { } 0 0 0
if defined $Nice::Try::LAST_VAL 0 0 0
length $@ ? : 0 0 0
unless builtin::blessed($@) 0 0 0
if ($Nice::Try::DIED) 0 0 0
if ($Nice::Try::HAS_CATCH) 0 0 0
if not defined $Nice::Try::WANTARRAY and scalar @Nice::Try::LAST_VAL 0 0 0
if (defined $Nice::Try::WANT and length $Nice::Try::WANT) { } 0 0 0
if ($Nice::Try::WANT eq 'OBJECT') { } 0 0 0
elsif ($Nice::Try::WANT eq 'CODE') { } 0 0 0
elsif ($Nice::Try::WANT eq 'HASH') { } 0 0 0
elsif ($Nice::Try::WANT eq 'ARRAY') { } 0 0 0
elsif ($Nice::Try::WANT eq 'REFSCALAR') { } 0 0 0
elsif ($Nice::Try::WANT eq 'GLOB') { } 0 0 0
elsif ($Nice::Try::WANT eq 'LIST') { } 0 0 0
elsif ($Nice::Try::WANT eq 'BOOLEAN') { } 0 0 0
elsif ($Nice::Try::WANT eq 'VOID') { } 0 0 0
elsif ($Nice::Try::WANT eq 'SCALAR') { } 0 0 0
if ($Nice::Try::WANTARRAY) { } 0 0 0
elsif (defined $Nice::Try::WANTARRAY) { } 0 0 0
Condition0%0/8
defined $Nice::Try::WANT and length $Nice::Try::WANT
!ll&&!rl&&r
000
not defined $Nice::Try::WANTARRAY and scalar @Nice::Try::LAST_VAL
!ll
00
defined $Nice::Try::WANT and length $Nice::Try::WANT
!ll&&!rl&&r
000
MC/DC0%0/2
defined $Nice::Try::WANT and length $Nice::Try::WANT
defined $Nice::Try::WANT length $Nice::Try::WANT
MC/DC0%0/1
not defined $Nice::Try::WANTARRAY and scalar @Nice::Try::LAST_VAL
not defined $Nice::Try::WANTARRAY
MC/DC0%0/2
defined $Nice::Try::WANT and length $Nice::Try::WANT
defined $Nice::Try::WANT length $Nice::Try::WANT
Truth table0%0/3
A and B
A= defined $Nice::Try::WANTB= length $Nice::Try::WANT
ABresult
0X0
100
111
Truth table0%0/2
not(A)
A= not defined $Nice::Try::WANTARRAY
Aresult
00
11
Truth table0%0/3
A and B
A= defined $Nice::Try::WANTB= length $Nice::Try::WANT
ABresult
0X0
100
111
590 0 {
591 0 ▶ warn( "Error with callback to process pong received from client: $e" ) if( $self->_warnings_is_enabled( $self->server ) );
Branch: 1 branch
BranchTrueFalseTotal
if $self->_warnings_is_enabled($self->server) 0 0 0
592 0 ▶ }
Subroutine BEGIN: called CC=1 SCAR=6.3
Subroutine BEGIN: called CC=1 SCAR=6.3
Subroutine BEGIN: called CC=1 SCAR=6.3
Branch: 56 branches
BranchTrueFalseTotal
if (defined $Nice::Try::WANT and length $Nice::Try::WANT) { } 0 0 0
if ($Nice::Try::WANT eq 'OBJECT') { } 0 0 0
elsif ($Nice::Try::WANT eq 'CODE') { } 0 0 0
elsif ($Nice::Try::WANT eq 'HASH') { } 0 0 0
elsif ($Nice::Try::WANT eq 'ARRAY') { } 0 0 0
elsif ($Nice::Try::WANT eq 'REFSCALAR') { } 0 0 0
elsif ($Nice::Try::WANT eq 'GLOB') { } 0 0 0
elsif ($Nice::Try::WANT eq 'LIST') { } 0 0 0
elsif ($Nice::Try::WANT eq 'BOOLEAN') { } 0 0 0
elsif ($Nice::Try::WANT eq 'VOID') { } 0 0 0
elsif ($Nice::Try::WANT eq 'SCALAR') { } 0 0 0
&$Nice::Try::CATCH ? : 0 0 0
if scalar @Nice::Try::VOID 0 0 0
if ($Nice::Try::WANTARRAY) { } 0 0 0
elsif (defined $Nice::Try::WANTARRAY) { } 0 0 0
if $@ 0 0 0
if (defined $Nice::Try::CATCH_DIED) 0 0 0
if (defined $Nice::Try::WANTARRAY || defined $Nice::Try::BREAK && $Nice::Try::BREAK eq 'return' and !builtin::blessed($Nice::Try::RETVAL[0]) || builtin::blessed($Nice::Try::RETVAL[0]) && !$Nice::Try::RETVAL[0]->isa('Nice::Try::SENTINEL')) { } 0 0 0
elsif (scalar @Nice::Try::VOID and !builtin::blessed($Nice::Try::VOID[0]) || builtin::blessed($Nice::Try::VOID[0]) && !$Nice::Try::VOID[0]->isa('Nice::Try::SENTINEL')) { } 0 0 0
if defined $Nice::Try::BREAK and $Nice::Try::BREAK eq "return" 0 0 0
if (not defined $Nice::Try::BREAK or $Nice::Try::BREAK eq "return") 0 0 0
if (defined $Nice::Try::WANT and length $Nice::Try::WANT) { } 0 0 0
if ($Nice::Try::WANT eq 'LIST') { } 0 0 0
elsif ($Nice::Try::WANT eq 'VOID') { } 0 0 0
elsif ($Nice::Try::WANT eq 'OBJECT') { } 0 0 0
elsif ($Nice::Try::WANT eq 'REFSCALAR') { } 0 0 0
elsif ($Nice::Try::WANT eq 'SCALAR') { } 0 0 0
elsif ($Nice::Try::WANT eq 'BOOLEAN') { } 0 0 0
elsif ($Nice::Try::WANT eq 'CODE') { } 0 0 0
elsif ($Nice::Try::WANT eq 'HASH') { } 0 0 0
elsif ($Nice::Try::WANT eq 'ARRAY') { } 0 0 0
elsif ($Nice::Try::WANT eq 'GLOB') { } 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
if (defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq '__NEXT__') { } 0 0 0
elsif (defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq '__LAST__') { } 0 0 0
elsif (defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq '__REDO__') { } 0 0 0
elsif (defined $Nice::Try::BREAK and $Nice::Try::BREAK eq 'return') { } 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::WANTARRAY ? : 0 0 0
$Nice::Try::WANTARRAY ? : 0 0 0
scalar @Nice::Try::VOID > 1 ? : 0 0 0
if (defined $Nice::Try::BREAK) 0 0 0
if ($Nice::Try::BREAK eq 'next') { } 0 0 0
elsif ($Nice::Try::BREAK eq 'last') { } 0 0 0
elsif ($Nice::Try::BREAK eq 'redo') { } 0 0 0
scalar @Nice::Try::LAST_VAL > 1 ? : 0 0 0
if not defined $Nice::Try::WANTARRAY and scalar @Nice::Try::LAST_VAL 0 0 0
Condition0%0/50
defined $Nice::Try::WANT and length $Nice::Try::WANT
!ll&&!rl&&r
000
defined $Nice::Try::WANTARRAY || defined $Nice::Try::BREAK && $Nice::Try::BREAK eq "return" and !builtin::blessed($Nice::Try::RETVAL[0]) || builtin::blessed($Nice::Try::RETVAL[0]) && !$Nice::Try::RETVAL[0]->isa("Nice::Try::SENTINEL")
!ll&&!rl&&r
000
defined $Nice::Try::WANTARRAY or defined $Nice::Try::BREAK and $Nice::Try::BREAK eq "return"
l!l&&r!l&&!r
000
defined $Nice::Try::BREAK and $Nice::Try::BREAK eq "return"
!ll&&!rl&&r
000
not builtin::blessed($Nice::Try::RETVAL[0]) or builtin::blessed($Nice::Try::RETVAL[0]) and not $Nice::Try::RETVAL[0]->isa("Nice::Try::SENTINEL")
l!l&&r!l&&!r
000
builtin::blessed($Nice::Try::RETVAL[0]) and not $Nice::Try::RETVAL[0]->isa("Nice::Try::SENTINEL")
!ll&&!rl&&r
000
defined $Nice::Try::BREAK and $Nice::Try::BREAK eq "return"
!ll&&!rl&&r
000
not defined $Nice::Try::BREAK or $Nice::Try::BREAK eq "return"
l!l&&r!l&&!r
000
defined $Nice::Try::WANT and length $Nice::Try::WANT
!ll&&!rl&&r
000
defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq "__NEXT__"
!ll&&!rl&&r
000
defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq "__LAST__"
!ll&&!rl&&r
000
defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq "__REDO__"
!ll&&!rl&&r
000
defined $Nice::Try::BREAK and $Nice::Try::BREAK eq "return"
!ll&&!rl&&r
000
scalar @Nice::Try::VOID and !builtin::blessed($Nice::Try::VOID[0]) || builtin::blessed($Nice::Try::VOID[0]) && !$Nice::Try::VOID[0]->isa("Nice::Try::SENTINEL")
!ll&&!rl&&r
000
not builtin::blessed($Nice::Try::VOID[0]) or builtin::blessed($Nice::Try::VOID[0]) and not $Nice::Try::VOID[0]->isa("Nice::Try::SENTINEL")
l!l&&r!l&&!r
000
builtin::blessed($Nice::Try::VOID[0]) and not $Nice::Try::VOID[0]->isa("Nice::Try::SENTINEL")
!ll&&!rl&&r
000
not defined $Nice::Try::WANTARRAY and scalar @Nice::Try::LAST_VAL
!ll
00
MC/DC0%0/2
defined $Nice::Try::WANT and length $Nice::Try::WANT
defined $Nice::Try::WANT length $Nice::Try::WANT
MC/DC0%0/6
defined $Nice::Try::WANTARRAY || defined $Nice::Try::BREAK && $Nice::Try::BREAK eq "return" and !builtin::blessed($Nice::Try::RETVAL[0]) || builtin::blessed($Nice::Try::RETVAL[0]) && !$Nice::Try::RETVAL[0]->isa("Nice::Try::SENTINEL")
defined $Nice::Try::WANTARRAY defined $Nice::Try::BREAK $Nice::Try::BREAK eq "return" not builtin::blessed($Nice::Try::RETVAL[0]) builtin::blessed($Nice::Try::RETVAL[0]) not $Nice::Try::RETVAL[0]->isa("Nice::Try::SENTINEL")
MC/DC0%0/2
not defined $Nice::Try::BREAK or $Nice::Try::BREAK eq "return"
not defined $Nice::Try::BREAK $Nice::Try::BREAK eq "return"
MC/DC0%0/2
defined $Nice::Try::WANT and length $Nice::Try::WANT
defined $Nice::Try::WANT length $Nice::Try::WANT
MC/DC0%0/2
defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq "__NEXT__"
defined $Nice::Try::RETVAL[0] $Nice::Try::RETVAL[0] eq "__NEXT__"
MC/DC0%0/2
defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq "__LAST__"
defined $Nice::Try::RETVAL[0] $Nice::Try::RETVAL[0] eq "__LAST__"
MC/DC0%0/2
defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq "__REDO__"
defined $Nice::Try::RETVAL[0] $Nice::Try::RETVAL[0] eq "__REDO__"
MC/DC0%0/4
scalar @Nice::Try::VOID and !builtin::blessed($Nice::Try::VOID[0]) || builtin::blessed($Nice::Try::VOID[0]) && !$Nice::Try::VOID[0]->isa("Nice::Try::SENTINEL")
scalar @Nice::Try::VOID not builtin::blessed($Nice::Try::VOID[0]) builtin::blessed($Nice::Try::VOID[0]) not $Nice::Try::VOID[0]->isa("Nice::Try::SENTINEL")
MC/DC0%0/1
not defined $Nice::Try::WANTARRAY and scalar @Nice::Try::LAST_VAL
not defined $Nice::Try::WANTARRAY
Truth table0%0/3
A and B
A= defined $Nice::Try::WANTB= length $Nice::Try::WANT
ABresult
0X0
100
111
Truth table0%0/10
A or B and C and not(D) or E and not(F)
A= defined $Nice::Try::WANTARRAYB= defined $Nice::Try::BREAKC= $Nice::Try::BREAK eq "return"D= not builtin::blessed($Nice::Try::RETVAL[0])E= builtin::blessed($Nice::Try::RETVAL[0])F= not $Nice::Try::RETVAL[0]->isa("Nice::Try::SENTINEL")
ABCDEFresult
00XXXX0
010XXX0
1XX00X0
1XX0100
01100X0
0110100
1XX1XX1
1XX0111
0111XX1
0110111
Truth table0%0/3
not(A) or B
A= not defined $Nice::Try::BREAKB= $Nice::Try::BREAK eq "return"
ABresult
1X1
011
000
Truth table0%0/3
A and B
A= defined $Nice::Try::WANTB= length $Nice::Try::WANT
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= defined $Nice::Try::RETVAL[0]B= $Nice::Try::RETVAL[0] eq "__NEXT__"
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= defined $Nice::Try::RETVAL[0]B= $Nice::Try::RETVAL[0] eq "__LAST__"
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= defined $Nice::Try::RETVAL[0]B= $Nice::Try::RETVAL[0] eq "__REDO__"
ABresult
0X0
100
111
Truth table0%0/5
A and not(B) or C and not(D)
A= scalar @Nice::Try::VOIDB= not builtin::blessed($Nice::Try::VOID[0])C= builtin::blessed($Nice::Try::VOID[0])D= not $Nice::Try::VOID[0]->isa("Nice::Try::SENTINEL")
ABCDresult
0XXX0
100X0
10100
11XX1
10111
Truth table0%0/2
not(A)
A= not defined $Nice::Try::WANTARRAY
Aresult
00
11
593 }
594 # rfc6455, section 5.5.1:
595 # "If an endpoint receives a Close frame and did not previously send a Close frame, the endpoint MUST send a Close frame in response. (When sending a Close frame in response, the endpoint typically echos the status code it received.)"
596 elsif( $frame->is_close )
597 {
598 # A reply to our own disconnection
599 0 ▶ if( $self->disconnecting )
Branch: 1 branch
BranchTrueFalseTotal
if ($self->disconnecting) { } 0 0 0
600 {
601 0 $self->shutdown;
602 }
603 # We receive a disconnect notification. We reply back and shutdown
604 else
605 {
606 # We reply
607 0 ▶ if( length( "$bytes" ) )
Branch: 1 branch
BranchTrueFalseTotal
if (length "$bytes") { } 0 0 0
608 {
609 0 my( $code, $reason ) = ( unpack( 'n', substr( $bytes, 0, 2, '' ) ), Encode::decode( 'UTF-8', $bytes ) );
610 0 $self->disconnect( $code );
611 }
612 else
613 {
614 0 $self->disconnect( WS_OK );
615 }
616 }
617 0 return( $self );
618 }
619 else
620 {
621 }
622 }
623  
624 0 ▶ if( !$bytes && $frame->error )
Branch: 1 branch
BranchTrueFalseTotal
if (not $bytes and $frame->error) 0 0 0
Condition0%0/3
not $bytes and $frame->error
!ll&&!rl&&r
000
MC/DC0%0/2
not $bytes and $frame->error
not $bytes $frame->error
Truth table0%0/3
not(A) and B
A= not $bytesB= $frame->error
ABresult
0X0
100
111
625 {
626 0 ▶ my $code = $frame->error->code || WS_PROTOCOL_ERROR;
Condition0%0/2
$frame->error->code || 1002
l!l
00
MC/DC0%0/1
$frame->error->code || 1002
$frame->error->code
Truth table0%0/2
A
A= $frame->error->code
Aresult
11
00
627 0 ▶ my $msg = $frame->error->message || 'Protocol error';
Condition0%0/2
$frame->error->message || 'Protocol error'
l!l
00
MC/DC0%0/1
$frame->error->message || 'Protocol error'
$frame->error->message
Truth table0%0/2
A
A= $frame->error->message
Aresult
11
00
628 0 $self->disconnect( $code => $msg ); # 1002, protocol error
629 0 return( $self );
630 }
631 # Should we rather return the number of bytes received or our object?
632 0 return( $self );
633 }
634  
635 0 ▶sub request_uri { return( shift->_set_get_uri( 'request_uri', @_ ) ); }
Subroutine request_uri: not called CC=1 SCAR=6.9
Pod documented
636  
637 sub send
638 0 ▶{
Subroutine send: not called CC=100 SCAR=91.1
Pod documented
639 0 my( $self, $type, $data ) = @_;
640  
641 0 ▶ if( !$self->handshake->is_done )
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->handshake->is_done) 0 0 0
642 {
643 0 ▶ warn( "Tried to send data before finishing handshake\n" ) if( $self->_warnings_is_enabled( $self->server ) );
Branch: 1 branch
BranchTrueFalseTotal
if $self->_warnings_is_enabled($self->server) 0 0 0
644 0 return(0);
645 }
646  
647 0 ▶ my $sock = $self->socket || return( $self->error( "The socket filehandle is gone!" ) );
Condition0%0/2
$self->socket || (return $self->error('The socket filehandle is gone!'))
l!l
00
MC/DC0%0/1
$self->socket || (return $self->error('The socket filehandle is gone!'))
$self->socket
Truth table0%0/2
A
A= $self->socket
Aresult
11
00
648
649 0 my $frame = WebSocket::Frame->new(
650 type => $type,
651 max_payload_size => $self->max_send_size,
652 debug => $self->debug,
653 version => $self->handshake->request->version,
654 );
655 0 ▶ $frame->append( $data ) if( defined( $data ) );
Branch: 1 branch
BranchTrueFalseTotal
if defined $data 0 0 0
656
657 0 ▶ try
Subroutine __ANON__: not called CC=2 SCAR=17.9
Subroutine __ANON__: not called CC=18 SCAR=57.3
Branch: 3 branches
BranchTrueFalseTotal
unless defined $Nice::Try::NEED_TO_RETURN 0 0 0
if ($INC{"threads.pm"} and not exists $INC{"forks.pm"}) 0 0 0
wantarray ? : 0 0 0
Condition0%0/3
$INC{"threads.pm"} and not exists $INC{"forks.pm"}
!ll&&!rl&&r
000
MC/DC0%0/2
$INC{"threads.pm"} and not exists $INC{"forks.pm"}
$INC{"threads.pm"} not exists $INC{"forks.pm"}
Truth table0%0/3
A and not(B)
A= $INC{"threads.pm"}B= not exists $INC{"forks.pm"}
ABresult
0X0
100
111
658 0 {
659 0 my $bytes = $frame->to_bytes;
660 0 my $rv = $sock->syswrite( $bytes );
661 0 ▶ return( $self->error( "Error writing ", length( $bytes ), " bytes of data on socket to remote ip '", $self->ip, "': $!" ) ) if( !defined( $rv ) );
Branch: 1 branch
BranchTrueFalseTotal
unless defined $rv 0 0 0
662 0 return( $rv );
663 }
664 0 ▶ catch( $e )
Subroutine BEGIN: called CC=1 SCAR=6.3
Subroutine BEGIN: called CC=1 SCAR=6.3
Subroutine __ANON__: not called CC=1 SCAR=6.3
Subroutine __ANON__: not called CC=1 SCAR=6.3
Subroutine __ANON__: not called CC=3 SCAR=23.9
Branch: 34 branches
BranchTrueFalseTotal
if (defined $Nice::Try::WANT and length $Nice::Try::WANT) { } 0 0 0
if ($Nice::Try::WANT eq 'OBJECT') { } 0 0 0
elsif ($Nice::Try::WANT eq 'CODE') { } 0 0 0
elsif ($Nice::Try::WANT eq 'HASH') { } 0 0 0
elsif ($Nice::Try::WANT eq 'ARRAY') { } 0 0 0
elsif ($Nice::Try::WANT eq 'REFSCALAR') { } 0 0 0
elsif ($Nice::Try::WANT eq 'GLOB') { } 0 0 0
elsif ($Nice::Try::WANT eq 'LIST') { } 0 0 0
elsif ($Nice::Try::WANT eq 'BOOLEAN') { } 0 0 0
elsif ($Nice::Try::WANT eq 'VOID') { } 0 0 0
elsif ($Nice::Try::WANT eq 'SCALAR') { } 0 0 0
&$Nice::Try::TRY ? : 0 0 0
if scalar @Nice::Try::VOID 0 0 0
if ($Nice::Try::WANTARRAY) { } 0 0 0
elsif (defined $Nice::Try::WANTARRAY) { } 0 0 0
if defined $Nice::Try::LAST_VAL 0 0 0
length $@ ? : 0 0 0
unless builtin::blessed($@) 0 0 0
if ($Nice::Try::DIED) 0 0 0
if ($Nice::Try::HAS_CATCH) 0 0 0
if not defined $Nice::Try::WANTARRAY and scalar @Nice::Try::LAST_VAL 0 0 0
if (defined $Nice::Try::WANT and length $Nice::Try::WANT) { } 0 0 0
if ($Nice::Try::WANT eq 'OBJECT') { } 0 0 0
elsif ($Nice::Try::WANT eq 'CODE') { } 0 0 0
elsif ($Nice::Try::WANT eq 'HASH') { } 0 0 0
elsif ($Nice::Try::WANT eq 'ARRAY') { } 0 0 0
elsif ($Nice::Try::WANT eq 'REFSCALAR') { } 0 0 0
elsif ($Nice::Try::WANT eq 'GLOB') { } 0 0 0
elsif ($Nice::Try::WANT eq 'LIST') { } 0 0 0
elsif ($Nice::Try::WANT eq 'BOOLEAN') { } 0 0 0
elsif ($Nice::Try::WANT eq 'VOID') { } 0 0 0
elsif ($Nice::Try::WANT eq 'SCALAR') { } 0 0 0
if ($Nice::Try::WANTARRAY) { } 0 0 0
elsif (defined $Nice::Try::WANTARRAY) { } 0 0 0
Condition0%0/8
defined $Nice::Try::WANT and length $Nice::Try::WANT
!ll&&!rl&&r
000
not defined $Nice::Try::WANTARRAY and scalar @Nice::Try::LAST_VAL
!ll
00
defined $Nice::Try::WANT and length $Nice::Try::WANT
!ll&&!rl&&r
000
MC/DC0%0/2
defined $Nice::Try::WANT and length $Nice::Try::WANT
defined $Nice::Try::WANT length $Nice::Try::WANT
MC/DC0%0/1
not defined $Nice::Try::WANTARRAY and scalar @Nice::Try::LAST_VAL
not defined $Nice::Try::WANTARRAY
MC/DC0%0/2
defined $Nice::Try::WANT and length $Nice::Try::WANT
defined $Nice::Try::WANT length $Nice::Try::WANT
Truth table0%0/3
A and B
A= defined $Nice::Try::WANTB= length $Nice::Try::WANT
ABresult
0X0
100
111
Truth table0%0/2
not(A)
A= not defined $Nice::Try::WANTARRAY
Aresult
00
11
Truth table0%0/3
A and B
A= defined $Nice::Try::WANTB= length $Nice::Try::WANT
ABresult
0X0
100
111
665 0 {
666 0 return( $self->error( "Error while building message: $e" ) );
667 0 ▶ }
Subroutine BEGIN: called CC=1 SCAR=6.3
Subroutine BEGIN: called CC=1 SCAR=6.3
Subroutine BEGIN: called CC=1 SCAR=6.3
Branch: 56 branches
BranchTrueFalseTotal
if (defined $Nice::Try::WANT and length $Nice::Try::WANT) { } 0 0 0
if ($Nice::Try::WANT eq 'OBJECT') { } 0 0 0
elsif ($Nice::Try::WANT eq 'CODE') { } 0 0 0
elsif ($Nice::Try::WANT eq 'HASH') { } 0 0 0
elsif ($Nice::Try::WANT eq 'ARRAY') { } 0 0 0
elsif ($Nice::Try::WANT eq 'REFSCALAR') { } 0 0 0
elsif ($Nice::Try::WANT eq 'GLOB') { } 0 0 0
elsif ($Nice::Try::WANT eq 'LIST') { } 0 0 0
elsif ($Nice::Try::WANT eq 'BOOLEAN') { } 0 0 0
elsif ($Nice::Try::WANT eq 'VOID') { } 0 0 0
elsif ($Nice::Try::WANT eq 'SCALAR') { } 0 0 0
&$Nice::Try::CATCH ? : 0 0 0
if scalar @Nice::Try::VOID 0 0 0
if ($Nice::Try::WANTARRAY) { } 0 0 0
elsif (defined $Nice::Try::WANTARRAY) { } 0 0 0
if $@ 0 0 0
if (defined $Nice::Try::CATCH_DIED) 0 0 0
if (defined $Nice::Try::WANTARRAY || defined $Nice::Try::BREAK && $Nice::Try::BREAK eq 'return' and !builtin::blessed($Nice::Try::RETVAL[0]) || builtin::blessed($Nice::Try::RETVAL[0]) && !$Nice::Try::RETVAL[0]->isa('Nice::Try::SENTINEL')) { } 0 0 0
elsif (scalar @Nice::Try::VOID and !builtin::blessed($Nice::Try::VOID[0]) || builtin::blessed($Nice::Try::VOID[0]) && !$Nice::Try::VOID[0]->isa('Nice::Try::SENTINEL')) { } 0 0 0
if defined $Nice::Try::BREAK and $Nice::Try::BREAK eq "return" 0 0 0
if (not defined $Nice::Try::BREAK or $Nice::Try::BREAK eq "return") 0 0 0
if (defined $Nice::Try::WANT and length $Nice::Try::WANT) { } 0 0 0
if ($Nice::Try::WANT eq 'LIST') { } 0 0 0
elsif ($Nice::Try::WANT eq 'VOID') { } 0 0 0
elsif ($Nice::Try::WANT eq 'OBJECT') { } 0 0 0
elsif ($Nice::Try::WANT eq 'REFSCALAR') { } 0 0 0
elsif ($Nice::Try::WANT eq 'SCALAR') { } 0 0 0
elsif ($Nice::Try::WANT eq 'BOOLEAN') { } 0 0 0
elsif ($Nice::Try::WANT eq 'CODE') { } 0 0 0
elsif ($Nice::Try::WANT eq 'HASH') { } 0 0 0
elsif ($Nice::Try::WANT eq 'ARRAY') { } 0 0 0
elsif ($Nice::Try::WANT eq 'GLOB') { } 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
if (defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq '__NEXT__') { } 0 0 0
elsif (defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq '__LAST__') { } 0 0 0
elsif (defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq '__REDO__') { } 0 0 0
elsif (defined $Nice::Try::BREAK and $Nice::Try::BREAK eq 'return') { } 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::NEED_TO_RETURN ? : 0 0 0
$Nice::Try::WANTARRAY ? : 0 0 0
$Nice::Try::WANTARRAY ? : 0 0 0
scalar @Nice::Try::VOID > 1 ? : 0 0 0
if (defined $Nice::Try::BREAK) 0 0 0
if ($Nice::Try::BREAK eq 'next') { } 0 0 0
elsif ($Nice::Try::BREAK eq 'last') { } 0 0 0
elsif ($Nice::Try::BREAK eq 'redo') { } 0 0 0
scalar @Nice::Try::LAST_VAL > 1 ? : 0 0 0
if not defined $Nice::Try::WANTARRAY and scalar @Nice::Try::LAST_VAL 0 0 0
Condition0%0/50
defined $Nice::Try::WANT and length $Nice::Try::WANT
!ll&&!rl&&r
000
defined $Nice::Try::WANTARRAY || defined $Nice::Try::BREAK && $Nice::Try::BREAK eq "return" and !builtin::blessed($Nice::Try::RETVAL[0]) || builtin::blessed($Nice::Try::RETVAL[0]) && !$Nice::Try::RETVAL[0]->isa("Nice::Try::SENTINEL")
!ll&&!rl&&r
000
defined $Nice::Try::WANTARRAY or defined $Nice::Try::BREAK and $Nice::Try::BREAK eq "return"
l!l&&r!l&&!r
000
defined $Nice::Try::BREAK and $Nice::Try::BREAK eq "return"
!ll&&!rl&&r
000
not builtin::blessed($Nice::Try::RETVAL[0]) or builtin::blessed($Nice::Try::RETVAL[0]) and not $Nice::Try::RETVAL[0]->isa("Nice::Try::SENTINEL")
l!l&&r!l&&!r
000
builtin::blessed($Nice::Try::RETVAL[0]) and not $Nice::Try::RETVAL[0]->isa("Nice::Try::SENTINEL")
!ll&&!rl&&r
000
defined $Nice::Try::BREAK and $Nice::Try::BREAK eq "return"
!ll&&!rl&&r
000
not defined $Nice::Try::BREAK or $Nice::Try::BREAK eq "return"
l!l&&r!l&&!r
000
defined $Nice::Try::WANT and length $Nice::Try::WANT
!ll&&!rl&&r
000
defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq "__NEXT__"
!ll&&!rl&&r
000
defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq "__LAST__"
!ll&&!rl&&r
000
defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq "__REDO__"
!ll&&!rl&&r
000
defined $Nice::Try::BREAK and $Nice::Try::BREAK eq "return"
!ll&&!rl&&r
000
scalar @Nice::Try::VOID and !builtin::blessed($Nice::Try::VOID[0]) || builtin::blessed($Nice::Try::VOID[0]) && !$Nice::Try::VOID[0]->isa("Nice::Try::SENTINEL")
!ll&&!rl&&r
000
not builtin::blessed($Nice::Try::VOID[0]) or builtin::blessed($Nice::Try::VOID[0]) and not $Nice::Try::VOID[0]->isa("Nice::Try::SENTINEL")
l!l&&r!l&&!r
000
builtin::blessed($Nice::Try::VOID[0]) and not $Nice::Try::VOID[0]->isa("Nice::Try::SENTINEL")
!ll&&!rl&&r
000
not defined $Nice::Try::WANTARRAY and scalar @Nice::Try::LAST_VAL
!ll
00
MC/DC0%0/2
defined $Nice::Try::WANT and length $Nice::Try::WANT
defined $Nice::Try::WANT length $Nice::Try::WANT
MC/DC0%0/6
defined $Nice::Try::WANTARRAY || defined $Nice::Try::BREAK && $Nice::Try::BREAK eq "return" and !builtin::blessed($Nice::Try::RETVAL[0]) || builtin::blessed($Nice::Try::RETVAL[0]) && !$Nice::Try::RETVAL[0]->isa("Nice::Try::SENTINEL")
defined $Nice::Try::WANTARRAY defined $Nice::Try::BREAK $Nice::Try::BREAK eq "return" not builtin::blessed($Nice::Try::RETVAL[0]) builtin::blessed($Nice::Try::RETVAL[0]) not $Nice::Try::RETVAL[0]->isa("Nice::Try::SENTINEL")
MC/DC0%0/2
not defined $Nice::Try::BREAK or $Nice::Try::BREAK eq "return"
not defined $Nice::Try::BREAK $Nice::Try::BREAK eq "return"
MC/DC0%0/2
defined $Nice::Try::WANT and length $Nice::Try::WANT
defined $Nice::Try::WANT length $Nice::Try::WANT
MC/DC0%0/2
defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq "__NEXT__"
defined $Nice::Try::RETVAL[0] $Nice::Try::RETVAL[0] eq "__NEXT__"
MC/DC0%0/2
defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq "__LAST__"
defined $Nice::Try::RETVAL[0] $Nice::Try::RETVAL[0] eq "__LAST__"
MC/DC0%0/2
defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq "__REDO__"
defined $Nice::Try::RETVAL[0] $Nice::Try::RETVAL[0] eq "__REDO__"
MC/DC0%0/4
scalar @Nice::Try::VOID and !builtin::blessed($Nice::Try::VOID[0]) || builtin::blessed($Nice::Try::VOID[0]) && !$Nice::Try::VOID[0]->isa("Nice::Try::SENTINEL")
scalar @Nice::Try::VOID not builtin::blessed($Nice::Try::VOID[0]) builtin::blessed($Nice::Try::VOID[0]) not $Nice::Try::VOID[0]->isa("Nice::Try::SENTINEL")
MC/DC0%0/1
not defined $Nice::Try::WANTARRAY and scalar @Nice::Try::LAST_VAL
not defined $Nice::Try::WANTARRAY
Truth table0%0/3
A and B
A= defined $Nice::Try::WANTB= length $Nice::Try::WANT
ABresult
0X0
100
111
Truth table0%0/10
A or B and C and not(D) or E and not(F)
A= defined $Nice::Try::WANTARRAYB= defined $Nice::Try::BREAKC= $Nice::Try::BREAK eq "return"D= not builtin::blessed($Nice::Try::RETVAL[0])E= builtin::blessed($Nice::Try::RETVAL[0])F= not $Nice::Try::RETVAL[0]->isa("Nice::Try::SENTINEL")
ABCDEFresult
00XXXX0
010XXX0
1XX00X0
1XX0100
01100X0
0110100
1XX1XX1
1XX0111
0111XX1
0110111
Truth table0%0/3
not(A) or B
A= not defined $Nice::Try::BREAKB= $Nice::Try::BREAK eq "return"
ABresult
1X1
011
000
Truth table0%0/3
A and B
A= defined $Nice::Try::WANTB= length $Nice::Try::WANT
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= defined $Nice::Try::RETVAL[0]B= $Nice::Try::RETVAL[0] eq "__NEXT__"
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= defined $Nice::Try::RETVAL[0]B= $Nice::Try::RETVAL[0] eq "__LAST__"
ABresult
0X0
100
111
Truth table0%0/3
A and B
A= defined $Nice::Try::RETVAL[0]B= $Nice::Try::RETVAL[0] eq "__REDO__"
ABresult
0X0
100
111
Truth table0%0/5
A and not(B) or C and not(D)
A= scalar @Nice::Try::VOIDB= not builtin::blessed($Nice::Try::VOID[0])C= builtin::blessed($Nice::Try::VOID[0])D= not $Nice::Try::VOID[0]->isa("Nice::Try::SENTINEL")
ABCDresult
0XXX0
100X0
10100
11XX1
10111
Truth table0%0/2
not(A)
A= not defined $Nice::Try::WANTARRAY
Aresult
00
11
668 }
669  
670 0 ▶sub send_binary { return( shift->send( binary => @_ ) ); }
Subroutine send_binary: not called CC=1 SCAR=6.9
Pod documented
671  
672 0 ▶sub send_utf8 { return( shift->send( text => Encode::encode( 'UTF-8', shift( @_ ) ) ) ); }
Subroutine send_utf8: not called CC=1 SCAR=6.9
Pod documented
673  
674 0 ▶sub server { return( shift->_set_get_object_without_init( 'server', 'WebSocket::Server', @_ ) ); }
Subroutine server: not called CC=1 SCAR=6.9
Pod documented
675  
676 sub shutdown
677 0 ▶{
Subroutine shutdown: not called CC=2 SCAR=17.9
Pod documented
678 0 my $self = shift( @_ );
679 0 ▶ return( $self ) if( $self->disconnected );
Branch: 1 branch
BranchTrueFalseTotal
if $self->disconnected 0 0 0
680 0 $self->server->disconnect( $self->{socket} );
681 0 $self->disconnected(1);
682 0 return( $self );
683 }
684  
685 0 ▶sub socket { return( shift->_set_get_object_without_init( 'socket', 'IO::Socket', @_ ) ); }
Subroutine socket: not called CC=1 SCAR=6.9
Pod documented
686  
687 0 ▶sub status_message { return( HTTP::Status::status_message( $_[1] ) ); }
Subroutine status_message: not called CC=1 SCAR=6.9
Pod documented
688  
689 sub subprotocol
690 0 ▶{
Subroutine subprotocol: not called CC=9 SCAR=45.0
Pod documented
691 0 my $self = shift( @_ );
692 0 ▶ if( @_ )
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 0 0 0
693 {
694 0 ▶ my $ref = $self->_is_array( $_[0] )
Branch: 4 branches
BranchTrueFalseTotal
$self->_is_array($_[0]) ? : 0 0 0
@_ == 1 ? : 0 0 0
$self->_is_object($_[0]) && overload::Method($_[0], '""') ? : 0 0 0
ref $_[0] ? : 0 0 0
Condition0%0/3
$self->_is_object($_[0]) and overload::Method($_[0], "\"\"")
!ll&&!rl&&r
000
MC/DC0%0/2
$self->_is_object($_[0]) and overload::Method($_[0], "\"\"")
$self->_is_object($_[0]) overload::Method($_[0], "\"\"")
Truth table0%0/3
A and B
A= $self->_is_object($_[0])B= overload::Method($_[0], "\"\"")
ABresult
0X0
100
111
695 ? shift( @_ )
696 : @_ == 1
697 ? ( $self->_is_object( $_[0] ) && overload::Method( $_[0], '""' ) )
698 ? [CORE::split( /[[:blank:]\h]+/, "$_[0]" )]
699 : ref( $_[0] )
700 ? shift( @_ )
701 : [CORE::split( /[[:blank:]\h]+/, $_[0] )]
702 : [@_];
703 0 ▶ my $v = $self->_set_get_array_as_object( 'subprotocol', $ref ) || return( $self->pass_error );
Condition0%0/2
$self->_set_get_array_as_object('subprotocol', $ref) || (return $self->pass_error)
l!l
00
MC/DC0%0/1
$self->_set_get_array_as_object('subprotocol', $ref) || (return $self->pass_error)
$self->_set_get_array_as_object('subprotocol', $ref)
Truth table0%0/2
A
A= $self->_set_get_array_as_object('subprotocol', $ref)
Aresult
11
00
704 0 ▶ $self->handshake->response->subprotocol( $v ) if( !$self->handshake->is_done );
Branch: 1 branch
BranchTrueFalseTotal
unless $self->handshake->is_done 0 0 0
705 }
706 0 return( $self->_set_get_array_as_object( 'subprotocol' ) );
707 }
708  
709 2 1;
710  
711 # NOTE POD
712 __END__
↑ Summary WebSocket/Client.pm »