Skip to content

Dead code cleanup: -381 lines, fix auth bug, extract shared concern#107

Merged
frogr merged 1 commit intomainfrom
hermes/dead-code-cleanup
Mar 17, 2026
Merged

Dead code cleanup: -381 lines, fix auth bug, extract shared concern#107
frogr merged 1 commit intomainfrom
hermes/dead-code-cleanup

Conversation

@frogr
Copy link
Copy Markdown
Owner

@frogr frogr commented Mar 17, 2026

What

Dead code removal and DRY extraction from codebase audit. @frogr

Deleted (10 files, -381 lines)

File Why
HttpBasicAuthenticable concern Never included by any controller
/movement-demo route + test No controller or view existed (would 500)
PWA views (manifest, service-worker) Routes commented out — unreachable
content_security_policy.rb Entirely commented out
react_server_rendering.rb Referenced non-existent server_rendering.js
blog.rake Duplicate of blog_posts.rake
convert_images.rake Target directory doesn't exist
ScrollbarStyles.jsx Never imported
DebugPanel.jsx Never imported

Fixes

Auth bug: BriefingsController was inheriting from ApplicationController instead of Api::V1::BaseController, bypassing API authentication while living in the API namespace.

DRY: Extracted format_money into MoneyFormattable concern — was copy-pasted in 3 places (Invoice model, InvoicePdfService, InvoicesHelper).

Verified

  • bundle exec rubocop — 208 files, 0 offenses
  • bin/rails test — 109 tests, 0 failures

Deleted (10 files):
- HttpBasicAuthenticable concern (never included)
- movement_demo route + orphan test (no controller existed)
- PWA views (routes commented out)
- content_security_policy.rb (entirely commented out)
- react_server_rendering.rb (referenced non-existent asset)
- blog.rake (duplicate of blog_posts.rake)
- convert_images.rake (target directory doesn't exist)
- ScrollbarStyles.jsx (never imported)
- DebugPanel.jsx (never imported)

Fixes:
- BriefingsController now inherits Api::V1::BaseController (was bypassing API auth)
- Extracted format_money into MoneyFormattable concern (was duplicated 3x)

109 tests, 0 failures. Rubocop clean.
@frogr frogr merged commit 3a64a49 into main Mar 17, 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.

1 participant