|
| 1 | +# Slop Pattern Categories |
| 2 | + |
| 3 | +Detailed reference for all slop patterns detected by the pipeline. |
| 4 | + |
| 5 | +## Pattern Categories |
| 6 | + |
| 7 | +### Console Debugging |
| 8 | + |
| 9 | +| Language | Patterns | Severity | |
| 10 | +|----------|----------|----------| |
| 11 | +| JavaScript | `console.log()`, `console.debug()`, `console.info()` | medium | |
| 12 | +| Python | `print()`, `import pdb`, `breakpoint()` | medium | |
| 13 | +| Rust | `println!()`, `dbg!()`, `eprintln!()` | medium | |
| 14 | + |
| 15 | +**Excludes**: Test files, CLI entry points, config files |
| 16 | + |
| 17 | +### Unsafe Error Handling (Rust) |
| 18 | + |
| 19 | +| Pattern | Severity | Better Alternatives | |
| 20 | +|---------|----------|---------------------| |
| 21 | +| `.unwrap()` | medium | `.expect("msg")`, `.unwrap_or(default)`, `?` operator | |
| 22 | + |
| 23 | +Bare `.unwrap()` calls can cause panics in production. Prefer: |
| 24 | +- `.expect("descriptive message")` - panic with context |
| 25 | +- `.unwrap_or(default)` / `.unwrap_or_default()` - provide fallback |
| 26 | +- `.unwrap_or_else(\|\| ...)` - lazy fallback computation |
| 27 | +- `?` operator - propagate errors to caller |
| 28 | +- `.ok()` / `.map()` / `.and_then()` - transform Result/Option |
| 29 | + |
| 30 | +**Excludes**: Test files, examples, benchmarks |
| 31 | + |
| 32 | +### Placeholder Code |
| 33 | + |
| 34 | +| Pattern | Language | Severity | |
| 35 | +|---------|----------|----------| |
| 36 | +| `throw new Error("TODO: ...")` | JavaScript | high | |
| 37 | +| `todo!()`, `unimplemented!()` | Rust | high | |
| 38 | +| `raise NotImplementedError` | Python | high | |
| 39 | +| `panic("TODO: ...")` | Go | high | |
| 40 | +| Empty function bodies `{}` | All | high | |
| 41 | +| `pass` only functions | Python | high | |
| 42 | + |
| 43 | +### Error Handling Issues |
| 44 | + |
| 45 | +| Pattern | Description | Fix Strategy | |
| 46 | +|---------|-------------|--------------| |
| 47 | +| Empty catch blocks | `catch (e) {}` | add_logging | |
| 48 | +| Silent except | `except: pass` | add_logging | |
| 49 | + |
| 50 | +### Hardcoded Secrets |
| 51 | + |
| 52 | +**Critical severity** - always flagged for manual review. |
| 53 | + |
| 54 | +| Pattern | Examples | |
| 55 | +|---------|----------| |
| 56 | +| Generic credentials | `password=`, `api_key=`, `secret=` | |
| 57 | +| JWT tokens | `eyJ...` base64 pattern | |
| 58 | +| Provider-specific | `sk-` (OpenAI), `ghp_` (GitHub), `AKIA` (AWS) | |
| 59 | + |
| 60 | +**Excludes**: Template placeholders (`${VAR}`, `{{VAR}}`), masked values (`xxxxxx`) |
| 61 | + |
| 62 | +### Documentation Issues |
| 63 | + |
| 64 | +| Pattern | Description | Severity | |
| 65 | +|---------|-------------|----------| |
| 66 | +| JSDoc > 3x function | Excessive documentation | medium | |
| 67 | +| Issue/PR references | `// #123`, `// PR #456` | medium | |
| 68 | +| Stale file references | `// see auth-flow.md` | low | |
| 69 | + |
| 70 | +### Code Smells |
| 71 | + |
| 72 | +| Pattern | Description | Severity | |
| 73 | +|---------|-------------|----------| |
| 74 | +| Boolean blindness | `fn(true, false, true)` | medium | |
| 75 | +| Message chains | `a.b().c().d().e()` | low | |
| 76 | +| Mutable globals | `let CONSTANT = ...` | high | |
| 77 | +| Dead code | Unreachable after return | high | |
| 78 | + |
| 79 | +### Verbosity Patterns |
| 80 | + |
| 81 | +| Pattern | Examples | Severity | |
| 82 | +|---------|----------|----------| |
| 83 | +| AI preambles | "Certainly!", "I'd be happy to help" | low | |
| 84 | +| Marketing buzzwords | "synergize", "paradigm shift" | low | |
| 85 | +| Hedging language | "it's worth noting", "arguably" | low | |
| 86 | + |
| 87 | +## Certainty Levels |
| 88 | + |
| 89 | +### HIGH Certainty |
| 90 | +- Direct regex match |
| 91 | +- Definitive slop pattern |
| 92 | +- Safe for auto-fix |
| 93 | + |
| 94 | +### MEDIUM Certainty |
| 95 | +- Multi-pass analysis required |
| 96 | +- Review context before fixing |
| 97 | +- May need human judgment |
| 98 | + |
| 99 | +### LOW Certainty |
| 100 | +- Heuristic detection |
| 101 | +- High false positive rate |
| 102 | +- Flag only, no auto-fix |
| 103 | + |
| 104 | +## Auto-Fix Strategies |
| 105 | + |
| 106 | +| Strategy | When Used | |
| 107 | +|----------|-----------| |
| 108 | +| `remove` | Debug statements, trailing whitespace | |
| 109 | +| `replace` | Mixed indentation, multiple blank lines | |
| 110 | +| `add_logging` | Empty error handlers | |
| 111 | +| `flag` | Secrets, placeholders, code smells | |
| 112 | + |
| 113 | +## Multi-Pass Analyzers |
| 114 | + |
| 115 | +These patterns require structural analysis beyond regex: |
| 116 | + |
| 117 | +- `doc_code_ratio_js` - JSDoc/function ratio |
| 118 | +- `over_engineering_metrics` - File/export ratios |
| 119 | +- `buzzword_inflation` - Claims vs evidence |
| 120 | +- `infrastructure_without_implementation` - Setup without usage |
| 121 | +- `dead_code` - Unreachable code detection |
| 122 | +- `shotgun_surgery` - Git co-change analysis |
0 commit comments