Skip to content

About

Roslyn-powered code metrics for .NET.

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

SourceGauge

CI CodeQL License: MIT

Roslyn-powered code metrics for .NET, built for downstream tools.

SourceGauge is a command-line tool for analyzing C#/.NET codebases and extracting software metrics into structured output for third-party tools. Roslyn is the first analysis backend. SourceGauge reports measurements; it does not enforce rules, emit threshold violations, or fail builds.

Status: early development. No metrics shipped yet. See the vision.

CLI

The CLI loads C# projects and Visual Studio solution files using the installed .NET SDK and MSBuild. Run it from a .NET 10 SDK environment:

dotnet run --project src/SourceGauge.Cli -- path/to/project.csproj
dotnet run --project src/SourceGauge.Cli -- path/to/solution.sln
dotnet run --project src/SourceGauge.Cli -- --output metrics.json path/to/project.csproj
dotnet run --project src/SourceGauge.Cli -- --help
dotnet run --project src/SourceGauge.Cli -- --version

Only analyze projects you trust. MSBuild project evaluation may execute project-defined logic; SourceGauge does not sandbox it. Operational messages and diagnostics are written to stderr. A successful analysis writes one versioned JSON document to stdout by default, or to the file selected with --output; an analysis with no collected metrics emits an empty metrics array. The JSON Schema and sample document define the v1 contract. Help and version are written to stdout.

Exit codes are 0 for a successful load/export, help, or version; 1 for an analysis or export failure; and 2 for invalid arguments or input paths.

Getting started (contributors)

./scripts/setup.sh          # or: pwsh ./scripts/setup.ps1
dotnet build -c Release
dotnet test -c Release

Documentation

Repository layout

src/SourceGauge.Analyzers/         current analyzer prototype (netstandard2.0)
src/SourceGauge.Cli/                CLI for loading C# projects and solutions (net10.0)
tests/SourceGauge.Analyzers.Tests/ tests for the current prototype
tests/SourceGauge.Cli.Tests/       CLI command and loading tests
docs/                              vision, requirements, ADRs
.github/                           CI, templates, agents, prompts, agent hooks
.githooks/                         local git hooks
scripts/                           setup and hook scripts

License

MIT

About

Roslyn-powered code metrics for .NET.

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages