Polyglot AST Symbol Extractor, Call Graph & Complexity Analyzer
analyze_ast_symbol_graphExtract imports, exports, classes, interfaces, functions, call edges, and complexity metrics from a source file to map its symbols and hotspots before refactoring.
Instructions
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 the internal functions, call graph, and complexity hotspots of a source file before refactoring; for analyzing cross-file import DAGs, circular dependencies, and topological build order across multiple modules, use audit_module_dependency_cycles instead. Read-only call (32 KB, 60 RPM): accepts 'code' (with enum defaults), uses '?demo=true' or L402 (75 sats); HTTP 400 if invalid.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | 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. |