MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / formatImpact

Method formatImpact

src/mcp/tools.ts:4855–4881  ·  view source on GitHub ↗
(symbol: string, impact: Subgraph)

Source from the content-addressed store, hash-verified

4853 }
4854
4855 private formatImpact(symbol: string, impact: Subgraph): string {
4856 const nodeCount = impact.nodes.size;
4857
4858 // Compact format: just list affected symbols grouped by file
4859 const lines: string[] = [
4860 `**Impact: "${symbol}" affects ${nodeCount} symbols**`,
4861 '',
4862 ];
4863
4864 // Group by file
4865 const byFile = new Map<string, Node[]>();
4866 for (const node of impact.nodes.values()) {
4867 const existing = byFile.get(node.filePath) || [];
4868 existing.push(node);
4869 byFile.set(node.filePath, existing);
4870 }
4871
4872 for (const [file, nodes] of byFile) {
4873 lines.push(`**${file}:**`);
4874 // Compact: inline list
4875 const nodeList = nodes.map(n => `${n.name}:${n.startLine}`).join(', ');
4876 lines.push(nodeList);
4877 lines.push('');
4878 }
4879
4880 return lines.join('\n');
4881 }
4882
4883 /**
4884 * Build a compact structural outline of a container symbol from its

Callers 1

handleImpactMethod · 0.95

Calls 3

getMethod · 0.65
setMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected