Skip to content

chore(sonar): remove dead store max_duration#2684

Merged
crivetimihai merged 1 commit intoIBM:mainfrom
oaslananka:chore/sonar-max-duration-2371
Feb 6, 2026
Merged

chore(sonar): remove dead store max_duration#2684
crivetimihai merged 1 commit intoIBM:mainfrom
oaslananka:chore/sonar-max-duration-2371

Conversation

@oaslananka
Copy link
Copy Markdown
Contributor

Fixes #2371

Removes a dead store flagged by Sonar (python:S1854): max_duration was reassigned in the latency_range==0 branch but never used after.

Testing:

  • python -m compileall mcpgateway

Signed-off-by: oaslananka <169144131+oaslananka@users.noreply.github.com>
Copilot AI review requested due to automatic review settings February 3, 2026 23:52
@oaslananka
Copy link
Copy Markdown
Contributor Author

Scope: remove dead store flagged by Sonar (python:S1854) only. No functional change. CI checks green (DCO).

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Removes an unused reassignment of max_duration in the PostgreSQL latency heatmap calculation to address Sonar rule python:S1854 (dead store).

Changes:

  • Deleted the unused max_duration = min_duration + 1.0 assignment in the latency_range == 0 branch.
  • Preserved the existing latency_range fallback behavior to avoid zero-sized latency buckets.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@crivetimihai
Copy link
Copy Markdown
Member

Clean fix — confirmed that max_duration is never read after this reassignment in _get_latency_heatmap_postgresql(). The function only uses latency_range and min_duration downstream. LGTM.

Note: only the DCO check appears to have run — can you confirm CI (lint/tests) passed or are you seeing the same?

@oaslananka
Copy link
Copy Markdown
Contributor Author

Confirmed: I’m seeing the same on GitHub for this PR—only the DCO check shows up as required/ran. Locally verified on Windows 11 (PowerShell 7.5.4) with: python -m compileall mcpgateway (passes).

@crivetimihai crivetimihai self-assigned this Feb 4, 2026
@crivetimihai crivetimihai merged commit b47921f into IBM:main Feb 6, 2026
56 of 57 checks passed
kcostell06 pushed a commit to kcostell06/mcp-context-forge that referenced this pull request Feb 24, 2026
Signed-off-by: oaslananka <169144131+oaslananka@users.noreply.github.com>
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.

[CLEANUP][SONAR][LOW]: Dead code - unused variable max_duration in admin.py

3 participants