| 1 | package SockJS::Connection; | ||||||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||||||
| 3 | 9 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 4 | 9 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||||||||||||||||||||
| 6 | 39 | ▶ | sub new { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
new: called CC=4 SCAR=14.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 7 | 39 | my $class = shift; | |||||||||||||||||||||||||||||||||||||||||||||
| 8 | 39 | my (%params) = @_; | |||||||||||||||||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||||||||||||||||
| 10 | 39 | my $self = {}; | |||||||||||||||||||||||||||||||||||||||||||||
| 11 | 39 | bless $self, $class; | |||||||||||||||||||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||||||||||||||||||||
| 13 | 39 | ▶ | $self->{type} = $params{type} || ''; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$params{'type'} || ''
MC/DC0%0/1
$params{'type'} || ''
$params{'type'}
Truth table50%1/2
A
A= $params{'type'}
| |||||||||||||||||||||||||||||||||||||||||||||||
| 14 | 39 | ▶ | $self->{close_cb} = $params{close_cb} || sub { }; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=1.2
Condition33%1/3
$params{'close_cb'} || sub {
}
MC/DC0%0/2
$params{'close_cb'} || sub {
}
$params{'close_cb'}
sub {
}
Truth table33%1/3
A || B
A= $params{'close_cb'}B= sub {
}
| |||||||||||||||||||||||||||||||||||||||||||||||
| 15 | 39 | ▶ | $self->{write_cb} = $params{write_cb} || sub { }; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=1.2
Condition33%1/3
$params{'write_cb'} || sub {
}
MC/DC0%0/2
$params{'write_cb'} || sub {
}
$params{'write_cb'}
sub {
}
Truth table33%1/3
A || B
A= $params{'write_cb'}B= sub {
}
| |||||||||||||||||||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||||||||||||||||||
| 17 | 39 | $self->{messages} = []; | |||||||||||||||||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||||||||||||||||
| 19 | 39 | return $self; | |||||||||||||||||||||||||||||||||||||||||||||
| 20 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||||||||||||||||||||
| 22 | 7 | ▶ | sub type { $_[0]->{type} } | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
type: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||||||||||||||||||||
| 24 | 16 | ▶ | sub write_cb { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
write_cb: called CC=2 SCAR=7.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 25 | 16 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||||||||||||||||||||
| 27 | 16 | ▶ | if (@_) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 28 | 16 | $self->{write_cb} = $_[0]; | |||||||||||||||||||||||||||||||||||||||||||||
| 29 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||||||||||||||||||||
| 31 | 16 | return $self->{write_cb}; | |||||||||||||||||||||||||||||||||||||||||||||
| 32 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||||||||||||||||||||
| 34 | 6 | ▶ | sub close_cb { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
close_cb: called CC=2 SCAR=7.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 35 | 6 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||||||||||||||||||||
| 37 | 6 | ▶ | if (@_) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 38 | 6 | $self->{close_cb} = $_[0]; | |||||||||||||||||||||||||||||||||||||||||||||
| 39 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||||||||||||||||||||
| 41 | 6 | return $self->{close_cb}; | |||||||||||||||||||||||||||||||||||||||||||||
| 42 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||||||||||||||||||||
| 44 | 115 | ▶ | sub is_connected { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
is_connected: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 45 | 115 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||||||||||||||||||||
| 47 | 115 | return $self->{is_connected}; | |||||||||||||||||||||||||||||||||||||||||||||
| 48 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||||||||||||||||||||
| 50 | 38 | ▶ | sub connected { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
connected: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 51 | 38 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||||||||||||||||||||
| 53 | 38 | $self->{is_connected} = 1; | |||||||||||||||||||||||||||||||||||||||||||||
| 54 | 38 | $self->{is_reconnecting} = 0; | |||||||||||||||||||||||||||||||||||||||||||||
| 55 | 38 | $self->{is_closed} = 0; | |||||||||||||||||||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||||||||||||||||||||
| 57 | 38 | $self->_send_staged_messages; | |||||||||||||||||||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||||||||||||||||||||
| 59 | 38 | $self->fire_event('connect'); | |||||||||||||||||||||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||||||||||||||||||||||
| 61 | 38 | return $self; | |||||||||||||||||||||||||||||||||||||||||||||
| 62 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 63 | |||||||||||||||||||||||||||||||||||||||||||||||
| 64 | 6 | ▶ | sub reconnecting { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
reconnecting: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 65 | 6 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||
| 66 | |||||||||||||||||||||||||||||||||||||||||||||||
| 67 | 6 | $self->{is_reconnecting} = 1; | |||||||||||||||||||||||||||||||||||||||||||||
| 68 | |||||||||||||||||||||||||||||||||||||||||||||||
| 69 | 6 | return $self; | |||||||||||||||||||||||||||||||||||||||||||||
| 70 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||||||||||||||||||||
| 72 | 67 | ▶ | sub is_reconnecting { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
is_reconnecting: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 73 | 67 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||
| 74 | |||||||||||||||||||||||||||||||||||||||||||||||
| 75 | 67 | return $self->{is_reconnecting}; | |||||||||||||||||||||||||||||||||||||||||||||
| 76 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 77 | |||||||||||||||||||||||||||||||||||||||||||||||
| 78 | 1 | ▶ | sub reconnected { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
reconnected: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 79 | 1 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||
| 80 | |||||||||||||||||||||||||||||||||||||||||||||||
| 81 | 1 | $self->{is_reconnecting} = 0; | |||||||||||||||||||||||||||||||||||||||||||||
| 82 | |||||||||||||||||||||||||||||||||||||||||||||||
| 83 | 1 | $self->_send_staged_messages; | |||||||||||||||||||||||||||||||||||||||||||||
| 84 | |||||||||||||||||||||||||||||||||||||||||||||||
| 85 | 1 | return $self; | |||||||||||||||||||||||||||||||||||||||||||||
| 86 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 87 | |||||||||||||||||||||||||||||||||||||||||||||||
| 88 | 7 | ▶ | sub closed { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
closed: called CC=2 SCAR=7.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 89 | 7 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||
| 90 | |||||||||||||||||||||||||||||||||||||||||||||||
| 91 | 7 | ▶ | return if $self->is_closed; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 92 | |||||||||||||||||||||||||||||||||||||||||||||||
| 93 | 7 | $self->{is_connected} = 0; | |||||||||||||||||||||||||||||||||||||||||||||
| 94 | 7 | $self->{is_closed} = 1; | |||||||||||||||||||||||||||||||||||||||||||||
| 95 | |||||||||||||||||||||||||||||||||||||||||||||||
| 96 | 7 | $self->fire_event('close'); | |||||||||||||||||||||||||||||||||||||||||||||
| 97 | |||||||||||||||||||||||||||||||||||||||||||||||
| 98 | 7 | return $self; | |||||||||||||||||||||||||||||||||||||||||||||
| 99 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 100 | |||||||||||||||||||||||||||||||||||||||||||||||
| 101 | 2 | ▶ | sub aborted { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
aborted: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 102 | 2 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||
| 103 | |||||||||||||||||||||||||||||||||||||||||||||||
| 104 | 2 | ▶ | return if $self->is_closed; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 105 | |||||||||||||||||||||||||||||||||||||||||||||||
| 106 | 2 | $self->{is_connected} = 0; | |||||||||||||||||||||||||||||||||||||||||||||
| 107 | 2 | $self->{is_closed} = 1; | |||||||||||||||||||||||||||||||||||||||||||||
| 108 | |||||||||||||||||||||||||||||||||||||||||||||||
| 109 | 2 | ▶ | if (exists $self->{on_abort}) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 110 | 1 | $self->fire_event('abort'); | |||||||||||||||||||||||||||||||||||||||||||||
| 111 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 112 | else { | ||||||||||||||||||||||||||||||||||||||||||||||
| 113 | 1 | $self->fire_event('close'); | |||||||||||||||||||||||||||||||||||||||||||||
| 114 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 115 | |||||||||||||||||||||||||||||||||||||||||||||||
| 116 | 2 | return $self; | |||||||||||||||||||||||||||||||||||||||||||||
| 117 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 118 | |||||||||||||||||||||||||||||||||||||||||||||||
| 119 | 34 | ▶ | sub is_closed { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
is_closed: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 120 | 34 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||
| 121 | |||||||||||||||||||||||||||||||||||||||||||||||
| 122 | 34 | return $self->{is_closed}; | |||||||||||||||||||||||||||||||||||||||||||||
| 123 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 124 | |||||||||||||||||||||||||||||||||||||||||||||||
| 125 | 8 | ▶ | sub on { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
on: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 126 | 8 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||
| 127 | 8 | my ($event, $cb) = @_; | |||||||||||||||||||||||||||||||||||||||||||||
| 128 | |||||||||||||||||||||||||||||||||||||||||||||||
| 129 | 8 | push @{$self->{"on_$event"}}, $cb; | |||||||||||||||||||||||||||||||||||||||||||||
| 130 | |||||||||||||||||||||||||||||||||||||||||||||||
| 131 | 8 | return $self; | |||||||||||||||||||||||||||||||||||||||||||||
| 132 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 133 | |||||||||||||||||||||||||||||||||||||||||||||||
| 134 | 24 | ▶ | sub write { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
write: called CC=6 SCAR=18.3
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 135 | 24 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||
| 136 | 24 | my ($message) = @_; | |||||||||||||||||||||||||||||||||||||||||||||
| 137 | |||||||||||||||||||||||||||||||||||||||||||||||
| 138 | 24 | ▶ | return $self unless defined $message && $message ne ''; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $message and $message ne ""
MC/DC0%0/2
defined $message and $message ne ""
defined $message
$message ne ""
Truth table33%1/3
A and B
A= defined $messageB= $message ne ""
| |||||||||||||||||||||||||||||||||||||||||||||||
| 139 | |||||||||||||||||||||||||||||||||||||||||||||||
| 140 | 24 | ▶ | if (($self->is_connected || $self->is_closed) | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition83%5/6
$self->is_connected || $self->is_closed and not $self->is_reconnecting
$self->is_connected or $self->is_closed
MC/DC66%2/3
$self->is_connected || $self->is_closed and not $self->is_reconnecting
$self->is_connected
$self->is_closed
not $self->is_reconnecting
Truth table60%3/5
A or B and not(C)
A= $self->is_connectedB= $self->is_closedC= not $self->is_reconnecting
| |||||||||||||||||||||||||||||||||||||||||||||||
| 141 | && !$self->is_reconnecting) | ||||||||||||||||||||||||||||||||||||||||||||||
| 142 | { | ||||||||||||||||||||||||||||||||||||||||||||||
| 143 | 7 | $self->{write_cb}->($self, $message); | |||||||||||||||||||||||||||||||||||||||||||||
| 144 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 145 | else { | ||||||||||||||||||||||||||||||||||||||||||||||
| 146 | 17 | push @{$self->{messages}}, $message; | |||||||||||||||||||||||||||||||||||||||||||||
| 147 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 148 | |||||||||||||||||||||||||||||||||||||||||||||||
| 149 | 24 | return $self; | |||||||||||||||||||||||||||||||||||||||||||||
| 150 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 151 | |||||||||||||||||||||||||||||||||||||||||||||||
| 152 | 7 | ▶ | sub close { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
close: called CC=5 SCAR=16.5
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 153 | 7 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||
| 154 | 7 | my ($code, $message) = @_; | |||||||||||||||||||||||||||||||||||||||||||||
| 155 | |||||||||||||||||||||||||||||||||||||||||||||||
| 156 | 7 | ▶ | if ($self->type ne 'raw_websocket') { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 157 | 7 | ▶ | $self->{close_message} ||= do { | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
$self->{"close_message"} ||= do {
$code ||= 3000;
$message ||= "Get away!";
[int $code, $message]
}
MC/DC0%0/2
$self->{"close_message"} ||= do {
$code ||= 3000;
$message ||= "Get away!";
[int $code, $message]
}
$self->{"close_message"}
do {
$code ||= 3000;
$message ||= "Get away!";
[int $code, $message]
}
Truth table66%2/3
A ||= B
A= $self->{"close_message"}B= do {
$code ||= 3000;
$message ||= "Get away!";
[int $code, $message]
}
| |||||||||||||||||||||||||||||||||||||||||||||||
| 158 | 4 | ▶ | $code ||= 3000; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$code ||= 3000
MC/DC0%0/1
$code ||= 3000
$code
Truth table50%1/2
A
A= $code
| |||||||||||||||||||||||||||||||||||||||||||||||
| 159 | 4 | ▶ | $message ||= 'Get away!'; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$message ||= "Get away!"
MC/DC0%0/1
$message ||= "Get away!"
$message
Truth table50%1/2
A
A= $message
| |||||||||||||||||||||||||||||||||||||||||||||||
| 160 | |||||||||||||||||||||||||||||||||||||||||||||||
| 161 | 4 | [int $code, $message]; | |||||||||||||||||||||||||||||||||||||||||||||
| 162 | }; | ||||||||||||||||||||||||||||||||||||||||||||||
| 163 | |||||||||||||||||||||||||||||||||||||||||||||||
| 164 | $self->write('c[' | ||||||||||||||||||||||||||||||||||||||||||||||
| 165 | . $self->{close_message}->[0] . ',"' | ||||||||||||||||||||||||||||||||||||||||||||||
| 166 | 7 | . $self->{close_message}->[1] | |||||||||||||||||||||||||||||||||||||||||||||
| 167 | . '"]'); | ||||||||||||||||||||||||||||||||||||||||||||||
| 168 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 169 | |||||||||||||||||||||||||||||||||||||||||||||||
| 170 | 7 | $self->{close_cb}->($self); | |||||||||||||||||||||||||||||||||||||||||||||
| 171 | |||||||||||||||||||||||||||||||||||||||||||||||
| 172 | 7 | $self->closed; | |||||||||||||||||||||||||||||||||||||||||||||
| 173 | |||||||||||||||||||||||||||||||||||||||||||||||
| 174 | 7 | return $self; | |||||||||||||||||||||||||||||||||||||||||||||
| 175 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 176 | |||||||||||||||||||||||||||||||||||||||||||||||
| 177 | 52 | ▶ | sub fire_event { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
fire_event: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 178 | 52 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||
| 179 | 52 | my $event = shift; | |||||||||||||||||||||||||||||||||||||||||||||
| 180 | |||||||||||||||||||||||||||||||||||||||||||||||
| 181 | 52 | ▶ | if (exists $self->{"on_$event"}) { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 182 | 7 | foreach my $ev (@{$self->{"on_$event"}}) { | |||||||||||||||||||||||||||||||||||||||||||||
| 183 | 7 | $ev->($self, @_); | |||||||||||||||||||||||||||||||||||||||||||||
| 184 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 185 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 186 | |||||||||||||||||||||||||||||||||||||||||||||||
| 187 | 52 | return $self; | |||||||||||||||||||||||||||||||||||||||||||||
| 188 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 189 | |||||||||||||||||||||||||||||||||||||||||||||||
| 190 | 39 | ▶ | sub _send_staged_messages { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_send_staged_messages: called CC=7 SCAR=19.5
| |||||||||||||||||||||||||||||||||||||||||||||||
| 191 | 39 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||
| 192 | |||||||||||||||||||||||||||||||||||||||||||||||
| 193 | 39 | ▶ | while ($self->is_connected | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition83%5/6
$self->is_connected and not $self->is_reconnecting and @{$self->{"messages"};}
$self->is_connected and not $self->is_reconnecting
MC/DC66%2/3
$self->is_connected and not $self->is_reconnecting and @{$self->{"messages"};}
$self->is_connected
not $self->is_reconnecting
@{$self->{"messages"};}
Truth table75%3/4
A and not(B) and C
A= $self->is_connectedB= not $self->is_reconnectingC= @{$self->{"messages"};}
| |||||||||||||||||||||||||||||||||||||||||||||||
| 194 | && !$self->is_reconnecting | ||||||||||||||||||||||||||||||||||||||||||||||
| 195 | 50 | && @{$self->{messages}}) | |||||||||||||||||||||||||||||||||||||||||||||
| 196 | { | ||||||||||||||||||||||||||||||||||||||||||||||
| 197 | 14 | my $message = shift @{$self->{messages}}; | |||||||||||||||||||||||||||||||||||||||||||||
| 198 | 14 | my $type = substr($message, 0, 1); | |||||||||||||||||||||||||||||||||||||||||||||
| 199 | |||||||||||||||||||||||||||||||||||||||||||||||
| 200 | 14 | ▶ | if ($type eq 'a') { | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 201 | 1 | ▶ | while ($self->{messages}->[0] | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$self->{"messages"}[0] and substr($self->{"messages"}[0], 0, 1) eq $type
MC/DC50%1/2
$self->{"messages"}[0] and substr($self->{"messages"}[0], 0, 1) eq $type
$self->{"messages"}[0]
substr($self->{"messages"}[0], 0, 1) eq $type
Truth table66%2/3
A and B
A= $self->{"messages"}[0]B= substr($self->{"messages"}[0], 0, 1) eq $type
| |||||||||||||||||||||||||||||||||||||||||||||||
| 202 | && substr($self->{messages}->[0], 0, 1) eq $type) | ||||||||||||||||||||||||||||||||||||||||||||||
| 203 | { | ||||||||||||||||||||||||||||||||||||||||||||||
| 204 | 1 | my $next_message = shift @{$self->{messages}}; | |||||||||||||||||||||||||||||||||||||||||||||
| 205 | |||||||||||||||||||||||||||||||||||||||||||||||
| 206 | 1 | $next_message =~ s{^a\[}{}; | |||||||||||||||||||||||||||||||||||||||||||||
| 207 | 1 | $message =~ s{\]}{,$next_message}; | |||||||||||||||||||||||||||||||||||||||||||||
| 208 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 209 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 210 | |||||||||||||||||||||||||||||||||||||||||||||||
| 211 | 14 | $self->{write_cb}->($self, $message); | |||||||||||||||||||||||||||||||||||||||||||||
| 212 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 213 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 214 | |||||||||||||||||||||||||||||||||||||||||||||||
| 215 | 9 | 1; | |||||||||||||||||||||||||||||||||||||||||||||