Branch Coverage

blib/lib/AnyEvent/MQTT.pm
Criterion Covered Total %
branch 130 150 86.6


line true false branch
56 18 2 if ($self->{'handle'})
74 5 0 if $self->{'on_error'}
75 3 2 if $reconnect
82 7 1 exists $p{'topic'} ? :
83 4 3 exists $p{'qos'} ? :
84 1 6 exists $p{'cv'} ? :
86 3 4 if ($qos)
87 2 1 $qos == 1 ? :
90 4 3 if (defined $message)
99 2 1 exists $p{'handle'} ? :
100 1 1 unless ($handle->isa("AnyEvent::Handle"))
101 0 1 unless $p{'handle_args'}
109 2 0 if $error_sub
116 1 1 unless $p{'push_read_args'}
142 1 70017 if $self->{'message_id'} >= 65536
148 5 3 if ($args->{'qos'}) { }
149 3 2 unless (exists $args->{'message_id'})
175 1 7 if $dup
183 18 1 exists $p{'topic'} ? :
185 17 1 exists $p{'callback'} ? :
186 5 12 exists $p{'qos'} ? :
187 1 16 exists $p{'cv'} ? :
189 12 5 if (defined $mid)
201 6 1 exists $p{'topic'} ? :
202 1 5 exists $p{'cv'} ? :
204 2 4 if (defined $mid)
215 2 15 if ($rec)
225 3 12 if ($rec)
242 1 5 if ($rec)
248 1 4 unless ($rec)
254 3 1 if (defined $sub)
255 0 3 unless (exists $rec->{'cb'}{$sub})
262 2 1 if (keys %{$$rec{"cb"};})
280 1 12 unless (defined $topic)
293 0 0 if (not $self->{'clean_session'} and $qos and $self->{'_qos_msg_cache'})
301 0 0 unless @$cache
309 1 2 unless (defined $topic)
325 35 21 $self->{'connected'} ? :
333 35 21 unless defined $self->{'_waiting'}
341 16 98 if (@_) { }
344 48 50 unless my $args = shift @{$$self{"write_queue"};}
349 5 61 if $self->{'message_log_callback'}
359 3 68 $wait ? :
387 2 1 unless defined $self->{'_keep_alive_waiting'}
396 21 9 if ($msg) { }
397 12 9 unless $cv
400 7 2 unless exists $self->{'connect_cv'}
403 12 18 if $self->{'handle'}
432 0 16 if $weak_self->{'on_connect'}
458 0 18 $self->{'tls'} ? :
468 3 0 if ($self->{'clean_session'})
479 0 58 if $error
480 1 57 if $self->{'message_log_callback'}
481 0 58 unless $self->_call_callback("before_msg_callback", $msg)
484 0 58 unless $self->_call_callback("before_" . $msg_type . "_callback", $msg)
486 1 57 unless ($self->can($method))
498 173 0 unless exists $self->{$cb_name}
505 1 12 unless ($msg->return_code == 0)
511 3 9 if $self->{'connect_cv'}
520 31 20 if ref $w and defined $w->[1]
559 1 15 unless (scalar @$matches)
567 0 19 if ($msg_retain)
568 0 0 if ($msg_data eq '') { }
577 2 25 if $matched{$cb}++
589 0 2 if ($qos and not $self->{'clean_session'} and not @{$self->{'_sub_topics'}->values($msg->topic);})
595 1 15 if ($qos == 2)
602 1 14 if $qos == 1
610 2 5 unless (exists $self->{'inflight'}{$mid})
616 1 4 unless ($got_type == $exp_type)
626 1 2 unless my $rec = $self->_inflight_record($msg)
635 1 1 unless my $rec = $self->_inflight_record($msg)
650 1 1 unless ($pubmsg)
660 1 1 unless my $rec = $self->_inflight_record($msg)
674 0 41 unless defined $$rbuf
677 41 58 unless $msg