[Feature Request] Support PMD incremental analysis cache in code-analyzer.yml and CLI
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 48/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- typescript
- Área
- tooling
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Lenguaje dominante
- TypeScript
- Estrellas
- 241
- Forks
- 53
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de forcedotcom/code-analyzer
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 73/100
forcedotcom/code-analyzer#2106 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
forcedotcom/code-analyzer#2094 ·
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
forcedotcom/code-analyzer#2093 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
forcedotcom/code-analyzer#2091 ·
-
[BUG][code-analyzer] sfge: calling toString() on an enum aborts the entry point (UnimplementedMethodException)Quizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
forcedotcom/code-analyzer#2090 ·
Todos los issues de forcedotcom/code-analyzer
Issues similares
-
guards: accept readonly arrays (and other array-likes) in isEmpty / hasElements / safeLengthAbiertoenhancement tech debt
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
danielmiessler/LifeOS#2533 ·
Los mantenedores suelen responder en 9 días
-
auto:producer auto:uiux
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
fritzprix/libr-agent#2447 ·
Los mantenedores suelen responder en 1 día
-
bug low priority
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100