Code review: refactoring hot-spots report and spec#92
Open
IanMayo wants to merge 3 commits into
Open
Conversation
Conduct a code review of large/complex modules and produce a prioritized report of refactoring recommendations covering: tight UI/business-logic coupling, deeply nested logic, extractable child components, Lit-component candidates, and files over 400 lines. Deliverables under specs/012-code-review/: - code-review-report.md: prioritized hot-spot findings with file/line refs - spec.md: refactoring feature spec derived from the report - checklists/requirements.md: spec quality checklist Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TvXAFvUpR6jxvQYTofu4eG
Contributor
🚀 PR Preview Deployment✅ Your changes are being built and deployed to a preview environment. 📋 Live PR Preview Links: ℹ️ About PR Previews:
📦 Production Demo (main branch): 🧪 Testing Locally: npm install
npm run build
# Open demo/quiz-index.html in your browser (use file:// or http-server)This comment will be automatically updated when you push new commits. |
Unblocks the repo-wide format:check, which was failing on this file (already broken on main) independently of this PR's documentation changes. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TvXAFvUpR6jxvQYTofu4eG
Phase 0/1 planning output for the code-review refactoring feature: - plan.md: technical context, constitution check (PASS), module map - research.md: 7 refactoring-strategy decisions (D1-D7) - data-model.md: no persisted changes; module responsibility map - contracts/module-boundaries.md: internal interfaces for extracted units - quickstart.md: TDD per-slice workflow and 5-wave sequencing Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TvXAFvUpR6jxvQYTofu4eG
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Conducts the requested code review of large/complex modules and produces a prioritized report of refactoring recommendations, plus a Spec Kit feature spec derived from it.
Findings cover all five requested hot-spot criteria:
Deliverables (
specs/012-code-review/)code-review-report.md— the primary deliverable: prioritized findings (HIGH/MEDIUM/LOW) with concrete file/line references and extraction recommendations, plus cross-cutting themes and a lowest-risk → highest-payoff sequencing.spec.md— feature spec turning the report into independently shippable refactoring slices (ready for/speckit.plan).checklists/requirements.md— spec quality checklist (all items pass).Headline findings
qd-login.ts(983) — component is the entire auth/PIN/migration pipeline; ~100-line duplicated retry methodquiz-table.ts(807) — persistence + DOM + instructor overlay fused;innerHTMLXSS risk on student dataindexeddb.ts(759) — one class doing connection, migration, encryption, backups, audit log; ~150 lines of boilerplateanalysis-table.ts(637) — pure logic + inline-CSS rendering embedded in DOM enhancerbootstrap.ts(490) — "god bootstrap"; security-sensitive answer-reveal logic duplicated withevent-coordinator.tsqd-migration-dialog.ts(519),session.ts(443),event-coordinator.ts(339),qd-instructor.ts(380),qd-pin-reset-dialog.ts(389)Most impactful cross-cutting fixes: the quiz-overlay XSS, the duplicated instructor answer-reveal logic, duplicated SHA-256 password hashing, and config reads that bypass the existing
readDOMConfig()service.Notes
🤖 Generated with Claude Code
https://claude.ai/code/session_01TvXAFvUpR6jxvQYTofu4eG
Generated by Claude Code