Skip to content

Chore: Remove dead code and unnecessary comments #18

@fred-maina

Description

@fred-maina

Description

The codebase contains several instances of commented-out code, "TODO" style comments, and debug-level logs that should be cleaned up. This "code rot" adds noise and confusion for new developers.

Examples found:

  • k8s/deployment.yaml: Entire livenessProbe and readinessProbe sections (this is a separate issue, but it's part of the cleanup).
  • JwtAuthenticationFilter.java: Has logic for a "reset-password" action that appears to be unimplemented and is a potential security hole if left in.
  • AuthService.java: // log.error(response.toString()); // log.info or log.debug...
  • ChatWebSocketHandler.java: log.info("extracted from cookies"); (This is a debug log, not info).
  • ChatController.java: // Not used in current methods, but good for future (This should be removed or made a TODO).
  • ChatService.java: // Placeholder (for avatar).

Acceptance Criteria

  1. Remove the dead "reset-password" logic from JwtAuthenticationFilter.java. This logic is not implemented and exposes an unused security check.
  2. Remove all commented-out code that is not an explanatory comment (e.g., the probes in deployment.yaml should be handled by the probe-feature issue, but other instances should be deleted).
  3. Review all // comments. If they are obsolete or just "noise" (like // Log the exception e), remove them.
  4. Review log levels. log.info messages that are only useful for debugging (like log.info("extracted form cookies")) should be changed to log.debug.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions