-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or requestpriority-lowLow priorityLow prioritytech-debtTechnical debt that needs addressingTechnical debt that needs addressing
Description
Background
PR #217 successfully implemented item name suggestions in SearchService, but code review identified several improvements that should be made:
Tasks
- Extract magic numbers as named constants:
- Base score (0.8)
- Position penalty (0.02)
- Minimum score (0.1)
- Replace
printstatements with proper logging usingos_logor logging framework - Fix test brittleness by avoiding hardcoded expectation counts
- Clarify misleading comments about item limits
Suggested Implementation
private enum ScoringConstants {
static let baseScore = 0.8
static let positionPenalty = 0.02
static let minimumScore = 0.1
}
// Use os_log for error logging
import os.log
os_log("Error fetching suggestions: %{public}@", log: .default, type: .error, String(describing: error))Related
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestpriority-lowLow priorityLow prioritytech-debtTechnical debt that needs addressingTechnical debt that needs addressing