code-analysis

Analyze Apex code with PMD for security and quality issues.

2|Updated Mar 18, 2026
One-click install
npx skills add https://github.com/bhanu91221/claude-sfdx-iq --skill code-analysis-bhanu91221
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: code-analysis
Source: https://github.com/bhanu91221/claude-sfdx-iq/tree/main/skills/code-analysis
Command: npx skills add https://github.com/bhanu91221/claude-sfdx-iq --skill code-analysis-bhanu91221

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Static code analysis for Apex/Salesforce projects to catch security, performance, and maintenance issues early.

Core Features & Use Cases

  • PMD-based analysis of Apex and Salesforce metadata
  • Custom rulesets and cyclomatic complexity checks with CI integration
  • Guidance for setup and automated scans in CI/CD

Quick Start

Install the plugin and run a code-analysis scan in your Salesforce project to start analyzing Apex code.

Frequently Asked Questions about code-analysis

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

FAQPage Schema
How do I run PMD static code analysis on Apex classes in a Salesforce project?

To run PMD static code analysis on Apex classes, you can use Salesforce Code Analyzer integration to scan your project for security, performance, and maintainability defects. This provides guidance for setup and automated scans in CI environments.

What is cyclomatic complexity checking in Apex and why does it matter?

Cyclomatic complexity checking in Apex measures the number of independent paths through your code to assess maintainability. High complexity indicates code that is difficult to test and maintain, which PMD rulesets identify to prevent maintenance issues early.

Can I integrate custom PMD rulesets into a Salesforce CI/CD deployment pipeline?

Yes, you can integrate custom PMD rulesets into a Salesforce CI/CD deployment pipeline. The approach applies PMD-based analysis across Apex and metadata, enabling automated scans during continuous integration to catch defects before deployment.

Does Salesforce Code Analyzer work with PMD for scanning Apex metadata?

Salesforce Code Analyzer works with PMD to scan Apex and Salesforce metadata. This integration applies custom rulesets and cyclomatic complexity checks to identify security vulnerabilities and quality issues across your deployment pipelines.

What is the best way to automate Apex code security scans in a CI environment?

The best way to automate Apex code security scans in a CI environment is integrating PMD with Salesforce Code Analyzer. This setup applies custom rulesets to your Apex metadata, catching security and performance issues early in the CI/CD pipeline.

Why does my Apex code analysis fail to catch deployment pipeline defects?

Apex code analysis fails to catch deployment pipeline defects when custom PMD rulesets are not properly configured for your metadata. Applying Salesforce Code Analyzer with targeted cyclomatic complexity checks ensures security and quality issues are caught early.