Introduce early return / continuepro
Change an if-statement into an early return or continue statement.

Why is this refactoring helpful?
If-else chains can lead to high indentation and require keeping track of many conditions, especially when there are several levels of nesting.
Introducing early return
statements (or continue
statements inside loops) can reduce the nesting level and lower the cognitive load because you can entirely rule out already covered conditions.
Configuration
- Code Assist ID (for the configuration file):
introduce-early-return
- You can configure custom keyboard shortcuts with this code action kind:
refactor.p42.introduce-early-return
- This code assist provides refactoring suggestions. Learn how to configure the refactoring suggestion visibility.