Skip to main content
CommentSense provides 26 diagnostic rules to ensure your C# code is properly documented. All rules are enabled by default except CSENSE014 (missing value documentation for properties).

Rule Categories

Rules are organized into the following categories:

All Rules

Rule IDCategorySeverityDescriptionCode Fix
CSENSE000ConfigurationWarningXML documentation parsing is disabledNo
CSENSE001GeneralWarningPublic API is missing documentationYes
CSENSE002ParametersWarningMissing parameter documentationYes
CSENSE003ParametersWarningStray parameter documentationYes
CSENSE004ParametersWarningMissing type parameter documentationYes
CSENSE005ParametersWarningStray type parameter documentationYes
CSENSE006Return ValuesWarningMissing return value documentationYes
CSENSE007GeneralWarningInvalid XML documentation reference (cref)Yes
CSENSE008ParametersWarningParameter documentation order mismatchYes
CSENSE009ParametersWarningDuplicate parameter documentationYes
CSENSE010ParametersWarningType parameter documentation order mismatchYes
CSENSE011ParametersWarningDuplicate type parameter documentationYes
CSENSE012ExceptionsWarningMissing exception documentationYes
CSENSE013Return ValuesWarningStray return value documentationYes
CSENSE014PropertiesDisabledMissing value documentationYes
CSENSE015PropertiesWarningStray value documentationYes
CSENSE016GeneralWarningLow-quality documentationYes
CSENSE017ExceptionsWarningInvalid exception typeYes
CSENSE018GeneralWarningMissing documentation for inheriting memberYes
CSENSE019GeneralWarningUse langword for keywordsYes
CSENSE020ParametersWarningGhost parameter reference in documentationYes
CSENSE021ParametersWarningGhost type parameter reference in documentationYes
CSENSE022GeneralWarningStray summary documentationYes
CSENSE023ExceptionsWarningStray exception documentationYes
CSENSE024GeneralWarningDocumentation tag order mismatchYes
CSENSE025GeneralWarningInaccessible cref referenceNo

Quick Reference

CSENSE000

XML documentation parsing is disabled Triggered when your project doesn’t have <GenerateDocumentationFile>true</GenerateDocumentationFile> in the .csproj file. CommentSense requires XML documentation parsing to be enabled.

CSENSE001

Public API is missing documentation Triggered when a public-facing member lacks XML documentation such as <summary>, <inheritdoc />, or other content tags. Configuration: Use comment_sense.visibility_level to control which members are analyzed.

CSENSE002

Missing parameter documentation Triggered when a method parameter is not documented with a <param> tag.

CSENSE003

Stray parameter documentation Triggered when a <param> tag refers to a non-existent parameter or is nested within another tag.

CSENSE004

Missing type parameter documentation Triggered when a generic type parameter is not documented with a <typeparam> tag.

CSENSE005

Stray type parameter documentation Triggered when a <typeparam> tag refers to a non-existent type parameter or is nested within another tag.

CSENSE006

Missing return value documentation Triggered when a method returns a value (non-void, non-Task, non-ValueTask) without a <returns> tag.

CSENSE007

Invalid XML documentation reference Triggered when a cref attribute points to a symbol that cannot be resolved.

CSENSE008

Parameter documentation order mismatch Triggered when <param> tags don’t appear in the same order as the method signature.

CSENSE009

Duplicate parameter documentation Triggered when the same parameter has multiple <param> tags.

CSENSE010

Type parameter documentation order mismatch Triggered when <typeparam> tags don’t match the order in the type declaration.

CSENSE011

Duplicate type parameter documentation Triggered when the same type parameter has multiple <typeparam> tags.

CSENSE012

Missing exception documentation Triggered when a method throws an exception that isn’t documented with an <exception> tag. Configuration: Use comment_sense.ignored_exceptions, comment_sense.ignore_system_exceptions, or comment_sense.scan_called_methods_for_exceptions.

CSENSE013

Stray return value documentation Triggered when a <returns> tag appears on a void method, constructor, or property.

CSENSE014

Missing value documentation (Disabled by default) Triggered when a property lacks a <value> tag.

CSENSE015

Stray value documentation Triggered when a <value> tag appears on a non-property member.

CSENSE016

Low-quality documentation Triggered when documentation is empty, too short, lacks punctuation, isn’t capitalized, or just repeats the member name. Configuration: Use comment_sense.low_quality_terms, comment_sense.min_summary_length, comment_sense.require_ending_punctuation, comment_sense.require_capitalization, or comment_sense.similarity_threshold.

CSENSE017

Invalid exception type Triggered when a cref in an <exception> tag doesn’t point to an Exception type.

CSENSE018

Missing documentation for inheriting member Triggered when comment_sense.allow_implicit_inheritdoc = false and an overriding/implementing member has no explicit documentation.

CSENSE019

Use langword for keywords Triggered when C# keywords like true, false, null, or void appear as plain text instead of <see langword="..." />. Configuration: Use comment_sense.langwords to customize the keyword list.

CSENSE020

Ghost parameter reference Triggered when a parameter name appears in documentation text without a <paramref /> tag. Configuration: Use comment_sense.ghost_references.mode (safe, strict, or off).

CSENSE021

Ghost type parameter reference Triggered when a type parameter name appears in documentation text without a <typeparamref /> tag. Configuration: Use comment_sense.ghost_references.mode (safe, strict, or off).

CSENSE022

Stray summary documentation Triggered when <summary> tags are nested within other tags or duplicated.

CSENSE023

Stray exception documentation Triggered when <exception> tags are nested within other tags or duplicated for the same exception type.

CSENSE024

Documentation tag order mismatch Triggered when top-level documentation tags don’t follow the standard order. Configuration: Use comment_sense.tag_order to customize the expected order.

CSENSE025

Inaccessible cref reference Triggered when a cref attribute points to a symbol with lower accessibility than the documented member (e.g., a public member referencing an internal type).

Build docs developers (and LLMs) love