Branch Coverage

blib/lib/AnyEvent/Discord.pm
Criterion Covered Total %
branch 43 314 13.6


line true false branch
45 3 0 @_ ? :
0 3 if @_ != 0
56 5 0 @_ ? :
0 5 if @_ != 2
5 0 $#_ >= 0 ? :
0 5 unless Type::Tiny::XS::Str($event_type)
5 0 if ($#_ >= 0)
5 0 $#_ >= 1 ? :
0 5 unless XXX
5 0 if ($#_ >= 1)
61 1 4 if scalar grep({$_ eq $handler;} @{$self->_events->{$event_type};}) > 0
67 3 0 @_ ? :
0 3 if @_ < 1
0 3 if @_ > 2
3 0 $#_ >= 0 ? :
0 3 unless Type::Tiny::XS::Str($event_type)
3 0 if ($#_ >= 0)
2 1 $#_ >= 1 ? :
0 2 unless XXX
2 1 if ($#_ >= 1)
70 3 0 if ($self->_events->{$event_type})
71 2 1 if ($handler) { }
74 1 1 if ($self->_events->{$event_type}[$index] eq $handler)
87 0 0 @_ ? :
0 0 if @_ != 0
95 0 0 if ($@)
116 0 0 unless ($self->_force_disconnect)
142 0 0 unless ($payload and defined $payload->op)
146 0 0 if $payload->s and $payload->s > 0
148 0 0 if ($payload->op == 10) { }
0 0 elsif ($payload->d) { }
151 0 0 if ($payload->d->{'author'})
166 0 0 @_ ? :
0 0 if @_ != 2
0 0 $#_ >= 0 ? :
0 0 $#_ >= 1 ? :
170 0 0 @_ ? :
0 0 if @_ != 1
0 0 $#_ >= 0 ? :
181 0 0 @_ ? :
0 0 if @_ != 0
189 0 0 @_ ? :
0 0 if @_ < 2
0 0 if @_ > 3
0 0 $#_ >= 0 ? :
0 0 unless Type::Tiny::XS::Str($method)
0 0 if ($#_ >= 0)
0 0 $#_ >= 1 ? :
0 0 unless Type::Tiny::XS::Str($path)
0 0 if ($#_ >= 1)
0 0 $#_ >= 2 ? :
204 0 0 if ($res->is_success)
205 0 0 if ($res->header('Content-Type') eq 'application/json') { }
215 0 0 @_ ? :
0 0 if @_ != 0
234 0 0 @_ ? :
0 0 if @_ != 1
0 0 $#_ >= 0 ? :
0 0 unless Type::Tiny::XS::AUTO::TC2($payload)
0 0 if ($#_ >= 0)
235 0 0 unless ($self->_socket)
245 0 0 @_ ? :
0 0 if @_ != 0
247 0 0 unless $payload and $payload->{'url'} and $payload->{'url'} =~ /^wss/u
251 0 0 unless $gateway =~ m[/$]u
257 0 0 @_ ? :
0 0 if @_ != 1
0 0 $#_ >= 0 ? :
0 0 unless Type::Tiny::XS::Str($type)
0 0 if ($#_ >= 0)
259 0 0 if ($self->{$event_source}{$type})
261 0 0 $event_source =~ /internal/u ? :
269 4 0 @_ ? :
0 4 if @_ != 1
4 0 $#_ >= 0 ? :
0 4 unless Type::Tiny::XS::AUTO::TC2($payload)
4 0 if ($#_ >= 0)
273 4 4 if ($self->{$event_source}{$type})
275 2 2 $event_source =~ /internal/u ? :
283 22 0 @_ ? :
0 22 if @_ != 1
22 0 $#_ >= 0 ? :
0 22 unless Type::Tiny::XS::Str($message)
22 0 if ($#_ >= 0)
284 0 22 if $self->verbose
288 0 0 @_ ? :
0 0 if @_ != 1
0 0 $#_ >= 0 ? :
0 0 unless Type::Tiny::XS::Str($message)
0 0 if ($#_ >= 0)
289 0 0 if $self->verbose and $self->verbose == 2
293 0 0 @_ ? :
0 0 if @_ != 1
0 0 $#_ >= 0 ? :
0 0 unless Type::Tiny::XS::AUTO::TC2($payload)
0 0 if ($#_ >= 0)
312 0 0 @_ ? :
0 0 if @_ < 2
0 0 if @_ > 3
0 0 $#_ >= 0 ? :
0 0 $#_ >= 1 ? :
0 0 unless XXX
0 0 if ($#_ >= 1)
0 0 $#_ >= 2 ? :
0 0 unless defined $opcode and not ref $opcode and &Scalar::Util::looks_like_number($opcode)
0 0 if ($#_ >= 2)
318 0 0 if ($channel->{'type'} == 0)
328 0 0 @_ ? :
0 0 if @_ < 2
0 0 if @_ > 3
0 0 $#_ >= 0 ? :
0 0 $#_ >= 1 ? :
0 0 unless XXX
0 0 if ($#_ >= 1)
0 0 $#_ >= 2 ? :
0 0 unless defined $opcode and not ref $opcode and &Scalar::Util::looks_like_number($opcode)
0 0 if ($#_ >= 2)
333 0 0 @_ ? :
0 0 if @_ < 2
0 0 if @_ > 3
0 0 $#_ >= 0 ? :
0 0 $#_ >= 1 ? :
0 0 unless XXX
0 0 if ($#_ >= 1)
0 0 $#_ >= 2 ? :
0 0 unless defined $opcode and not ref $opcode and &Scalar::Util::looks_like_number($opcode)
0 0 if ($#_ >= 2)
338 0 0 @_ ? :
0 0 if @_ < 2
0 0 if @_ > 3
0 0 $#_ >= 0 ? :
0 0 $#_ >= 1 ? :
0 0 unless XXX
0 0 if ($#_ >= 1)
0 0 $#_ >= 2 ? :
0 0 unless defined $opcode and not ref $opcode and &Scalar::Util::looks_like_number($opcode)
0 0 if ($#_ >= 2)
343 0 0 @_ ? :
0 0 if @_ < 2
0 0 if @_ > 3
0 0 $#_ >= 0 ? :
0 0 $#_ >= 1 ? :
0 0 unless XXX
0 0 if ($#_ >= 1)
0 0 $#_ >= 2 ? :
0 0 unless defined $opcode and not ref $opcode and &Scalar::Util::looks_like_number($opcode)
0 0 if ($#_ >= 2)
348 0 0 @_ ? :
0 0 if @_ < 2
0 0 if @_ > 3
0 0 $#_ >= 0 ? :
0 0 $#_ >= 1 ? :
0 0 unless XXX
0 0 if ($#_ >= 1)
0 0 $#_ >= 2 ? :
0 0 unless defined $opcode and not ref $opcode and &Scalar::Util::looks_like_number($opcode)
0 0 if ($#_ >= 2)