Skip to content

BRO1610: Documentation text should not be empty

An empty <remarks> element is removed. Replaces StyleCop SA1627.

Example

Before

public class Parser
{
    /// <summary>Parses the input.</summary>
    /// <remarks></remarks>
    public void Parse()
    {
    }
}

After

public class Parser
{
    /// <summary>Parses the input.</summary>
    public void Parse()
    {
    }
}

Why

An empty element documents nothing; it's usually left over from a template or a generated stub.

How the fix works

The element is removed: its whole /// lines when it has them to itself, otherwise just the element. <remarks/> and remarks with only whitespace count as empty.

Empty <summary>, <param> and <returns> elements aren't reported: the only fix would be placeholder text (see BRO1601).

This rule reads documentation as XML, which needs <GenerateDocumentationFile>true</GenerateDocumentationFile>.