Hardcoded Magic Numbers #20

Open
opened 2026-02-02 14:51:16 -05:00 by jared · 0 comments
Owner

Many thresholds are hardcoded:

if is_new_drive and wear_attr.get('ignore_on_new_drive', False):
logger.debug(f"Skipping Wear_Leveling_Count evaluation for new drive: {raw_value}")

The definition of "new drive" (720 hours = 30 days) is in a different method. Centralize:

CONFIG = {
# ... existing ...
'NEW_DRIVE_HOURS_THRESHOLD': 720, # 30 days
'SMART_ERROR_RECENT_HOURS': 168, # 1 week
# ...
}

Many thresholds are hardcoded: if is_new_drive and wear_attr.get('ignore_on_new_drive', False): logger.debug(f"Skipping Wear_Leveling_Count evaluation for new drive: {raw_value}") The definition of "new drive" (720 hours = 30 days) is in a different method. Centralize: CONFIG = { # ... existing ... 'NEW_DRIVE_HOURS_THRESHOLD': 720, # 30 days 'SMART_ERROR_RECENT_HOURS': 168, # 1 week # ... }
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: LotusGuild/hwmonDaemon#20