mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
19 lines
584 B
Plaintext
19 lines
584 B
Plaintext
/**
|
|
* @name Complex functions
|
|
* @description Finds functions which call too many other functions. Splitting these functions would increase maintainability and readability.
|
|
* @kind problem
|
|
* @id cpp/architecture/complex-functions
|
|
* @problem.severity recommendation
|
|
* @tags maintainability
|
|
* statistical
|
|
* non-attributable
|
|
*/
|
|
import cpp
|
|
|
|
from Function f, int n
|
|
where f.fromSource() and
|
|
n = f.getMetrics().getNumberOfCalls() and
|
|
n > 99 and
|
|
not f.isMultiplyDefined()
|
|
select f as Function, "This function makes too many calls (" + n.toString() + ")"
|