TypeName | SA1123DoNotPlaceRegionsWithinElements |
CheckId | SA1123 |
Category | Readability Rules |
The C# code contains a region within the body of a code element.
A violation of this rule occurs whenever a region is placed within the body of a code element. In many editors, including Visual Studio, the region will appear collapsed by default, hiding the code within the region. It is generally a bad practice to hide code within the body of an element, as this can lead to bad decisions as the code is maintained over time.
To fix a violation of this rule, remove the region from the code.
[SuppressMessage("StyleCop.CSharp.ReadabilityRules", "SA1123:DoNotPlaceRegionsWithinElements", Justification = "Reviewed.")]
#pragma warning disable SA1123 // DoNotPlaceRegionsWithinElements
#pragma warning restore SA1123 // DoNotPlaceRegionsWithinElements