PhpStorm
 
Get PhpStorm
You are viewing the documentation for an earlier version of PhpStorm.

Code Inspection: Complex function should be refactored

Last modified: 16 May 2022

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