Comments analyzer reference¶
The comments analyzer evaluates documentation coverage by examining comment presence, placement, and density across your source code.
For the conceptual model — what documentation coverage means and what a healthy comment density looks like — see Understanding documentation coverage. To run it, see the Quick start.
Configuration options¶
The comments analyzer uses the UAST directly and has no analyzer-specific configuration options.
| Option | Type | Default | Description |
|---|---|---|---|
| (none) | -- | -- | Uses UAST; no analyzer-specific config |
Example output¶
{
"comments": {
"files": [
{
"file": "main.go",
"total_lines": 250,
"comment_lines": 45,
"comment_density": 0.18,
"functions_total": 12,
"functions_documented": 8,
"documentation_coverage": 0.67,
"undocumented": [
{"name": "helperFunc", "line": 89},
{"name": "processItem", "line": 134},
{"name": "cleanup", "line": 201},
{"name": "retryLoop", "line": 220}
]
}
],
"summary": {
"total_files": 1,
"avg_comment_density": 0.18,
"avg_documentation_coverage": 0.67,
"total_undocumented_functions": 4
}
}
}
See also¶
- Understanding documentation coverage — the mental model, comment types, and limitations.
- Quick start — run static analysis.