redline
LowAI tellsrestating-comment

Comment repeats the code

Comment repeats the code. This comment repeats the next line in words. It adds reading, not information.

This is how the comment reads inline, under the flagged line.

Why it matters

// increment counter above counter++ doubles the reading and goes stale when the code changes. It's the most common AI comment.

What to do

Delete it. Write comments for what the code can't say: why, constraints, links.

Examples

Flagged
// Get the user
const user = getUser(id);
Better
const user = getUser(id);

What it catches

It reads the shape of the code: functions, blocks, loops and calls. Languages: TypeScript and JavaScript, Python, Go, Rust, Java, C and similar. Scope: All files. These cases are the rule's own tests: the first set must be flagged and the second must not.

Flagged

// Get the user
const user = getUser(id);
src/app.py
# return the user
return user

Left alone

// Cached: lookups repeat within one request
const user = getUser(id);

Research

Comments and docstrings that repeat the next line, the function name or the structure ("Step 1", "This function handles"). The reader learns nothing, and the comment drifts out of date when the code changes.

Turn it off or change it

In a config file for the CLI, or in the API's rules field:

{
  "rules": {
    "disable": [
      "restating-comment"
    ],
    "severity": {
      "restating-comment": "medium"
    }
  }
}

Read the source or report a false positive.