Skip to content

Latest commit

 

History

History
29 lines (18 loc) · 1.18 KB

File metadata and controls

29 lines (18 loc) · 1.18 KB

CL007 — Case/typo suspicion

  • Severity: Warning
  • Confidence: Medium for one edit of distance, Low for two (capped by the resolution of the code access)

What it finds

A key read in code that is missing from configuration (CL001), while a key with a small edit distance (≤ 2, case-insensitive Levenshtein) exists — most likely a typo on one of the two sides.

Why it matters

App:Timeuot vs App:Timeout is invisible in review and produces a runtime null instead of an error. The near-match is the actionable hint that turns a generic "missing key" into a one-character fix.

Semantics

  • Pure casing differences never get here: all key comparisons in ConfigLens are case-insensitive, mirroring the configuration system.
  • Only value reads that are actually missing are considered; the closest candidate wins (ties resolved alphabetically).
  • Keys shorter than 5 characters are skipped — the edit distance is meaningless there.

Example

var timeout = config["App:Timeuot"];
// CL007: 'App:Timeout' is a close match — possible typo (plus CL001 for the missing key)

How to fix

Rename one of the two sides so code and configuration agree.