claude-crap 0.4.6 → 0.4.7
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/CHANGELOG.md +25 -0
- package/dist/dashboard/file-detail.d.ts +6 -0
- package/dist/dashboard/file-detail.d.ts.map +1 -1
- package/dist/dashboard/file-detail.js +1 -0
- package/dist/dashboard/file-detail.js.map +1 -1
- package/dist/shared/exclusions.d.ts.map +1 -1
- package/dist/shared/exclusions.js +10 -0
- package/dist/shared/exclusions.js.map +1 -1
- package/package.json +1 -1
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/bundle/dashboard/public/index.html +216 -7
- package/plugin/bundle/mcp-server.mjs +18 -0
- package/plugin/bundle/mcp-server.mjs.map +2 -2
- package/plugin/hooks/lib/quality-gate.mjs +3 -0
- package/src/dashboard/file-detail.ts +7 -0
- package/src/dashboard/public/index.html +216 -7
- package/src/shared/exclusions.ts +11 -0
- package/src/tests/exclusions.test.ts +34 -0
- package/src/tests/file-detail-api.test.ts +38 -0
- package/src/tests/workspace-walker.test.ts +30 -0
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,31 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.4.7] - 2026-04-18
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- **Coverage-report bundles leaking into the complexity scanner.** The
|
|
13
|
+
shared exclusion list skipped `coverage/` but not the generated
|
|
14
|
+
report bundles produced *next to* it (ReportGenerator writes to
|
|
15
|
+
`coverage-report/`, `dotnet test` emits `TestResults/`, Istanbul
|
|
16
|
+
emits `lcov-report/`, coverage.py emits `htmlcov/`). On a real-world
|
|
17
|
+
.NET workspace the dashboard flagged
|
|
18
|
+
`GanttLite.Server/coverage-report/main.js` as the single hottest
|
|
19
|
+
file with four CC-80+ errors, all coming from the minified
|
|
20
|
+
auto-generated `main.js` / `class.js` bundles — inflating Reliability
|
|
21
|
+
from A to D on a codebase whose real source was clean. Seven
|
|
22
|
+
canonical coverage-report directory names are now excluded at every
|
|
23
|
+
walker layer (`coverage-report`, `CoverageReport`, `coveragereport`,
|
|
24
|
+
`TestResults`, `cobertura`, `lcov-report`, `htmlcov`). Covered by
|
|
25
|
+
new characterization tests in `src/tests/exclusions.test.ts` and
|
|
26
|
+
`src/tests/workspace-walker.test.ts` that pin both the filter
|
|
27
|
+
predicate and the end-to-end walker behavior. The hooks twin
|
|
28
|
+
(`plugin/hooks/lib/quality-gate.mjs`) was updated in the same
|
|
29
|
+
commit so the Stop-gate LOC walker stays consistent with the shared
|
|
30
|
+
filter. (`src/shared/exclusions.ts`,
|
|
31
|
+
`plugin/hooks/lib/quality-gate.mjs`.)
|
|
32
|
+
|
|
8
33
|
## [0.4.5] - 2026-04-13
|
|
9
34
|
|
|
10
35
|
### Fixed
|
|
@@ -49,6 +49,12 @@ export interface FileDetailSummary {
|
|
|
49
49
|
/** Full response payload for the file detail endpoint. */
|
|
50
50
|
export interface FileDetailResponse {
|
|
51
51
|
readonly filePath: string;
|
|
52
|
+
/**
|
|
53
|
+
* Absolute path on the host filesystem, already resolved through the
|
|
54
|
+
* workspace-traversal guard. The UI uses this to build editor
|
|
55
|
+
* deep-links (e.g. `vscode://file/{absolutePath}:{line}`).
|
|
56
|
+
*/
|
|
57
|
+
readonly absolutePath: string;
|
|
52
58
|
readonly language: SupportedLanguage | null;
|
|
53
59
|
readonly physicalLoc: number;
|
|
54
60
|
readonly logicalLoc: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-detail.d.ts","sourceRoot":"","sources":["../../src/dashboard/file-detail.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,EAA0B,KAAK,iBAAiB,EAAE,MAAM,2BAA2B,CA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EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,WAAW,EAAE,MAAM,EAAE,CAAC;IAC/B,QAAQ,CAAC,SAAS,EAAE,kBAAkB,EAAE,CAAC;IACzC,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,EAAE,CAAC;IACvC,QAAQ,CAAC,OAAO,EAAE,iBAAiB,CAAC;CACrC;AAED,iDAAiD;AACjD,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,SAAS,CAAC,EAAE,gBAAgB,GAAG,SAAS,CAAC;IAClD,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;IAChC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;CAChC;AAID;;;;;;GAMG;AACH,wBAAsB,eAAe,CACnC,KAAK,EAAE,oBAAoB,GAC1B,OAAO,CAAC,kBAAkB,CAAC,CAyG7B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-detail.js","sourceRoot":"","sources":["../../src/dashboard/file-detail.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAA0B,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"file-detail.js","sourceRoot":"","sources":["../../src/dashboard/file-detail.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAA0B,MAAM,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-1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exclusions.d.ts","sourceRoot":"","sources":["../../src/shared/exclusions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAMH;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,EAAE,WAAW,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"exclusions.d.ts","sourceRoot":"","sources":["../../src/shared/exclusions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAMH;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,EAAE,WAAW,CAAC,MAAM,CA6EhD,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,EAAE,aAAa,CAAC,MAAM,CAOvD,CAAC;AAIF;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,oEAAoE;IACpE,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;IACxC,qEAAqE;IACrE,cAAc,CAAC,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CACjE;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,qBAAqB,CACnC,cAAc,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,GACrC,eAAe,CA2CjB"}
|
|
@@ -34,6 +34,16 @@ export const DEFAULT_SKIP_DIRS = new Set([
|
|
|
34
34
|
"coverage",
|
|
35
35
|
"artifacts", // CI artefact staging, Maven
|
|
36
36
|
"publish", // `dotnet publish` output
|
|
37
|
+
// Test coverage report bundles (generated HTML/JS from coverage tools;
|
|
38
|
+
// walking them floods the complexity scanner with synthetic minified
|
|
39
|
+
// functions like `coverage-report/main.js::gG` at CC 80+).
|
|
40
|
+
"coverage-report", // ReportGenerator default (.NET)
|
|
41
|
+
"CoverageReport", // ReportGenerator PascalCase variant
|
|
42
|
+
"coveragereport", // ReportGenerator lowercase fallback
|
|
43
|
+
"TestResults", // `dotnet test` default output
|
|
44
|
+
"cobertura", // Cobertura XML reporter
|
|
45
|
+
"lcov-report", // Istanbul HTML reporter
|
|
46
|
+
"htmlcov", // coverage.py HTML output
|
|
37
47
|
// Desktop / mobile packaging outputs
|
|
38
48
|
"dist-electron", // Electron-builder
|
|
39
49
|
"release", // Electron-builder, Tauri
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exclusions.js","sourceRoot":"","sources":["../../src/shared/exclusions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,SAAS,MAAM,WAAW,CAAC;AAElC,mEAAmE;AAEnE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAwB,IAAI,GAAG,CAAC;IAC5D,mCAAmC;IACnC,cAAc;IACd,QAAQ;IAER,kBAAkB;IAClB,MAAM;IAEN,0BAA0B;IAC1B,MAAM;IACN,OAAO;IACP,QAAQ;IACR,KAAK;IACL,QAAQ;IACR,UAAU;IACV,WAAW,EAAK,6BAA6B;IAC7C,SAAS,EAAO,0BAA0B;IAE1C,qCAAqC;IACrC,eAAe,EAAC,mBAAmB;IACnC,SAAS,EAAO,0BAA0B;IAE1C,6DAA6D;IAC7D,KAAK;IACL,KAAK;IAEL,wCAAwC;IACxC,MAAM,EAAU,YAAY;IAC5B,aAAa,EAAG,QAAQ;IACxB,UAAU,EAAM,QAAQ;IAExB,0BAA0B;IAC1B,OAAO,EAAS,UAAU;IAC1B,OAAO,EAAS,SAAS;IACzB,SAAS,EAAO,SAAS;IACzB,SAAS,EAAO,SAAS;IACzB,aAAa,EAAG,YAAY;IAC5B,QAAQ,EAAQ,QAAQ;IACxB,UAAU,EAAM,UAAU;IAC1B,QAAQ,EAAQ,YAAY;IAC5B,eAAe,EAAC,SAAS;IACzB,OAAO,EAAS,sBAAsB;IAEtC,2BAA2B;IAC3B,OAAO;IACP,MAAM;IACN,aAAa;IACb,QAAQ;IACR,YAAY,EAAI,iBAAiB;IACjC,SAAS,EAAO,SAAS;IAEzB,YAAY;IACZ,OAAO;IAEP,k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,KAAK,CAAC;QACf,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://code.claude.com/schemas/plugin.json",
|
|
3
3
|
"name": "claude-crap",
|
|
4
|
-
"version": "0.4.
|
|
4
|
+
"version": "0.4.7",
|
|
5
5
|
"description": "Deterministic Quality Assurance plugin for Claude Code. Wraps every Write / Edit / Bash tool call with a PreToolUse gatekeeper, a PostToolUse verifier, and a Stop quality gate backed by CRAP index, Technical Debt Ratio, tree-sitter AST metrics, and SARIF 2.1.0 reports. Forbids the agent from writing functional code before a test safety net exists.",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Alan Hernandez",
|
|
@@ -317,6 +317,95 @@
|
|
|
317
317
|
opacity: 0.7;
|
|
318
318
|
margin-left: 12px;
|
|
319
319
|
}
|
|
320
|
+
/* CC heat bar — ReportGenerator-style visual severity */
|
|
321
|
+
.heat-bar {
|
|
322
|
+
position: relative;
|
|
323
|
+
width: 140px;
|
|
324
|
+
height: 8px;
|
|
325
|
+
background: rgba(255, 255, 255, 0.06);
|
|
326
|
+
border-radius: 4px;
|
|
327
|
+
overflow: hidden;
|
|
328
|
+
}
|
|
329
|
+
.heat-bar-fill {
|
|
330
|
+
height: 100%;
|
|
331
|
+
border-radius: 4px;
|
|
332
|
+
transition: width 120ms ease-out;
|
|
333
|
+
}
|
|
334
|
+
.heat-bar-threshold {
|
|
335
|
+
position: absolute;
|
|
336
|
+
top: -2px;
|
|
337
|
+
bottom: -2px;
|
|
338
|
+
width: 1px;
|
|
339
|
+
background: rgba(255, 255, 255, 0.35);
|
|
340
|
+
}
|
|
341
|
+
/* CC chip — numeric value + % of threshold */
|
|
342
|
+
.cc-chip {
|
|
343
|
+
display: inline-flex;
|
|
344
|
+
align-items: baseline;
|
|
345
|
+
gap: 6px;
|
|
346
|
+
font-variant-numeric: tabular-nums;
|
|
347
|
+
}
|
|
348
|
+
.cc-chip .cc-value {
|
|
349
|
+
font-weight: 700;
|
|
350
|
+
font-size: 13px;
|
|
351
|
+
}
|
|
352
|
+
.cc-chip .cc-ratio {
|
|
353
|
+
font-size: 11px;
|
|
354
|
+
color: var(--muted);
|
|
355
|
+
}
|
|
356
|
+
/* Method name button — scrolls source view to fn start line */
|
|
357
|
+
.method-jump {
|
|
358
|
+
background: none;
|
|
359
|
+
border: none;
|
|
360
|
+
padding: 0;
|
|
361
|
+
font: inherit;
|
|
362
|
+
font-family: "SF Mono", "Fira Code", "Consolas", monospace;
|
|
363
|
+
font-size: 13px;
|
|
364
|
+
color: var(--accent);
|
|
365
|
+
cursor: pointer;
|
|
366
|
+
}
|
|
367
|
+
.method-jump:hover { text-decoration: underline; }
|
|
368
|
+
/* "Open in editor" icon link */
|
|
369
|
+
.editor-link {
|
|
370
|
+
display: inline-flex;
|
|
371
|
+
align-items: center;
|
|
372
|
+
justify-content: center;
|
|
373
|
+
width: 24px;
|
|
374
|
+
height: 24px;
|
|
375
|
+
border-radius: 4px;
|
|
376
|
+
color: var(--muted);
|
|
377
|
+
text-decoration: none;
|
|
378
|
+
font-size: 13px;
|
|
379
|
+
transition: background 120ms, color 120ms;
|
|
380
|
+
}
|
|
381
|
+
.editor-link:hover {
|
|
382
|
+
background: rgba(62, 166, 255, 0.12);
|
|
383
|
+
color: var(--accent);
|
|
384
|
+
text-decoration: none;
|
|
385
|
+
}
|
|
386
|
+
/* "Show all / show fewer" toggle under the methods table */
|
|
387
|
+
.show-all-btn {
|
|
388
|
+
display: inline-block;
|
|
389
|
+
margin: 12px 0 0 0;
|
|
390
|
+
padding: 6px 12px;
|
|
391
|
+
background: transparent;
|
|
392
|
+
border: 1px solid var(--border);
|
|
393
|
+
border-radius: 6px;
|
|
394
|
+
color: var(--accent);
|
|
395
|
+
font-size: 12px;
|
|
396
|
+
cursor: pointer;
|
|
397
|
+
}
|
|
398
|
+
.show-all-btn:hover {
|
|
399
|
+
background: rgba(62, 166, 255, 0.08);
|
|
400
|
+
}
|
|
401
|
+
/* Line-flash animation when the user jumps to a source line */
|
|
402
|
+
.source-line.jump-target {
|
|
403
|
+
animation: jumpFlash 1.2s ease-out;
|
|
404
|
+
}
|
|
405
|
+
@keyframes jumpFlash {
|
|
406
|
+
0% { background: rgba(62, 166, 255, 0.35); }
|
|
407
|
+
100% { background: transparent; }
|
|
408
|
+
}
|
|
320
409
|
</style>
|
|
321
410
|
</head>
|
|
322
411
|
<body>
|
|
@@ -372,33 +461,74 @@
|
|
|
372
461
|
</div>
|
|
373
462
|
</div>
|
|
374
463
|
|
|
375
|
-
<!-- Methods table -->
|
|
376
|
-
<div v-if="fileDetail.functions.length" class="section-title">
|
|
464
|
+
<!-- Methods table — top-5 by CC with heat bar + jump + editor link -->
|
|
465
|
+
<div v-if="fileDetail.functions.length" class="section-title">
|
|
466
|
+
Methods
|
|
467
|
+
<span style="color: var(--muted); font-weight: 400; text-transform: none; letter-spacing: 0; margin-left: 8px;">
|
|
468
|
+
threshold CC {{ fileDetail.cyclomaticMax }}
|
|
469
|
+
</span>
|
|
470
|
+
</div>
|
|
377
471
|
<div v-if="fileDetail.functions.length" class="card">
|
|
378
472
|
<table>
|
|
379
473
|
<thead>
|
|
380
474
|
<tr>
|
|
381
475
|
<th>Method</th>
|
|
382
476
|
<th style="text-align: right">Line</th>
|
|
383
|
-
<th style="
|
|
477
|
+
<th style="width: 180px;">CC</th>
|
|
384
478
|
<th style="text-align: right">Lines</th>
|
|
385
479
|
<th>Status</th>
|
|
480
|
+
<th style="width: 32px;"></th>
|
|
386
481
|
</tr>
|
|
387
482
|
</thead>
|
|
388
483
|
<tbody>
|
|
389
|
-
<tr v-for="fn in
|
|
390
|
-
<td
|
|
484
|
+
<tr v-for="fn in visibleFunctions" :key="fn.startLine">
|
|
485
|
+
<td>
|
|
486
|
+
<button
|
|
487
|
+
class="method-jump"
|
|
488
|
+
@click="jumpToLine(fn.startLine)"
|
|
489
|
+
:title="'Jump to line ' + fn.startLine"
|
|
490
|
+
>{{ fn.name }}</button>
|
|
491
|
+
</td>
|
|
391
492
|
<td style="text-align: right; font-variant-numeric: tabular-nums;">{{ fn.startLine }}</td>
|
|
392
|
-
<td
|
|
493
|
+
<td>
|
|
494
|
+
<div class="cc-chip">
|
|
495
|
+
<div class="heat-bar" :title="ccTooltip(fn)">
|
|
496
|
+
<div
|
|
497
|
+
class="heat-bar-fill"
|
|
498
|
+
:style="heatBarStyle(fn)"
|
|
499
|
+
></div>
|
|
500
|
+
<div
|
|
501
|
+
class="heat-bar-threshold"
|
|
502
|
+
:style="{ left: thresholdMarker() + '%' }"
|
|
503
|
+
></div>
|
|
504
|
+
</div>
|
|
505
|
+
<span class="cc-value" :style="{ color: ccColor(fn) }">{{ fn.cyclomaticComplexity }}</span>
|
|
506
|
+
<span class="cc-ratio">{{ ccRatio(fn) }}%</span>
|
|
507
|
+
</div>
|
|
508
|
+
</td>
|
|
393
509
|
<td style="text-align: right; font-variant-numeric: tabular-nums;">{{ fn.lineCount }}</td>
|
|
394
510
|
<td>
|
|
395
511
|
<span v-if="fn.cyclomaticComplexity >= fileDetail.cyclomaticMax * 2" class="pill pill-error">error</span>
|
|
396
512
|
<span v-else-if="fn.cyclomaticComplexity > fileDetail.cyclomaticMax" class="pill pill-warning">warning</span>
|
|
397
513
|
<span v-else class="pill pill-note">ok</span>
|
|
398
514
|
</td>
|
|
515
|
+
<td>
|
|
516
|
+
<a
|
|
517
|
+
class="editor-link"
|
|
518
|
+
:href="editorLink(fn)"
|
|
519
|
+
:title="'Open ' + fileDetail.filePath + ':' + fn.startLine + ' in VS Code'"
|
|
520
|
+
>↗</a>
|
|
521
|
+
</td>
|
|
399
522
|
</tr>
|
|
400
523
|
</tbody>
|
|
401
524
|
</table>
|
|
525
|
+
<button
|
|
526
|
+
v-if="fileDetail.functions.length > topMethodsLimit"
|
|
527
|
+
class="show-all-btn"
|
|
528
|
+
@click="toggleShowAllMethods()"
|
|
529
|
+
>
|
|
530
|
+
{{ showAllMethods ? 'Show top ' + topMethodsLimit : 'Show all ' + fileDetail.functions.length + ' methods' }}
|
|
531
|
+
</button>
|
|
402
532
|
</div>
|
|
403
533
|
|
|
404
534
|
<!-- Findings table -->
|
|
@@ -622,11 +752,87 @@
|
|
|
622
752
|
});
|
|
623
753
|
|
|
624
754
|
// ── File detail computed ──
|
|
755
|
+
const topMethodsLimit = 5;
|
|
756
|
+
const showAllMethods = ref(false);
|
|
757
|
+
|
|
625
758
|
const sortedFunctions = computed(() => {
|
|
626
759
|
if (!fileDetail.value) return [];
|
|
627
760
|
return [...fileDetail.value.functions].sort((a, b) => b.cyclomaticComplexity - a.cyclomaticComplexity);
|
|
628
761
|
});
|
|
629
762
|
|
|
763
|
+
const visibleFunctions = computed(() => {
|
|
764
|
+
if (showAllMethods.value) return sortedFunctions.value;
|
|
765
|
+
return sortedFunctions.value.slice(0, topMethodsLimit);
|
|
766
|
+
});
|
|
767
|
+
|
|
768
|
+
function toggleShowAllMethods() {
|
|
769
|
+
showAllMethods.value = !showAllMethods.value;
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
// ── CC heat-bar helpers ──
|
|
773
|
+
// Fill width is clamped at 3× threshold so a CC of 80 with
|
|
774
|
+
// threshold 15 still produces a visually meaningful bar rather
|
|
775
|
+
// than overflowing. The threshold marker sits at the "1.0×"
|
|
776
|
+
// position (i.e. threshold/3threshold = 33%).
|
|
777
|
+
function ccRatio(fn) {
|
|
778
|
+
const max = fileDetail.value?.cyclomaticMax || 1;
|
|
779
|
+
return Math.round((fn.cyclomaticComplexity / max) * 100);
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
function heatBarStyle(fn) {
|
|
783
|
+
const max = fileDetail.value?.cyclomaticMax || 1;
|
|
784
|
+
const cap = max * 3;
|
|
785
|
+
const pct = Math.min(100, (fn.cyclomaticComplexity / cap) * 100);
|
|
786
|
+
return { width: pct + "%", background: ccColor(fn) };
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
function thresholdMarker() {
|
|
790
|
+
// threshold sits at 1/3 of the bar (since we cap at 3× threshold)
|
|
791
|
+
return 33.33;
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
function ccColor(fn) {
|
|
795
|
+
const max = fileDetail.value?.cyclomaticMax || 1;
|
|
796
|
+
const r = fn.cyclomaticComplexity / max;
|
|
797
|
+
if (r >= 2) return "var(--rating-E)"; // red — error (≥ 2×)
|
|
798
|
+
if (r > 1) return "var(--rating-C)"; // yellow — warning
|
|
799
|
+
if (r > 0.66) return "var(--rating-B)"; // yellow-green — near threshold
|
|
800
|
+
return "var(--rating-A)"; // green — healthy
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
function ccTooltip(fn) {
|
|
804
|
+
const max = fileDetail.value?.cyclomaticMax || 1;
|
|
805
|
+
return (
|
|
806
|
+
"CC " + fn.cyclomaticComplexity +
|
|
807
|
+
" / threshold " + max +
|
|
808
|
+
" (" + ccRatio(fn) + "% of threshold)"
|
|
809
|
+
);
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
// ── Editor deep-link + jump-to-line ──
|
|
813
|
+
// vscode:// handler accepts absolute paths. The `absolutePath`
|
|
814
|
+
// field is resolved server-side through the workspace-traversal
|
|
815
|
+
// guard, so this is safe to paste into an href.
|
|
816
|
+
function editorLink(fn) {
|
|
817
|
+
const abs = fileDetail.value?.absolutePath;
|
|
818
|
+
if (!abs) return "#";
|
|
819
|
+
return "vscode://file" + abs + ":" + fn.startLine + ":1";
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
function jumpToLine(lineNum) {
|
|
823
|
+
// Source lines are keyed by 0-based index, so line N lives at
|
|
824
|
+
// child index N-1 of `.source-view`.
|
|
825
|
+
const view = document.querySelector(".source-view");
|
|
826
|
+
if (!view) return;
|
|
827
|
+
const row = view.children[lineNum - 1];
|
|
828
|
+
if (!row) return;
|
|
829
|
+
row.scrollIntoView({ behavior: "smooth", block: "center" });
|
|
830
|
+
row.classList.remove("jump-target");
|
|
831
|
+
// force reflow so the animation restarts on repeat clicks
|
|
832
|
+
void row.offsetWidth;
|
|
833
|
+
row.classList.add("jump-target");
|
|
834
|
+
}
|
|
835
|
+
|
|
630
836
|
const sortedFindings = computed(() => {
|
|
631
837
|
if (!fileDetail.value) return [];
|
|
632
838
|
return [...fileDetail.value.findings].sort((a, b) => a.startLine - b.startLine);
|
|
@@ -777,7 +983,10 @@
|
|
|
777
983
|
currentView, selectedFile, fileDetail,
|
|
778
984
|
score, complexity, loading, error,
|
|
779
985
|
toolEntries, fileEntries, formatTimestamp,
|
|
780
|
-
sortedFunctions, sortedFindings,
|
|
986
|
+
sortedFunctions, sortedFindings, visibleFunctions,
|
|
987
|
+
showAllMethods, toggleShowAllMethods, topMethodsLimit,
|
|
988
|
+
ccRatio, ccColor, ccTooltip, heatBarStyle, thresholdMarker,
|
|
989
|
+
editorLink, jumpToLine,
|
|
781
990
|
navigateToFile, goBack,
|
|
782
991
|
lineFindings, lineClass, gutterClass, lineFnLabel,
|
|
783
992
|
};
|
|
@@ -7458,6 +7458,23 @@ var DEFAULT_SKIP_DIRS = /* @__PURE__ */ new Set([
|
|
|
7458
7458
|
// CI artefact staging, Maven
|
|
7459
7459
|
"publish",
|
|
7460
7460
|
// `dotnet publish` output
|
|
7461
|
+
// Test coverage report bundles (generated HTML/JS from coverage tools;
|
|
7462
|
+
// walking them floods the complexity scanner with synthetic minified
|
|
7463
|
+
// functions like `coverage-report/main.js::gG` at CC 80+).
|
|
7464
|
+
"coverage-report",
|
|
7465
|
+
// ReportGenerator default (.NET)
|
|
7466
|
+
"CoverageReport",
|
|
7467
|
+
// ReportGenerator PascalCase variant
|
|
7468
|
+
"coveragereport",
|
|
7469
|
+
// ReportGenerator lowercase fallback
|
|
7470
|
+
"TestResults",
|
|
7471
|
+
// `dotnet test` default output
|
|
7472
|
+
"cobertura",
|
|
7473
|
+
// Cobertura XML reporter
|
|
7474
|
+
"lcov-report",
|
|
7475
|
+
// Istanbul HTML reporter
|
|
7476
|
+
"htmlcov",
|
|
7477
|
+
// coverage.py HTML output
|
|
7461
7478
|
// Desktop / mobile packaging outputs
|
|
7462
7479
|
"dist-electron",
|
|
7463
7480
|
// Electron-builder
|
|
@@ -7835,6 +7852,7 @@ async function buildFileDetail(input) {
|
|
|
7835
7852
|
) / 100 : 0;
|
|
7836
7853
|
return {
|
|
7837
7854
|
filePath: relativePath,
|
|
7855
|
+
absolutePath,
|
|
7838
7856
|
language,
|
|
7839
7857
|
physicalLoc,
|
|
7840
7858
|
logicalLoc,
|