MCPcopy Create free account
hub / github.com/FonaTech/Clouds-Coder / analyze

Method analyze

split_coder.py:334–348  ·  view source on GitHub ↗

Parse and classify all top-level nodes.

(self)

Source from the content-addressed store, hash-verified

332 self.import_statements: List[ImportStatement] = []
333
334 def analyze(self) -> List[NodeInfo]:
335 """Parse and classify all top-level nodes."""
336 text = self.source_path.read_text(encoding="utf-8")
337 self.source_lines = text.splitlines(keepends=True)
338 print(f" Parsing {len(self.source_lines):,} lines with AST...")
339 self.tree = ast.parse(text, filename=str(self.source_path))
340 self.nodes = []
341 self.import_statements = []
342
343 for node in self.tree.body:
344 self._register_top_level_import(node)
345 infos = self._extract_node_info(node)
346 self.nodes.extend(infos)
347
348 return self.nodes
349
350 def _extract_node_info(self, node: ast.AST) -> List[NodeInfo]:
351 """Convert one AST body node into NodeInfo records."""

Callers 2

runMethod · 0.95
mainFunction · 0.95

Calls 2

_extract_node_infoMethod · 0.95

Tested by

no test coverage detected