This repository has been archived by the owner on Jul 24, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow to configure severity threshold. (#12)
* Allow to configure severity threshold * Add severity-threshold option to check minimum severity to check. * Apply a red color based on threshold only for text STDOUT. * Updated the yavdb gem to make use of the SEVERITIES constant * definition. * Merged the formatter and style code for the text formatter.
- Loading branch information
Showing
5 changed files
with
41 additions
and
9 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
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,13 @@ | ||
module DependencySpy | ||
class Helper | ||
|
||
def self.severity_above_threshold?(severity = 'unknown', severity_threshold) | ||
return true if severity_threshold == 'low' || severity == 'unknown' | ||
return ['medium', 'high'].include? severity if severity_threshold == 'medium' | ||
return severity == 'high' if severity_threshold == 'high' | ||
|
||
false | ||
end | ||
|
||
end | ||
end |