Cleaning up suppressed and orphaned issue records

Over time, Validate projects may accumulate "orphaned" defect information: issues that were originally loaded in a build, but the associated build was later deleted. These defects no longer exist in any past or future builds but may still be referenced during operations. To clean up these suppressed and orphaned defects, use RemoveSuppressedIssues utility.

Prerequisites

Before running RemoveSuppressedIssues, ensure that:

  • The Validate web server is stopped, but the database remains running.

  • A suppression file (sconf) is provided, as it is required for the cleanup process.

  • All unwanted builds containing defect data have been deleted to ensure proper orphan detection.

  • A dry run is performed first using the --dry flag to review which defects will be removed.

Running the Cleanup Utility

To execute the utility, run the following command:

Copy
java -cp class/dbvalidate.jar com.klocwork.dbvalidate.suppression.RemoveSuppressedIssues \
     --projects-root <projects_root> \
     --project-id <project_id> \
     --suppression-file <path_to_suppression_file>

Performing a Dry Run

Before making permanent changes, it is recommended to perform a dry run to see which issues will be removed:

Copy
java -cp class/dbvalidate.jar com.klocwork.dbvalidate.suppression.RemoveSuppressedIssues \
     --projects-root <projects_root> \
     --project-id <project_id> \
     --suppression-file <path_to_suppression_file> \
     --dry

This will output a list of defects that would be deleted without actually removing them.

Deleting Only Truly Orphaned Issues

By default, the tool removes only defects that are completely unreferenced. To ensure only dead defects are removed, use the --dead-only flag:

Copy
java -cp class/dbvalidate.jar com.klocwork.dbvalidate.suppression.RemoveSuppressedIssues \
     --projects-root <projects_root> \
     --project-id <project_id> \
     --suppression-file <path_to_suppression_file> \
     --dead-only

This ensures that only defects that are no longer present or referenced in any stream are removed, preventing accidental deletion of active issue records.

Verifying the Cleanup Process

After running the tool, confirm that the orphaned defects have been successfully removed and that the project database is up to date.

If needed, run the tool with the --debug flag to print detailed debug information about the process:

Copy
java -cp class/dbvalidate.jar com.klocwork.dbvalidate.suppression.RemoveSuppressedIssues \
     --projects-root <projects_root> \
     --project-id <project_id> \
     --suppression-file <path_to_suppression_file> \
     --debug

Command Reference

Option Description

--projects-root <string>

Define the root directory for projects

--project-id <string>

Specify the project ID

--suppression-file <string>

Specify the issue suppressions file (sconf)

--dry

Perform a dry run to preview deletions

--dead-only

Only remove defects that are no longer referenced in any stream

--debug

Output debug information