dx-code-analyzer-configure

Configure and troubleshoot Salesforce Code Analyzer installations, engines, rules, and CI/CD pipelines.

Updated Jul 2, 2026
One-click install
npx skills add https://github.com/padjei/SF_Build --skill dx-code-analyzer-configure-padjei
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: dx-code-analyzer-configure
Source: https://github.com/padjei/SF_Build/tree/main/.claude/skills/dx-code-analyzer-configure
Command: npx skills add https://github.com/padjei/SF_Build --skill dx-code-analyzer-configure-padjei

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? Setting up Salesforce Code Analyzer involves installing the sf CLI plugin, verifying Java/Node/Python prerequisites, and authoring a correct code-analyzer.yml file where a single misspelled rule name is silently ignored. This Skill handles installation, prerequisite checks, broken-setup diagnosis, and all configuration edits so scans run correctly. ## Core Features & Use Cases - Setup and Diagnostics: Checks sf CLI, plugin, Java 11+, Node 18+, and Python 3 prerequisites, then follows a layered diagnostic flow to fix broken installations one layer at a time. - Configuration Management: Creates or edits code-analyzer.yml for engine enable/disable, ignore patterns, rule severity overrides, suppressions, and engine-specific tuning like SFGE heap size, with fuzzy rule-name resolution to exact names before writing YAML. - CI/CD Pipeline Setup: Generates GitHub Actions, Jenkins, GitLab, or Bitbucket pipelines with quality gates, SARIF upload, and changed-files-only scanning. - Use Case: A developer says "disable the ApexDoc rule, ignore test files, and add a GitHub Actions quality gate" — the Skill resolves the exact rule name, writes only those overrides to code-analyzer.yml, validates with sf code-analyzer config, and produces the workflow file. ## Quick Start Ask the assistant to set up Salesforce Code Analyzer in this project and configure it to ignore test files and fail the build on critical violations.

Frequently Asked Questions about dx-code-analyzer-configure

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I configure Salesforce Code Analyzer for my project?▼

Create a code-analyzer.yml file at your project root containing only the overrides you need, such as ignore patterns or rule severity changes. The CLI auto-discovers it when you run sf code-analyzer run from that directory, and you validate changes with sf code-analyzer config.

How do I disable a rule or change its severity in code-analyzer.yml?▼

Add an entry under rules.<engine>.<rule_name> with severity (1-5) or disabled: true. You must use the exact rule name from sf code-analyzer rules output, because misspelled names are silently ignored with no error.

What prerequisites does Salesforce Code Analyzer need?▼

It requires the sf CLI with the @salesforce/plugin-code-analyzer plugin installed. PMD, CPD, and SFGE need Java 11+, ESLint and RetireJS need Node.js 18+, the Flow engine needs Python 3, and ApexGuru needs an authenticated Salesforce org.

Why is my code-analyzer.yml configuration not being applied?▼

The file must be named exactly code-analyzer.yml and sit in the directory where you run the scan, or be passed via --config-file. Also check YAML indentation (spaces only) and confirm rule names exactly match the registry, since wrong names fail silently.

How do I add Salesforce Code Analyzer to a GitHub Actions pipeline?▼

Use the forcedotcom/run-code-analyzer@v2 action after setting up Node, Java, the sf CLI, and the plugin. Pass run-arguments like --workspace . --rule-selector Recommended and gate the build on the action's num-sev1-violations or changed-files outputs.

How do I fix SFGE out of memory errors during scans?▼

Increase the Java heap by setting engines.sfge.java_max_heap_size in code-analyzer.yml. Use 2g for under 200 Apex classes, 4g for 200-500, and 6g-8g for larger codebases.