Skip to content
| Marketplace
Sign in
Visual Studio Code>Visualization>oxide-slocNew to Visual Studio Code? Get it now.
oxide-sloc

oxide-sloc

Nima Shafie

| (0) | Free
Code metrics in VS Code, powered by oxide-sloc: lines of code, test coverage, cyclomatic complexity, COCOMO estimates, per-language & per-file breakdowns, HTML/web reports, and a live SLOC status-bar count.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

oxide-sloc

oxide-sloc for VS Code

Code metrics without leaving the editor — lines of code, test coverage, complexity, and more.

Marketplace Version Installs Rating License: AGPL v3

Bring oxide-sloc code-metrics reports into VS Code: count lines of code, track test coverage and cyclomatic complexity, get COCOMO effort estimates, and drill into per-language and per-file breakdowns — all from the editor. The extension drives the oxide-sloc binary, and can download the latest release for you in one click.

This is the companion repository for the VS Code extension. The Visual Studio extension and the CMake integration live separately — see the main oxide-sloc repository.

Install

Install Oxide SLOC from the VS Code Marketplace, or from the command line:

code --install-extension oxide-sloc.oxide-sloc

Then get the oxide-sloc binary. The fastest way is from inside the editor: open the Oxide SLOC panel (Activity Bar) and click Download oxide-sloc, or run Oxide SLOC: Download / Update Binary from the command palette. It fetches the latest release for your platform from GitHub, verifies its SHA-256, and wires it up automatically. If you already have the binary, see Requirements for how it's discovered.

Screenshots

Activity Bar panel — live metrics for the open workspace: code/comment/blank lines, complexity, functions, unit tests, ULOC & DRYness, COCOMO estimate, per-language and per-file breakdowns:

Oxide SLOC metrics panel

Status bar — the workspace code-line count, always in view; click it to re-analyze:

Oxide SLOC status bar

HTML report — generated by Analyze Workspace and opened with Open HTML Report (in your browser or a VS Code webview):

Oxide SLOC HTML report

Web UI — the interactive dashboard launched by Start Web UI, with trends, comparisons, and PDF/Excel export:

Oxide SLOC web UI

Features

  • One-click binary install - download the latest oxide-sloc release for your platform from GitHub (SHA-256 verified) without leaving the editor; no separate install step.
  • Analyze Workspace / Analyze Current File/Folder - one command to scan and report.
  • Status bar - a live code-line count for the open workspace ($(code) 78.5K SLOC); click it to re-analyze.
  • Open HTML Report - view the full report in your browser or in a VS Code webview.
  • Web UI - start/stop the oxide-sloc web dashboard (http://127.0.0.1:4317) from the command palette.
  • Gate awareness - if a run trips a --fail-* gate (warnings, threshold, budget, baseline, complexity), the extension shows a matching notification.

Requirements

The oxide-sloc executable must be available. The extension finds it, in order, from:

  1. the oxideSloc.binaryPath setting,
  2. the SLOC_BIN / OXIDE_SLOC environment variables,
  3. oxide-sloc on your PATH.

Don't have it yet? Run Oxide SLOC: Download / Update Binary (or click Download oxide-sloc in the panel) to fetch the latest release into the extension's storage and set binaryPath for you. By default it downloads from oxide-sloc/oxide-sloc; point oxideSloc.releaseRepo at a trusted mirror or fork if you need to. You can also install oxide-sloc yourself via the instructions at https://github.com/oxide-sloc/oxide-sloc.

Workspace Trust & safety

Because the extension runs an external executable, analysis only happens in a trusted workspace. In Restricted Mode the panel and status bar still appear, but the binary is never run. The oxideSloc.binaryPath, oxideSloc.configPath, and oxideSloc.analyzeFlags settings are machine-scoped, so a repository's committed .vscode/settings.json cannot silently redirect the extension to a different executable or inject CLI flags.

Commands

Command Description
Oxide SLOC: Analyze Workspace Scan all workspace folders.
Oxide SLOC: Analyze Current File/Folder Scan the active file, or a folder/file from the Explorer context menu.
Oxide SLOC: Open HTML Report Open the most recent report.
Oxide SLOC: Start Web UI / Stop Web UI Manage the oxide-sloc web dashboard.
Oxide SLOC: Refresh Status Bar Re-run the workspace analysis for the status bar.
Oxide SLOC: Download / Update Binary Download the latest oxide-sloc release for your platform and use it.
Oxide SLOC: Locate / Auto-detect Binary Pick a local build, auto-detect one, or trigger the download.

Settings

Setting Default Description
oxideSloc.binaryPath "" Explicit path to oxide-sloc. Empty = env vars, then PATH. (machine-scoped)
oxideSloc.releaseRepo oxide-sloc/oxide-sloc GitHub owner/repo the download command pulls releases from. (machine-scoped)
oxideSloc.analyzeFlags [] Extra flags appended to analyze (e.g. ["--per-file", "--activity-window", "90"]).
oxideSloc.configPath "" Path to a .oxide-sloc.toml, passed as --config.
oxideSloc.report.viewer external Open reports in the external browser or a webview.
oxideSloc.report.useBinaryOpen false Let oxide-sloc open the report itself (--open).
oxideSloc.statusBar.enabled true Show the status-bar code-line count.
oxideSloc.statusBar.autoRefresh false Re-analyze on every save (can be slow on large trees).
oxideSloc.serve.port 4317 Port for the web UI started from VS Code.

Reports are written to the extension's storage directory, never into your workspace.

Exit codes

The analyze commands map oxide-sloc's exit codes to notifications:

Exit Meaning
0 Success
2 Warnings gate (--fail-on-warnings)
3 Code lines below threshold (--fail-below)
4 SLOC budget exceeded (--fail-on-budget)
5 Growth exceeded baseline (--fail-above-baseline)
6 Cyclomatic complexity exceeded (--max-complexity)

Building from source

This is the companion repository for the VS Code extension. The Visual Studio (VSIX) extension and the CMake integration live in their own repositories — see the main oxide-sloc repo for the full list.

git clone https://github.com/oxide-sloc/oxide-sloc-vscode.git
cd oxide-sloc-vscode
npm install
npm run compile            # type-check and bundle to dist/ (esbuild)
npx @vscode/vsce package   # produce oxide-sloc-<version>.vsix
code --install-extension oxide-sloc-*.vsix

Press F5 in VS Code (with this folder open) to launch an Extension Development Host for live testing.

CI builds the .vsix on every push (see .github/workflows/build.yml) and uploads it as a build artifact. Releases are automatic: whenever package.json's version changes on main, release.yml packages the .vsix, publishes to the VS Code Marketplace and Open VSX (when VSCE_PAT / OVSX_PAT secrets are set), and cuts a tagged GitHub Release with the .vsix attached — it self-skips if that version's tag already exists. A weekly upstream-watch.yml job tracks new oxide-sloc releases so the extension stays linked to the latest tool version.

Cutting a release

  1. Bump version in package.json and add a dated section to CHANGELOG.md.
  2. Merge to main — release.yml publishes and tags it automatically.

One-time setup for Marketplace publishing: create a publisher named oxide-sloc, generate an Azure DevOps PAT with Marketplace > Manage, and add it as the repo secret VSCE_PAT (optionally OVSX_PAT for Open VSX). Until then the publish steps self-skip.

License

AGPL-3.0-or-later. See LICENSE.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft