Skip to content
ptittof57 edited this page Aug 15, 2015 · 5 revisions
<title>SA1404: CodeAnalysisSuppressionMustHaveJustification</title> <script src="script/helpstudio.js" type="text/javascript"></script> <script src="script/StandardText.js" type="text/jscript"></script>
<script type="text/jscript">WritePageTop(document.title);</script>

TypeName

CodeAnalysisSuppressionMustHaveJustification

CheckId

SA1404

Category

Maintainability Rules

Cause

A Code Analysis SuppressMessage attribute does not include a justification.

Rule Description

A violation of this rule occurs when the code contains a Code Analysis SuppressMessage attribute, but a justification for the suppression has not been provided within the attribute. Whenever a Code Analysis rule is suppressed, a justification should be provided. Thiscan increase the long-term maintainability of the code.

[SuppressMessage("Microsoft.Performance", "CA1804:RemoveUnusedLocals", Justification = "Used during unit testing")]

public bool Enable()

{

}

How to Fix Violations

To fix an instance of this violation, add a Justification tag and justification text to the SuppressMessage attribute describing the reason for the suppression.

How to Suppress Violations

[SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1404:CodeAnalysisSuppressionMustHaveJustification", Justification = "Reviewed.")]
Clone this wiki locally