-
Notifications
You must be signed in to change notification settings - Fork 4
AA1102InnerTypesMustBePrivate
Warning: this wiki page is auto-generated by the Arnolyzer solution-build process. Do not directly edit this page, as your changes will be lost on the next commit. To edit this page, please refer to Contributing to this project.
These wiki pages reflect the state of the project in development, per the last commit. For details of the latest release of the Arnolyzer Analysers, please see the Arnolyzer website.
Report code: AA1102-InnerTypesMustBePrivate
Status | Implemented |
Description | Inner types should be treated as implementation details and encapsulated by marking them as private |
Category | Encapsulation Analyzers |
Enabled by default: | Yes |
Severity: | Error |
Inner types that are marked internal
or public
are likely doing one (or, in some cases, both) of two things:
- They are using the outer class as a namespace label,
- They are exposing the inner workings of the outer class, thus weakening encapsulation.
In the first case, the type should be moved to its own file in an appropriate directory to give it a proper namespace name.
In the latter case, either the type should be made private
, to properly encapsulate the inner workings of the outer class, or the two types should be redesigned and the inner type moved to its own file and marked as internal
or public
as appropriate.
There currently aren't any implemented code-fixes for this rule.
This rule cannot be suppressed.