Pattern: Too many nested blocks in function
Issue: -
Excessively nested code becomes harder to read and increases its hidden complexity. It might become harder to understand edge-cases of the function. Prefer extracting the nested code into well-named functions to make it easier to understand.