suppression

Marking one diagnostic or scanner finding as intentionally ignored for some code, usually with an inline comment or attribute and a reason.

A broad suppression can hide a genuine defect the rule would have caught.

In more detail

Suppressions are sometimes necessary when a rule cannot apply, such as at a third-party boundary. Keep suppressions narrow and add a reason, because a blanket suppression hides the next real problem too.

Examples

#pragma warning disable CA2000
[SuppressMessage("Reliability", "CA2000", Justification = "...")]
The course lets a developer suppress one finding only with a reason visible in the diff, so the decision is reviewed.

Related terms

Taught in

References