fix: disable jar analyzer for scanners other than vuln (#3810)

This commit is contained in:
DmitriyLewen
2023-03-13 04:11:25 +06:00
committed by GitHub
parent aaf265881e
commit 1fac7bf1ba

View File

@@ -498,8 +498,7 @@ func disabledAnalyzers(opts flag.Options) []analyzer.Type {
// But we don't create client if vulnerability analysis is disabled and SBOM format is not used // But we don't create client if vulnerability analysis is disabled and SBOM format is not used
// We need to disable jar analyzer to avoid errors // We need to disable jar analyzer to avoid errors
// TODO disable all languages that don't contain license information for this case // TODO disable all languages that don't contain license information for this case
if opts.Scanners.Enabled(types.LicenseScanner) && !opts.Scanners.Enabled(types.VulnerabilityScanner) && if !opts.Scanners.Enabled(types.VulnerabilityScanner) && !slices.Contains(report.SupportedSBOMFormats, opts.Format) {
!slices.Contains(report.SupportedSBOMFormats, opts.Format) {
analyzers = append(analyzers, analyzer.TypeJar) analyzers = append(analyzers, analyzer.TypeJar)
} }