Skip to content

Commit

Permalink
Change: Show false positives in reports list by default
Browse files Browse the repository at this point in the history
When no results filter is given for get_reports, include false positive
results by default and use the levels keyword from the reports filter if
available.

This was changed because the previous behavior was confusing for users.
  • Loading branch information
timopollmeier committed Apr 24, 2023
1 parent 8c591f4 commit 8cbf953
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions src/gmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -14248,7 +14248,7 @@ handle_get_reports (gmp_parser_t *gmp_parser, GError **error)
|| (strlen (get_reports_data->report_get.id) == 0))
{
int overrides, min_qod;
gchar *filter;
gchar *filter, *levels;
get_data_t * get;

/* For simplicity, use a fixed result filter when filtering
Expand All @@ -14269,12 +14269,14 @@ handle_get_reports (gmp_parser_t *gmp_parser, GError **error)
g_free (get_reports_data->get.filter);
overrides = filter_term_apply_overrides (filter ? filter : get->filter);
min_qod = filter_term_min_qod (filter ? filter : get->filter);
levels = filter_term_value (filter ? filter : get->filter, "levels");
g_free (filter);

/* Setup result filter from overrides. */
get_reports_data->get.filter
= g_strdup_printf ("apply_overrides=%i min_qod=%i",
overrides, min_qod);
= g_strdup_printf ("apply_overrides=%i min_qod=%i levels=%s",
overrides, min_qod, levels);
g_free (levels);
}

ret = init_report_iterator (&reports, &get_reports_data->report_get);
Expand Down
2 changes: 1 addition & 1 deletion src/manage_sql.c
Original file line number Diff line number Diff line change
Expand Up @@ -27435,7 +27435,7 @@ print_report_xml_start (report_t report, report_t delta, task_t task,

max_results = manage_max_rows (max_results);

levels = levels ? levels : g_strdup ("hmlgd");
levels = levels ? levels : g_strdup ("hmlgdf");

if (task && task_uuid (task, &tsk_uuid))
{
Expand Down

0 comments on commit 8cbf953

Please sign in to comment.