roast-my-codebase 1.3.5 → 1.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +203 -385
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,427 +2,256 @@
|
|
|
2
2
|
|
|
3
3
|
> Get roasted. Get better. Ship faster.
|
|
4
4
|
|
|
5
|
-
A zero-config CLI that
|
|
5
|
+
A zero-config CLI that scans your codebase and delivers brutally honest (but funny) feedback. Every roast is backed by a real finding — not random noise.
|
|
6
6
|
|
|
7
|
-
```
|
|
7
|
+
```bash
|
|
8
8
|
npx roast-my-codebase
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
Scans your project in seconds and produces:
|
|
11
|
+
---
|
|
14
12
|
|
|
15
|
-
|
|
16
|
-
- **Project Statistics** — files, lines, dependencies
|
|
17
|
-
- **Actionable Findings** — large files, circular deps, unused packages, TODOs
|
|
18
|
-
- **Roasts** — humorous commentary tied to actual issues
|
|
19
|
-
- **Verdict** — a one-liner summary of your codebase's state
|
|
20
|
-
|
|
21
|
-
## Screenshot
|
|
13
|
+
## What it looks like
|
|
22
14
|
|
|
23
15
|
```
|
|
24
16
|
╔═════════════════════════════╗
|
|
25
17
|
║ Roast My Codebase 🔥 ║
|
|
26
18
|
╚═════════════════════════════╝
|
|
27
19
|
|
|
28
|
-
Project
|
|
20
|
+
Project: my-app
|
|
29
21
|
|
|
30
|
-
|
|
22
|
+
Health Score: 42/100 F Chaotic
|
|
31
23
|
|
|
32
|
-
|
|
33
|
-
Lines of Code 64,112
|
|
34
|
-
Dependencies 87
|
|
24
|
+
[████████████░░░░░░░░░░░░░░░░░░]
|
|
35
25
|
|
|
36
|
-
|
|
37
|
-
⚠ 7 Large Files (500+ lines)
|
|
38
|
-
⚠ 2 Circular Dependencies
|
|
26
|
+
Some findings require immediate attention.
|
|
39
27
|
|
|
40
|
-
|
|
28
|
+
Project Summary
|
|
29
|
+
────────────────────────────────────────
|
|
30
|
+
Files Scanned 138
|
|
31
|
+
Total Files 412
|
|
32
|
+
Lines of Code 28,904
|
|
33
|
+
Dependencies 54
|
|
34
|
+
Dev Dependencies 21
|
|
41
35
|
|
|
42
|
-
|
|
43
|
-
|
|
36
|
+
Findings
|
|
37
|
+
────────────────────────────────────────
|
|
38
|
+
● 3 critical
|
|
39
|
+
● 18 warnings
|
|
40
|
+
● 11 info
|
|
44
41
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
42
|
+
✗ AuthService in src/auth/auth.service.ts has cyclomatic complexity of 34
|
|
43
|
+
Gru's plan: write simple function → add one more condition → this.
|
|
44
|
+
✗ .env is tracked in git — secrets may be exposed
|
|
45
|
+
Little Bobby Tables visited your repo. He felt at home.
|
|
46
|
+
⚠ src/auth/auth.service.ts is 1,847 lines
|
|
47
|
+
Nobody: ... This file: *adds 200 more lines*
|
|
48
|
+
⚠ "lodash" appears unused — paying rent for no reason
|
|
49
|
+
node_modules: the folder that makes SSD manufacturers nervous.
|
|
50
|
+
⚠ src/utils/helpers.ts has cyclomatic complexity of 22
|
|
51
|
+
I've seen smaller decision trees at the DMV.
|
|
49
52
|
|
|
50
|
-
|
|
53
|
+
The findings have formed a coalition.
|
|
51
54
|
|
|
52
|
-
|
|
53
|
-
# Run directly (no install needed)
|
|
54
|
-
npx roast-my-codebase
|
|
55
|
+
────────────────────────────────────────
|
|
55
56
|
|
|
56
|
-
|
|
57
|
-
npm install -g roast-my-codebase
|
|
58
|
-
roast-my-codebase
|
|
59
|
-
```
|
|
57
|
+
Verdict
|
|
60
58
|
|
|
61
|
-
|
|
59
|
+
Functional code with security issues is a solved problem waiting to be exploited.
|
|
62
60
|
|
|
63
|
-
|
|
64
|
-
# Basic scan
|
|
65
|
-
npx roast-my-codebase
|
|
61
|
+
────────────────────────────────────────
|
|
66
62
|
|
|
67
|
-
|
|
68
|
-
npx roast-my-codebase ./path/to/project
|
|
63
|
+
Share your roast → https://x.com/intent/tweet?text=My%20codebase%20just%20got%20roasted...
|
|
69
64
|
|
|
70
|
-
|
|
71
|
-
|
|
65
|
+
roast-my-codebase · github.com/rahuldk1105/roast-my-codebase
|
|
66
|
+
```
|
|
72
67
|
|
|
73
|
-
|
|
74
|
-
npx roast-my-codebase --ai-roasts
|
|
68
|
+
---
|
|
75
69
|
|
|
76
|
-
|
|
77
|
-
npx roast-my-codebase --interactive
|
|
70
|
+
## Add it to your CI in 30 seconds
|
|
78
71
|
|
|
79
|
-
|
|
80
|
-
npx roast-my-codebase --interactive --dry-run
|
|
72
|
+
Every PR gets a roast comment automatically. Teams screenshot them. They spread.
|
|
81
73
|
|
|
82
|
-
|
|
83
|
-
npx roast-my-codebase --watch
|
|
74
|
+
**Step 1** — create `.github/workflows/roast.yml` in your repo:
|
|
84
75
|
|
|
85
|
-
|
|
86
|
-
|
|
76
|
+
```yaml
|
|
77
|
+
name: Roast My Codebase
|
|
87
78
|
|
|
88
|
-
|
|
89
|
-
|
|
79
|
+
on:
|
|
80
|
+
pull_request:
|
|
81
|
+
types: [opened, synchronize, reopened]
|
|
90
82
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
npx roast-my-codebase --badge # Generate SVG badge
|
|
94
|
-
npx roast-my-codebase --markdown # Markdown for PRs
|
|
95
|
-
npx roast-my-codebase --markdown-file # Save to .roast-report.md
|
|
96
|
-
```
|
|
83
|
+
permissions:
|
|
84
|
+
pull-requests: write
|
|
97
85
|
|
|
98
|
-
|
|
86
|
+
jobs:
|
|
87
|
+
roast:
|
|
88
|
+
runs-on: ubuntu-latest
|
|
89
|
+
steps:
|
|
90
|
+
- uses: actions/checkout@v4
|
|
91
|
+
with:
|
|
92
|
+
fetch-depth: 0
|
|
99
93
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
| **Dependencies** | Excessive or unused packages |
|
|
105
|
-
| **Circular Deps** | Import cycles between modules |
|
|
106
|
-
| **Structure** | Deep nesting, bloated folders, utils explosion |
|
|
107
|
-
| **Complexity** | Functions with high cyclomatic complexity (15+) |
|
|
108
|
-
| **Duplicates** | Copy-pasted code blocks across files |
|
|
109
|
-
| **Dead Exports** | Exports that are never imported |
|
|
110
|
-
| **Type Safety** | `any` usage, `@ts-ignore`, type bypasses |
|
|
111
|
-
|
|
112
|
-
## Supported Languages
|
|
113
|
-
|
|
114
|
-
### Fully Supported
|
|
115
|
-
- **JavaScript** (.js, .jsx, .mjs, .cjs)
|
|
116
|
-
- **TypeScript** (.ts, .tsx)
|
|
117
|
-
- **Python** (.py) — Complexity, type hints, imports, docstrings, security, class design
|
|
118
|
-
- **Go** (.go) — Complexity, error handling, lint conventions
|
|
119
|
-
- **Rust** (.rs) — Complexity, unsafe usage, clippy hints
|
|
120
|
-
- **Java** (.java) — Complexity, code smells, naming conventions
|
|
121
|
-
- **C#** (.cs) — Complexity, code smells, async patterns
|
|
122
|
-
|
|
123
|
-
### Framework-Specific Checks
|
|
124
|
-
|
|
125
|
-
| Framework | What's detected |
|
|
126
|
-
|-----------|----------------|
|
|
127
|
-
| **Next.js** | Missing metadata exports, server/client component misuse |
|
|
128
|
-
| **React** | Missing error boundaries |
|
|
129
|
-
| **Vue 3** | Options API in Vue 3, v-for without :key, deep watchers |
|
|
130
|
-
| **Angular** | Missing OnPush strategy, direct DOM manipulation, untyped events |
|
|
131
|
-
| **Svelte** | Reactive side effects, inaccessible buttons |
|
|
132
|
-
| **Express** | Missing error middleware, no rate limiting, sync I/O in routes |
|
|
133
|
-
| **FastAPI** | Missing response_model, sync endpoints, missing status codes |
|
|
134
|
-
|
|
135
|
-
### Language-Specific Checks
|
|
136
|
-
|
|
137
|
-
| Language | Scanners |
|
|
138
|
-
|----------|----------|
|
|
139
|
-
| Python | Cyclomatic complexity, type hints, imports, docstrings, code smells, security, class design |
|
|
140
|
-
| Go | Complexity, ignored errors, panic usage, undocumented exports, init() |
|
|
141
|
-
| Rust | Complexity, unsafe blocks, .unwrap() overuse, .clone() overuse, dead_code |
|
|
142
|
-
| Java | Complexity, God classes, raw types, empty catches, System.out, naming |
|
|
143
|
-
| C# | Complexity, God classes, #regions, async void, sync-over-async, empty catches |
|
|
144
|
-
|
|
145
|
-
### Universal Features (All Languages)
|
|
146
|
-
- File size analysis
|
|
147
|
-
- TODO/FIXME detection
|
|
148
|
-
- Git insights (churn, PR size, stale branches)
|
|
149
|
-
- Security scans (secrets, .env in git, eval)
|
|
150
|
-
- Test coverage gaps
|
|
151
|
-
- Framework best practices (Next.js, React)
|
|
152
|
-
|
|
153
|
-
Language detection is automatic! The tool detects your project's languages via package files and runs appropriate scanners.
|
|
94
|
+
- uses: rahuldk1105/roast-my-codebase@v1
|
|
95
|
+
with:
|
|
96
|
+
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
97
|
+
```
|
|
154
98
|
|
|
155
|
-
|
|
99
|
+
That's it. No secrets to configure. `GITHUB_TOKEN` is provided automatically by GitHub.
|
|
156
100
|
|
|
157
|
-
|
|
158
|
-
2. **Completely offline** — No APIs, no cloud, no telemetry, no data collection.
|
|
159
|
-
3. **Fast** — Under 3 seconds for repos with < 1000 files.
|
|
160
|
-
4. **Beautiful output** — Designed to be screenshot-worthy.
|
|
101
|
+
**What the PR comment looks like:**
|
|
161
102
|
|
|
162
|
-
|
|
103
|
+
```
|
|
104
|
+
## 🔥 Roast My Codebase — Health: 42/100 🔴
|
|
163
105
|
|
|
164
|
-
|
|
106
|
+
[████████████░░░░░░░░░░░░░░░░░░] 42/100
|
|
165
107
|
|
|
166
|
-
|
|
|
167
|
-
|
|
168
|
-
|
|
|
169
|
-
|
|
|
170
|
-
|
|
|
171
|
-
| Unused dependency | -2 |
|
|
172
|
-
| TODO/FIXME (per occurrence) | -0.25 |
|
|
173
|
-
| Excessive total dependencies | -5 |
|
|
174
|
-
| Deep nesting | -2 |
|
|
108
|
+
| Metric | Value |
|
|
109
|
+
|--------|-------|
|
|
110
|
+
| Files | 138 |
|
|
111
|
+
| Lines | 28k |
|
|
112
|
+
| Deps | 54 |
|
|
175
113
|
|
|
176
|
-
|
|
177
|
-
- **90–100** Excellent
|
|
178
|
-
- **80–89** Good
|
|
179
|
-
- **70–79** Fair
|
|
180
|
-
- **60–69** Risky
|
|
181
|
-
- **0–59** Chaotic
|
|
114
|
+
🔴 3 critical ⚠️ 18 warnings ℹ️ 11 info
|
|
182
115
|
|
|
183
|
-
|
|
116
|
+
- 🔴 `src/auth/auth.service.ts` — cyclomatic complexity of 34
|
|
117
|
+
- 🔴 `.env` is tracked in git — secrets may be exposed
|
|
118
|
+
- ⚠️ `src/auth/auth.service.ts` is 1,847 lines
|
|
119
|
+
- ⚠️ "lodash" appears unused — paying rent for no reason
|
|
184
120
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
```
|
|
189
|
-
- Big, colorful letter grade at the top (A/B/C/D/F)
|
|
190
|
-
- Perfect for screenshots and social media
|
|
191
|
-
- Color-coded based on health score
|
|
121
|
+
> 🔥 **src/auth/auth.service.ts**: Nobody: ... This file: *adds 200 more lines*
|
|
122
|
+
> 🔥 **.env**: Little Bobby Tables visited your repo. He felt at home.
|
|
123
|
+
> 🔥 **codebase**: The findings have formed a coalition.
|
|
192
124
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
roast-my-codebase
|
|
196
|
-
```
|
|
197
|
-
- Generates `.roast-badge.svg` for your README
|
|
198
|
-
- Shields.io-style badge showing "Health: 82/100"
|
|
199
|
-
- Color-coded: green (90+), yellow-green (80+), yellow (70+), orange (60+), red (<60)
|
|
200
|
-
- Embed in your README:
|
|
201
|
-
```markdown
|
|
202
|
-

|
|
203
|
-
```
|
|
204
|
-
|
|
205
|
-
### Markdown Output
|
|
206
|
-
```bash
|
|
207
|
-
roast-my-codebase --markdown # Output to stdout
|
|
208
|
-
roast-my-codebase --markdown-file # Save to .roast-report.md
|
|
125
|
+
*Functional code with security issues is a solved problem waiting to be exploited.*
|
|
126
|
+
|
|
127
|
+
Generated by roast-my-codebase
|
|
209
128
|
```
|
|
210
|
-
- Beautiful markdown with collapsible sections
|
|
211
|
-
- Perfect for GitHub PRs, Notion, and documentation
|
|
212
|
-
- Includes emoji severity indicators (🔴/⚠️/ℹ️)
|
|
213
|
-
- Tables for stats, blockquotes for roasts
|
|
214
129
|
|
|
215
|
-
|
|
130
|
+
**Optional: fail PRs below a score threshold**
|
|
216
131
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
132
|
+
```yaml
|
|
133
|
+
- uses: rahuldk1105/roast-my-codebase@v1
|
|
134
|
+
with:
|
|
135
|
+
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
136
|
+
fail-below: "60"
|
|
220
137
|
```
|
|
221
|
-
- Machine-readable output
|
|
222
|
-
- Exit code 1 if score < threshold
|
|
223
|
-
- Perfect for CI pipelines
|
|
224
138
|
|
|
225
|
-
|
|
226
|
-
```bash
|
|
227
|
-
roast-my-codebase --fix
|
|
228
|
-
```
|
|
229
|
-
- Actionable one-liner fixes for each issue
|
|
230
|
-
- Specific commands (e.g., `npm uninstall unused-package`)
|
|
231
|
-
- Refactoring guidance
|
|
139
|
+
**Optional: AI-powered roasts via Claude**
|
|
232
140
|
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
141
|
+
```yaml
|
|
142
|
+
- uses: rahuldk1105/roast-my-codebase@v1
|
|
143
|
+
with:
|
|
144
|
+
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
145
|
+
ai-roasts: "true"
|
|
146
|
+
anthropic-api-key: ${{ secrets.ANTHROPIC_API_KEY }}
|
|
236
147
|
```
|
|
237
|
-
- 🤖 Context-aware roasts generated by Claude AI
|
|
238
|
-
- 🎯 Specific to your actual code issues
|
|
239
|
-
- 😄 More witty and relevant than generic roasts
|
|
240
|
-
- 💾 Cached for 7 days to minimize API costs
|
|
241
|
-
- 🔒 Requires ANTHROPIC_API_KEY environment variable
|
|
242
|
-
|
|
243
|
-
**Example comparison:**
|
|
244
148
|
|
|
245
|
-
|
|
246
|
-
> "This file contains several geological layers."
|
|
149
|
+
---
|
|
247
150
|
|
|
248
|
-
|
|
249
|
-
> "This 1,847-line auth service is doing authentication, authorization, password reset, email verification, 2FA, and probably making coffee. Pick a lane."
|
|
151
|
+
## Installation
|
|
250
152
|
|
|
251
|
-
**Setup:**
|
|
252
153
|
```bash
|
|
253
|
-
#
|
|
254
|
-
|
|
154
|
+
# Run without installing
|
|
155
|
+
npx roast-my-codebase
|
|
255
156
|
|
|
256
|
-
#
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
"cacheEnabled": true
|
|
263
|
-
}
|
|
264
|
-
}
|
|
157
|
+
# Install globally
|
|
158
|
+
npm install -g roast-my-codebase
|
|
159
|
+
roast-my-codebase
|
|
160
|
+
|
|
161
|
+
# Scan a specific path
|
|
162
|
+
roast-my-codebase ./path/to/project
|
|
265
163
|
```
|
|
266
164
|
|
|
267
|
-
|
|
268
|
-
- Only roasts top 10 most interesting findings
|
|
269
|
-
- Caches roasts for 7 days
|
|
270
|
-
- Cache stored in `.roast-ai-cache.json`
|
|
271
|
-
- Typical cost: $0.01-0.05 per scan
|
|
165
|
+
---
|
|
272
166
|
|
|
273
|
-
|
|
274
|
-
```bash
|
|
275
|
-
roast-my-codebase --interactive
|
|
276
|
-
```
|
|
277
|
-
- 🎯 Walk through issues one by one
|
|
278
|
-
- 💡 See detailed explanations and fix suggestions
|
|
279
|
-
- ✨ Apply automatic fixes where possible
|
|
280
|
-
- ⚡ Preview changes with `--dry-run` flag
|
|
281
|
-
- 🎨 Beautiful interactive UI
|
|
282
|
-
|
|
283
|
-
**What can be auto-fixed:**
|
|
284
|
-
- ✅ Remove unused dependencies (`npm uninstall`)
|
|
285
|
-
- ✅ Add issue references to TODO comments
|
|
286
|
-
- ✅ Remove dead exports
|
|
287
|
-
- ✅ Add `'use client'` directive to Next.js components
|
|
288
|
-
- ✅ Add missing metadata export to Next.js pages
|
|
289
|
-
- ✅ Add `.env` files to `.gitignore`
|
|
290
|
-
- ✅ Upgrade `@ts-ignore` to `@ts-expect-error`
|
|
291
|
-
- ✅ Create skeleton test files for untested source files
|
|
292
|
-
- ✅ Add secret files to `.gitignore`
|
|
293
|
-
|
|
294
|
-
**Example session:**
|
|
295
|
-
```
|
|
296
|
-
🔧 Interactive Fix Mode
|
|
167
|
+
## What gets analyzed
|
|
297
168
|
|
|
298
|
-
|
|
169
|
+
| Check | What it finds |
|
|
170
|
+
|-------|--------------|
|
|
171
|
+
| **File Size** | Files over 500 / 1000 / 2000 lines |
|
|
172
|
+
| **Complexity** | Functions with cyclomatic complexity 15+ |
|
|
173
|
+
| **TODOs** | TODO, FIXME, HACK, XXX comments |
|
|
174
|
+
| **Dependencies** | Unused or excessive packages |
|
|
175
|
+
| **Circular Deps** | Import cycles between modules |
|
|
176
|
+
| **Duplicates** | Copy-pasted code blocks |
|
|
177
|
+
| **Dead Exports** | Exports that are never imported |
|
|
178
|
+
| **Type Safety** | `any`, `@ts-ignore`, type bypasses |
|
|
179
|
+
| **Security** | Secrets in git, hardcoded credentials, eval usage |
|
|
180
|
+
| **Test Coverage** | Source files with no corresponding tests |
|
|
181
|
+
| **Git Insights** | High-churn files, large PRs, stale branches |
|
|
182
|
+
| **Structure** | Deep nesting, utils explosion, bloated folders |
|
|
299
183
|
|
|
300
|
-
|
|
301
|
-
─────────────────────────────────────────
|
|
302
|
-
Unused dependency `lodash` is installed but never imported
|
|
184
|
+
---
|
|
303
185
|
|
|
304
|
-
|
|
305
|
-
Remove unused dependency: lodash
|
|
186
|
+
## Supported languages
|
|
306
187
|
|
|
307
|
-
|
|
188
|
+
**Full support:** JavaScript · TypeScript · Python · Go · Rust · Java · C# · Ruby · PHP · Swift · Kotlin
|
|
308
189
|
|
|
309
|
-
|
|
310
|
-
❯ Apply fix automatically
|
|
311
|
-
Show details
|
|
312
|
-
Skip
|
|
313
|
-
Exit interactive mode
|
|
314
|
-
```
|
|
190
|
+
**Framework checks:** Next.js · React · Vue 3 · Angular · Svelte · Express · FastAPI
|
|
315
191
|
|
|
316
|
-
|
|
317
|
-
```bash
|
|
318
|
-
roast-my-codebase --html-file
|
|
319
|
-
```
|
|
320
|
-
- Saves `.roast-report.html` — a beautiful standalone HTML report
|
|
321
|
-
- Dark theme, SVG health gauge, sortable findings table, severity chart
|
|
322
|
-
- Fully self-contained (no CDN, works offline)
|
|
323
|
-
- Perfect for sharing with the team
|
|
192
|
+
Language detection is automatic — no config needed.
|
|
324
193
|
|
|
325
|
-
|
|
326
|
-
```bash
|
|
327
|
-
roast-my-codebase --incremental # Only changed files since last commit
|
|
328
|
-
roast-my-codebase --since main # Only files changed since branching from main
|
|
329
|
-
```
|
|
330
|
-
- Dramatically faster on large repos — only scans changed files
|
|
331
|
-
- Global findings (circular deps, excessive dependencies) are always shown
|
|
332
|
-
- Falls back to full scan if not in a git repository
|
|
194
|
+
---
|
|
333
195
|
|
|
334
|
-
|
|
335
|
-
```bash
|
|
336
|
-
roast-my-codebase --watch
|
|
337
|
-
```
|
|
338
|
-
- Re-runs on file changes
|
|
339
|
-
- Shows score delta
|
|
340
|
-
- Compact summaries for quick feedback
|
|
196
|
+
## Health Score
|
|
341
197
|
|
|
342
|
-
|
|
343
|
-
```bash
|
|
344
|
-
roast-my-codebase --compare main
|
|
345
|
-
```
|
|
346
|
-
- Diff current code vs. a git branch
|
|
347
|
-
- Shows new issues introduced
|
|
348
|
-
- Shows resolved issues
|
|
349
|
-
- Score delta comparison
|
|
198
|
+
Starts at 100. Deductions for real issues:
|
|
350
199
|
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
200
|
+
| Issue | Points |
|
|
201
|
+
|-------|--------|
|
|
202
|
+
| Extreme file (2000+ lines) | −5 |
|
|
203
|
+
| Circular dependency | −5 |
|
|
204
|
+
| Critical security issue | −10 |
|
|
205
|
+
| Large file (1000+ lines) | −3 |
|
|
206
|
+
| Unused dependency | −2 |
|
|
207
|
+
| Complex function | −2 |
|
|
208
|
+
| TODO/FIXME (each) | −0.25 |
|
|
360
209
|
|
|
361
|
-
**
|
|
362
|
-
```bash
|
|
363
|
-
roast-my-codebase --history # Last 30 days
|
|
364
|
-
roast-my-codebase --history 7 # Last 7 days
|
|
365
|
-
roast-my-codebase --history 90 # Last 90 days
|
|
366
|
-
```
|
|
210
|
+
**Grades:** 90–100 Excellent · 80–89 Good · 70–79 Fair · 60–69 Risky · 0–59 Chaotic
|
|
367
211
|
|
|
368
|
-
|
|
369
|
-
- Health score over time
|
|
370
|
-
- Finding counts by severity
|
|
371
|
-
- Category-level trends
|
|
372
|
-
- Git commit information
|
|
373
|
-
- Score improvement rate
|
|
212
|
+
---
|
|
374
213
|
|
|
375
|
-
|
|
376
|
-
```
|
|
377
|
-
📊 Health History Report
|
|
378
|
-
|
|
379
|
-
Project: my-app
|
|
380
|
-
Total snapshots: 45
|
|
381
|
-
|
|
382
|
-
Current Health
|
|
383
|
-
Score: 85/100 (B)
|
|
384
|
-
Findings: 12
|
|
385
|
-
● 2 critical ● 6 warnings ● 4 info
|
|
386
|
-
|
|
387
|
-
Trend Analysis (Last 30 days)
|
|
388
|
-
↗ IMPROVING (+12 points)
|
|
389
|
-
|
|
390
|
-
Statistics:
|
|
391
|
-
Average score: 78.5/100
|
|
392
|
-
Best score: 85/100
|
|
393
|
-
Worst score: 68/100
|
|
394
|
-
Improvement rate: +0.4 points/day
|
|
395
|
-
|
|
396
|
-
Score Trend
|
|
397
|
-
100 ┤
|
|
398
|
-
90 ┤ ●●
|
|
399
|
-
80 ┤ ●● ●
|
|
400
|
-
70 ┤ ●●
|
|
401
|
-
60 ┼──────────────→
|
|
402
|
-
Jan 1 Jan 30
|
|
403
|
-
|
|
404
|
-
Category Changes
|
|
405
|
-
↓ Improving:
|
|
406
|
-
✓ unused-dependencies: -5 issues
|
|
407
|
-
✓ todos: -8 issues
|
|
408
|
-
↑ Declining:
|
|
409
|
-
✗ complexity: +2 issues
|
|
410
|
-
```
|
|
214
|
+
## All options
|
|
411
215
|
|
|
412
|
-
**Use in CI:**
|
|
413
216
|
```bash
|
|
414
|
-
#
|
|
415
|
-
roast-my-codebase --
|
|
416
|
-
|
|
417
|
-
#
|
|
418
|
-
roast-my-codebase --
|
|
217
|
+
# Output formats
|
|
218
|
+
roast-my-codebase --json # Machine-readable JSON
|
|
219
|
+
roast-my-codebase --markdown # Markdown to stdout
|
|
220
|
+
roast-my-codebase --markdown-file # Save to .roast-report.md
|
|
221
|
+
roast-my-codebase --html-file # Save to .roast-report.html
|
|
222
|
+
roast-my-codebase --ascii # Big ASCII art grade (screenshot-worthy)
|
|
223
|
+
roast-my-codebase --badge # Generate .roast-badge.svg for your README
|
|
224
|
+
|
|
225
|
+
# CI/CD
|
|
226
|
+
roast-my-codebase --json --threshold 80 # Exit code 1 if score < 80
|
|
227
|
+
roast-my-codebase --pr-comment # Post GitHub PR comment
|
|
228
|
+
roast-my-codebase --init-ci # Drop a CI workflow into your repo
|
|
229
|
+
|
|
230
|
+
# AI roasts
|
|
231
|
+
roast-my-codebase --ai-roasts # Claude-powered contextual roasts
|
|
232
|
+
|
|
233
|
+
# Interactive
|
|
234
|
+
roast-my-codebase --fix # Show fix suggestions
|
|
235
|
+
roast-my-codebase --interactive # Walk through and apply fixes
|
|
236
|
+
roast-my-codebase --interactive --dry-run # Preview fixes without applying
|
|
237
|
+
|
|
238
|
+
# Scanning
|
|
239
|
+
roast-my-codebase --incremental # Only changed files since last commit
|
|
240
|
+
roast-my-codebase --since main # Only files changed since branching from main
|
|
241
|
+
roast-my-codebase --watch # Re-run on file changes
|
|
242
|
+
|
|
243
|
+
# History and comparison
|
|
244
|
+
roast-my-codebase --track # Save score snapshot
|
|
245
|
+
roast-my-codebase --history # Show last 30 days
|
|
246
|
+
roast-my-codebase --history 7 # Show last 7 days
|
|
247
|
+
roast-my-codebase --compare main # Diff against a branch
|
|
419
248
|
```
|
|
420
249
|
|
|
421
|
-
|
|
250
|
+
---
|
|
422
251
|
|
|
423
|
-
|
|
252
|
+
## Configuration
|
|
424
253
|
|
|
425
|
-
Create
|
|
254
|
+
Create `.roastrc.json` in your project root:
|
|
426
255
|
|
|
427
256
|
```json
|
|
428
257
|
{
|
|
@@ -431,80 +260,69 @@ Create a `.roastrc.json` in your project root to customize behavior:
|
|
|
431
260
|
"extremeFile": 3000
|
|
432
261
|
},
|
|
433
262
|
"scanners": {
|
|
434
|
-
"disabled": ["test-coverage"
|
|
263
|
+
"disabled": ["test-coverage"]
|
|
435
264
|
},
|
|
436
265
|
"ignore": [
|
|
437
266
|
"**/vendor/**",
|
|
438
267
|
"**/generated/**"
|
|
439
268
|
],
|
|
440
269
|
"deductions": {
|
|
441
|
-
"secret": -20
|
|
442
|
-
|
|
443
|
-
},
|
|
444
|
-
"plugins": [
|
|
445
|
-
"roast-plugin-graphql"
|
|
446
|
-
]
|
|
270
|
+
"secret": -20
|
|
271
|
+
}
|
|
447
272
|
}
|
|
448
273
|
```
|
|
449
274
|
|
|
450
|
-
|
|
275
|
+
See [CUSTOMIZATION.md](CUSTOMIZATION.md) for the full config reference and plugin development guide.
|
|
451
276
|
|
|
452
|
-
|
|
277
|
+
---
|
|
453
278
|
|
|
454
|
-
|
|
279
|
+
## AI-Powered Roasts
|
|
455
280
|
|
|
456
|
-
```
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
name: "roast-plugin-example",
|
|
460
|
-
version: "1.0.0",
|
|
461
|
-
scanner: {
|
|
462
|
-
name: "example",
|
|
463
|
-
async scan(rootDir) {
|
|
464
|
-
const findings = [];
|
|
465
|
-
// Your scanner logic
|
|
466
|
-
return { findings };
|
|
467
|
-
}
|
|
468
|
-
}
|
|
469
|
-
};
|
|
281
|
+
```bash
|
|
282
|
+
export ANTHROPIC_API_KEY=your_key_here
|
|
283
|
+
npx roast-my-codebase --ai-roasts
|
|
470
284
|
```
|
|
471
285
|
|
|
472
|
-
|
|
286
|
+
Uses Claude to generate context-aware roasts specific to your actual code. Cached for 7 days. Typical cost: $0.01–0.05 per scan.
|
|
287
|
+
|
|
288
|
+
**Generic roast:** `"This file contains several geological layers."`
|
|
289
|
+
|
|
290
|
+
**AI roast:** `"This 1,847-line auth service handles authentication, authorization, password reset, email verification, 2FA, and probably your taxes. Pick a lane."`
|
|
291
|
+
|
|
292
|
+
---
|
|
473
293
|
|
|
474
294
|
## VS Code Extension
|
|
475
295
|
|
|
476
|
-
|
|
296
|
+
Search **"Roast My Codebase"** in the VS Code marketplace for inline diagnostics, a live health score in the status bar, and findings in the Problems panel.
|
|
477
297
|
|
|
478
|
-
|
|
479
|
-
- **Status bar widget** showing live health score
|
|
480
|
-
- **Tree view panels** for browsing findings and stats
|
|
481
|
-
- **Interactive HTML reports** in VS Code
|
|
482
|
-
- **Badge generation** from the command palette
|
|
483
|
-
- **Configurable** - reads `.roastrc.json` and VS Code settings
|
|
298
|
+
---
|
|
484
299
|
|
|
485
|
-
|
|
300
|
+
## Design principles
|
|
486
301
|
|
|
487
|
-
1.
|
|
488
|
-
2.
|
|
489
|
-
3.
|
|
302
|
+
1. **Real value** — humor is the presentation layer; analysis is the product
|
|
303
|
+
2. **Zero config** — works on any codebase with no setup
|
|
304
|
+
3. **Completely offline** — no telemetry, no data collection, no cloud
|
|
305
|
+
4. **Fast** — under 3 seconds on repos with fewer than 1000 files
|
|
490
306
|
|
|
491
|
-
|
|
307
|
+
---
|
|
492
308
|
|
|
493
309
|
## Contributing
|
|
494
310
|
|
|
495
|
-
PRs welcome.
|
|
311
|
+
PRs welcome. Each scanner is independent and easy to add to.
|
|
496
312
|
|
|
497
313
|
```
|
|
498
314
|
src/
|
|
499
315
|
├── cli/ # Command setup
|
|
500
316
|
├── scanners/ # Modular analysis passes
|
|
501
317
|
├── scoring/ # Health score calculation
|
|
502
|
-
├── roasts/ # Roast
|
|
503
|
-
├── report/ # Terminal rendering
|
|
318
|
+
├── roasts/ # Roast message pools
|
|
319
|
+
├── report/ # Terminal + HTML rendering
|
|
504
320
|
├── types/ # Shared interfaces
|
|
505
321
|
└── utils/ # Shared helpers
|
|
506
322
|
```
|
|
507
323
|
|
|
324
|
+
---
|
|
325
|
+
|
|
508
326
|
## License
|
|
509
327
|
|
|
510
328
|
MIT
|
package/package.json
CHANGED