mirror of
https://github.com/github/codeql.git
synced 2026-02-13 05:31:22 +01:00
In hindsight, having a `.getMetrics()` method that just returns `this` is somewhat weird. It's possible that it predates the existence of the inline cast, however.
18 lines
500 B
Plaintext
18 lines
500 B
Plaintext
/**
|
|
* @name Number of parameters without defaults
|
|
* @description The number of parameters of a function that do not have default values defined.
|
|
* @kind treemap
|
|
* @id py/number-of-parameters-without-default-per-function
|
|
* @treemap.warnOn highValues
|
|
* @metricType callable
|
|
* @metricAggregate avg max
|
|
* @tags testability
|
|
* complexity
|
|
*/
|
|
|
|
import python
|
|
private import LegacyPointsTo
|
|
|
|
from FunctionMetrics func
|
|
select func, func.getNumberOfParametersWithoutDefault() as n order by n desc
|