A comment holds a statement that was commented out

tx0/sql:commented-out-codestrictnotemaintainability/dead-codedepth fastmaintainability

What it finds

A comment that holds a whole statement, such as -- DELETE FROM t WHERE x = 1;, is code kept around instead of removed; version control keeps old code. A comment counts when its text parses as SQL that ends with ; and starts with a statement keyword.

From the rule's source, commented_out_code.rs.

Turn it on, off or suppress it

The rule runs from the strict tier up. To turn it on in a lower tier, give it a level in tx0.toml:

tx0.toml
[rules]
"tx0/sql:commented-out-code" = "note"

To keep one finding, suppress it with a reason: tx0 suppress ID --reason "..." writes the comment for it.

tx0 explain tx0/sql:commented-out-code shows the same in the terminal. Found a false positive? Report it.