deslop
deslop is a Rust-based static analyzer for Go repositories that focuses on signals commonly associated with low-context AI-generated code. It currently scans a repository, parses Go files with tree-sitter-go, extracts structural fingerprints for each function, builds a lightweight local package index, runs early heuristic checks, and can benchmark the pipeline against real Go repositories.
Overview
The current implementation is optimized around a fast full-repository pass:
- walk the target tree with
.gitignoreawareness - skip common generated-code inputs and
vendor/paths - parse Go files with tree-sitter-go
- fingerprint functions and methods with lightweight structural metrics
- flag generic naming, overlong naming, weak typing, comment-style slop, weak crypto usage, hardcoded secret literals, dynamically constructed SQL queries, conservative missing-context cases, missing derived-context cancellation, looped sleep and select-default busy waiting, looped JSON marshaling, looped string concatenation, goroutine fan-out inside loops, looping goroutines without shutdown paths, mutex pressure signals, allocation churn, fmt or reflect hot-path calls, full-memory read patterns, looped database query-shape issues, mixed receiver styles, suspicious struct tags, and low-signal test bodies
- use a local package index to catch some unresolved repository-local calls
- benchmark discovery, parse, index, heuristic, and total runtime stages
Commands
Run a scan against a target path:
By default, scan output prints the scan summary plus the standard finding set. Detail-only diagnostics such as full_dataset_load are held back unless you pass --details.
Run the same scan with JSON output:
Show full per-function fingerprint details and detail-only findings in either text or JSON output:
Write scan output directly to a file:
Run a scan without .gitignore filtering:
Benchmark the current pipeline against a real local Go repository:
Benchmark with explicit repeats and warmups:
Benchmark with JSON output:
Development
Run the test suite:
Build release executables for your current platform or cross-compile for other supported platforms:
If you are cross-compiling, make sure the matching Rust target is installed first. Adjust the target triple to match the architecture you want to ship:
The native release binary is written to target/release/. Cross-compiled binaries are written under target/<target-triple>/release/ and are named deslop on Unix-like systems and deslop.exe on Windows.
For a detailed architecture and roadmap guide, see guides/implementation-guide.md.
For a detector-oriented overview, see guides/features-and-detections.md.