Skip to content

Commit

Permalink
Show operational risk table even if empty
Browse files Browse the repository at this point in the history
  • Loading branch information
attiasas committed Jan 7, 2025
1 parent 1fff830 commit 0ac6142
Showing 1 changed file with 10 additions and 16 deletions.
26 changes: 10 additions & 16 deletions utils/results/output/resultwriter.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,23 +275,17 @@ func PrintViolationsTable(tables formats.ResultsTables, cmdType utils.CommandTyp
if err != nil {
return err
}
if len(tables.OperationalRiskViolationsTable) > 0 {
return coreutils.PrintTable(formats.ConvertOperationalRiskTableRowToScanTableRow(tables.OperationalRiskViolationsTable), "Operational Risk Violations", "No operational risk violations were found", printExtended)
}
} else {
err = coreutils.PrintTable(tables.SecurityViolationsTable, "Security Violations", "No security violations were found", printExtended)
if err != nil {
return err
}
err = coreutils.PrintTable(tables.LicenseViolationsTable, "License Compliance Violations", "No license compliance violations were found", printExtended)
if err != nil {
return err
}
if len(tables.OperationalRiskViolationsTable) > 0 {
return coreutils.PrintTable(tables.OperationalRiskViolationsTable, "Operational Risk Violations", "No operational risk violations were found", printExtended)
}
return coreutils.PrintTable(formats.ConvertOperationalRiskTableRowToScanTableRow(tables.OperationalRiskViolationsTable), "Operational Risk Violations", "No operational risk violations were found", printExtended)
}
return nil
err = coreutils.PrintTable(tables.SecurityViolationsTable, "Security Violations", "No security violations were found", printExtended)
if err != nil {
return err
}
err = coreutils.PrintTable(tables.LicenseViolationsTable, "License Compliance Violations", "No license compliance violations were found", printExtended)
if err != nil {
return err
}
return coreutils.PrintTable(tables.OperationalRiskViolationsTable, "Operational Risk Violations", "No operational risk violations were found", printExtended)
}

// PrintLicensesTable prints the licenses in a table.
Expand Down

0 comments on commit 0ac6142

Please sign in to comment.