Cppcheck addon reports are dropped since 6.27 (regression from #4690)

Aperta
#5,161 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 8 giorni

@pcbeingused333 ci sta già lavorando.

Dal 26/10/2026.

  • #5170 di @pcbeingused333 — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
76/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
cpp, python
Ambito
backend, testing

Direzione di ricerca

Start by reading CppcheckResultHandler.postprocess_result and get_analyzer_checkers(); the issue identifies the filter that drops addon reports and names docs/analyzer/checker_and_analyzer_configuration.md for the existing addon behavior. Reproduce with the provided C example and cppcheck:addons=misra.py, then inspect the raw .plist.bak output alongside parsed results. Done when addon findings appear while informational diagnostics such as normalCheckLevelMaxBranches remain filtered.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Describe the bug

Since CodeChecker 6.27, the findings of Cppcheck addons enabled with
--analyzer-config cppcheck:addons=... (e.g. misra.py, threadsafety.py,
y2038.py, namingng.py) no longer appear in the results.

Cppcheck still reports them: they are in the raw output under
<output>/cppcheck/<hash>/*.plist.bak. But CppcheckResultHandler.postprocess_result
drops every report whose checker is not in get_analyzer_checkers()
(cppcheck --errorlist plus the label file). Addon checkers are never in that list,
so every addon report is filtered out, without a warning.

The filter came with #4690 ("Cppcheck reports from checkers only"), whose goal was to
drop informational diagnostics such as normalCheckLevelMaxBranches.

The documentation (docs/analyzer/checker_and_analyzer_configuration.md, "Specific
considerations for Cppcheck") still says: "Addon checkers can be used, but their
reports severity will be displayed as Unspecified."

CodeChecker version

  • Broken: 6.27.1, 6.29.1 (the filter is also on master).
  • Works: 6.26.2.
  • Cppcheck 2.16.0, Python 3.9, Ubuntu 20.04.

To Reproduce

src/t.c:

int f(int a)
{
  int b;
  if (a) b = 1;
  return b + 0x1u;
}

cc.json (with <dir> replaced by the folder that contains src/):

[{"directory": "<dir>", "command": "gcc -c src/t.c", "file": "src/t.c"}]
CodeChecker analyze cc.json --analyzers cppcheck \
  --analyzer-config cppcheck:addons=misra.py -o rep
CodeChecker parse rep

Expected behaviour

As with 6.26.2:

[cppcheck-misra-c2012-8.4]
[cppcheck-misra-c2012-10.4]
[cppcheck-misra-c2012-14.4]
[cppcheck-uninitvar]

Actual behaviour

With 6.27.1 and 6.29.1 only [cppcheck-uninitvar] is reported. The raw Cppcheck
output of the same run, rep/cppcheck/<hash>/t_*.plist.bak, contains
misra-c2012-8.4, misra-c2012-10.4 and misra-c2012-14.4.

Additional context

A possible fix: filter only the informational diagnostics (such as
normalCheckLevelMaxBranches) instead of everything outside the checker list, or keep
the reports of the addons enabled with cppcheck:addons.

Lingua principale
Python
Stelle
2.6k
Fork
494
Merge medio
9g 2h
PR unite (30g)
23

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Ericsson/codechecker

Tutte le issue di Ericsson/codechecker

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.