Skip to main content

Polyglot structural-analysis platform: extract dependency graphs, visualize coupling, track architectural drift.

Project description

code-split

Structural-analysis tool for Rust, Python, JavaScript and TypeScript codebases. Built AI-agent-friendly first — finds where a project has structural problems and hands an actionable shortlist to a human or an AI agent for the actual refactor.

Status: pre-alpha. APIs and output shapes may change without notice. Pin a specific version.

What it finds

  • Components that grew too complex and should be split. Per-function and per-module cyclomatic / cognitive / Halstead / MI metrics; flags entities above your threshold.
  • Strong coupling between components. Computes fan-in / fan-out / HK on the call and module graphs; surfaces the modules that everything depends on (or that depend on everything).
  • Cyclic dependencies. Detects SCCs at module, file and function level — including the silent ones the compiler does not catch.
  • Files that are just too big. Raw LOC, public surface size, item / method counts per file.

The tool does not refactor for you. It produces a structured, machine-readable list of problem spots and an offline HTML report a human or an LLM can act on.

CI integration

Runs as a linter. Configure thresholds in code-split.toml; the CLI exits non-zero when the codebase breaches them — so a PR that introduces a new cycle, a function above your cognitive budget, or a file above your LOC limit fails the build.

code-split analyze --plugin rust . && \
  code-split lint --max-cycles 0 --max-cognitive 25 --max-loc 800

Full CLI

Written in Rust — fast, memory-safe, single static-ish binary with no runtime dependencies (no Python, no Node, no JVM, no shared libs to install). One file on PATH, done.

Everything is driven from the command line: analyze → snapshot JSON, report → offline HTML, diff → before/after report between two snapshots, lint → CI gate. No daemon, no language server, no plugin host required at runtime.

HTML report with dynamic diagrams

code-split report writes a single self-contained HTML file with:

  • Three interactive levels: modules, files, functions.
  • Dagre-laid-out graph with pan/zoom and live filtering.
  • Sortable tables per metric; click a node to open its neighbourhood.
  • "Prompt generator" panel that copies a ready-to-paste prompt (one for each principle: ADP, SRP, OCP, LSP, ISP, DIP, DRY, KISS, LoD, MISU, CoI, YAGNI; plus Reduce Complexity, Split Components) — feed the prompt + the selected nodes to your AI agent.

No network, no analytics, no telemetry. Open in any browser, share as a file.

Install

Pick a channel:

# universal — shell installer that drops the prebuilt binary on PATH
curl -fsSL https://github.com/ffedoroff/code-split/releases/latest/download/code-split-installer.sh | sh

# Windows
powershell -ExecutionPolicy ByPass -c "irm https://github.com/ffedoroff/code-split/releases/latest/download/code-split-installer.ps1 | iex"

# Rust (Cargo)
cargo install code-split --version 0.1.0-alpha.10

# Node (npm)
npm install -g code-split

# Python (pip / uv / pipx)
pip install code-split

# Docker (Docker Hub)
docker pull ffedoroff/code-split:0.1.0-alpha.10

# Docker (GHCR — no anonymous rate limits)
docker pull ghcr.io/ffedoroff/code-split:0.1.0-alpha.10

All channels ship the same code-split binary built from the same Rust source. Linux (x86_64, aarch64), macOS (x86_64, aarch64), Windows (x86_64).

Quick start

# extract dependency graphs from a workspace
code-split analyze --plugin rust ./path/to/project
# → modules.json / files.json / functions.json

# generate an offline interactive HTML report
code-split report ./snapshots/latest

# before / after refactor comparison
code-split diff ./snapshots/before ./snapshots/after

Built-in plugins: rust (cargo + syn + rust-analyzer), python, javascript (also handles TypeScript). Third-party plugins resolved as code-split-plugin-<name> on PATH.

Documentation

  • PRD — product requirements
  • DESIGN — technical design
  • Principles corpus — Rust / Python / TypeScript principle catalogues used by the prompt generator

License

Apache-2.0.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

code_split-0.1.0a10.tar.gz (816.1 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

code_split-0.1.0a10-py3-none-win_amd64.whl (10.4 MB view details)

Uploaded Python 3Windows x86-64

code_split-0.1.0a10-py3-none-manylinux_2_28_x86_64.whl (10.6 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ x86-64

code_split-0.1.0a10-py3-none-manylinux_2_28_aarch64.whl (9.9 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ ARM64

code_split-0.1.0a10-py3-none-macosx_11_0_arm64.whl (10.0 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

File details

Details for the file code_split-0.1.0a10.tar.gz.

File metadata

  • Download URL: code_split-0.1.0a10.tar.gz
  • Upload date:
  • Size: 816.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for code_split-0.1.0a10.tar.gz
Algorithm Hash digest
SHA256 6c9e660da819a95b63c7f17c0f7bd372fb0821dfb259e9cef1eff198a5d77c55
MD5 b0ab02d123e1203b0d21832a97ec3ebb
BLAKE2b-256 dabdaf7e9eeb4557cb799b7e3cf5ffa125361e0f703a554a134230849c10c6bd

See more details on using hashes here.

File details

Details for the file code_split-0.1.0a10-py3-none-win_amd64.whl.

File metadata

File hashes

Hashes for code_split-0.1.0a10-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 b82b759afea9d88392581f55ffe7d7218066e17f3a84897a82ac49c2e008708b
MD5 57cbf391147c276d3f779795052cfc80
BLAKE2b-256 371c6eec0a12067690aad3aacc2f0035b8884206e99159493ea3e3ca121af5ae

See more details on using hashes here.

File details

Details for the file code_split-0.1.0a10-py3-none-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for code_split-0.1.0a10-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 4321a0309ea79090632d60f90198a4ba9468c556d5af528f8a7f3997a73103f8
MD5 7395bb43257796759429238058c8bf9b
BLAKE2b-256 b1f2c59f10d2400fed646be884243b1e0cec997d44bbf56c336fdc32bf499432

See more details on using hashes here.

File details

Details for the file code_split-0.1.0a10-py3-none-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for code_split-0.1.0a10-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 96ef47adbb1c574ce34469fb7da1ef59baa58a67ab3870ad7e619a8d5149a0d5
MD5 f38e269333876af5e02daf84b0a14db6
BLAKE2b-256 82b200968f8ad6357a509c1333f739b1f20051c7afb6c660b796dee5981cfa86

See more details on using hashes here.

File details

Details for the file code_split-0.1.0a10-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for code_split-0.1.0a10-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 496e7acbdec7fbb47997a5e0335c9363b945e8affd3d2942d5ff1e77e82558da
MD5 fde2f72db7447fb7a694341b22f0a564
BLAKE2b-256 ed1425343ae43a377a81df9bbb22f6e2a15ac47cb6f914fdd889a0f8edc3ec3c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page