Skip to content

Remove dead code: commented telemetry calls and unused log decoration#19

Merged
Hexagon merged 3 commits intomainfrom
copilot/review-dead-duplicated-code
Nov 9, 2025
Merged

Remove dead code: commented telemetry calls and unused log decoration#19
Hexagon merged 3 commits intomainfrom
copilot/review-dead-duplicated-code

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Nov 9, 2025

Review project for dead or duplicated code

Completed ✅

  • Remove commented-out dead code from scheduler jobs (14 lines across 5 files)
    • backend/scheduler/jobs/daily.currencyupdate.ts (2 commented lines removed)
    • backend/scheduler/jobs/daily.priceupdate.ts (2 commented lines removed)
    • backend/scheduler/jobs/daily.outageupdate.ts (2 commented lines removed)
    • backend/scheduler/jobs/hourly.consumptionupdate.ts (4 commented lines + 1 dead log removed)
    • backend/scheduler/jobs/hourly.productionupdate.ts (4 commented lines removed)
  • Remove dead code from utils/log.ts (hardcoded false constant with dead if branch)
  • Verify no other dead code exists in the codebase
  • Changes verified
  • Fix pre-commit formatting checks

Summary

Successfully reviewed the entire codebase for dead and duplicated code. Removed 23 lines of dead code:

Dead Code Removed:

  1. 14 commented-out lines: Removed commented-out tm.emit() calls for "spotweb-main-2" and "spotweb-main-3" processes across all scheduler job files
  2. 7 lines from utils/log.ts: Removed unused decorate constant and dead conditional branch
  3. 2 lines: Removed inconsistent log message from hourly.consumptionupdate.ts

Formatting Fixed:

  • Applied deno fmt to fix indentation, quotes, trailing whitespace, and export ordering
  • All files now pass deno fmt --check

Duplicated Code Analysis:

While some code patterns are repeated across chart components (e.g., annotation code for the "now" marker), these are intentional duplications in separate components and don't constitute problematic dead code. Refactoring these would be a separate enhancement task beyond the scope of this review.

Verification:

  • ✅ No dead imports or exports found
  • ✅ No unreachable code found
  • ✅ No unused functions found
  • ✅ No backup or temporary files found
  • ✅ All exported functions are actively used
  • ✅ Build artifacts (dist/) are intentionally tracked in git for deployment
  • ✅ Code formatting checks pass
Original prompt

Review the project on dead or duplicated code


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: Hexagon <419737+Hexagon@users.noreply.github.com>
Copilot AI changed the title [WIP] Review project for dead or duplicated code Remove dead code: commented telemetry calls and unused log decoration Nov 9, 2025
Copilot AI requested a review from Hexagon November 9, 2025 23:12
@Hexagon
Copy link
Copy Markdown
Owner

Hexagon commented Nov 9, 2025

@copilot fix pre commit checks (formatting etc)

Co-authored-by: Hexagon <419737+Hexagon@users.noreply.github.com>
@Hexagon Hexagon marked this pull request as ready for review November 9, 2025 23:17
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Nov 9, 2025

@copilot fix pre commit checks (formatting etc)

Fixed formatting issues. Applied deno fmt to fix indentation, quotes, trailing whitespace, and export ordering across 8 files. All formatting checks now pass. (0b003f1)

@Hexagon Hexagon merged commit 2dcc8cc into main Nov 9, 2025
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.

2 participants