Skip to content

Conversation

Copy link

Copilot AI commented Dec 1, 2025

Cleanup of dead code, noisy comments, and incorrect log levels that add confusion for developers.

Changes

  • JwtAuthenticationFilter.java: Remove unimplemented reset-password action check—dead security logic that was never wired up

  • k8s/deployment.yaml: Remove commented-out livenessProbe and readinessProbe sections

  • ChatWebSocketHandler.java: Downgrade debug-only logs from log.info to log.debug

  • All Java files: Remove all unused trailing comments from 15 files across the codebase:

    • AuthController.java
    • JWTService.java
    • UserRepository.java
    • ChatMessage.java
    • ChatController.java
    • ChatWebSocketHandler.java
    • MessagingService.java
    • ChatService.java
    • WebSocketConfig.java
    • JacksonConfig.java
    • ChatMessageRepository.java
    • ChatMessageMapper.java
    • WebSocketMessagePayload.java
    • ChatMessageDto.java
    • ChatSessionDto.java
  • Fixes Chore: Remove dead code and unnecessary comments #18

Original prompt

This section details on the original issue you should resolve

<issue_title>Chore: Remove dead code and unnecessary comments</issue_title>
<issue_description>### 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.</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

- Remove unused reset-password logic from JwtAuthenticationFilter.java
- Remove commented-out livenessProbe and readinessProbe from deployment.yaml
- Remove noisy inline comments from ChatController.java
- Change debug-level logs from log.info to log.debug in ChatWebSocketHandler.java
- Remove placeholder comment from ChatService.java

Co-authored-by: fred-maina <150168105+fred-maina@users.noreply.github.com>
Copilot AI changed the title [WIP] Remove dead code and unnecessary comments Chore: Remove dead code and unnecessary comments Dec 1, 2025
Copilot AI requested a review from fred-maina December 1, 2025 12:33
Copy link
Owner

@fred-maina fred-maina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove all comments not being used

Remove trailing comments from:
- AuthController.java
- JWTService.java
- UserRepository.java
- ChatMessage.java
- ChatController.java
- ChatWebSocketHandler.java
- MessagingService.java
- ChatService.java
- WebSocketConfig.java
- JacksonConfig.java
- ChatMessageRepository.java
- ChatMessageMapper.java
- WebSocketMessagePayload.java
- ChatMessageDto.java
- ChatSessionDto.java

Co-authored-by: fred-maina <150168105+fred-maina@users.noreply.github.com>
Copy link
Author

Copilot AI commented Dec 1, 2025

remove all comments not being used

Removed all unused comments from 15 files across the codebase in commit 93f8d25.

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.

Chore: Remove dead code and unnecessary comments

2 participants