redline
LowDesigntemporary-code

Temporary code with no end

Temporary code with no end. Marked temporary (// workaround for now) with no link to when it goes away.

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

Why it matters

Temporary code without an owner or an issue becomes permanent. Nobody remembers what it was waiting for.

What to do

Link the issue that removes it, or do the real fix now.

Examples

Flagged
// workaround for now
Better
// Remove after the vendor fix ships: https://github.com/org/repo/issues/12

What it catches

It reads a pattern on each line, aware of strings and comments. 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

// workaround for now

Left alone

// workaround for https://github.com/x/y/issues/12
// written to a temporary file, then renamed

Research

"Temporary" or "for now" workarounds with no issue link or end condition. Temporary code with no owner becomes permanent.

  • skill: no-sus-code-doctor
  • owner's code bar

Turn it off or change it

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

{
  "rules": {
    "disable": [
      "temporary-code"
    ],
    "severity": {
      "temporary-code": "medium"
    }
  }
}

Read the source or report a false positive.