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.11

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

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

# Docker (Docker Hub)
docker pull fedoroff/code-split:0.1.0-alpha.11

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

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.0a11.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.0a11-py3-none-win_amd64.whl (10.4 MB view details)

Uploaded Python 3Windows x86-64

code_split-0.1.0a11-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.0a11-py3-none-manylinux_2_28_aarch64.whl (9.9 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ ARM64

code_split-0.1.0a11-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.0a11.tar.gz.

File metadata

  • Download URL: code_split-0.1.0a11.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.0a11.tar.gz
Algorithm Hash digest
SHA256 e140897889bb03d9f19669a18f5531d3298ba505f49b7b37ada41f8ee6e944a3
MD5 f16872b6eac7040a3d4835a654fc950c
BLAKE2b-256 b5c550a90757bf96e9772bf4575ee95411de7cddd0cf8970aa500b62c5008e02

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for code_split-0.1.0a11-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 1c3ae980d2effa3dc253c0dc68f1c82bb0ef1e0de7e44dd0ff6fd95050162d39
MD5 5cbbf547776165d85de1644f55b67ad2
BLAKE2b-256 6aabcfabba4da585212f701f2a03bbdf3700622c20a2476c801605d099add63a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for code_split-0.1.0a11-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 9fef7e1970593f3379885bf222d4ffb26d0a7dff7b8707fd043659432513844a
MD5 4e6922efc953374d4e1acd502a350aee
BLAKE2b-256 bdec64c297b02fb7fb9722f3b27d51222f9f201fd4b12a3e9d42e78661d99a51

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for code_split-0.1.0a11-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 7e44d84a0edfc486a0d619d76061ffe0fa81ffe05ba51e84ecc48dc0ea95c7df
MD5 b29257671ee16e4d5ddd09adb022d862
BLAKE2b-256 e2b800379634e2b4dcc217c4388d045cd08d54b666bfd6b9bd3cf1e0dbeb878f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for code_split-0.1.0a11-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 92bd3e000388378a6e93ad19aa961df155a4220b67d1b158f113697ba9341dd9
MD5 bca4000f8e7ad0202295fba8fb766df2
BLAKE2b-256 6c02a071f5a2bcb1db8f9bd682d8c6174a53e80436de0d71e35eb11484f55230

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