-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
MEDIUMNot a risk, but definitely would improve functionalityNot a risk, but definitely would improve functionalityenhancementNew feature or requestNew feature or request
Description
Medium: Magic Numbers Should Be Named Constants
Priority: MEDIUM
Type: Code Quality
Locations
Multiple locations throughout libwsv5.c
Examples
Event thread timeout:
lws_service(conn->lws_context, 50); // What is 50?Request timeout:
if (now - (*req)->timestamp > 30) { // What is 30?Sleep durations:
struct timespec ts = {0, 50000000}; // 50ms - hard to readConnection wait loops:
for (int i = 0; i < 50 && !obsws_is_connected(conn); i++) {
usleep(100000); // What is 100000?
}Impact
- Reduced code readability
- Harder to maintain and tune performance
- Values might be used inconsistently
- Intent is unclear
Metadata
Metadata
Assignees
Labels
MEDIUMNot a risk, but definitely would improve functionalityNot a risk, but definitely would improve functionalityenhancementNew feature or requestNew feature or request