Skip to content

Commit 464c304

Browse files
castlerCopilot
andcommitted
Fix analysis_report crash on MISRA C++ results
generate_guideline_compliance_summary() renders the Guideline Compliance Summary report by mapping each applied standard's short name to a display name via the standard_pretty_name dict. That dict only contained entries for "cert" and "autosar", so analyzing a database against the MISRA C++ pack (codeql/misra-cpp-coding-standards) aborted the report generation with: KeyError: 'misra' at the "**Coding Standards applied**" line (and the same lookup is used again when tabulating per-guideline results). Add the missing "misra" -> "MISRA C++:2023" mapping so MISRA C++ analyses can produce the compliance summary report like the other supported standards. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 62bf905 commit 464c304

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

scripts/reports/utils.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,10 @@ def generate_guideline_compliance_summary(output_directory, results_summary):
183183
print(
184184
"**Result**: " + ("Not compliant" if total_guidelines_violated > 0 else "Compliant"))
185185
standard_pretty_name = {
186-
"cert": "CERT C++ 2016", "autosar": "AUTOSAR C++ R22-11, R21-11, R20-11, R19-11 and R19-03"}
186+
"cert": "CERT C++ 2016",
187+
"autosar": "AUTOSAR C++ R22-11, R21-11, R20-11, R19-11 and R19-03",
188+
"misra": "MISRA C++:2023",
189+
}
187190
print("**Coding Standards applied**: " + ", ".join([standard_pretty_name[standard_short_name]
188191
for standard_short_name in results_summary.guideline_violation_count.keys()]))
189192

0 commit comments

Comments
 (0)