Duplicated block
This is how the comment reads inline, under the flagged line.
Why it matters
Copy-pasted code drifts: a fix lands in one copy and not the other. Models duplicate rather than find the existing helper.
What to do
Keep one copy and call it from both places, or delete the old one if this replaces it.
Examples
// a.ts and b.ts both carry the same 12-line validation
// both call validateOrder() from orders/validate.ts
What it catches
It reads the whole change: every file and the lines it removed. Languages: TypeScript and JavaScript, Python, Go, Rust, Java, C and similar. Scope: Shipped code only. These cases are the rule's own tests: the first set must be flagged and the second must not.
Research
Copy-pasted blocks. A fix lands in one copy and not the other.
Turn it off or change it
In a config file for the CLI, or in the API's rules field:
{
"rules": {
"disable": [
"duplicate-block"
],
"severity": {
"duplicate-block": "low"
}
}
}
src/orders/validate.ts. Two copies drift apart; keep one.