Branch Coverage

blib/lib/Mojo/SNMP.pm
Criterion Covered Total %
branch 47 92 51.0


line true false branch
90 0 11 $ENV{'MOJO_SNMP_DEBUG'} ? :
298 2 16 ref $_[-1] eq 'CODE' ? :
300 0 18 ref $_[0] eq 'ARRAY' ? :
301 13 5 ref $_[0] eq 'HASH' ? :
304 0 5 unless $self->{'sessions'}
5 13 if $hosts->[0] and $hosts->[0] eq '*'
315 13 12 $key eq $host ? :
316 0 25 unless $self->{'sessions'}{$key} ||= $self->_new_session(\%args)
321 13 5 ref $_[0] eq 'ARRAY' ? :
329 2 7 unless my $queue = $self->_dequeue
333 0 18 if not $self->{'_setup'}++ and $self->ioloop->is_running
380 0 0 unless $self->{'_setup'}++
388 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' ? :
399 34 18 defined $_[1]{$_} ? :
404 0 13 unless $self->{'queue'}
3 10 unless my $key = (keys %{{} unless $self->{'queue'};})[0]
419 0 10 if $error
424 1 16 $_[1] =~ /3/ ? :
1 17 $_[1] =~ /1/ ? :
431 4 8 unless ($item)
432 1 3 unless $queue = $self->_dequeue
443 7 4 unless ($session->transport)
445 0 7 unless ($session->open)
448 0 0 if $cb
469 0 2 if ($session->var_bind_list) { }
471 0 0 if $cb
476 0 2 if $cb
480 0 2 unless (eval { do { local(@$args{'method', 'request'}) = @$item[1, 2]; --$self->{'n_requests'}; if ($session->var_bind_list) { '???'; return $self->$cb('', $session) if $cb; return $self->emit('response', $session, $args); } else { '???'; return $self->$cb($session->error, undef) if $cb; return $self->emit('error', $session->error, $session, $args); } ; 1 } })
486 1 1 unless $self->{'n_requests'}
488 1 10 $method =~ /bulk/ ? :
3 8 ref $method ? :
490 11 0 if $success
497 0 2 unless my $timeout = $self->master_timeout
521 0 0 if %tree
528 0 0 unless my $res = $session->var_bind_list
529 0 0 unless my(@sortres) = $session->var_bind_names
534 0 0 if $types{$oid} or not Net::SNMP::oid_base_match($base_oid, $oid)
539 0 0 unless $next
553 0 0 if %tree
560 0 0 unless my $res = $session->var_bind_list
565 0 0 if (not $types{$oid} and Net::SNMP::oid_base_match($base_oid, $oid))
572 0 0 unless @next