property-summary-omits-restricted-accessor
What it does
Section titled “What it does”Reports a property summary that says “Gets or sets” while one of the accessors is not reachable from outside the type (private set, internal get on a public property). The fix replaces the start of the text with the one that matches the visible accessor and is unsafe.
Why it matters
Section titled “Why it matters”The documentation is for the callers of the property, and a caller outside the type cannot use the restricted accessor, so the summary should describe only what is possible.
Example
Section titled “Example”... /// <summary>Gets a value indicating whether it is ready.</summary> public bool? NullableBool { get; } /// <summary>Gets or sets the count.</summary> internal int InternalBoth { get; private set; } /// <summary>Gets or sets the count.</summary> protected int ProtectedPrivateSet { get; private set; } /// <summary>Gets or sets the count.</summary> protected internal int ProtectedInternalSet { get; internal set; } /// <summary>Gets or sets the count.</summary> public int InternalSet { get; internal set; } /// <summary>Gets or sets the count.</summary> public int ProtectedSet { get; protected set; } /// <summary>Gets the count.</summary>...... /// <summary>Gets a value indicating whether it is ready.</summary> public bool? NullableBool { get; } /// <summary>Gets the count.</summary> internal int InternalBoth { get; private set; } /// <summary>Gets the count.</summary> protected int ProtectedPrivateSet { get; private set; } /// <summary>Gets the count.</summary> protected internal int ProtectedInternalSet { get; internal set; } /// <summary>Gets the count.</summary> public int InternalSet { get; internal set; } /// <summary>Gets or sets the count.</summary> public int ProtectedSet { get; protected set; } /// <summary>Sets the count.</summary>...Configuration
Section titled “Configuration”csharp: lint: rules: property-summary-omits-restricted-accessor: warn # off (default), warn, errorEnabled by the presets: csharp/stylecop.
Suppress one line with sudsy-disable-next-line property-summary-omits-restricted-accessor in a comment of the file’s language.
Upstream equivalents
Section titled “Upstream equivalents”The same check in other tools; Sudsy reports what each upstream rule reports.
| Tool | Rule | Match |
|---|---|---|
| StyleCop | SA1624 |
full |