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
Platform
What happens
Windows 10/11 (Git Bash)
Extracts pre-built binary from dist/ — no Rust required
Linux — Rust installed
Builds offline from committed vendor.tar.xz
Linux — no Rust, toolchain committed
Bootstraps Rust from toolchain/ archives, builds offline
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
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
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?
Capability
oxide-sloc
cloc
tokei
scc
Languages
60
250+
240+
240+
Web UI + HTML/PDF reports
✓
—
—
—
MCP server (AI agent tools)
✓
—
—
—
Test function detection
✓
—
—
—
Trend / history tracking
✓
—
—
—
Coverage file import
✓
—
—
—
Git Hotspots (churn × size)
✓
—
—
—
COCOMO + complexity¹ + DRYness
✓
—
—
✓
IEEE 1045-1992 compliance
✓
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.
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.
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), and the Git Browser (/git-browser) for scanning any branch, tag, or commit.
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.
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
docs/ # airgap.md, ci-integrations.md, server-deployment.md, openapi.yaml
dist/ # Windows pre-built binary (committed by CI after each release)
examples/ # Runnable examples + sloc.example.toml
scripts/ # run.sh, serve-server.sh (user-facing entry points)
AI Integration
The sloc-mcp binary implements the Model Context Protocol, making oxide-sloc callable as a tool from Claude Desktop, Claude Code, and any MCP-compatible host.
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.