Code Quality Improvement
Issue
Hard-coded values throughout the codebase make it difficult to maintain and understand.
Magic Numbers to Extract
# Current
self.debounce_delay = 0.3 # What is 0.3?
max_results = 20 # Why 20?
context_size = 150 # Why 150?
# Improved
# Constants at module level
DEFAULT_MAX_RESULTS = 20
DEFAULT_CONTEXT_SIZE = 150
DEBOUNCE_DELAY_MS = 300
SEARCH_WORKER_POLL_INTERVAL = 0.05
MAX_PREVIEW_LENGTH = 200
TERMINAL_UPDATE_RATE = 0.1
SESSION_DISPLAY_LIMIT = 20
MAX_SEARCH_CACHE_SIZE = 100
class RealTimeSearch:
def __init__(self, searcher, extractor):
# ... existing code ...
self.debounce_delay = DEBOUNCE_DELAY_MS / 1000 # Convert to seconds
self.max_cache_size = MAX_SEARCH_CACHE_SIZE
Files Affected
realtime_search.py - UI timing constants
search_conversations.py - Search parameters
extract_claude_logs.py - Extraction limits
interactive_ui.py - Display constants
Benefits
- Self-documenting code
- Easy to adjust parameters
- Consistent values across codebase
- Better maintainability
Priority
LOW - Code quality improvement
Code Quality Improvement
Issue
Hard-coded values throughout the codebase make it difficult to maintain and understand.
Magic Numbers to Extract
Files Affected
realtime_search.py- UI timing constantssearch_conversations.py- Search parametersextract_claude_logs.py- Extraction limitsinteractive_ui.py- Display constantsBenefits
Priority
LOW - Code quality improvement