Polyglot AST Symbol Extractor, Call Graph & Complexity Analyzer
analyze_ast_symbol_graphStatic lexer and AST parser only (zero execution or evaluation): extracts imports, exports, classes, interfaces, and functions with line numbers, intra-file call edges, McCabe cyclomatic complexity, and Halstead volume across TypeScript, Python, Rust, Go, and Move. Use when mapping internal functions, call graphs, and complexity hotspots of a source file before refactoring; for analyzing cross-file import DAGs and circular dependencies, use audit_module_dependency_cycles instead. Read-only call (32 KB, 60 RPM): accepts 'source_text' (with enum defaults), uses '?demo=true' or L402 (75 sats); HTTP 400 if invalid.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | No | Source code file content to parse for symbols and complexity metrics. | |
| language | No | Programming language grammar used for symbol extraction; defaults to 'typescript' when omitted. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| functions | Yes | Extracted functions with line number, cyclomatic_complexity, and outgoing calls. | |
| lines_of_code | Yes | Total line count of the analyzed source code. | |
| halstead_metrics | Yes | Halstead vocabulary_size, program_length, volume, and estimated_bugs. | |
| high_complexity_hotspots | Yes | Functions with McCabe cyclomatic complexity >= 8 flagged for refactoring. |