-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change frontend to use code impacts for severity
- Loading branch information
1 parent
dc3f77f
commit a27c13b
Showing
4 changed files
with
37 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
|
||
export enum Severity { | ||
INFO, | ||
LOW, | ||
MEDIUM, | ||
HIGH, | ||
BLOCKER, | ||
}; | ||
|
||
export function maxSeverity(impacts: any): Severity { | ||
let maxSeverity: Severity = Severity.INFO; | ||
for (const key in impacts) { | ||
const val = impacts[key]; | ||
const sev: Severity = Severity[val as keyof typeof Severity]; | ||
if (sev > maxSeverity) { | ||
maxSeverity = sev; | ||
} | ||
} | ||
return maxSeverity; | ||
} |