Skip to main content
새로운 커뮤니티 대화를 Slack으로 이전함에 따라 온라인 Trailblazer Community는 2026년 10월 30일부터 읽기 전용으로 전환됩니다. FAQ를 읽어보십시오.

Explore Salesforce Code Analyzer

Learning Objectives

After completing this unit, you’ll be able to:

  • Identify the key features of Salesforce Code Analyzer.
  • Describe each of the seven prebundled rule engines and their purposes.
  • Explain how to install and set up the Salesforce Code Analyzer extension in Visual Studio Code.

What Is Salesforce Code Analyzer?

Maintaining consistency across a development team and keeping security vulnerabilities out of production can feel like a constant uphill battle. That’s exactly where Salesforce Code Analyzer comes into the picture.

Instead of relying on manual code reviews or waiting for errors to pop up during testing, Salesforce Code Analyzer evaluates your source code directly without executing it. This process, known as static code analysis, allows you to scan your application for code quality issues, formatting issues, and performance bottlenecks before you deploy a single line of code.

Salesforce Code Analyzer is a unified, multi-language static code analysis tool with 700+ built-in rules that:

  • Detects security vulnerabilities such as SOQL injection.
  • Identifies code quality issues such as repetitive code from copy-paste activities.
  • Enforces coding standards consistently across teams such as banning trailing whitespaces.
  • Improves performance by spotting bottlenecks before they impact users.

The tool adapts to your workflow, whether you prefer using CLI commands for automation and CI/CD integration, or the Visual Studio (VS) Code extension for real-time feedback while coding. It features broad language support, works natively with Apex, JavaScript, TypeScript, Visualforce, and more. You can easily customize the 700+ built-in rules or create rules for organization-specific patterns.

Rule Engines

Code Analyzer doesn't work alone—it uses multiple specialized rule engines, each designed to catch different types of issues. Think of these engines as expert reviewers, each with an area of expertise. These engines work simultaneously during a scan, each analyzing your code through its specialized lens.

Rule Engine

Description

CPD

Identifies blocks of duplication across files

ESLint

Evaluates JavaScript, TypeScript, and React component code

Flow Scanner

Audits Salesforce Flows and reports detailed information about security issues

PMD

Performs static analysis of code written in a number of supported languages, such as Apex and Visualforce and PMD AppExchange rules

RetireJS

Analyzes a project’s third-party JavaScript dependencies and identifies security vulnerabilities

Regex

Uses regular expressions (regex) to search your code base for patterns

Salesforce Graph Engine

Performs complex analysis on Apex code and identifies security vulnerabilities and code issues

Set Up Your Environment

Before you scan your code, install Salesforce Code Analyzer. Here’s the setup process.

Prerequisites

To complete the work in this badge, you need these tools on your computer.

Install the Visual Studio Code Extension

The Salesforce Code Analyzer VS Code extension integrates many of Code Analyzer’s most useful features into VS Code, so that you can run them easily with clicks instead of terminal CLI commands.

The VS Code extension gives you immediate feedback while you type, catching violations before you even save your files.

Agentforce Vibes includes the Salesforce Code Analyzer extension.

  1. Open Visual Studio Code.
  2. Select the Extensions icon on the left sidebar, or press Cmd+Shift+X (macOS) or Ctrl+Shift+X (Windows).
  3. In the extension marketplace search box, enter Salesforce Code Analyzer.
  4. Select Install.

After installation completes, reload VS Code if prompted.

Installation is complete and your environment is ready. In the next unit, you’ll run your first scan to see the system in action.

Salesforce 도움말에서 Trailhead 피드백을 공유하세요.

Trailhead에 관한 여러분의 의견에 귀 기울이겠습니다. 이제 Salesforce 도움말 사이트에서 언제든지 새로운 피드백 양식을 작성할 수 있습니다.

자세히 알아보기 의견 공유하기