Skip to content

doc-param-has-text

C#styleno fixdefault: offcsharp/stylecop

Reports a <param> without text. A comment with <inheritdoc /> is not reported. No fix.

An empty <param name="x"></param> looks like documentation and says nothing, and it stops the compiler from warning about the missing parameter.

To fix, describe the parameter.

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

Enabled by the presets: csharp/stylecop.

Suppress one line with sudsy-disable-next-line doc-param-has-text 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 SA1614 full