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 are StyleCop's SA1606, SA1614 and SA1616. They aren't reported: the only fix would be placeholder text (see BRO1601).

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

Compared with StyleCop

Same results as StyleCop. StyleCop has no fix for SA1627.