UNPKG

cognitive-complexity-ts

Version:

This program analyses TypeScript and JavaScript code according to the [Cognitive Complexity metric](https://www.sonarsource.com/docs/CognitiveComplexity.pdf). It produces a JSON summary and a GUI for exploring the complexity of your codebase.

19 lines (18 loc) 597 B
import ts from "typescript"; /** * Contains all names that could be recursively referenced. */ export declare class Scope { /** * Variables that can be referenced as is from a scope. */ readonly local: ReadonlyArray<string>; /** * Variables that can only be referenced with a prefix in the scope. */ readonly object: ReadonlyArray<string>; constructor(local: ReadonlyArray<string>, object: ReadonlyArray<string>); includes(name: string): boolean; maybeAdd(node: ts.Node, variableBeingDefined: string | undefined): Scope; private scopeToAdd; }