Inspectopedia
 
2024.3

Complex function should be refactored

Info
New
Last modified: 03 December 2024

Reports the functions or methods that are too complex.

Complexity is evaluated based on four metrics:

  • Lines of code — the number of code lines in a function/method (less is better)

  • Maximum Nesting depth — the maximum number of nested statements in a function/method body (less is better)

  • Cyclomatic complexity — the function/method cyclomatic complexity (less is better)

  • Number of variables — the number of variables used in function/method body