-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Description
Description
The getCursorFromHashParams
function in src/utils/url/urlHash.ts
currently uses an ESLint suppression comment (// eslint-disable-next-line max-statements
) to bypass the max-statements rule due to its length and complexity.
Proposed Solution
Refactor the function by extracting discrete responsibilities into smaller helper functions, such as:
handlePrettifyChange(hashParams): boolean
handleTimestampParam(hashParams): number | undefined
handleEventNumParam(hashParams): number | undefined
- Additional validation/normalization helpers as needed
This will make getCursorFromHashParams
a thin orchestrator of these helpers, with each helper having a single responsibility and clear inputs/outputs.
Benefits
- Improved code readability and maintainability
- Removal of ESLint suppression
- Better testability of individual components
- Adherence to single responsibility principle
References
- PR: feat(MenuBar): Add timestamp query input for jumping to log events by UTC timestamp (resolves #118). #359
- Original discussion: feat(MenuBar): Add timestamp query input for jumping to log events by UTC timestamp (resolves #118). #359 (comment)
Requested by: @junhaoliao
Metadata
Metadata
Assignees
Labels
No labels