Skip to content

Function ​

Parameter Count ​

function.parameter_count — Number of declared parameters.

ItemValue
DefinitionParameters of the function in the IR.
Scopefunction
InputFunction parameters
CalculationVariadic parameters (e.g. *args) count as one. Separators such as Python * and / and C (void) are not parameters.
Unitcount
Language Applicabilitypartially_language_dependent
LimitationsExplicit receivers (Python self) count; implicit ones (this) do not.
Reference-

Average Parameter Count ​

function.avg_parameter_count — Mean Parameter Count over functions.

ItemValue
DefinitionMean of function.parameter_count.
Scopefile, project
InputFunction parameters
Calculationnot_applicable when there are no functions.
Unitcount
Language Applicabilitypartially_language_dependent
LimitationsSee function.parameter_count.
Reference-

Maximum Parameter Count ​

function.max_parameter_count — Largest Parameter Count over functions.

ItemValue
DefinitionMaximum of function.parameter_count.
Scopefile, project
InputFunction parameters
Calculationnot_applicable when there are no functions.
Unitcount
Language Applicabilitypartially_language_dependent
LimitationsSee function.parameter_count.
Reference-

Expression Count ​

function.expression_count — Number of expressions, including sub-expressions.

ItemValue
DefinitionNodes of kind expression, call, assignment, binary, logical, conditional or unary.
Scopefunction, file, project
InputNode kinds
CalculationFunction: excluding nested functions. File: the whole file. Project: sum. Identifiers and literals are not expressions on their own.
Unitcount
Language Applicabilitypartially_language_dependent
LimitationsExpression forms not listed in a language Mapping (e.g. lambdas' bodies are nested functions; unmapped expression types are other) are not counted.
Reference-

Call Count ​

function.call_count — Number of call sites.

ItemValue
DefinitionNodes of kind call (function calls and constructor calls).
Scopefunction, file, project
InputNode kinds
CalculationFunction: excluding nested functions. File: the whole file. Project: sum.
Unitcount
Language Applicabilitylanguage_independent
Limitations-
Reference-