KT.NESTED_BLOCK_DEPTH

Excessive nesting depth in functions

This rule reports excessive nesting depth in functions. 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.

Options

  • threshold (default: 4)

    the nested depth required to trigger rule

The content on this page is adapted from the Detekt Docs. Copyright ©2022 The Detekt Team. All rights reserved. https://detekt.dev/comments.html