dead-code
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseDead Code Detection
死代码检测
Find unused functions and dead code using TLDR static analysis.
使用TLDR静态分析查找未使用的函数和死代码。
Quick Start
快速开始
bash
undefinedbash
undefinedScan entire project
Scan entire project
tldr dead .
tldr dead .
Scan specific directory
Scan specific directory
tldr dead src/
tldr dead src/
Specify entry points (functions to exclude from analysis)
Specify entry points (functions to exclude from analysis)
tldr dead . --entry main cli test_
tldr dead . --entry main cli test_
Specify language
Specify language
tldr dead . --lang python
tldr dead . --lang typescript
undefinedtldr dead . --lang python
tldr dead . --lang typescript
undefinedOutput Format
输出格式
Dead code analysis:
Total functions: 150
Dead functions: 12
Unused functions:
- old_helper (src/utils.py:42)
- deprecated_func (src/legacy.py:15)
- _unused_method (src/api.py:230)Dead code analysis:
Total functions: 150
Dead functions: 12
Unused functions:
- old_helper (src/utils.py:42)
- deprecated_func (src/legacy.py:15)
- _unused_method (src/api.py:230)Cross-Platform
跨平台支持
Works on Windows, Mac, and Linux (including WSL).
bash
undefined支持在Windows、Mac和Linux(包括WSL)系统上运行。
bash
undefinedWindows (PowerShell)
Windows (PowerShell)
tldr dead .
tldr dead .
Mac/Linux
Mac/Linux
tldr dead .
undefinedtldr dead .
undefinedEntry Points
入口点
Functions matching entry patterns are excluded from dead code analysis:
- ,
main- Application entry pointscli - ,
test_*- Test functions*_test - ,
setup- Fixturesteardown - ,
@app.route- Framework handlers@api.endpoint
bash
undefined匹配入口点模式的函数将被排除在死代码分析之外:
- ,
main- 应用程序入口点cli - ,
test_*- 测试函数*_test - ,
setup- 测试夹具teardown - ,
@app.route- 框架处理器@api.endpoint
bash
undefinedCustom entry points
Custom entry points
tldr dead src/ --entry main api_handler background_job
undefinedtldr dead src/ --entry main api_handler background_job
undefinedIntegration
集成方式
This skill replaces the session-start-dead-code hook with on-demand analysis.
| Approach | Pros | Cons |
|---|---|---|
| Hook (removed) | Automatic | Slowed startup by 3s |
| Skill (this) | On-demand, fast | Manual invocation |
本技能将session-start-dead-code钩子替换为按需分析。
| 实现方式 | 优点 | 缺点 |
|---|---|---|
| 钩子(已移除) | 自动执行 | 启动速度减慢3秒 |
| 本技能 | 按需执行、速度快 | 需手动调用 |
Related Commands
相关命令
bash
undefinedbash
undefinedImpact analysis (who calls this?)
Impact analysis (who calls this?)
tldr impact func_name .
tldr impact func_name .
Architecture layers
Architecture layers
tldr arch src/
tldr arch src/
Full codebase structure
Full codebase structure
tldr structure . --lang python
undefinedtldr structure . --lang python
undefined