-
Notifications
You must be signed in to change notification settings - Fork 22
SA1202
TypeName |
ElementsMustBeOrderedByAccess |
CheckId |
SA1202 |
Category |
Ordering Rules |
An element within a C# code file is out of order within regard to access level, in relation to other elements in the code.
A violation of this rule occurs when the code elements within a file do not follow a standard ordering scheme based on access level.
To comply with this rule, adjacent elements of the same type must be positioned in the following order by access level:
public
internal
protected internal
protected
private
Complying with a standard ordering scheme based on access level can increase the readability and maintainability of the file and make it easier to identify the public interface that is being exposed from a class.
To fix an instance of this violation, order the elements in the file in the order described above.
[SuppressMessage("StyleCop.CSharp.OrderingRules", "SA1202:ElementsMustBeOrderedByAccess", 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