Class: SemgrepWebApp::TriageReasons2
- Inherits:
-
Object
- Object
- SemgrepWebApp::TriageReasons2
- Defined in:
- lib/semgrep_web_app/models/triage_reasons2.rb
Overview
Which triage reasons do you want to include? If not specified, includes all.
This filter is applicable when status is ignored. Valid values:
acceptable_risk, false_positive, no_time, no_triage_reason, duplicate
Constant Summary collapse
- TRIAGE_REASONS2 =
[ # TODO: Write general description for ACCEPTABLE_RISK ACCEPTABLE_RISK = 'acceptable_risk'.freeze, # TODO: Write general description for FALSE_POSITIVE FALSE_POSITIVE = 'false_positive'.freeze, # TODO: Write general description for NO_TIME NO_TIME = 'no_time'.freeze, # TODO: Write general description for NO_TRIAGE_REASON NO_TRIAGE_REASON = 'no_triage_reason'.freeze, # TODO: Write general description for DUPLICATE DUPLICATE = 'duplicate'.freeze ].freeze
Class Method Summary collapse
Class Method Details
.from_value(value, default_value = ACCEPTABLE_RISK) ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/semgrep_web_app/models/triage_reasons2.rb', line 34 def self.from_value(value, default_value = ACCEPTABLE_RISK) return default_value if value.nil? str = value.to_s.strip case str.downcase when 'acceptable_risk' then ACCEPTABLE_RISK when 'false_positive' then FALSE_POSITIVE when 'no_time' then NO_TIME when 'no_triage_reason' then NO_TRIAGE_REASON when 'duplicate' then DUPLICATE else default_value end end |
.validate(value) ⇒ Object
28 29 30 31 32 |
# File 'lib/semgrep_web_app/models/triage_reasons2.rb', line 28 def self.validate(value) return false if value.nil? TRIAGE_REASONS2.include?(value) end |