Conversation
📝 WalkthroughWalkthroughThe pull request removes duplicate code from two Java classes: redundant imports, field declarations, and duplicate method implementations in Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/main/java/com/iemr/admin/utils/JwtUserIdValidationFilter.java (1)
44-50:⚠️ Potential issue | 🟡 MinorLines 125–126 are unreachable dead code due to the early bypass above.
The early health/version check at lines 44–50 returns before reaching the consolidated skip list. Lines 125–126 then re-check the same
contextPath + HEALTH_ENDPOINTandcontextPath + VERSION_ENDPOINTconditions, but those paths will never match because the early return already handled them.To fix, remove the duplicate health/version entries from the consolidated skip list (lines 125–126):
Suggested cleanup
// Skip login and public endpoints if (path.equals(contextPath + "/user/userAuthenticate") || path.equalsIgnoreCase(contextPath + "/user/logOutUserFromConcurrentSession") || path.startsWith(contextPath + "/swagger-ui") || path.startsWith(contextPath + "/v3/api-docs") || path.startsWith(contextPath + "/user/refreshToken") - || path.startsWith(contextPath + "/public") - || path.equals(contextPath + HEALTH_ENDPOINT) - || path.equals(contextPath + VERSION_ENDPOINT)) { + || path.startsWith(contextPath + "/public")) { logger.info("Skipping filter for path: " + path); filterChain.doFilter(servletRequest, servletResponse); return; }Also applies to: 119–124
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/main/java/com/iemr/admin/utils/JwtUserIdValidationFilter.java` around lines 44 - 50, The early bypass in JwtUserIdValidationFilter checks HEALTH_ENDPOINT and VERSION_ENDPOINT (including contextPath variants) and returns, making the later consolidated skip list redundant; remove the duplicate contextPath + HEALTH_ENDPOINT and contextPath + VERSION_ENDPOINT entries from the consolidated skip list in the method (i.e., update the skip list used later in doFilter to exclude those two entries) so the health/version checks are only handled by the initial early-return block and no unreachable conditions remain.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@src/main/java/com/iemr/admin/utils/JwtUserIdValidationFilter.java`:
- Around line 44-50: The early bypass in JwtUserIdValidationFilter checks
HEALTH_ENDPOINT and VERSION_ENDPOINT (including contextPath variants) and
returns, making the later consolidated skip list redundant; remove the duplicate
contextPath + HEALTH_ENDPOINT and contextPath + VERSION_ENDPOINT entries from
the consolidated skip list in the method (i.e., update the skip list used later
in doFilter to exclude those two entries) so the health/version checks are only
handled by the initial early-return block and no unreachable conditions remain.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: ff739bd9-5dff-4083-8b76-2b347ecf105d
📒 Files selected for processing (2)
src/main/java/com/iemr/admin/controller/version/VersionController.javasrc/main/java/com/iemr/admin/utils/JwtUserIdValidationFilter.java
💤 Files with no reviewable changes (1)
- src/main/java/com/iemr/admin/controller/version/VersionController.java



📋 Description
JIRA ID:
AMM-2280
✅ Type of Change
Summary by CodeRabbit