Investigate adding fallow for dead code and codebase health analysis
@EhabY 已经在做这个了。
开始于 2026年4月15日。
评估
这个 Issue 还没有评估数据。
描述
Summary
fallow is a Rust-based codebase analysis tool that detects dead code, circular dependencies, code duplication, and complexity hotspots. It is much faster than Knip (5-41x in benchmarks) and works with zero configuration. It auto-detected our Electron + Vite + Vitest + TypeScript setup out of the box.
Trial run on this repo
I ran npx fallow against the current codebase. It analyzed 213 files in 0.34 seconds and found:
Dead code
- 2 unused files --
.vscode-test.mjsandtest/mocks/vscode.runtime.ts - 5 unused exports --
getEventName,AgentMetadataEventSchema,REMOTE_SSH_EXTENSION_IDS,RemoteSSHLogPortRegex,MockOAuthInterceptor - 15 unused type exports -- across
exec.ts,eventStreamConnection.ts,sshConfig.ts,remote.ts, and others - 119 unused class members -- mostly in test mock helpers (46 in
testHelpers.tsalone), but also 8 incoderApi.tsand 8 inpathResolver.ts
Circular dependencies (2 cycles)
cliCredentialManager.ts->cliExec.ts->cli.ts->cliCredentialManager.ts(11 files affected)- A shorter cycle through the same area
Code duplication
- 73 clone groups detected, including repeated patterns in test setup and SSH config handling
Complexity hotspots
extension.ts:activate-- cognitive complexity 30workspacesProvider.ts:getChildren-- cognitive complexity 37remote.ts:setup-- cognitive complexity 32
Maintainability
- Overall maintainability index: 91.0 (rated "good")
What would be useful
- Dead code cleanup -- the unused exports and types are low-hanging fruit. Fallow can auto-fix these with
fallow fix --dry-run. - CI integration -- fallow has a GitHub Action that can run on PRs with
--since mainto catch new dead code before it lands. - Circular dependency tracking -- the two cycles through
cliCredentialManager/cliExec/cliare flagged as the top refactoring targets.
Caveats
- Fallow does syntactic analysis only (no TypeScript type resolution), so some "unused" class members may actually be consumed through interfaces or dynamic access. The test mock findings in particular will need filtering.
- VS Code extension APIs use a lot of convention-based exports (e.g.
activate/deactivate) that fallow already handles via its Electron plugin, but edge cases are possible.
Suggested next steps
- Review the unused exports/types and clean up what is genuinely dead
- Decide if fallow should be added as a dev dependency or just run ad-hoc
- Consider adding a
pnpm fallowscript and/or CI check for new dead code on PRs
- 主要语言
- TypeScript
- 星标
- 131
- 派生
- 48
- 平均合并
- 4 天 15 小时
- 30 天内合并 PR
- 17
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
coder/vscode-coder 的其他 Issue
-
coder/vscode-coder#1125 · 1 条评论 · 已指派 1 人 ·
-
tech-debt
coder/vscode-coder#1119 · 1 条评论 · 已指派 1 人 ·
-
enhancement tech-debt
难度 3/5 1-2 天 新手友好度 74/100
coder/vscode-coder#1118 · 1 条评论 ·
-
coder/vscode-coder#1113 · 3 条评论 · 已指派 1 人 ·
-
enhancement tech-debt
难度 5/5 一周以上 新手友好度 45/100
coder/vscode-coder#1112 · 1 条评论 ·
查看 coder/vscode-coder 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
vercel-labs/just-bash#464 ·
-
looksLikeSlug() is ASCII-only, so non-Latin entity slugs (e.g. Korean) skip exact match and collapse 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 2/5 1-3 小时 新手友好度 65/100
-
难度 2/5 1-3 小时 新手友好度 65/100
-
难度 1/5 1 小时以内 新手友好度 90/100
TanStack/tanstack.com#1293 ·