Skip to content

chore: remove stale dead code in reports and student-by-year config - #194

Merged
buzz-code merged 1 commit into
mainfrom
refactor/tech-debt-cleanup
Sep 22, 2026
Merged

buzz-code merged 1 commit into
mainfrom
refactor/tech-debt-cleanup

Conversation

@buzz-code

Copy link
Copy Markdown
Owner

Conservative tech-debt cleanup pass. Only removed inert, clearly-stale commented-out code — no behavior change, no API changes.

Changes

  • server/src/reports/klassAttendanceReport.ts: removed the unused hoursRow/topicRow/lessonCountRow/teacherRow/separatorRow block, commented out with no explanation and never referenced by live code, plus the formatTime import that was only used inside that dead code (now flagged as unused by eslint — this fix clears that warning).
  • server/src/entity-modules/student-by-year.config.ts: removed a stale commented-out early-return (if (item.absCount === 0) return;) with no explanation for why it's disabled.
  • server/src/utils/studentReportData.util.ts: removed a single dead commented-out line (// if (grade === 0) return '0%';) already superseded by the very next line (if (!grade) return '';).

What I checked but did NOT change (explicitly out of scope / too risky)

  • Numerous console.log calls in src/reports/* — look like deliberate debug logging, not dead code; removing them is a behavior/logging change, not a cleanup.
  • any/as any usage in attendance-cleanup-rule.config.ts, student-by-year.config.ts, student-percent-report.config.ts — used to bypass typing for a dynamically-added .headers property; the correct type is ambiguous without touching shared report interfaces across many call sites.
  • Comment blocks in lessonSignaturePdfReport.tsx, homeContent.js, settingsUtil.js, etc. — these are legitimate explanatory comments, not dead/stale code.
  • server/shared and client/shared submodules — untouched (not part of this commit; a pre-existing local diff inside server/shared's working tree from before this session was left alone and never staged).

Test results

  • cd server && yarn test: 118 suites / 1038 tests passed (before and after the change).
  • cd client && yarn test: 34/35 suites passed (1 pre-existing skip), 214/215 tests passed (baseline, unaffected by this change since no client files were touched).
  • npx eslint on the 3 touched files: no new errors introduced; the formatTime unused-import warning present before this change is now resolved. Remaining lint findings in studentReportData.util.ts (var usage, some prettier formatting) are pre-existing and unrelated to this diff.

🤖 Generated with Claude Code

https://claude.ai/code/session_01VwgtFx4bsoC4bS1Mw2jBms


Generated by Claude Code

- klassAttendanceReport.ts: drop unused hoursRow/topicRow/lessonCountRow/
  teacherRow/separatorRow, commented out with no explanation, plus the
  now-unused formatTime import they were the only caller of
- student-by-year.config.ts: drop a stale commented-out early return with
  no explanation
- studentReportData.util.ts: drop a dead commented-out line already
  superseded by the following if statement

No behavior change; all three are inert comments/imports.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VwgtFx4bsoC4bS1Mw2jBms
Copilot AI lite review requested due to automatic review settings September 19, 2026 06:30

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

Changes are limited to inert comments and an unused import, with no behavior changes identified.

Review effort: Lite
Findings: None

What changed in this PR

Removes stale commented-out code and its now-unused import without changing runtime behavior.

Changes:

  • Removed dead attendance report rows and formatTime import.
  • Removed stale commented-out logic from student-by-year and grade display code.
  • Tests remain covered per PR description.
File Description
server/​src/​reports/​klassAttendanceReport.ts Removes unused commented rows and import.
server/​src/​entity-modules/​student-by-year.config.ts Removes stale commented early return.
server/​src/​utils/​studentReportData.util.ts Removes superseded commented condition.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@buzz-code
buzz-code merged commit 0ef2a61 into main Sep 22, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants