Branch Coverage

blib/lib/CAPE/Utils.pm
Criterion Covered Total %
branch 0 266 0.0


line true false branch
61 0 0 unless (defined $ini)
99 0 0 if (not defined $config) { }
104 0 0 unless (defined $config->{'_'}{$item})
155 0 0 if (defined $opts{'where'} and $opts{'where'} =~ /\;/)
159 0 0 unless (defined $opts{'where'} or $self->{'config'}{'_'}{'fail_all'})
167 0 0 if (defined $opts{'where'})
201 0 0 if (defined $opts{'where'} and $opts{'where'} =~ /\;/)
208 0 0 if (defined $opts{'where'})
240 0 0 if (defined $opts{'where'} and $opts{'where'} =~ /\;/)
247 0 0 if (defined $opts{'where'})
295 0 0 unless (defined $opts{$override})
310 0 0 if ($header_int % 2 != 0) { }
324 0 0 if ($column eq "ET")
328 0 0 if (defined $row->{$column}) { }
329 0 0 if ($column eq "ET")
333 0 0 if ($column eq 'clock' || $column eq 'added_on' and $opts{'pending_time_clip'}) { }
0 0 elsif ($column eq 'target' and $opts{'pending_target_clip'}) { }
376 0 0 if (defined $opts{'where'} and $opts{'where'} =~ /\;/)
383 0 0 if (defined $opts{'where'})
422 0 0 if (defined $opts{'where'} and $opts{'where'} =~ /\;/)
429 0 0 if (defined $opts{'where'})
477 0 0 unless (defined $opts{$override})
492 0 0 if ($header_int % 2 != 0) { }
506 0 0 if ($column eq "ET")
510 0 0 if (defined $row->{$column}) { }
511 0 0 if ($column eq "ET")
515 0 0 if ($column eq 'clock' || $column eq 'added_on' || $column eq 'started_on' and $opts{'running_time_clip'}) { }
0 0 elsif ($column eq 'target' and $opts{'running_target_clip'}) { }
565 0 0 if (defined $opts{'where'} and $opts{'where'} =~ /\;/)
569 0 0 if (defined $opts{'order'} and not $opts{'order'} =~ /^[0-9a-zA-Z]+$/) { }
575 0 0 if (defined $opts{'limit'} and not $opts{'limit'} =~ /^[0-9]+$/) { }
581 0 0 if (defined $opts{'direction'})
584 0 0 if (defined $opts{'direction'} and $opts{'direction'} ne 'desc' || $opts{'direction'} ne 'asc') { }
591 0 0 unless $dbh = $self->connect
592 0 0 if ($@)
597 0 0 if (defined $opts{'where'})
605 0 0 unless $sth = $dbh->prepare($statement)
606 0 0 unless $sth->execute
608 0 0 if ($@)
642 0 0 if (defined $opts{'where'} and $opts{'where'} =~ /\;/)
649 0 0 if (defined $opts{'where'})
700 0 0 unless (defined $opts{$override})
720 0 0 if ($header_int % 2 != 0) { }
739 0 0 if ($column eq "ET")
743 0 0 if ($column eq "latest")
746 0 0 if (defined $row->{$item})
752 0 0 if (defined $row->{$column}) { }
753 0 0 if ($column eq "ET")
757 0 0 if ($column eq 'clock' || $column eq 'added_on' || $column eq 'started_on' || $column eq 'completed_on' || $column eq 'analysis_started_on' || $column eq 'analysis_finished_on' || $column eq 'processing_started_on' || $column eq 'processing_finished_on' || $column eq 'signatures_started_on' || $column eq 'signatures_finished_on' || $column eq 'reporting_started_on' || $column eq 'reporting_finished_on' || $column eq 'latest' and $opts{'task_time_clip'}) { }
0 0 elsif ($column eq 'target' and $opts{'task_target_clip'}) { }
805 0 0 unless (defined $opts{'file'})
809 0 0 unless (-f $opts{'file'})
816 0 0 if (not -f $pre_munge_file) { }
818 0 0 unless copy($opts{'file'}, $pre_munge_file)
826 0 0 if ($@)
834 0 0 if ($item =~ /^munge\_/)
848 0 0 if (defined $self->{'config'}{$item}{'check'} and defined $self->{'config'}{$item}{'munge'}) { }
852 0 0 unless ($check_file =~ m[^/] or $check_file =~ m[^./] or $check_file =~ m[^../])
855 0 0 unless ($munge_file =~ m[^/] or $munge_file =~ m[^./] or $munge_file =~ m[^../])
864 0 0 if ($@)
868 0 0 if ($@)
876 0 0 if ($munge_it)
880 0 0 if ($@)
884 0 0 if ($@)
894 0 0 if ($changed)
899 0 0 if ($report->{'signatures'}[$sig_int]{'severity'}) { }
911 0 0 if ($malscore > 10)
917 0 0 if ($@)
995 0 0 if (defined $opts{'where'} and $opts{'where'} =~ /\;/)
1015 0 0 if (defined $opts{$var_to_check} and $opts{$var_to_check} =~ /[\\\']/)
1026 0 0 if (defined $opts{'where'})
1037 0 0 if (defined $opts{$item})
1054 0 0 if (defined $opts{$item})
1064 0 0 if ($arg =~ /^[0-9]+$/) { }
0 0 elsif ($arg =~ /^\=[0-9]+$/) { }
0 0 elsif ($arg =~ /^\<\=[0-9]+$/) { }
0 0 elsif ($arg =~ /^\<[0-9]+$/) { }
0 0 elsif ($arg =~ /^\>\=[0-9]+$/) { }
0 0 elsif ($arg =~ /^\>[0-9]+$/) { }
0 0 elsif ($arg =~ /^\![0-9]+$/) { }
0 0 elsif ($arg =~ /^$/) { }
1104 0 0 if (defined $opts{$item})
1105 0 0 if (defined $opts{$item . '_like'} and $opts{$item . '_like'}) { }
1196 0 0 unless (defined $opts{'items'}[0])
1200 0 0 if (not defined $opts{'clock'} and $self->{'config'}{'_'}{'set_clock_to_now'})
1204 0 0 unless (defined $opts{'timeout'})
1208 0 0 unless (defined $opts{'enforce_timeout'})
1215 0 0 if (-f $item) { }
0 0 elsif (-d $item) { }
1220 0 0 if (-f $item . "/" . $_)
1228 0 0 unless chdir $self->{'config'}{'_'}{'base'}
1232 0 0 if ($self->{'config'}{'_'}{'poetry'})
1238 0 0 if (defined $opts{'clock'})
1242 0 0 if (defined $opts{'unique'} and $opts{'unique'})
1246 0 0 if (defined $opts{'timeout'})
1250 0 0 if ($opts{'enforce_timeout'} and $opts{'enforce_timeout'})
1254 0 0 if (defined $opts{'package'})
1258 0 0 if (defined $opts{'machine'})
1262 0 0 if (defined $opts{'options'})
1266 0 0 if (defined $opts{'tags'})
1279 0 0 unless ($opts{'quiet'})
1287 0 0 if ($item =~ /^Success\:\ File\ \".*\"\ added\ as\ task\ with\ ID\ \d+$/)
1311 0 0 if ($sec < 10)
1314 0 0 if ($min < 10)
1317 0 0 if ($hour < 10)
1320 0 0 if ($mon < 10)
1323 0 0 if ($mday < 10)
1342 0 0 if $i == $j
1366 0 0 if ($self->{'config'}{'_'}{'auth'} ne 'ip' || $self->{'config'}{'_'}{'auth'} ne 'either' and not defined $opts{'apikey'})
1373 0 0 if ($self->{'config'}{'_'}{'auth'} ne "ip" and defined $opts{'apikey'} and $opts{'apikey'} ne $self->{'config'}{'_'}{'apikey'})
1378 0 0 if ($self->{'config'}{'_'}{'auth'} ne "either")
1384 0 0 if (defined $opts{'apikey'} and $self->{'config'}{'_'}{'auth'} ne 'apikey' || $self->{'config'}{'_'}{'auth'} ne 'either')
1391 0 0 unless (defined $opts{'ip'})
1401 0 0 if ($item =~ /^[\:A-Fa-f0-9]+$/) { }
0 0 elsif ($item =~ m[^[\:A-Fa-f0-9]+/[0-9]+$]) { }
0 0 elsif ($item =~ /^[\.0-9]+$/) { }
0 0 elsif ($item =~ m[^[\.0-9]+/[0-9]+$]) { }
1413 0 0 if ($@)
1417 0 0 if (&$allowed_subnets($opts{'ip'}))
1436 0 0 unless $dbh = $self->connect
1437 0 0 if ($@)
1467 0 0 if (-f $report and -r $report and not -f $id_eve) { }
1471 0 0 if (-f $incoming_json) { }
1476 0 0 if ($@)
1495 0 0 unless (defined $eve_json->{'cape_eve_process'}{'incoming_json_error'})
1503 0 0 if (defined $lite_json->{'signatures'})
1507 0 0 if (defined $lite_json->{'malscore'})
1510 0 0 if ($lite_json->{'malscore'} >= $self->{'config'}{'_'}{'malscore'})
1515 0 0 if ($@)
1526 0 0 if ($@)
1533 0 0 unless (-f $report and -r $report)
1545 0 0 unless (defined $level)
1549 0 0 unless (defined $sender)