refactor(renderer): move diff rendering into its own module
views.js sat at the project's 750-line limit, so the diff cap in the previous commit pushed it over and every further change would have meant shaving comments elsewhere. That is the file asking for decomposition, which is what the architecture audit says to do. Diff rendering is self-contained: the line cap, the line classifier and the change-map illustration depend on nothing in views.js beyond ui and escapeHtml. They now live in src/renderer/diff-view.js and are registered in index.html and in the three renderer file lists that scan the bridge surface, so anything added there is covered by the existing contract tests. views.js drops from 755 to 714 lines and no source file exceeds 750 again. The nested ternary that classified a diff line became a named function with guard clauses on the way. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
5cecaa080d
commit
d77643c058
@@ -1,27 +1,10 @@
|
||||
{
|
||||
"generatedAt": "2026-08-23T12:44:33.101Z",
|
||||
"generatedAt": "2026-08-23T12:51:31.496Z",
|
||||
"thresholds": {
|
||||
"preferredMaximumLines": 750,
|
||||
"justificationRequiredLines": 1000
|
||||
},
|
||||
"over750": [
|
||||
{
|
||||
"file": "src/renderer/views.js",
|
||||
"lines": 759,
|
||||
"branches": 57,
|
||||
"functions": 159,
|
||||
"ipcHandlers": 0,
|
||||
"responsibilities": [
|
||||
"inventory",
|
||||
"deployment",
|
||||
"git",
|
||||
"renderer",
|
||||
"security",
|
||||
"updates"
|
||||
],
|
||||
"hotspotScore": 97
|
||||
}
|
||||
],
|
||||
"over750": [],
|
||||
"over1000": [],
|
||||
"cyclomaticHotspots": [
|
||||
{
|
||||
@@ -193,9 +176,9 @@
|
||||
},
|
||||
{
|
||||
"file": "src/renderer/views.js",
|
||||
"lines": 759,
|
||||
"branches": 57,
|
||||
"functions": 159,
|
||||
"lines": 715,
|
||||
"branches": 53,
|
||||
"functions": 152,
|
||||
"ipcHandlers": 0,
|
||||
"responsibilities": [
|
||||
"inventory",
|
||||
@@ -205,7 +188,7 @@
|
||||
"security",
|
||||
"updates"
|
||||
],
|
||||
"hotspotScore": 97
|
||||
"hotspotScore": 93
|
||||
},
|
||||
{
|
||||
"file": "src/main/ipc.cjs",
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
# ForgeFlow architecture audit
|
||||
|
||||
Generated 2026-08-23T12:44:33.101Z. Complexity is a deterministic decision-point count used for hotspot ranking, not a claim of exact McCabe complexity.
|
||||
Generated 2026-08-23T12:51:31.496Z. Complexity is a deterministic decision-point count used for hotspot ranking, not a claim of exact McCabe complexity.
|
||||
|
||||
## Files above 750 lines
|
||||
|
||||
| File | Lines | Decisions | Functions | IPC handlers | Responsibilities |
|
||||
|---|---:|---:|---:|---:|---|
|
||||
| `src/renderer/views.js` | 759 | 57 | 159 | 0 | inventory, deployment, git, renderer, security, updates |
|
||||
No findings.
|
||||
|
||||
## Files above 1,000 lines
|
||||
|
||||
|
||||
Reference in New Issue
Block a user