Branch Coverage

blib/lib/Mojo/SNMP.pm
Criterion Covered Total %
branch 47 94 50.0


line true false branch
7 0 12 $ENV{'MOJO_SNMP_DEBUG'} ? :
42 2 16 ref $_[-1] eq 'CODE' ? :
44 0 18 ref $_[0] eq 'ARRAY' ? :
45 13 5 ref $_[0] eq 'HASH' ? :
48 0 5 unless $self->{'sessions'}
5 13 if $hosts->[0] and $hosts->[0] eq '*'
59 13 12 $key eq $host ? :
60 0 25 unless $self->{'sessions'}{$key} ||= $self->_new_session(\%args)
65 13 5 ref $_[0] eq 'ARRAY' ? :
73 2 7 unless my $queue = $self->_dequeue
77 0 18 if not $self->{'_setup'}++ and $self->ioloop->is_running
93 0 0 unless $self->{'_setup'}++
101 0 0 ref $_[0] eq 'HASH' ? :
1 0 ref $_[0] eq 'HASH' ? :
0 0 ref $_[0] eq 'HASH' ? :
0 1 ref $_[0] eq 'HASH' ? :
0 0 ref $_[0] eq 'HASH' ? :
0 0 ref $_[0] eq 'HASH' ? :
112 34 18 defined $_[1]{$_} ? :
117 0 14 unless $self->{'queue'}
3 11 unless my $key = (keys %{{} unless $self->{'queue'};})[0]
132 0 10 if $error
137 1 16 $_[1] =~ /3/ ? :
1 17 $_[1] =~ /1/ ? :
144 5 7 unless ($item)
145 1 4 unless $queue = $self->_dequeue
156 8 3 unless ($session->transport)
158 0 8 unless ($session->open)
161 0 0 if $cb
182 0 2 if ($session->var_bind_list) { }
184 0 0 $cb ? :
188 0 2 $cb ? :
191 0 2 unless (eval { do { local(@$args{'method', 'request'}) = @$item[1, 2]; --$self->{'n_requests'}; if ($session->var_bind_list) { '???'; $cb ? $self->$cb('', $session) : $self->emit('response', $session, $args); } else { '???'; $cb ? $self->$cb($session->error, $session) : $self->emit('error', $session->error, $session, $args); } ; 1 } })
198 1 1 unless $self->{'n_requests'}
200 1 10 $method =~ /bulk/ ? :
3 8 ref $method ? :
202 11 0 if $success
209 0 2 unless my $timeout = $self->master_timeout
233 0 0 if (scalar keys %tree) { }
245 0 0 unless my $res = $session->var_bind_list
246 0 0 unless my(@sortres) = $session->var_bind_names
251 0 0 if $types{$oid} or not Net::SNMP::oid_base_match($base_oid, $oid)
256 0 0 unless $next
270 0 0 if %tree
277 0 0 unless my $res = $session->var_bind_list
282 0 0 if (not $types{$oid} and Net::SNMP::oid_base_match($base_oid, $oid))
289 0 0 unless @next