checkExpressionComplexity
function checkExpressionComplexity(tokens, config): { complexityScore: number; engineError?: EngineError; errorMessage?: string; passed: boolean;};Defined in: packages/engine/src/engine/ExpressionEngineSafety.ts:83
Score expression complexity based on token count, function calls, and nesting depth. Returns the complexity score and whether it exceeds the configured maximum.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
tokens | Token[] |
config | ValidationConfig |
Returns
Section titled “Returns”{ complexityScore: number; engineError?: EngineError; errorMessage?: string; passed: boolean;}complexityScore
Section titled “complexityScore”complexityScore: number;engineError?
Section titled “engineError?”optional engineError?: EngineError;errorMessage?
Section titled “errorMessage?”optional errorMessage?: string;passed
Section titled “passed”passed: boolean;