[Feature Request] Support PMD incremental analysis cache in code-analyzer.yml and CLI
還沒有人認領這個 Issue。
評估
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 新手友好度
- 48/100
- Issue 類型
- 功能
- 描述清晰度
- 基本清楚
- 活躍度
- 活躍
- 技術堆疊
- typescript
- 領域
- tooling
研究方向
Start by reading the PMD engine wrapper and its configuration handling, then trace how sf code-analyzer run builds the PMD command. The issue does not name those files or tests, so locate the existing PMD options and related tests first. Done means a configured cache path reaches PMD as --cache <path> and the behavior is covered for the YAML configuration or CLI option.
由索引模型根據 Issue 內容生成。
描述
Product Area
An Engine
Your Need or Problem
Related to #671 .
Was this implemented in v5 or is it still planned to be implemented in the future?
In large enterprise codebases with hundreds of Apex classes and custom PMD rulesets, running static code analysis via sf code-analyzer run can take a significant amount of time.
Your Desired Solution
1. Configuration in code-analyzer.yml
Expose a configuration property under engines.pmd to specify the cache file path or toggle caching:
engines:
pmd:
cache_file: .pmdcache # Path to the incremental analysis cache file
custom_rulesets:
- config/pmd-ruleset.xml
2. Passthrough to PMD Runtime
When cache_file is specified (or enabled via a CLI flag such as --pmd-cache), the PMD engine wrapper should append --cache to the underlying PMD command invocation.
Alternatives Considered
-
Targeting files via git diff:
Passing only changed files (--target) works for simple commit-level scans, but it does not maintain a persistent baseline for full-branch audits, nightly builds, or full CI matrix runs where a full repository scan is expected. -
Invoking native PMD directly:
Running native PMD CLI (pmd check --cache ...) allows incremental analysis, but we lose Salesforce Code Analyzer’s unified reporting, severity normalization, exit code management, and multi-engine orchestration (e.g., combining PMD with ESLint or Sfge).
Additional Context (Screenshots, Files, etc)
-
Target Engine: PMD (PMD 7.x)
-
Environment: Enterprise CI/CD pipelines (GitHub Actions, Azure DevOps, GitLab CI) and local pre-commit hooks where reducing turnaround time directly improves developer productivity.
Workaround
No response
Urgency
Low
- 主要語言
- TypeScript
- 星號
- 241
- 分支
- 53
- PR 合併指標
- 30 天內沒有已合併 PR
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
forcedotcom/code-analyzer 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 73/100
forcedotcom/code-analyzer#2106 ·
-
難度 2/5 1-3 小時 新手友好度 78/100
forcedotcom/code-analyzer#2094 ·
-
難度 1/5 1 小時以內 新手友好度 88/100
forcedotcom/code-analyzer#2093 ·
-
難度 2/5 1-3 小時 新手友好度 82/100
forcedotcom/code-analyzer#2091 ·
-
[BUG][code-analyzer] sfge: calling toString() on an enum aborts the entry point (UnimplementedMethodException)可能重新可做 關聯的 PR 已關閉且未合併。 未關閉
難度 2/5 1-3 小時 新手友好度 76/100
forcedotcom/code-analyzer#2090 ·
查看 forcedotcom/code-analyzer 的全部 Issue
相似的 Issue
-
backend bug documentation
難度 2/5 1-3 小時 新手友好度 78/100
geolens-io/geolens#3568 ·
維護者通常 1 天內回覆
-
area:docs documentation good first issue priority:low
難度 1/5 1 小時以內 新手友好度 80/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 75/100
microsoft/TypeScript#65083 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 67/100
維護者通常 1 天內回覆
-
bug p2 platform:web triaged
難度 2/5 1-3 小時 新手友好度 72/100
維護者通常 1 天內回覆