Rule Catalogue
Every finding CodeKnife reports carries a rule ID such as CK_DEAD_SYMBOL. This page lists every rule ID the codeknife binary can emit, so you can look up a finding you see, write baseline entries, or filter JSON output by rule.
The list was built mechanically: every string literal starting with CK_ in the non-test source of every crate, then each emitting site was read to get its blade, severity and trigger. No rule ID is built at runtime with format!. The native-linter rules from check --deep are fixed per tool; the linter’s own code goes into the finding’s symbol and message instead.
Total: 98 rule IDs that can appear on a finding. 89 come from the 13 blades, 5 from the guard, and 4 from check --deep. Two more IDs appear only as patch labels in codeknife fix output (see Fix patch labels).
How to read the tables
Section titled “How to read the tables”- Severity is the default severity. Where the code picks between two severities, both are listed with the condition.
- Threshold / config names the
codeknife.tomlkey, CLI flag or hard-coded value that controls the rule.thresholds.*keys live under[thresholds]. See codeknife.toml. --strictsays whether strict mode changes the rule. Strict mode is on when you pass--strictor setstrictness = "strict"incodeknife.toml. It lowers these thresholds (only ever downwards):max_file_linesto 400,max_fn_linesto 40,max_cognitive_complexityto 10,max_crapto 10,max_paramsto 4,max_nestingto 3. A few rules also check the strict flag directly.- In
check, error and warning findings fail the gate and info findings do not. See The Check Gate and Findings Model.
Test code is skipped by most rules: files detected as test files, and test functions inside production files.
JSON blade value comments. Runs in codeknife comments and check (toggle blades.comments).
| Rule | Severity | Trigger | Threshold / config | --strict |
|---|---|---|---|---|
CK_CMT_APOLOGY |
warning | Comment contains a workaround or fear phrase (do not remove, do not touch, don't remove, don't touch, workaround, for now, too risky, hack:, kludge, important:), or is a comment inside a function body spanning more lines than the limit |
comments.max_inline_prose_lines (default 4) |
No |
CK_CMT_BANNER |
info | Section-divider banner made mostly of =, -, *, ~ or # |
none | No |
CK_CMT_CORPSE |
warning | Commented-out code | none | No |
CK_CMT_AI_RESIDUE |
info | Conversational or boilerplate phrases (added as requested, updated to handle, step 1: to step 4:, initialize variables, return the result), this helper or this function openers inside a function body, or a one-line doc comment that only repeats the names in the next line |
none | No |
CK_CMT_NARRATION |
info | Comment inside a function body (or trailing a line) that restates the next line of code, either by a stock opener (increment , loop through , check if , return , and others) or by word overlap with the next line |
comments.narration_overlap_threshold (default 0.65) |
No |
CK_CMT_SUPPRESSION |
warning for type/safety suppressions, info for style ones | Inline lint or type suppression. Warning: @ts-ignore, @ts-nocheck, @ts-expect-error, type: ignore, pyright: ignore, and Rust #[allow(...)] containing warnings, clippy::all, dead_code or unused. Info: eslint-disable, noqa, pylint: disable, nolint, other #[allow(...)]. @ts-expect-error in test files is skipped |
none | No |
Comments protected by the keep-list are never flagged. comments.keep_pub_docs (default true) is part of that keep-list.
JSON blade value arch. Runs in codeknife arch and check (toggle blades.arch).
| Rule | Severity | Trigger | Threshold / config | --strict |
|---|---|---|---|---|
CK_ARCH_LONG_FILE |
error above max_file_lines, warning above warn_file_lines |
Production line count of a non-test file. For Rust, lines from the first #[cfg(test)] on are not counted |
thresholds.max_file_lines (1000), thresholds.warn_file_lines (500) |
Yes: error limit drops to 400. The warning limit is unchanged |
CK_ARCH_LONG_FN |
warning | Function or method longer than the limit | thresholds.max_fn_lines (60) |
Yes: 40 |
CK_ARCH_DEEP_NESTING |
warning | Nesting depth above the limit | thresholds.max_nesting (4) |
Yes: 3 |
CK_ARCH_COGNITIVE_COMPLEXITY |
warning | Cognitive complexity above the limit | thresholds.max_cognitive_complexity (15) |
Yes: 10 |
CK_ARCH_TOO_MANY_PARAMS |
warning | More parameters than the limit | thresholds.max_params (5) |
Yes: 4 |
CK_ARCH_BOOL_TRAP |
warning | Boolean parameter count at or above the limit (note: >=, not >) |
thresholds.max_bool_params (2) |
No |
CK_ARCH_LOW_COHESION |
warning | Type with at least 2 fields and at least 4 methods (and either at least 6 methods or a file longer than warn_file_lines) whose LCOM4 analysis gives at least 4 clusters, or at least 2 clusters with 2 or more methods each |
thresholds.warn_file_lines |
No |
CK_ARCH_FAKE_SPLIT |
warning | Chain of 3 or more private functions in one module, each with at least 4 parameters and exactly one caller | hard-coded: 3 links, 4 params | No |
CK_ARCH_SHALLOW_MODULE |
warning | Module exposes more working functions than the limit, and exposes at least as many as it hides | thresholds.held_in_mind (7) |
No |
CK_ARCH_WIDE_DIR |
warning | Directory with more entries than the limit | thresholds.max_dir_members (15) |
No |
CK_ARCH_MODULE_CYCLE |
error | Import cycle between modules | none | No |
CK_ARCH_TANGLE |
warning | Group of items that all depend on each other, spanning more than one module or more items than the limit | thresholds.held_in_mind (7) |
No |
CK_ARCH_FIELD_LEAK |
warning | A struct field is read or written from outside its owning module. Reads of passive data-carrier types are excluded | none | No |
CK_ARCH_LAYER_VIOLATION |
error | An import breaks a [[deny]] or layer rule. Only runs when arch.toml exists, or arch --layers <file> is given |
arch.toml |
No |
JSON blade value clones. Runs in codeknife clones and check (toggle blades.clones).
| Rule | Severity | Trigger | Threshold / config | --strict |
|---|---|---|---|---|
CK_CLONE_BLOCK |
warning | Cluster of structurally similar code fragments. Fragments must have at least clone_min_lines lines and clone_min_nodes normalized tokens. A cluster of exactly 2 needs at least max(clone_min_lines, 12) lines |
thresholds.clone_similarity (0.82) or clones --threshold, thresholds.clone_min_lines (10), thresholds.clone_min_nodes (45) |
No |
CK_CLONE_DTO_SHAPE |
warning | Two types in different files whose field names overlap (Jaccard) at or above the limit | thresholds.dto_field_overlap (0.80) |
No |
CK_CLONE_REINVENTED_HELPER |
warning | Only with --changed: a whole function in a changed file is at least 78% similar to a function in an unchanged file |
hard-coded 0.78 | No |
JSON blade value dead. Runs in codeknife dead and check (toggle blades.dead).
| Rule | Severity | Trigger | Threshold / config | --strict |
|---|---|---|---|---|
CK_DEAD_SYMBOL |
warning | Non-public function, method or const that is not reachable and not referenced as a value | none | No |
CK_DEAD_TEST_ONLY_PROD |
warning | Non-public production function, method or const that only tests reach | none | No |
CK_DEAD_FILE |
warning | Non-test, non-entry file with production items, no inbound imports, and no reachable items | none | No |
CK_DEAD_ONE_CALLER_WRAPPER |
info | Non-public pass-through wrapper with exactly one non-test caller | none | No |
CK_DEAD_SINGLE_IMPL_TRAIT |
info | Non-public trait or interface with one implementation (Rust and Python: 0 or 1; TypeScript and JavaScript: exactly 1; never for Go) | none | No |
JSON blade value slop. Runs in codeknife slop and check (toggle blades.slop).
| Rule | Severity | Trigger | Threshold / config | --strict |
|---|---|---|---|---|
CK_SLOP_EMPTY_CATCH |
error for an empty catch/except body (empty, pass or ...); warning for a Rust Err(_) => {} match arm |
Swallowed error. A Python except clause is never flagged in this build; see Slop |
none | No |
CK_SLOP_BROAD_SWALLOW |
warning | catch (or a clause naming Exception) that does not rethrow and returns null, None, [], {} or false |
none | No |
CK_SLOP_TYPE_ESCAPE |
error for a Rust unsafe block with no SAFETY: comment; warning otherwise |
Rust .unwrap() / .expect() calls; TypeScript/JavaScript as any, as unknown as, non-null ! |
none | No |
CK_SLOP_UNBOUNDED_SPAWN |
warning | tokio::spawn( or Promise.all( inside a loop |
none | No |
CK_SLOP_NO_TIMEOUT |
warning | reqwest::get, reqwest::blocking::get, Go http.Get/http.Post, Python requests.get/requests.post without timeout=, or fetch( without a signal |
none | No |
CK_SLOP_BLOCKING_IN_ASYNC |
error | std::fs::*, std::thread::sleep, fs.readFileSync, fs.writeFileSync or time.sleep inside an async function |
none | No |
CK_SLOP_RESOURCE_LEAK |
warning | TypeScript/JavaScript useEffect that adds a listener or interval without removing or clearing it |
none | No |
CK_SLOP_STUB_HANDLER |
error | Rust todo! or unimplemented! in production code |
none | No |
CK_SLOP_DEBUG_LEFTOVER |
warning | Rust dbg!, breakpoint(, pdb.set_trace( |
none | No |
CK_SLOP_PLACEHOLDER |
warning | String literal equal to changeme, lorem ipsum or replace_me, or starting with your-api-key |
none | Yes: also flags placeholder and todo |
CK_SLOP_GUARD_SCATTER |
info | A function re-validates parameters that 2 or more of its callers already validate | hard-coded: 2 callers | No |
CK_SLOP_UNWIRED_ENV |
info | Environment variable read in code but missing from .env.example. Only runs when .env.example exists at the root |
.env.example |
No |
CK_SLOP_N_PLUS_ONE |
warning | Database or HTTP call inside a loop | none | No |
CK_SLOP_FLOATING_PROMISE |
warning | Unawaited fetch, axios.*, prisma.* or fs.promises.* call statement inside an async TypeScript/JavaScript function, with no .then( or .catch( |
none | No |
CK_SLOP_GO_DEFER_IN_LOOP |
warning | Go defer inside a loop |
none | No |
CK_SLOP_IGNORED_ERROR |
warning | Go assignment to _ from a fallible call (Write, Close, Flush, Exec, Commit, Sync, Remove, Encode, Marshal, Unmarshal, Copy) |
none | No |
CK_SLOP_ERROR_CONTEXT_LOSS |
info | Python raise X(...) inside except without from |
none | No |
CK_SLOP_LOCK_ACROSS_AWAIT |
warning | Rust guard from .lock(), .read() or .write() still alive at an .await in an async block |
none | No |
JSON blade value sec. Runs in codeknife sec and check (toggle blades.sec).
| Rule | Severity | Trigger | Threshold / config | --strict |
|---|---|---|---|---|
CK_SEC_SQL_INTERP |
error | SQL text built by string interpolation or concatenation, unless it is a safe parameterized SQL tag | none | No |
CK_SEC_CMD_INJECTION |
error | Python subprocess.* with shell=True or os.system(; JS/TS exec(/child_process.exec( with ${ or +; Go exec.Command("sh" with -c and +; Rust Command::new("sh") with -c and format! |
none | No |
CK_SEC_XSS_SINK |
error | JS/TS dangerouslySetInnerHTML, assignment to .innerHTML, document.write(, eval( |
none | No |
CK_SEC_WEAK_CRYPTO |
error | MD5, SHA-1 or Math.random call near code mentioning token, auth, secret, password, session or csrf |
none | No |
CK_SEC_HARDCODED_SECRET |
error | String literal that matches a known token prefix, an AWS key ID, a PEM private key, a database URL with credentials, or a high-entropy value bound to a sensitive name | none | No |
CK_SEC_UNSAFE_DESER |
error | pickle.load(s), marshal.loads, unserialize(, or yaml.load( without a safe loader |
none | No |
CK_SEC_JWT_NONE |
error | JWT or verify/decode call with none algorithm or disabled signature or expiry checks |
none | No |
CK_SEC_CORS_WILDCARD |
error | Wildcard CORS origin combined with credentials | none | No |
CK_SEC_AUTH_PARITY |
warning | In a file with at least 4 route registrations where at least 80% use auth, each route without auth | hard-coded: 4 routes, 80% | No |
CK_SEC_PATH_TRAVERSAL |
warning | Tainted input reaches a filesystem call without a sanitizer | none | No |
CK_SEC_SSRF |
warning | Tainted input reaches an outbound HTTP call without a sanitizer | none | No |
CK_SEC_OPEN_REDIRECT |
warning | Tainted input reaches a redirect call without a sanitizer | none | No |
CK_SEC_PROTO_POLLUTION |
warning | Tainted object passed to Object.assign, merge or deepMerge, or a tainted bracket write in JS/TS, in a function with no prototype-key guard |
none | No |
CK_SEC_WORKFLOW_INJECTION |
error | Untrusted github.event.* field (issue/PR/comment/review/discussion title or body, head_ref, commits) used inside a workflow run: script |
.github/workflows/*.yml and *.yaml |
No |
CK_SEC_UNPINNED_ACTION |
warning for a mutable branch ref (main, master, latest, HEAD, dev, develop); info otherwise |
Workflow uses: not pinned to a 40-character commit SHA. actions/* and github/* pinned to a v tag are allowed |
none | No |
CK_SEC_DOCKER_ROOT |
warning | Dockerfile whose final stage has CMD or ENTRYPOINT and no non-root USER |
Dockerfile, Dockerfile.*, *.Dockerfile |
No |
CK_SEC_DOCKER_PIPE_SH |
error | Dockerfile RUN that pipes curl or wget into sh or bash |
same files | No |
JSON blade value tests. Runs in codeknife tests and check (toggle blades.tests).
| Rule | Severity | Trigger | Threshold / config | --strict |
|---|---|---|---|---|
CK_TEST_HIGH_CRAP |
error at CRAP 30 or more; warning above the limit | Function CRAP score above the limit. Needs coverage data for the function | thresholds.max_crap (15) |
Yes: limit 10 |
CK_TEST_UNCOVERED_COMPLEXITY |
info | No coverage data for the function and cyclomatic complexity of 10 or more | hard-coded 10 | No |
CK_TEST_ZERO_ASSERT |
warning | Test with no assertions that does not call an assertion helper | none | Yes: error |
CK_TEST_WEAK_ASSERT |
warning | Every assertion in the test is a weak existence or truthiness check. It does not fire for JavaScript or TypeScript expect(...) chains; see Tests & CRAP |
none | Yes: error |
CK_TEST_MOCK_THEATER |
warning | Test with 3 or more mock setups whose mock assertions are at least as many as its other assertions | hard-coded 3 | No |
CK_TEST_BRANCHING |
warning | Test with 3 or more conditional or loop branches | hard-coded 3 | No |
CK_TEST_IMPL_COUPLED |
info | Test asserts call counts or brittle error strings | none | No |
CK_TEST_FLAKE_SMELL |
warning | In a test: a sleep (thread::sleep, setTimeout(, time.sleep(, time.Sleep(), wall-clock time (SystemTime::now, Date.now(, time.time(, time.Now() or unseeded randomness (Math.random(, rand::random). One finding per line and kind |
none | No |
JSON blade value mutate. Runs in codeknife mutate and in check --tier full. Not part of the default check.
| Rule | Severity | Trigger | Threshold / config | --strict |
|---|---|---|---|---|
CK_MUTATE_SITE |
info | mutate --scan only: one finding per candidate mutation site |
none | No |
CK_MUTATE_SURVIVOR |
error | A mutant survived the test run (killed and timed-out mutants are not reported) | none | No |
JSON blade value churn. Runs in codeknife churn and check (toggle blades.churn). Needs Git history.
| Rule | Severity | Trigger | Threshold / config | --strict |
|---|---|---|---|---|
CK_CHURN_HOTSPOT |
warning with 6 or more commits and (a function over max_cognitive_complexity or score 240 or more); info otherwise |
File with at least max(thrash_min_edits, 4) commits in the window, complexity sum of 20 or more, and hotspot score of 100 or more |
thresholds.thrash_min_edits (4), thresholds.max_cognitive_complexity, churn.days or churn --days (90) |
Indirect: the cognitive limit drops to 10 |
CK_CHURN_THRASH |
warning when more than 12 commits were scanned and the 7-day count is at least the minimum plus 2; info otherwise | File modified at least max(thrash_min_edits, 3) times in the last 7 days |
thresholds.thrash_min_edits (4) |
Yes: warning as soon as the 7-day count is above the minimum |
CK_CHURN_BLOAT_VELOCITY |
warning | File that started at 60 lines or more, grew by 200 lines or more in the window, and is now at least warn_file_lines long |
thresholds.warn_file_lines (500) |
No |
CK_CHURN_TEMPORAL_COUPLING |
warning for files in different directories changed together at least the minimum plus 2 times with a ratio of 0.75 or more; info otherwise | Pair of files changed together at least max(temporal_coupling_min_commits, 3) times with a co-change ratio at or above the limit. At most 15 pairs are reported |
thresholds.temporal_coupling_min_commits (5), thresholds.temporal_coupling_ratio (0.60) |
No |
JSON blade value blast. Runs in codeknife blast, and in check only with --changed when at least one file changed.
| Rule | Severity | Trigger | Threshold / config | --strict |
|---|---|---|---|---|
CK_BLAST_IMPACT |
warning when 4 or more files are affected with no tests and the target is not an entrypoint (or, with --symbol/--changed, 5 or more files with no tests); info otherwise |
Caller cone of a target symbol. Always emitted with --symbol or --changed; otherwise only when 4 or more files are affected and there are entrypoints or 5 or more upstream callers |
hard-coded | No |
CK_BLAST_CONTRACT |
warning with --symbol or --changed; info otherwise |
The caller cone touches a SQL, HTTP or env contract token that other files or languages share | none | No |
JSON blade value deps. Runs in codeknife deps and check (toggle blades.deps).
| Rule | Severity | Trigger | Threshold / config | --strict |
|---|---|---|---|---|
CK_DEP_UNUSED |
warning | Non-dev dependency with no observed imports. Not reported for Go | none | No |
CK_DEP_TRIVIAL_USE |
info | Non-dev JS/TS dependency imported at exactly one site | none | No |
CK_DEP_PHANTOM |
warning | Imported external package missing from every manifest. Only when at least one dependency is declared | none | No |
CK_DEP_DUPLICATE_VERSION |
info | Package with more than one major version in a lockfile | none | No |
CK_DEP_SLOPSQUAT_RISK |
warning for an npm lockfile package with hasInstallScript: true; error for a registry risk found by deps --verify-registry |
Install-script packages always; registry lookups only with --verify-registry |
deps --verify-registry |
No |
JSON blade value docs. Runs in codeknife docs and check (toggle blades.docs). Scans *.md files.
| Rule | Severity | Trigger | Threshold / config | --strict |
|---|---|---|---|---|
CK_DOC_DEAD_PATH |
warning | Markdown link target, or inline-code path, that does not exist | none | No |
CK_DOC_DEAD_SYMBOL |
warning | Inline-code a::b symbol not found in the code model |
none | No |
CK_DOC_DEAD_ROUTE |
info | Inline-code /api/, /v1/ or /v2/ route not among registered routes (only when 2 or more routes are known) |
none | No |
CK_DOC_DEAD_FLAG |
warning | --flag in an inline-code command for a known project binary that the binary does not define |
none | No |
CK_DOC_STALE_COMMAND |
warning | npm run X, just X or make X whose script, recipe or target does not exist |
package.json, justfile, Makefile |
No |
codeknife map emits no findings. It only writes the HTML map and notes.
Guard rules
Section titled “Guard rules”JSON blade value guard. Run by every command that runs the full static suite, including check, plan, score, map and baseline update/prune. Single blade commands do not run it. There is no toggle. See Loosening Guard.
| Rule | Severity | Trigger | Threshold / config | --strict |
|---|---|---|---|---|
CK_GUARD_ALWAYS_BLOCK_SUPPRESSION |
error | Suppression line contains an always_block entry |
suppressions.always_block (default @ts-ignore, @ts-nocheck, #[allow(clippy::all)], #[allow(warnings)]) |
No |
CK_GUARD_SUPPRESSION_EXPIRED |
error | Suppression with an until: YYYY-MM-DD date in the past |
none | No |
CK_GUARD_SUPPRESSION_HORIZON |
error | New suppression whose until: date is more than max_days away |
suppressions.max_days (90) |
No |
CK_GUARD_SUPPRESSION_NO_EXPIRY |
error | New suppression with no until: date |
suppressions.require_reason_and_expiry (true) |
No |
CK_GUARD_SUPPRESSION_NO_REASON |
error | New suppression with an until: date but no reason text |
suppressions.require_reason_and_expiry (true) |
No |
A suppression is “new” when the file has more lines with that marker than the same file at the base ref (HEAD by default, or --since). Outside a Git repository nothing counts as new, so only CK_GUARD_ALWAYS_BLOCK_SUPPRESSION and CK_GUARD_SUPPRESSION_EXPIRED can fire.
Loosening warnings (config, baseline and arch.toml weakened against the base ref, and each new suppression) are not findings and have no rule ID. They are reported in a separate loosenings list.
Deep mode rules
Section titled “Deep mode rules”Only emitted by check --deep, when the tool is installed and its project file exists. These findings report the blade value slop. The linter’s own code (for example a Clippy lint name or a Ruff code) goes into the finding’s symbol and message. See Deep Mode (Native Linters).
| Rule | Severity | Source | Runs when |
|---|---|---|---|
CK_DEEP_CLIPPY |
error or warning, from the compiler message level | cargo clippy --message-format=json --all-targets |
Cargo.toml at the root |
CK_DEEP_RUFF |
warning | ruff check --output-format=json . |
pyproject.toml or requirements.txt at the root |
CK_DEEP_TSC |
error for error TS, warning for warning TS lines |
npx --no-install tsc --noEmit --pretty false |
tsconfig.json at the root |
CK_DEEP_GOVET |
warning | go vet ./... |
go.mod at the root |
Fix patch labels
Section titled “Fix patch labels”codeknife fix prints each planned patch as [FIX] <rule> | <description>. Most labels are the rule ID of the finding the patch resolves: CK_DEAD_SYMBOL, CK_DEAD_ONE_CALLER_WRAPPER, CK_SLOP_DEBUG_LEFTOVER, CK_SLOP_NO_TIMEOUT, CK_GUARD_SUPPRESSION_EXPIRED, CK_DOC_DEAD_PATH, CK_DEP_UNUSED. Two labels exist only on patches and never on a finding:
| Label | Meaning |
|---|---|
CK_CMT_STRIP |
Removes the strippable comments in one file (the comments reported as CK_CMT_NARRATION, CK_CMT_BANNER, CK_CMT_CORPSE or CK_CMT_AI_RESIDUE) |
CK_DEAD_UNUSED_IMPORT |
Removes an unused import. No blade reports unused imports as findings |
See Autofix Engine.
IDs in the code that are never emitted
Section titled “IDs in the code that are never emitted”| ID | Where | Why it never appears |
|---|---|---|
CK_CMT_SLOP |
crates/codeknife-comments/src/lib.rs |
Fallback arm of a match that is only ever called with the four strippable comment classes, which all have their own IDs |
CK_ARCH_COGNITIVE |
crates/codeknife-intel/src/work_order_types.rs |
Used to put findings in the complexity category of work orders. The arch blade emits CK_ARCH_COGNITIVE_COMPLEXITY, so this match never succeeds |
CK_ARCH_CYCLE |
crates/codeknife-intel/src/work_orders.rs |
Used to cluster work orders. The arch blade emits CK_ARCH_MODULE_CYCLE, so this match never succeeds |
Two other CK_ strings are not rule IDs: CK_MUT is an environment variable set while mutants run, and CK_GUARD_ / CK_CLONE_ are prefixes used for matching.