Skip to content

doc-param-has-name

C#styleno fixdefault: offcsharp/stylecop

Reports a <param> in a documentation comment that has no name attribute, or an empty one. No fix.

The name is how the tools connect the text to a parameter. A <param> without it is documentation that tells the IDE nothing and is shown nowhere.

To fix, add name="value" with the name of the parameter.

Reported
...
public class Parameters
{
/// <summary>Sets.</summary>
/// <param>No name.</param>
/// <param name="">Empty name.</param>
...
/// <param name="c">Good.</param>
...
private void PrivateParams(int a) { }
/// <summary>Delegate.</summary>
...
/// <param>No name.</param>
public delegate void Callback(int a);
/// <summary>Constructor.</summary>
...
public Parameters(int a) { }
/// <summary>Indexer.</summary>
...
/// <param>No name.</param>
public int this[int a] => a;
}
csharp:
lint:
rules:
doc-param-has-name: warn # off (default), warn, error

Enabled by the presets: csharp/stylecop.

Suppress one line with sudsy-disable-next-line doc-param-has-name in a comment of the file’s language.

The same check in other tools; Sudsy reports what each upstream rule reports.

Tool Rule Match
StyleCop SA1613 full