Files
ForgeFlow/reports/architecture-audit.md
T
NuklearRabbitandClaude Opus 5 5cecaa080d fix: stop a large diff and a second SSH error from taking the app down
Two failure modes that only show up under conditions the tests never reached.

renderDiff built one span per diff line with no bound. A regenerated lock file
is an ordinary change: 50,000 lines produce 4 MB of markup and 50,000 elements
that then have to be parsed and laid out inside the full shell replacement, and
200,000 lines produce 16 MB. The rendered view now stops at 2,000 lines and says
how many were left out; ui.diff keeps the whole change, so Copy diff, the editor
and hunk staging are unaffected. The line scan also runs once now instead of
three times.

withClient registered the connection error handler with once(). A connection
that fails and then emits a second error while it is being torn down - a reset
during client.end() is the ordinary case - leaves that event unhandled, and an
unhandled 'error' on an EventEmitter reaches the uncaughtException handler,
which calls app.exit(1). The handler stays attached and ignores anything after
the first failure.

Both are covered by tests that were confirmed to fail without the fix, together
with the SSH paths that had none: host key mismatch reporting, the trusted
fingerprint requirement for exec and upload, and remote upload path validation.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-23 14:44:33 +02:00

1.4 KiB

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.

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

Files above 1,000 lines

File Lines Decisions Functions IPC handlers Responsibilities
No findings.

Cyclomatic hotspots

File Lines Decisions Functions IPC handlers Responsibilities
src/renderer/actions/shell.js 518 101 86 0 inventory, deployment, git, renderer, updates
src/renderer/app.js 732 80 124 0 inventory, deployment, git, renderer, security, updates
src/main/server-inventory.cjs 578 89 104 0 inventory, deployment, git, security, updates
src/main/git-service.cjs 687 111 118 0 git, security
src/main/unraid-inventory-methods.cjs 708 76 93 0 inventory, deployment, git, security, updates

Interpretation

Files above 750 lines require decomposition. Files above 1,000 lines are release blockers unless a concrete technical exception is documented. Mixed responsibility and IPC hotspot lists are available in the JSON report.