Skip to content

doc-param-missing

C#Javastyleno fixdefault: offcsharp/stylecop

Reports a parameter of a documented, non-private method, constructor, delegate, operator or indexer that has no <param name="..."> in its /// comment. A comment with <inheritdoc /> or <include> is not reported, and neither is a declaration without a comment. No fix.

The comment is what the IDE shows when the method is called and what the generated reference lists. A parameter that is not described leaves the caller to guess what it means, its unit, whether it may be null or empty, and what the method does with it.

To fix, add the tag that documents the parameter.

Reported
...
* Adds.
* @param a first
*/
public int add(int a, int b) { return a + b; }
/** Inherits. {@inheritDoc} */
public int sub(int a) { return a; }
...
csharp:
lint:
rules:
doc-param-missing: warn # off (default), warn, error
java:
lint:
rules:
doc-param-missing: warn # off (default), warn, error

Enabled by the presets: csharp/stylecop.

Suppress one line with sudsy-disable-next-line doc-param-missing 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 SA1611 full