krz/octosentry

macOS menu bar app to monitor GitHub security alerts

clone: git clone https://gitbay.org/krz/octosentry.git

e99a9b48543fee0773ede87742af0bc2be607407

unsigned

author: Christian Cleberg <hello@cleberg.net> · 2026-08-08T20:32:25Z

Simplify secretScanning severity mapping to ternary
 octosentry/SeverityMapping.swift | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/octosentry/SeverityMapping.swift b/octosentry/SeverityMapping.swift
index 5befb46..bdb86b8 100644
--- a/octosentry/SeverityMapping.swift
+++ b/octosentry/SeverityMapping.swift
@@ -44,9 +44,6 @@ nonisolated enum SeverityMapping {
     /// Secret scanning has no native severity field. Per spec: validated/active
     /// secrets are treated as critical, unvalidated ones as high.
     static func secretScanning(validity: String?) -> SecurityEventSeverity {
-        switch validity?.lowercased() {
-        case "active": .critical
-        default: .high
-        }
+        validity?.lowercased() == "active" ? .critical : .high
     }
 }