Extract magic numbers to named constants#32
Conversation
Co-authored-by: angelo-hub <12058178+angelo-hub@users.noreply.github.com>
|
@copilot there was another magic number you found in this comment but i believe it's a max not min? The magic number 30000 (30 seconds) for rate limit delay lacks explanation. Consider extracting this to a named constant like DEFAULT_RATE_LIMIT_DELAY or adding a more detailed comment explaining why 30 seconds is the minimum for rate limiting without a Retry-After header. |
Co-authored-by: angelo-hub <12058178+angelo-hub@users.noreply.github.com>
You're correct - it's a minimum (using |
Addresses code review feedback to extract hardcoded magic numbers to named constants for improved maintainability.
Changes
1. Tree View Debounce Delay
TREE_VIEW_REFRESH_DEBOUNCE_MSconstant at module level insrc/activation/treeView.ts500with the constant indebounce()callBefore:
After:
2. Rate Limit Retry Delay
MIN_RATE_LIMIT_DELAY_MSconstant insrc/shared/http/RetryableHttpClient.ts30000with the constant for minimum rate limit retry delayBefore:
After:
Improves maintainability by making delay values self-documenting and centralized.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.