-
-
Couldn't load subscription status.
- Fork 246
Description
Refactor frontend functions with more than 4 levels of nesting to improve code readability and maintainability.
Rule: typescript:S2004
Here's a full list of issues we have under this rule
Why?
- Readability: Deeply nested functions are harder to read and follow
- Maintainability: Difficult to modify or debug complex nested structures
- Testing: Nested functions are harder to unit test in isolation
- Cognitive load: Increases mental overhead for developers
How to refactor
- Use early returns to reduce nesting depth
- Apply guard clauses to avoid nested if statements
- Break down complex operations into smaller, composable functions
- Extract nested logic into separate named functions
Scope
- These issues are mostly happening in tests, but there are a couple of application code instances too
Metadata
Metadata
Assignees
Type
Projects
Status
In progress