Branch Coverage

blib/lib/App/MBUtiny/Collector.pm
Criterion Covered Total %
branch 16 86 18.6


line true false branch
292 0 1 unless is_array($collector_config)
294 0 1 unless $dbi and ref $dbi eq 'App::MBUtiny::Collector::DBI'
301 0 1 if ($url) { }
309 1 0 unless $internal
316 0 1 unless (@collectors)
317 0 0 unless $internal
336 1 0 if ($cnt >= 2)
337 0 1 if ($s) { }
353 1 1 unless wantarray
361 0 0 unless $self->collectors
365 0 0 if ($type eq 'internal') { }
366 0 0 if ($dbi->error)
378 0 0 unless ($client->status)
383 0 0 unless ($client->status)
390 0 0 @ret ? :
397 0 1 unless $self->collectors
406 0 1 if ($op =~ /^(del)|(rem)/) { }
407 0 0 if ($type eq 'internal') { }
412 0 0 unless ($dbi->del('type', _type2int($type), 'name', $args{'name'}, 'file', $args{'file'}))
419 0 0 unless ($client->status)
427 0 0 unless ($client->del('type', _type2int($type), 'name', $args{'name'}, 'file', $args{'file'}))
434 1 0 if ($type eq 'internal') { }
445 0 1 unless ($dbi->add('type', _type2int($type), 'name', $args{'name'}, 'file', $args{'file'}, 'size', $args{'size'}, 'md5', $args{'md5'}, 'sha1', $args{'sha1'}, 'status', $args{'status'}, 'error', $args{'error'}, 'comment', $comment))
452 0 0 unless ($client->status)
466 0 0 unless ($client->add('type', _type2int($type), 'name', $args{'name'}, 'file', $args{'file'}, 'size', $args{'size'}, 'md5', $args{'md5'}, 'sha1', $args{'sha1'}, 'status', $args{'status'}, 'error', $args{'error'}, 'comment', $comment))
475 1 0 @ret ? :
482 0 0 unless $self->collectors
485 0 0 if ($collector->{'type'} eq 'internal') { }
489 0 0 unless ((%info) = $dbi->get('name', $args{'name'}, 'file', $args{'file'}))
498 0 0 unless ($client->status)
506 0 0 if ($client->error)
511 0 0 if $info{'id'} and $info{'status'}
520 0 0 unless $self->collectors
524 0 0 if ($collector->{'type'} eq 'internal') { }
526 0 0 if ($dbi->error)
535 0 0 if ($client->error)
540 0 0 if ($client->error)
550 0 0 unless ($t)
554 0 0 if $t->{'time'} < $rec->{'time'}
561 0 0 unless $s
564 0 0 unless $inv{$s}
568 0 1 unless $s
570 1 0 unless $types{$s}