Skip to content

feat: add visual graph export, path tracing CLI, architecture metrics, code health audit, and MCP extensions - #1643

Open
Jaymr1031-Z wants to merge 2 commits into
colbymchenry:mainfrom
Jaymr1031-Z:feat/secondary-dev-features
Open

feat: add visual graph export, path tracing CLI, architecture metrics, code health audit, and MCP extensions#1643
Jaymr1031-Z wants to merge 2 commits into
colbymchenry:mainfrom
Jaymr1031-Z:feat/secondary-dev-features

Conversation

@Jaymr1031-Z

Copy link
Copy Markdown

Summary of Changes

This PR introduces 5 major enhancements to CodeGraph to extend its visual exporting, pathfinding, architectural metric analysis, dead code auditing, and MCP agent tool capabilities:

  1. Visual Graph Exporter (codegraph export):

    • Added support for exporting code knowledge subgraphs and symbol call/impact graphs into Mermaid.js, Graphviz DOT, and JSON Graph formats.
    • Ideal for generating architecture diagrams in markdown documentation and CI/CD artifacts.
  2. Multi-Hop Call & Dependency Path Tracing (codegraph trace <from> <to>):

    • Added CLI and API methods (findPathBetweenSymbols) to compute and visually render multi-hop traversal paths between any two symbols.
  3. Architectural & Coupling Metrics (codegraph metrics):

    • Implemented MetricsAnalyzer to calculate file-level Afferent Coupling ($C_a$), Efferent Coupling ($C_e$), and Instability Index ($I = C_e / (C_a + C_e)$).
    • Detects structural hotspots with high fan-in, high fan-out, and large blast radii.
  4. Code Health & Dead Code Audit (codegraph audit):

    • Scans the codebase for unreferenced non-exported dead symbols and cyclic file dependencies.
  5. MCP Tool Suite Extension:

    • Registered and exposed codegraph_trace, codegraph_export, and codegraph_metrics tools to MCP clients (Claude Code, Cursor, Codex, etc.).

Verification & Tests

  • Added comprehensive unit tests in __tests__/secondary-features.test.ts (13/13 tests passing).
  • Verified full TypeScript compilation (npm run build) and asset bundling.
  • Verified CLI subcommands output via codegraph --help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant