RVM.CodeLens
Static analysis tool for .NET solutions using Roslyn, with CLI, Blazor dashboard and REST API.
Overview
RVM.CodeLens is a static analysis tool that uses the Roslyn compiler to calculate code metrics, detect architectural patterns, map dependencies and identify hotspots through Git history analysis. The project offers three interfaces: a CLI with multiple output formats (table, JSON, Markdown), a Blazor Server web dashboard with interactive visualizations and a REST API for integration with other tools.
Features
- Cyclomatic Complexity (CC) calculation with support for if, for, switch, catch, logical and ternary operators
- Maintainability Index (MI) using the Visual Studio formula
- Class coupling via Roslyn semantic analysis
- Inheritance depth and line counts (code, comments, blank)
- Dependency graph between projects and NuGet packages
- Automatic detection of architectural layers (Domain, Application, Infrastructure, Presentation)
- Hotspot analysis combining Git churn with complexity
- CLI with Spectre.Console, Blazor Dashboard and 6 REST endpoints
- Multiple output formats: table, JSON and Markdown
Technologies
Patterns & architecture
REST endpoints
| Method | Path | Description |
|---|---|---|
| POST | /api/analyze | Analyze .NET solution |
| GET | /api/analysis/current | Current analysis in memory |
| GET | /api/metrics | Metrics for all projects |
| GET | /api/deps | Dependency graph |
| GET | /api/hotspots | Git-based hotspots |
| GET | /api/architecture | Layers and violations |