A visual code analysis tool for Rust projects that maps function call relationships across your entire codebase.
- Multi-file Analysis - Parses entire Rust projects and tracks relationships across files
- Cross-file Call Graphs - Visualize how functions call each other, even across module boundaries
- Import Resolution - Handles
usestatements to accurately resolve function calls - Interactive Visualization - Click nodes to explore function details, callers, and callees
- Real-time Metrics - See call counts, hotspots, and project statistics
- Single Binary - Backend and frontend bundled together for easy deployment
for merde repo. https://github.com/bearcove/merde
- Rust (1.70+)
- Node.js (18+)
- npm
- Clone the repository
git clone https://github.com/YOUR_USERNAME/sourcemapper.git
cd sourcemapper- Build the frontend
cd ui
npm install
npm run build
cd ..- Run the server. runs at port http://localhost:5173/
cargo run --releaseUses tree-sitter to parse Rust source files and extract:
- Function definitions
- Function calls
- Import statements (
usedeclarations) - Module structure
Builds a symbol database that:
- Maps function names to their definitions
- Resolves imports to full paths
- Tracks cross-file relationships
Creates a directed graph where:
- Nodes = Functions
- Edges = Function calls
- Handles
crate::paths and module resolution
Renders the graph with:
- Hierarchical layout using Dagre
- Interactive node selection
- Detailed side panel with metrics
- Code Navigation - Quickly understand how functions relate to each other
- Dependency Analysis - Find highly coupled functions or orphaned code
SourceMapper calculates and displays:
- Total functions and calls in the project
- Call count per function (how many times a function is called)
- Hotspots (most frequently called functions) → yet to be implemented.
- Caller/callee relationships
- Project-level statistics
- Multi-file Rust parsing
- Cross-file call graph generation
- Import resolution (
usestatements) - Interactive graph visualization
- Function metrics and statistics
- Side panel with detailed information
- Single binary deployment.
- Bidirectional Editing - Modify code through the UI
- Edit doc comments from side panel
- Rename functions with automatic refactoring
- Add new function stubs visually.
- Export graphs as images (PNG, SVG)