Baseline existing violations (focus on new code)¶
Turning a large standard on for an existing codebase surfaces thousands of violations at once. Baselining records the current violations as accepted, so CodeCheck highlights only new violations from then on — a realistic way to hold the line on legacy code and improve going forward.
Create a baseline¶
- Run an inspection (see run your first check).
- In the Inspections list, right-click the inspection (or use its baseline icon ) and choose Add to Baseline. In the "Would you like to baseline this inspection?" prompt, click Yes.
The baselined inspection appears in italic with a “Baseline” prefix. To change it later, baseline it again and click Replace in the confirmation; to drop it, Remove from Baseline.
Baseline affects new violations only
Changing the baseline only affects which violations count as new — it doesn't alter past inspections. Baselined violations are still viewable, just not flagged as new.
Baseline in CI¶
You can compare a run against a previous inspection from the command line with
und codecheck -previous <old.sarif>, which produces New_ and Fixed_
report variants — ideal for failing CI only on newly-introduced violations. See
run CodeCheck in your CI pipeline for the full pattern.