Repository navigation
chore: remove stale dead code in reports and student-by-year config - #194
Merged
Merged
Conversation
- 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
There was a problem hiding this comment.
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
formatTimeimport. - 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.
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.
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 unusedhoursRow/topicRow/lessonCountRow/teacherRow/separatorRowblock, commented out with no explanation and never referenced by live code, plus theformatTimeimport 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)
console.logcalls insrc/reports/*— look like deliberate debug logging, not dead code; removing them is a behavior/logging change, not a cleanup.any/as anyusage inattendance-cleanup-rule.config.ts,student-by-year.config.ts,student-percent-report.config.ts— used to bypass typing for a dynamically-added.headersproperty; the correct type is ambiguous without touching shared report interfaces across many call sites.lessonSignaturePdfReport.tsx,homeContent.js,settingsUtil.js, etc. — these are legitimate explanatory comments, not dead/stale code.server/sharedandclient/sharedsubmodules — untouched (not part of this commit; a pre-existing local diff insideserver/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 eslinton the 3 touched files: no new errors introduced; theformatTimeunused-import warning present before this change is now resolved. Remaining lint findings instudentReportData.util.ts(varusage, 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