Encapsulate Public Field
Flags publicly exposed instance fields.
Reasoning
Instance fields are the implementation details of a object's internal state; exposing them directly breaks encapsulation. Often, an object only needs to expose a 'Get' procedure to expose an internal instance field.
Default severity
Suggestion
Inspection type
NamingAndConventionsIssues
Examples
This example should trigger a result
This example should NOT trigger a result
Rubberduck.CodeAnalysis.Inspections.Concrete.EncapsulatePublicFieldInspection.cs (Prerelease-v2.5.9.6289)