pi-lens 1.3.13 → 1.3.14
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/index.ts +44 -3
- package/package.json +1 -1
package/index.ts
CHANGED
|
@@ -217,10 +217,10 @@ export default function (pi: ExtensionAPI) {
|
|
|
217
217
|
|
|
218
218
|
pi.registerCommand("lens-booboo", {
|
|
219
219
|
description:
|
|
220
|
-
"
|
|
220
|
+
"Full codebase review: design smells, complexity, AI slop detection, TODOs, dead code, duplicates, type coverage. Usage: /lens-booboo [path]",
|
|
221
221
|
handler: async (args, ctx) => {
|
|
222
222
|
const targetPath = args.trim() || ctx.cwd || process.cwd();
|
|
223
|
-
ctx.ui.notify("🔍 Running
|
|
223
|
+
ctx.ui.notify("🔍 Running full codebase review...", "info");
|
|
224
224
|
|
|
225
225
|
const parts: string[] = [];
|
|
226
226
|
|
|
@@ -304,8 +304,9 @@ export default function (pi: ExtensionAPI) {
|
|
|
304
304
|
}
|
|
305
305
|
}
|
|
306
306
|
|
|
307
|
-
// Part 3: Complexity metrics
|
|
307
|
+
// Part 3: Complexity metrics + AI slop detection
|
|
308
308
|
const results: import("./clients/complexity-client.js").FileComplexity[] = [];
|
|
309
|
+
const aiSlopIssues: string[] = [];
|
|
309
310
|
|
|
310
311
|
const scanDir = (dir: string) => {
|
|
311
312
|
if (!require("node:fs").existsSync(dir)) return;
|
|
@@ -320,6 +321,15 @@ export default function (pi: ExtensionAPI) {
|
|
|
320
321
|
const metrics = complexityClient.analyzeFile(fullPath);
|
|
321
322
|
if (metrics) {
|
|
322
323
|
results.push(metrics);
|
|
324
|
+
|
|
325
|
+
// Check AI slop indicators per file
|
|
326
|
+
const warnings = complexityClient.checkThresholds(metrics);
|
|
327
|
+
if (warnings.length > 0) {
|
|
328
|
+
aiSlopIssues.push(` ${metrics.filePath}:`);
|
|
329
|
+
for (const w of warnings) {
|
|
330
|
+
aiSlopIssues.push(` ⚠ ${w}`);
|
|
331
|
+
}
|
|
332
|
+
}
|
|
323
333
|
}
|
|
324
334
|
}
|
|
325
335
|
}
|
|
@@ -355,9 +365,40 @@ export default function (pi: ExtensionAPI) {
|
|
|
355
365
|
if (highCognitive.length > 5) summary += ` ... and ${highCognitive.length - 5} more\n`;
|
|
356
366
|
}
|
|
357
367
|
|
|
368
|
+
// Add AI slop issues
|
|
369
|
+
if (aiSlopIssues.length > 0) {
|
|
370
|
+
summary += `\n[AI Slop Indicators]\n${aiSlopIssues.join("\n")}`;
|
|
371
|
+
}
|
|
372
|
+
|
|
358
373
|
parts.push(summary);
|
|
359
374
|
}
|
|
360
375
|
|
|
376
|
+
// Part 4: TODOs scan
|
|
377
|
+
const todoResult = todoScanner.scanDirectory(targetPath);
|
|
378
|
+
const todoReport = todoScanner.formatResult(todoResult);
|
|
379
|
+
if (todoReport) parts.push(todoReport);
|
|
380
|
+
|
|
381
|
+
// Part 5: Dead code (knip)
|
|
382
|
+
if (knipClient.isAvailable()) {
|
|
383
|
+
const knipResult = knipClient.analyze(targetPath);
|
|
384
|
+
const knipReport = knipClient.formatResult(knipResult);
|
|
385
|
+
if (knipReport) parts.push(knipReport);
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
// Part 6: Code duplication
|
|
389
|
+
if (jscpdClient.isAvailable()) {
|
|
390
|
+
const jscpdResult = jscpdClient.scan(targetPath);
|
|
391
|
+
const jscpdReport = jscpdClient.formatResult(jscpdResult);
|
|
392
|
+
if (jscpdReport) parts.push(jscpdReport);
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
// Part 7: Type coverage
|
|
396
|
+
if (typeCoverageClient.isAvailable()) {
|
|
397
|
+
const tcResult = typeCoverageClient.scan(targetPath);
|
|
398
|
+
const tcReport = typeCoverageClient.formatResult(tcResult);
|
|
399
|
+
if (tcReport) parts.push(tcReport);
|
|
400
|
+
}
|
|
401
|
+
|
|
361
402
|
if (parts.length === 0) {
|
|
362
403
|
ctx.ui.notify("✓ Code review clean", "info");
|
|
363
404
|
} else {
|
package/package.json
CHANGED