-
Notifications
You must be signed in to change notification settings - Fork 22
SA1400
ptittof57 edited this page Aug 15, 2015
·
3 revisions
<title>SA1400: AccessModifierMustBeDeclared</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 |
AccessModifierMustBeDeclared |
CheckId |
SA1400 |
Category |
Maintainability Rules |
The access modifier for a C# element has not been explicitly defined.
C# allows elements to be defined without an access modifier. Depending upon the type of element, C# will automatically assign an access level to the element in this case.
This rule requires an access modifier to be explicitly defined for every element. This removes the need for the reader to make assumptions about the code, improving the readability of the code.
To fix a violation of this rule, add an access modifier to the declaration of the element.
[SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1400:AccessModifierMustBeDeclared", Justification = "Reviewed.")]
- - SA0102 - Clean Install
- - Download
- - Documentation Rules - Layout Rules - Maintainability Rules - Naming Rules - Ordering Rules - Readability Rules - Spacing Rules - Suppressions
- - Adding a custom StyleCop settings page - Adding custom rule settings - Authoring a custom styleCop rule - Authoring rules metadata - Custom CSharp Language Service - Custom MSBuild Integration - Hosting StyleCop in a Custom Environment - Installing a Custom Rule - Integrating StyleCop Into Build Environments - Integrating StyleCop into MSBuild - Writing Custom Rules for StyleCop