[Feature Request] Support PMD incremental analysis cache in code-analyzer.yml and CLI

Abierto
#2,109 0 comentarios 0 reacciones 0 asignados Ver en GitHub

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
  1. 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.

  2. 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

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de forcedotcom/code-analyzer

Todos los issues de forcedotcom/code-analyzer

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.