Skip to content

Commit

Permalink
Linting
Browse files Browse the repository at this point in the history
Signed-off-by: Charles Hu <computerscience@verizon.net>
  • Loading branch information
charleshu-8 committed Aug 8, 2024
1 parent a3bbaeb commit 9c4677e
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions libs/hdf-converters/src/cyclonedx-sbom-mapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {CweNistMapping} from './mappings/CweNistMapping';
import {getCCIsForNISTTags} from './utils/global';
import {RatingRepository} from '@cyclonedx/cyclonedx-library/dist.d/models/vulnerability';
import {CweRepository} from '@cyclonedx/cyclonedx-library/dist.d/types';
import {Severity} from '@cyclonedx/cyclonedx-library/dist.d/enums/vulnerability';

const CWE_NIST_MAPPING = new CweNistMapping();
const DEFAULT_NIST_TAG = ['SI-2', 'RA-5'];
Expand Down Expand Up @@ -40,12 +41,10 @@ function aggregateImpact(ratings: RatingRepository): number {
impact = rating.score / 10 > impact ? rating.score / 10 : impact;
} else {
// Else interpret it from `severity` field
if (rating.severity) {
const severity = IMPACT_MAPPING.get(
rating.severity.toLowerCase()
) as number;
impact = severity > impact ? severity : impact;
}
const severity = IMPACT_MAPPING.get(
(rating.severity as Severity).toLowerCase()
) as number;
impact = severity > impact ? severity : impact;
}
}
return impact;
Expand Down

0 comments on commit 9c4677e

Please sign in to comment.