Synopsis: | Do not have overly complex functions |
Language: | C++ |
Severity Level: | 4 |
Category: | Control Flow |
Description: |
If a function is too complex, it can be difficult to comprehend. The cyclomatic complexity of a function, i.e. the number of linearly independent paths through a function, should not exceed the agreed maximum. A function with a cyclomatic complexity less than 5 is considered to be ok. However, if its cyclomatic complexity is higher than 10, refactoring is recommended. |