fix(dashboard): readable tool names for findings, including the new .NET and mobile checks
CI / Check (push) Skipped
CI / Detect Changes (pull_request) Skipped
CI / Deploy Agent (pull_request) Skipped
CI / Deploy Dashboard (pull_request) Skipped
CI / Deploy Docs (pull_request) Skipped
CI / Deploy MCP (pull_request) Skipped
CI / Check (pull_request) Successful in 8m16s

Findings showed the scanner's internal name (`dotnet-config`,
`secret-files`, `dotnet-lifecycle`, `mobsfscan`, `gdpr-patterns`).
findings::tool_name gives every known tool a German and English name
(".NET-Konfiguration", "Schlüsseldateien im Repository",
".NET-Version ohne Support", "Mobile-App-Analyse (mobsfscan)", …); an
unknown tool keeps its own. Used in the findings list and on the finding
page (the internal name stays as the tooltip) and in the CRA view's
"did not complete" reason. The skipped stages sast_mobile, lfs_objects,
sast_vendor_code and sbom_dependencies already have their names.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
This commit is contained in:
Sharang ParnerkarandClaude Opus 5.5 committed 2026-10-05 19:53:26 +02:00
1 parent 8926255d6f
commit 12855c2a4c
3 files changed
+95 -6

No files matched your search

+92 -3
View File
@@ -1694,6 +1694,71 @@ pub mod findings {
}
}
/// The name of the tool that reported a finding (`Finding::scanner`), in
/// words; an unknown tool keeps its own name.
pub fn tool_name(scanner: &str, lang: super::super::Lang) -> String {
let text = match scanner {
"semgrep" => Text {
de: "Codeanalyse (Semgrep)",
en: "Code analysis (Semgrep)",
},
"cppcheck" => Text {
de: "C/C++-Analyse (cppcheck)",
en: "C/C++ analysis (cppcheck)",
},
"mobsfscan" => Text {
de: "Mobile-App-Analyse (mobsfscan)",
en: "Mobile app analysis (mobsfscan)",
},
"gitleaks" => Text {
de: "Zugangsdaten im Code (gitleaks)",
en: "Secrets in the code (gitleaks)",
},
"secret-files" => Text {
de: "Schlüsseldateien im Repository",
en: "Key files in the repository",
},
"dotnet-config" => Text {
de: ".NET-Konfiguration",
en: ".NET configuration",
},
"dotnet-lifecycle" => Text {
de: ".NET-Version ohne Support",
en: ".NET version out of support",
},
"gdpr-patterns" => Text {
de: "Datenschutz-Muster",
en: "Privacy patterns",
},
"oauth-patterns" => Text {
de: "OAuth-Muster",
en: "OAuth patterns",
},
"plc-control-logic" => Text {
de: "SPS-Regeln",
en: "PLC rules",
},
"control-check" => Text {
de: "CRA-Kontrollprüfung (KI)",
en: "CRA control check (AI)",
},
"osv" => Text {
de: "CVE-Abgleich (OSV)",
en: "CVE lookup (OSV)",
},
"syft" => Text {
de: "Stückliste (Syft)",
en: "SBOM (Syft)",
},
"manual" => Text {
de: "Manuell erfasst",
en: "Entered by hand",
},
other => return other.to_string(),
};
text.get(lang).to_string()
}
/// A user of the tenant whose name is not known.
pub const SOMEONE: Text = Text {
de: "Benutzer",
@@ -2276,8 +2341,8 @@ pub mod compliance {
.iter()
.filter_map(serde_json::Value::as_str)
.map(|tool| match tool {
"osv" => CVE_LOOKUP.get(lang),
other => other,
"osv" => CVE_LOOKUP.get(lang).to_string(),
other => super::findings::tool_name(other, lang),
})
.collect::<Vec<_>>()
.join(", ")
@@ -2289,6 +2354,30 @@ pub mod compliance {
#[cfg(test)]
mod tests {
use super::super::super::Lang;
#[test]
fn tool_names_read_as_words_and_unknown_ones_stay() {
assert_eq!(
crate::i18n::texts::findings::tool_name("dotnet-config", Lang::De),
".NET-Konfiguration"
);
assert_eq!(
crate::i18n::texts::findings::tool_name("secret-files", Lang::En),
"Key files in the repository"
);
assert_eq!(
crate::i18n::texts::findings::tool_name("dotnet-lifecycle", Lang::De),
".NET-Version ohne Support"
);
assert_eq!(
crate::i18n::texts::findings::tool_name("mobsfscan", Lang::En),
"Mobile app analysis (mobsfscan)"
);
assert_eq!(
crate::i18n::texts::findings::tool_name("clippy", Lang::De),
"clippy"
);
}
use super::*;
#[test]
@@ -2296,7 +2385,7 @@ pub mod compliance {
let reason = serde_json::json!({ "kind": "tool_failed", "tools": ["osv", "semgrep"] });
assert_eq!(
not_assessed_reason(&reason, Lang::De).as_deref(),
Some("Bei der letzten Prüfung nicht vollständig gelaufen: CVE-Abgleich, semgrep")
Some("Bei der letzten Prüfung nicht vollständig gelaufen: CVE-Abgleich, Codeanalyse (Semgrep)")
);
}
@@ -106,7 +106,7 @@ pub fn FindingDetailPage(id: String) -> Element {
title: f.title.clone(),
description: format!(
"{} | {} | {}",
f.scanner,
tx::tool_name(&f.scanner, lang),
tx::scan_type(&f.scan_type).get(lang),
tx::status(&f.status).get(lang)
),
@@ -151,7 +151,7 @@ pub fn FindingDetailPage(id: String) -> Element {
span { style: "font-family: monospace;", "{place}" }
}
span { style: "opacity: 0.7;", {tx::COL_SCANNER.get(lang)} }
span { "{f.scanner}" }
span { title: "{f.scanner}", {tx::tool_name(&f.scanner, lang)} }
if let Some(who) = &f.reported_by {
span { style: "opacity: 0.7;", {tx::REPORTED_BY.get(lang)} }
span { "{who}" }
+1 -1
View File
@@ -329,7 +329,7 @@ pub fn FindingsPage(target: String) -> Element {
class: "finding-title-link",
"{finding.title}"
}
span { class: "finding-tool", "{finding.scanner}" }
span { class: "finding-tool", title: "{finding.scanner}", {tx::tool_name(&finding.scanner, lang)} }
}
td { {tx::scan_type(&finding.scan_type).get(lang)} }
if let Some(names) = &target_names {