Use this command to install oxide-sloc with WinGet:
winget install --id=NimaShafie.OxideSLOC -e
Oxide-SLOC is a Rust-based code metrics workbench designed for IEEE 1045-1992 compliant SLOC (Source Lines of Code) analysis and unit test detection across 41 programming languages. It provides developers with a comprehensive toolset to measure, analyze, and visualize code composition and test coverage.
Key Features:
Multi-Language Support: Analyzes source code in 41 languages including C, Python, Java, JavaScript, Rust, and more.
Web UI & CLI Integration: Offers both a localhost web interface for interactive analysis and command-line tools for scripted workflows.
Rich Reporting: Generates detailed HTML reports, PDF exports, CSV files, and multi-sheet Excel documents.
IEEE 1045 Compliance: Implements standardized counting rules for physical SLOC, including configurable policies for mixed lines, continuation lines, compiler directives, and comments.
Test Metrics & Coverage: Detects unit test functions across languages, measures test-to-production code density, and imports coverage data from LCOV, Cobertura XML, JaCoCo XML, and NYC formats.
Offline-First Design: Built with vendor dependencies to ensure air-gap compatibility, with no external CDN calls required.
Audience & Benefit:
Ideal for developers, DevOps engineers, and QA teams seeking precise code composition metrics and unit test coverage insights. Oxide-SLOC enables organizations to improve code quality, track project trends over time, and integrate metrics into CI/CD pipelines via its REST API and Git webhook support. It is particularly valuable for projects requiring compliance with IEEE standards or offline deployment capabilities.
Installable via winget, Oxide-SLOC combines powerful analysis features with user-friendly tools to streamline software development and testing workflows.
README
oxide-sloc
oxide-sloc is a Rust-based local code analysis tool — IEEE 1045-1992 SLOC analysis, unit test detection, and coverage reporting.
Quick Start
bash scripts/run.sh # installs on first run, then opens http://127.0.0.1:4317
On Windows with no Git Bash, use the native-PowerShell installer instead — it needs
no bash (see Windows without Git Bash):
CLI + web UI — analyze / report / diff / serve / send / init commands; guided 4-step web flow with Quick Scan
IEEE 1045-1992 physical SLOC — configurable mixed-line, continuation-line, compiler-directive, and blank-in-comment policies; symbol counting (functions, classes, variables, imports)
Deep metrics — COCOMO I effort/cost estimate, approximate cyclomatic complexity (branch-keyword count), ULOC / DRYness, and duplicate-file detection on every run
Git Hotspots — ranks refactor candidates by code lines × commit activity over a configurable window (90 days by default); per-file commit counts and last-changed dates from a single git log pass
Code Ownership — per-author line attribution via git blame; contributor leaderboard, per-author file drill-down, hotspot ownership, and .mailmap identity merge/export; on by default
Test Metrics — lexical test function detection across 60 languages; test-to-code density; multi-format coverage import (LCOV, Cobertura XML, JaCoCo XML, coverage.py JSON, Istanbul/NYC JSON)
Flexible output — HTML reports, PDF, CSV, and 4-sheet Excel export; re-render any saved JSON
Git integration — branch/tag/commit browser (remote URLs and local checkouts), recursive submodule scanning, GitHub/GitLab/Bitbucket webhooks and polling, submodule breakdown
Offline-first — vendored deps, Chart.js compiled in, no CDN calls; Docker on GHCR; LAN server mode with API key auth and optional TLS
Why oxide-sloc vs cloc / tokei / scc / UCC?
Capability
oxide-sloc
cloc
tokei
scc
UCC
Languages
60
250+
240+
240+
~30
Web UI + HTML/PDF reports
✓
—
—
—
—
MCP server (AI agent tools)
✓
—
—
—
—
Test function detection
✓
—
—
—
—
Trend / history tracking
✓
—
—
—
—
Coverage file import
✓
—
—
—
—
Git Hotspots (churn × size)
✓
—
—
—
—
Code ownership (git-blame attribution)
✓
—
—
—
—
COCOMO + complexity¹ + DRYness
✓
—
—
✓
partial
IEEE 1045-1992 compliance
✓
partial
—
—
partial
REST API + SVG badge
✓
—
—
—
—
Git webhook integration
✓
—
—
—
—
CI/CD marketplace action
✓
—
—
—
—
Offline / air-gapped build
✓
—
—
—
—
¹ Complexity is a lexical approximation — a sum of branch/decision keywords (if, for, while, ||, &&, …) per code line, not a control-flow-graph McCabe computation.
cloc, tokei, and scc win on raw language count and throughput for pure line-counting
pipelines; UCC (USC's Unified Code Count) brings rigorous physical/logical SLOC counting,
cyclomatic complexity, and two-baseline differencing from an academic lineage. oxide-sloc is
the right choice when you need analysis depth, visual reports, history, or AI-native
integration — particularly as an MCP tool callable by Claude, Copilot, and other agents.
export SLOC_API_KEY=$(openssl rand -hex 32)
docker compose up
# CLI via Docker
docker run --rm -v /path/to/your/repo:/repo:ro \
ghcr.io/nimashafie/oxide-sloc:latest analyze /repo --plain
Set SLOC_API_KEY, SLOC_ALLOWED_ROOTS, and SLOC_TLS_CERT/SLOC_TLS_KEY as needed. See docs/server-deployment.md.
Windows without Git Bash
The bash launchers (run.sh / install.sh) need Git Bash. On a locked-down or
air-gapped Windows host where you cannot install Git for Windows,
use the native-PowerShell installer — it reproduces the full offline flow
(checksum-verify → reassemble split parts → extract with the built-in tar.exe →
bootstrap the bundled toolchain → cargo build --release --offline) using only tools
that ship with Windows 10/11:
powershell -ExecutionPolicy Bypass -File scripts\internal\install.ps1
# flags: -Rebuild (fresh compile), -Build (compile even if dist\ exists),
# -MingwBin , -SkipDist
If a pre-built binary is committed in dist\, it is extracted and no build runs. For a
source build, the one requirement PowerShell cannot supply is a C linker: the bundled
toolchain targets x86_64-pc-windows-gnu, which links with MinGW gcc/ld. The
installer auto-locates it from a PortableGit folder (a no-install extract),
-MingwBin , $env:SLOC_MINGW_BIN, or a gcc already on PATH:
# Stage a portable Git Bash once (no installer) — provides both the
# bash.exe for CI and the mingw64\bin linker for the native build:
powershell -ExecutionPolicy Bypass -File ci\jenkins\stage-portable-git.ps1 PortableGit-2.47.0-64-bit.7z.exe
$env:SLOC_PORTABLE_GIT = 'C:\Tools\PortableGit' # only if staged outside the workspace
For running the Jenkins pipeline on a Windows agent without a system Git install, see
the Windows-agents section of docs/ci-integrations.md.
A guided 4-step flow: select project → counting rules → outputs → review & run. Quick Scan submits from step 1 with all defaults. Reports include a ranked Git Hotspots table (when run against a git repo) alongside the SLOC, complexity, and COCOMO breakdowns.
Additional pages: Test Metrics (/test-metrics), Trend Reports (/trend-reports), Compare Scans (/compare-scans), Code Ownership (/code-ownership) for per-author blame attribution and the contributor leaderboard, Integrations (/integrations) for webhook and Jira/Bitbucket/Confluence setup, and the Git Browser (/git-browser) for scanning any branch, tag, or commit — from a remote URL or a local checkout, with recursive submodule support.
Configuration
oxide-sloc init # generates .oxide-sloc.toml with all options documented inline
IEEE 1045-1992 counting parameters — mixed_line_policy, continuation_line_policy, blank_in_block_comment_policy, count_compiler_directives — are configurable via TOML or CLI flags. CLI flags always override config file values.
For Jenkins/GitLab setup, native Jira / Bitbucket / Confluence publishing, and artifact repository integration, see docs/ci-integrations.md.
To scan repositories hosted on different git instances than the tool/pipeline (e.g. tooling on bitbucket.instance1.com, code on bitbucket.instance2.com) — with per-host credentials, corporate proxy/VLAN support, and air-gapped offline import — across local, server, and Jenkins modes, see docs/multi-instance.md.
Editor & Build Integrations
Run oxide-sloc reports without leaving your editor or build:
crates/
sloc-cli/ # CLI entry point and commands (binary: oxide-sloc)
sloc-config/ # Config schema and TOML parsing
sloc-core/ # File discovery, decoding, aggregation, delta engine, COCOMO/hotspots
sloc-git/ # Git CLI wrappers, webhook parsing, scan-schedule store
sloc-languages/ # Language detection, lexical analyzers, symbol counting
sloc-report/ # HTML rendering, PDF/CSV/Excel export
sloc-web/ # Axum web server, metrics API, badge endpoint
sloc-mcp/ # MCP stdio server for AI agent integration
ci/ # CI scripts + config presets
cmake/ # OxideSloc.cmake reusable CMake module
docs/ # airgap.md, ci-integrations.md, ide-integrations.md, server-deployment.md, openapi.yaml
dist/ # Windows pre-built binary (committed by CI after each release)
examples/ # examples/cmake/ runnable CMake integration sample
scripts/ # run.sh, serve-server.sh (user-facing entry points)
testing/ # fixtures/ (scan sample repo) + examples/ (CI configs, sloc.example.toml)
AI Integration
The sloc-mcp binary implements the Model Context Protocol (protocol revision 2025-06-18, with version negotiation), making oxide-sloc callable as a tool from Claude Desktop, Claude Code, and any MCP-compatible host. All 7 tools carry read-only / open-world annotations and return structured content alongside their text block.
Pre-built tool definitions for Claude API (tool_use) and OpenAI (function_calling): docs/mcp/. A running server also exposes GET /llms.txt and GET /llms-full.txt for agent self-discovery.
License
oxide-sloc is licensed under AGPL-3.0-or-later.
Copyright (C) 2026 Nima Shafie.