Repository navigation
Conversation
- Delete leftover commented-out header-row placeholders in klassAttendanceReport.ts (unused formatTime import too, only referenced from the removed comment). - Delete an abandoned commented-out @manytoone relation in StudentByYear.entity.ts (view entity - relation never worked and nothing references it), plus its now-unused typeorm imports. - Remove unused typeorm/entity imports in AttReportAndGrade.entity.ts, LessonKlassName.entity.ts, TeacherGradeReportStatus.entity.ts, TeacherReportStatus.entity.ts, and User.entity.ts (verified via `tsc --noUnusedLocals`, each confirmed unused by grep). - Remove unused imports IsUniqueCombination (AbsenceType.entity.ts), fillDefaultYearValue (ReportGroupSession.entity.ts), AttGradeEffect (student-percent-report.config.ts), Any (studentReportData.util.ts), ReportGroupSession (lessonSignaturePdfReport.tsx). - Drop unused destructured locals: userId in teacherReportFile.ts, emptyCellStyle/key in studentReportCardReact.tsx, id/entityName in lessonSignaturePdfReport.tsx. No behavior change - all findings verified unused via grep and a tsc --noUnusedLocals --noUnusedParameters pass; server test suite (118 suites / 1034 tests) passes before and after. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013ogK8XQU9EwAhU3KcbCUMB
There was a problem hiding this comment.
🟢 Approval recommended
The changes are limited to verified dead-code cleanup, with successful type-checking and tests; remaining feedback is minor.
Pull request overview
This PR removes verified dead code and unused imports across server/src without changing APIs or schemas.
Changes:
- Removes obsolete commented-out code.
- Removes unused imports and locals.
- Simplifies attendance report construction.
- Server type-checking and 118 test suites passed.
File summaries
| File | Summary |
|---|---|
server/src/utils/studentReportData.util.ts |
Removes unused import. |
server/src/reports/teacherReportFile.ts |
Removes unused local. |
server/src/reports/studentReportCardReact.tsx |
Removes unused destructured values. |
server/src/reports/lessonSignaturePdfReport.tsx |
Removes unused import and locals. |
server/src/reports/klassAttendanceReport.ts |
Removes dead header code and import. |
server/src/entity-modules/student-percent-report.config.ts |
Removes unused import. |
server/src/db/view-entities/TeacherReportStatus.entity.ts |
Removes unused imports. |
server/src/db/view-entities/TeacherGradeReportStatus.entity.ts |
Removes unused imports. |
server/src/db/view-entities/StudentByYear.entity.ts |
Removes obsolete relation comments and imports. |
server/src/db/view-entities/LessonKlassName.entity.ts |
Removes unused imports. |
server/src/db/view-entities/AttReportAndGrade.entity.ts |
Removes unused imports. |
server/src/db/entities/User.entity.ts |
Removes unused relation imports. |
server/src/db/entities/ReportGroupSession.entity.ts |
Removes unused import. |
server/src/db/entities/AbsenceType.entity.ts |
Removes unused validator import. |
Review details
- Files reviewed: 14/14 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| @@ -702,7 +701,6 @@ interface StudentRecordsTableProps { | |||
| const StudentRecordsTable: React.FC<StudentRecordsTableProps> = ({ | |||
| studentRecords, | |||
| entityConfig, | |||
| `; | ||
|
|
||
| const { fullCellStyle, rightAlignFullCellStyle, emptyCellStyle } = useCellStyles(); | ||
| const { fullCellStyle, rightAlignFullCellStyle } = useCellStyles(); |
- lessonSignaturePdfReport.tsx: StudentRecordsTable no longer reads entityName, but the prop stayed required in its interface and both call sites still passed it. Removed the dead prop end-to-end. - studentReportCardReact.tsx: useCellStyles() still built and returned emptyCellStyle even though its only consumer stopped destructuring it. Removed the now-unused style. Addresses Copilot review comments on PR #187. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013ogK8XQU9EwAhU3KcbCUMB
Owner
Author
|
נסגר ככפילות: כל השינויים כאן כלולים ב-#178 (tech-debt cleanup רחב יותר, 51 קבצים). |
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.
What changed
Small, conservative dead-code cleanup in
server/src, found viagrep(to confirm each symbol was truly unused) and atsc --noUnusedLocals --noUnusedParameterspass:Dead commented-out code
klassAttendanceReport.ts: removed leftover commented-out header-row variables/entries (hoursRow,topicRow,lessonCountRow,teacherRow,separatorRow) from an earlier table layout; also dropped the now-unusedformatTimeimport (it was only referenced from the removed comment).StudentByYear.entity.ts: removed an abandoned commented-out@ManyToOne/@JoinColumnrelation. Unlike the similar-looking pattern inUser.entity.ts(which I left alone — those commented decorators keep typed fields that other entities' inverse relations actually reference), nothing in the codebase references a.studentrelation offStudentByYear, so this one was genuinely dead.Unused imports (verified unused via grep, each file's raw-SQL/query-builder view expression doesn't touch them):
AttReportAndGrade.entity.ts,LessonKlassName.entity.ts,TeacherGradeReportStatus.entity.ts,TeacherReportStatus.entity.ts,User.entity.ts(Klass,Lesson,StudentKlass,OneToMany),AbsenceType.entity.ts(IsUniqueCombination),ReportGroupSession.entity.ts(fillDefaultYearValue),student-percent-report.config.ts(AttGradeEffect),studentReportData.util.ts(Any),lessonSignaturePdfReport.tsx(ReportGroupSession).Unused destructured locals:
userIdinteacherReportFile.ts(code already usesparams.userIdinstead),emptyCellStyle/keyinstudentReportCardReact.tsx,id/entityNameinlessonSignaturePdfReport.tsx.What I deliberately left alone
CrudRequest<any, any>and similar framework-genericanyusage — consistent, intentional pattern across every entity-module config; narrowing it would require guessing per-entity DTO shapes.approvedAbsCount/sheetNameexport-header entries inatt-report.config.ts/att-report-with-report-month.config.ts— mirrored by matching commented<NumberField>s in the client entities, so this reads as a deliberate "hide column, keep for later" pattern rather than accidental leftovers.gradeAvg/lessonsCountunused destructure inmichlolPopulatedFile.ts— guarded by an explicit// TODO add param here to use lastGrade or gradeAvgcomment.entityColumns,importFields,filter) — required to match base-class/interface method signatures by position.migrations/— dozens of historical migration files have an unuseddbNamelocal, but rewriting one-time DB scripts wholesale isn't a "surgical" change, so left untouched.client/andclient/shared/server/shared(out of scope per instructions; not touched).Verification
tsc --noEmit(server): clean.yarn test(server): 118 suites / 1034 tests passed, both before and after these changes.🤖 Generated with Claude Code
https://claude.ai/code/session_013ogK8XQU9EwAhU3KcbCUMB
Generated by Claude Code