Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
attiasas committed Sep 2, 2024
1 parent 3f4c4e8 commit aad0f9d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions utils/resultstable.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func PrintViolationsTable(violations []services.Violation, results *Results, mul
return err
}
// Print tables, if scan is true; print the scan tables.
if results.ResultType == Binary || results.ResultType == DockerImage {
if results.ResultType.IsTargetBinary() {
err = coreutils.PrintTable(formats.ConvertToVulnerabilityScanTableRow(securityViolationsRows), "Security Violations", "No security violations were found", printExtended)
if err != nil {
return err
Expand Down Expand Up @@ -198,7 +198,7 @@ func PrintVulnerabilitiesTable(vulnerabilities []services.Vulnerability, results
return err
}

if scanType == Binary || scanType == DockerImage {
if scanType.IsTargetBinary() {
return coreutils.PrintTable(formats.ConvertToVulnerabilityScanTableRow(vulnerabilitiesRows), "Vulnerable Components", "✨ No vulnerable components were found ✨", printExtended)
}
var emptyTableMessage string
Expand Down Expand Up @@ -305,7 +305,7 @@ func PrintLicensesTable(licenses []services.License, printExtended bool, scanTyp
if err != nil {
return err
}
if scanType == Binary || scanType == DockerImage {
if scanType.IsTargetBinary() {
return coreutils.PrintTable(formats.ConvertToLicenseScanTableRow(licensesRows), "Licenses", "No licenses were found", printExtended)
}
return coreutils.PrintTable(formats.ConvertToLicenseTableRow(licensesRows), "Licenses", "No licenses were found", printExtended)
Expand Down
2 changes: 1 addition & 1 deletion utils/resultwriter.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ func (rw *ResultsWriter) printScanResultsTables() (err error) {
}

func shouldPrintTable(requestedScans []SubScanType, subScan SubScanType, scanType CommandType) bool {
if (scanType == Binary || scanType == DockerImage) && (subScan == IacScan || subScan == SastScan) {
if scanType.IsTargetBinary() && (subScan == IacScan || subScan == SastScan) {
return false
}
return len(requestedScans) == 0 || slices.Contains(requestedScans, subScan)
Expand Down

0 comments on commit aad0f9d

Please sign in to comment.