[Feature Request] Support PMD incremental analysis cache in code-analyzer.yml and CLI
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 48/100
- Tipo de issue
- Funcionalidade
- Clareza
- Razoavelmente clara
- Status de atividade
- Ativa
- Stack de tecnologia
- typescript
- Domínio
- tooling
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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
- Linguagem predominante
- TypeScript
- Estrelas
- 241
- Forks
- 53
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de forcedotcom/code-analyzer
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 73/100
forcedotcom/code-analyzer#2106 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
forcedotcom/code-analyzer#2094 ·
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 88/100
forcedotcom/code-analyzer#2093 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
forcedotcom/code-analyzer#2091 ·
-
[BUG][code-analyzer] sfge: calling toString() on an enum aborts the entry point (UnimplementedMethodException)Talvez livre de novo Um pull request para esta issue foi fechado sem ser mesclado. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
forcedotcom/code-analyzer#2090 ·
Todas as issues de forcedotcom/code-analyzer
Issues semelhantes
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 82/100
Doist/todoist-sdk-typescript#740 ·
Mantenedores costumam responder em até 1 dia
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:auth-provider issue-rating: 🦞 diamond lobster no-stale P1
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
steipete/oracle#614 · 1 comentário · 1 reação ·
Mantenedores costumam responder em até 1 dia
-
enhancement
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
MoonshotAI/kimi-code#4591 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
Koenkk/zigbee-herdsman-converters#13656 ·
Mantenedores costumam responder em até 2 dias
-
Report: Mooz Dance SDAbertacheck:passed streams:remove
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 62/100
Mantenedores costumam responder em até 1 dia