graphlint
Dead-code detection for AI-generated codebases: graphlint builds a dependency graph, finds code unreachable from any entry point to enable codebase cleanup and functional‑effectiveness understanding.
一句话定位
Dead-code detection for AI-generated codebases: graphlint builds a dependency graph, finds code unreachable from any entry point to enable codebase cleanup and functional‑effectiveness understanding.
安装方式
在 DSH 的 web profile 中执行下面的命令;装完刷新页面即可。
$ dsh plugin --profile web add 'git+https://github.com/AngelosZou/graphlint.git#4e810d8ff8a380d419316be91ec03936de37393b'
兼容的 DSH 版本
未声明
作者与热度
AngelosZou · ★ 7 · 更新于 2026-10-11
关于这个插件
graphlint
[English](README.md) | [简体中文](docs/zh/README.md)
Dead code detection for AI-generated codebases.
AI agents generate code rapidly, leaving behind dead and redundant code that pollutes the LLM's context window and dilutes attention. Graphlint analyzes your codebase's dependency graph to identify entry points and detect dead code — components unreachable from any entry point — so agents can self-clean and keep the codebase lean.
Supported Languages
| Language | Status | Parser | Features |
|----------|--------|--------|----------|
| Python (.py) | Built-in | ast (stdlib) | Decorators, type annotations, dynamic imports, framework-aware entry detection |
| Rust (.rs) | Built-in (opt-in deps) | tree-sitter | Attribute macros, traits, pub visibility, macro_rules! |
| C# (.cs) | Built-in (opt-in deps) | tree-sitter | Partial classes, properties/indexers/events, attributes, .csproj awareness, test framework entries |
| C / C++ (.c .h .cpp .cc .cxx .hpp .hh .hxx) | Built-in (opt-in deps) | tree-sitter | struct/union/enum members, typedefs, macros, #include tracking, per-TU static linkage, C library entry mode, C++ classes/namespaces/templates, cross-TU member-call resolution |
| TypeScript / JavaScript (.ts .tsx .js .jsx .mts .cts .mjs .cjs) | Built-in (opt-in deps) | tree-sitter | JSX/React components, Next.js pages, NestJS decorators, Jest/Vitest tests, import/export analysis |
| GDScript / Godot (.gd .tscn .tres project.godot) | Built-in (opt-in deps) | tree-sitter + built-in resource parser | Scene/resource attachment, preload/load/class_name, main scene and autoload entries, editor-wired [connection] callbacks, res:// path validation, dynamic-dispatch keep-alive |
Install optional language support:
pip install graphlint[rust] # adds tree-sitter and tree-sitter-rust pip install graphlint[csharp] # adds tree-sitter and tree-sitter-c-sharp pip install graphlint[c] # adds tree-sitter + tree-sitter-c + tree-sitter-cpp (C/C++) pip install graphlint[typescript] # adds tree-sitter + tree-sitter-typescript + tree-sitter-javascript pip install graphlint[godot] # adds tree-sitter + tree-sitter-gdscript (.tscn/.tres/project.godot use the built-in parser)
> C/C++ are analysed by a single unified C/C++ analyzer that owns `.c .h .cpp
> .cc .cxx .hpp .hh .hxx. It uses tree-sitter-c for C files, tree-sitter-cpp`
> for C++ files, and routes a .h by the language of the TU(s) that include it
> — exactly as a C/C++ compiler does. One extra, graphlint[c], installs both
> grammars.
> Godot is likewise analysed by a single unified Godot analyzer that owns
> .gd + .tscn + .tres + project.godot: scripts, scenes, resources and the
> project manifest must share one graph for detect_entries() to see the main
> scene, the autoloads, the script each scene attaches and the callbacks the
> editor wires in one pass. Scripts use tree-sitter-gdscript; the INI-like
> resource formats use a built-in parser.
Features
- Dead code detection — finds components unreachable from any entry point via graph traversal
- Multi-language support — Python, Rust, C#, C/C++ (unified), TypeScript/JavaScript, and GDScript/Godot backends via a language adapter abstraction; Python uses stdlib
ast, the others usetree-sitter(Godot's.tscn/.tres/project.godotuse a built-in resource parser) - Language-specific awareness — Python decorators, Rust attribute macros (
#[tokio::main],#[test]), C# attributes ([Fact],[HttpGet]), C translation-unit scope (staticinternal linkage, per-TU headerstatics) and library entry mode, C++ classes/namespaces/templates,enum classmembers, and cross-TU member-call resolution, TS/JS JSX elements and ES module imports/exports, GDScriptclass_name/signal/@export/@onready/@tool/@rpc, scene andExtResourceattachment, trait implementations,pub/publicvisibility, partial classes, and more - AST/CST parsing — extracts functions, methods, structs, enums, traits, impls, macros, classes, properties, indexers, events, variables, and fields; aware of type annotations, destructured variables, and generics
- Dependency graph — builds directed edges:
read,write,call,inherit,decorate - Entry point detection — built-in rules covering Python frameworks (FastAPI, Flask, Django, Click, Typer, Celery, pytest), Rust conventions (main, async runtimes, WASM, proc macros, FFI, tests, pub API), .NET conventions (console, xUnit, NUnit, MSTest, Web API, Minimal API, Generic Host, WinForms, WPF), C/C++ conventions (
main/WinMain/wWinMain/DllMain/_tmainfor C and a freemainfor C++,class_definition:patterns,test_fileby convention, and C library mode via external-linkage symbols), TS/JS conventions (main, module index, CLI/server listen, Next.js pages, NestJS decorators, React JSX, Jest/Vitest tests), and Godot conventions (theproject.godotmanifest,class_namepublic classes,@tooleditor scripts,@rpcremote methods, GUT/gdUnit4 tests, literal string dispatch and.tscn-wired callbacks) plus custom rules - Configurable entry templates — add custom entry rules via
ast_patternprefixes includingfunction_call:,function_def:,decorator:,class_definition:(C#),file_match:,file_is_program(C#),visibility:pub(Rust),visibility:public(C#),trait_impl:(Rust),macro_def:(Rust),jsx_element:(TypeScript),export:(TypeScript), and more --public-as-entryflag — treat all public items (Rustpub, C#public, C external-linkage symbols) as entry points for library analysis- Warning detection — 10 warning types including unused imports, write-only variables, dead code, and more
- Incremental updates — after initial full scan, only changed files are re-indexed; delta-aware reachability analy
同分类对比
同一分类下 Star 最高的 5 个,便于横向比较。
| 插件 | 作者 | Star | 版本 | 更新 |
|---|---|---|---|---|
| brooks-lint | hyhmrright | 1.6K | 1.9.1 | 2026-11-10 |
| helm-d | ADWMC | 1.2K | 0.0.0 | 2026-11-04 |
| dsh-startup-screen | 6shenhonghong9 | 814 | 1.3.0 | 2026-10-31 |
| dsh-reverse-skill | dhicoc | 341 | 1.0.5 | 2026-10-08 |
| dsh-startup-secret | huzhengcai471-crypto | 197 | 1.5.2 | 2026-10-29 |