91ºÚÁÏÍø

Articles
4/28/2023
10 minutes

Maximize Your Code Quality, Security and performance with 91ºÚÁÏÍø Salesforce Code Analyzer

Written by
Abhishek Saxena
Table of contents

Salesforce Code Analyzer is Salesforce’s open source code quality, security and performance monitoring tool. It’s the one stop shop that aggregates different static code analysis tools, as well as multiple open-source static application security testing (SAST) tools to help you write secure and clean code. Salesforce Code Analyzer unifies all of them under a unified Salesforce CLI experience.

â€

Code Analyzer currently supports the PMD Copy Paste Detector, , , and Salesforce Graph Engine. Using these, it can identify a variety of security, quality, and performance issues early in the development lifecycle and help monitor code health.Ìý

â€

Having used the Code Analyzer in the past, I knew how powerful it is. Thus using and a I created an integration between 91ºÚÁÏÍø and Code Analyzer, and got it .Ìý

â€

This quality gate 

  • Runs the SFDX Analyzer for the changed components between your branch and the target branch
  • Provides the user the ability to configure it to run in an automated manner or trigger it manually on every user story.
  • Fail or Pass the job, depending on the Acceptance Criteria chosen by the user.

Let’s take a look at how to install and configure it to use as a Quality Gate within a DevOps Pipeline.

â€

Pre-requisites

  1. or higher
  2. 91ºÚÁÏÍø Quality Tools extension v1.14 or higher
  3. 91ºÚÁÏÍø DX Extension v3.3 or higher

This extension is currently only supported for . Thus, you should have a working 2nd Generation 91ºÚÁÏÍø pipeline.

â€

Install and configure the extension

  1. Navigate to the listing of on 91ºÚÁÏ꿉۪s DevOps Exchange.
  2. Click on Get it now, and then install it in your org.
  3. Follow the to create required picklist values, extension records and quality gates.

â€

Reviewing the Extension’s configurable parameters

  1. Click on App Launcher, and navigate to Functions.
  2. Open the Run SFDX Code Analyzer QIF function, switch to the Parameters sub tab.
  3. There are two configurable parameters, that’re important to know.
  4. severityThreshold - This dictates when this extension should fail. When violations are found with equal or greater severity than the provided value it proceeds to fail the job. Normalized severity values are: 1 (high), 2 (moderate), and 3 (low). Exit code is the most severe violation. The default value set is 2. Feel free to edit it as per your project needs.
  5. engine - Specifies one or more engines to run. You can submit multiple values as a comma-separated list. Valid values need to be from either of these eslint,eslint-lwc,eslint-typescript,pmd,retire-js,cpd. The default OOB value is set to eslint-lwc,pmd,cpd,retire-js. Feel free to edit it as per your project needs.

â€

Create Quality Gates and Quality Gate Rule Conditions

Now that we’ve reviewed the extension’s configurable parameters, let’s create two Quality Gate Rules. The different scanners are grouped as two separate Quality Gates:

  1. PMD, ESLint, RetireJS, PMD Copy Paste Detector can be run from the sfdx-scanner extension configuration.
  2. The Salesforce Graph Engine for Data Flow Analysis(DFA) can be run from the sfdx-scanner-dfa extension configuration.

If you followed the installation instructions, the Quality Gates should already be created, if not then let’s just take a quick recap on how to set up Quality Gates.

â€

Creating Quality Gates

  1. Go to App Launcher > Quality Gate Rules, and click the New button.
  2. Quality Gate Rule Name: SFDX Scanner
  3. Tool: sfdx-scanner
  4. Status: Active
  5. Execution Sequence: After, Commit

Repeat the process, to create another Quality Gate for the sfdx-scanner-dfa tool.

â€

Quality Gate Rule

What we’ve configured here, tells 91ºÚÁÏÍø when to invoke this Quality Gate, and we’ve chosen to invoke it After Commit. We could configure it to run at other different places like before a deployment or a merge(promotion) as well.

Now, we need to create a Quality Gate Rule Condition, so we can apply this Quality Gate to correct environments, stages and/or pipelines as well as trigger it based on a specific filter criteria.

â€

Creating a Quality Gate Rule Condition

  1. On the SFDX Scanner Quality Gate, go to the Conditions sub-tab and click New.
  2. Extension Configuration: SFDX Scanner Config
  3. Platform: SFDX
  4. Tests From: User Story
  5. Pipeline: CICD 2nd Gen Pipeline
  6. Environment and Stage: Let’s leave them blank for this example.
  7. ¹ó¾±±ô³Ù±ð°ù:Ìý
  8. Type contains Apex
  9. Type contains LightningComponentBundle
  10. Type contains AuraDefinitionBundle
Quality Gate Rule Condition

We could make the rule condition even more restrictive or relaxed by configuring it to run for specific environments or .

Repeat the steps to create a QGRC for SFDX Scanner DFA Quality Gate.

â€

Monitoring progress and checking execution results

We’re now ready to run our Quality Gate, let’s try to commit an Apex Class and a LWC that follow bad coding practices. If you have your own metadata, feel free to skip this step and run it through your actual metadata.

â€

Creating Metadata to commit

1. Create an ApexClass called ContactUpdater with the following code:

â€

ApexClass ContactUpdater Code

â€

2. Create a LWC component called contactUpdateLWC and paste the following code in the contactUpdateLWC.js file

â€

Contact Update LWC Code

Save and deploy both of them to your Dev environment.Ìý

â€

Committing the Metadata Changes

1.ÌýCreate or open a User Story tied to an Environment and a Project that relate to a CICD 2nd Gen Pipeline since this is the pipeline where we’ve set our Quality Gate Rule Condition to trigger out of.

â€

User Story

2. Click on Commit Changes, and select the appropriate date and time to show recent changes and commit them.

â€

User Story Commit Grid

3. You should be redirected to the User Story Commit record, as soon as you click on Commit. Here on the right hand side, you should start to see the job steps that’d happen in this commit.

  • Commit
  • Create Test Records
  • SFDX Scanner

SFDX Scanner is here since we created the Quality Gate Rule to trigger after commits. You can expand any of the sections to see the process of a particular Job Step. Once all of them finish, you’d notice that the SFDX Scanner failed.

â€

User Story Commit Record

Review Result

1. Let’s click on the SFDX Scanner Job Step.

â€

User Story Commit Selected

2.ÌýAfter opening the Job Step, click on the result record tied to the failed Run SFDX Code Analyzer job step.

â€

SFDX Scanner Job Step

3. On the result record, you can view the logs, by switching to the logs tab, as well as see the attached result.html file.Ìý

4. Download and open the results.html file, it should look like this

â€

Salesforce Code Analyzer Report - Result 1
Salesforce Code Analyzer - Result 2

Thus, we could see how SFDX Scanner is giving the Developers immediate feedback through its different engines as soon as they commit their changes.Ìý

â€

Conclusion

Salesforce Code Analyzer captures complex violations including those that’re caught only during the AppExchange Security Review process courtesy its Data Flow Analysis via the Graph Engine. Thus, it’s a perfect solution for ISV developers as well as Salesforce application developers to use this extension to prepare for a formal security review process. Using this extension, teams can identify a variety of security, quality, and performance issues early in development and ship better solutions and products.

â€

Book a demo

About The Author

Technical Architect

Abhishek is a Salesforce DevOps Architect who’s passionate about improving the software development lifecycle. For the last several years he has been working with enterprise customers to help build, design, and customize scalable Salesforce DevOps solutions. He is 8x Salesforce Certified and holds several certifications on major Salesforce DevOps tools.

91ºÚÁÏÍø Introduces ´¡²µ±ð²Ô³Ù¾±²¹â„¢, Bringing Context-Aware AI Agents to Salesforce DevOps
DevOps Pipeline Best Practices
DevSecOps vs. DevOps
DevOps vs. Agile
Generative AI in DevOps
How DevOps Teams Use AI to Win
Using AI in DevOps
Agentic AI in DevOps: Automation Solutions for Teams
91ºÚÁÏÍø Awarded on CarahSoft’s GSA Schedule, Expanding Access for Federal Agencies
Salesforce Agentforce AI Capabilities and Solutions
Salesforce AI Agent Software Features for DevOps Teams
91ºÚÁÏÍø Renews FedRAMP Authorization and Advances Toward IL5 to Support U.S. Military Organizations
91ºÚÁÏÍø Appoints Rajit Joseph as Chief Product Officer to Accelerate AI-Driven Customer Success and Product Innovation
91ºÚÁÏÍø Recognized in Salesforce 2025 Partner Innovation Awards
91ºÚÁÏÍø Appoints Gaurav Kheterpal as Chief Evangelist to Accelerate Global DevOps Community Growth
91ºÚÁÏÍø CI/CD & Robotic Testing Now TX-RAMP Certified for Texas Government
Org Intelligence: Why Context Matters So Much in Salesforce DevOps Tools
Hubbl Technologies and 91ºÚÁÏÍø Forge Strategic Alliance to Power AI-Driven DevOps with Deep SaaS Context
From Chaos to Control: Why Public Sector Teams Are Moving Beyond Manual Pipelines
91ºÚÁÏÍø Hosts India's Flagship DevOps Conference in Response to Overwhelming Demand
What Does “Org Intelligence†Really Mean for Salesforce Teams?
91ºÚÁÏÍø Launches Org Intelligence to Provide End-to-End Visibility into Salesforce Environments
Why Pipeline Visibility Is Key to Successful Salesforce DevOps Transformation
91ºÚÁÏÍø Robotic Testing Now in AWS Marketplace, AI-Powered Salesforce Test Automation at Scale
Navigating User Acceptance Testing on Salesforce: Challenges, Best Practices and Strategy
Navigating Salesforce Data Cloud: DevOps Challenges and Solutions for Salesforce Developers
Chapter 8: Salesforce Testing Strategy
Beyond the Agentforce Testing Center
How to Deploy Agentforce: A Step-by-Step Guide
How AI Agents Are Transforming Salesforce Revenue Cloud
The Hidden Costs of Building Your Own Salesforce DevOps Solution
Chapter 7 - Talk (Test) Data to Me
91ºÚÁÏÍø Announces DevOps Automation Agent on Salesforce AgentExchange
Deploying CPQ and Revenue Cloud: A DevOps Approach
91ºÚÁÏÍø Launches AI-Powered DevOps Agents on Slack Marketplace
Redefining the Future of DevOps: Salesforce’s Pioneering Ideas and Innovations
91ºÚÁÏÍø Announces DevOps Support for Salesforce Data Cloud, Accelerating AI-Powered Agent Development
AI-Powered Releasing for Salesforce DevOps
Top 3 Pain Points in DevOps — And How 91ºÚÁÏÍø AI Platform Solves Them
91ºÚÁÏÍø AI Platform: A New Era of Salesforce DevOps
91ºÚÁÏÍø Expands Its Operations in Japan with SunBridge Partners
Chapter 6: Test Case Design
Article: Making DevOps Easier and Faster with AI
Chapter 5: Automated Testing
Reimagining Salesforce Development with 91ºÚÁÏÍø's AI-Powered Platform
Planning User Acceptance Testing (UAT): Tips and Tricks for a Smooth and Enjoyable UAT
What is DevOps for Business Applications
Testing End-to-End Salesforce Flows: Web and Mobile Applications
91ºÚÁÏÍø Integrates Powerful AI Solutions into Its Community as It Surpasses the 100,000 Member Milestone
How to get non-technical users onboard with Salesforce UAT testing
DevOps Excellence within Salesforce Ecosystem
Best Practices for AI in Salesforce Testing
6 testing metrics that’ll speed up your Salesforce release velocity (and how to track them)
Chapter 4: Manual Testing Overview
AI Driven Testing for Salesforce
Chapter 3: Testing Fun-damentals
AI-powered Planning for Salesforce Development
Salesforce Deployment: Avoid Common Pitfalls with AI-Powered Release Management
Exploring DevOps for Different Types of Salesforce Clouds
91ºÚÁÏÍø Launches Suite of AI Agents to Transform Business Application Delivery
What’s Special About Testing Salesforce? - Chapter 2
Why Test Salesforce? - Chapter 1
Continuous Integration for Salesforce Development
Comparing Top AI Testing Tools for Salesforce
Avoid Deployment Conflicts with 91ºÚÁÏ꿉۪s Selective Commit Feature: A New Way to Handle Overlapping Changes
Enhancing Salesforce Security with AppOmni and 91ºÚÁÏÍø Integration: Insights, Uses and Best Practices
From Learner to Leader: Journey to 91ºÚÁÏÍø Champion of the Year
The Future of Salesforce DevOps: Leveraging AI for Efficient Conflict Management
A Guide to Using AI for Salesforce Development Issues
How to Sync Salesforce Environments with Back Promotions
91ºÚÁÏÍø and Wipro Team Up to Transform Salesforce DevOps
DevOps Needs for Operations in China: Salesforce on Alibaba Cloud
What is Salesforce Deployment Automation? How to Use Salesforce Automation Tools
Maximizing 91ºÚÁÏÍø's Cooperation with Essential Salesforce Instruments
From Chaos to Clarity: Managing Salesforce Environment Merges and Consolidations
Future Trends in Salesforce DevOps: What Architects Need to Know
Enhancing Customer Service with 91ºÚÁÏÍøGPT Technology
What is Efficient Low Code Deployment?
91ºÚÁÏÍø Launches Test Copilot to Deliver AI-powered Rapid Test Creation
Cloud-Native Testing Automation: A Comprehensive Guide
A Guide to Effective Change Management in Salesforce for DevOps Teams
Building a Scalable Governance Framework for Sustainable Value
91ºÚÁÏÍø Launches 91ºÚÁÏÍø Explorer to Simplify and Streamline Testing on Salesforce
Exploring Top Cloud Automation Testing Tools
Master Salesforce DevOps with 91ºÚÁÏÍø Robotic Testing
Exploratory Testing vs. Automated Testing: Finding the Right Balance
A Guide to Salesforce Source Control | 91ºÚÁÏÍø
A Guide to DevOps Branching Strategies
Family Time vs. Mobile App Release Days: Can Test Automation Help Us Have Both?
How to Resolve Salesforce Merge Conflicts: A Guide
91ºÚÁÏÍø Expands Beta Access to 91ºÚÁÏÍøGPT for All Customers, Revolutionizing SaaS DevOps with AI
Is Mobile Test Automation Unnecessarily Hard? A Guide to Simplify Mobile Test Automation
From Silos to Streamlined Development: Tarun’s Tale of DevOps Success
Simplified Scaling: 10 Ways to Grow Your Salesforce Development Practice
What is Salesforce Incident Management?
What Is Automated Salesforce Testing? Choosing the Right Automation Tool for Salesforce
91ºÚÁÏÍø Appoints Seasoned Sales Executive Bob Grewal to Chief Revenue Officer
Business Benefits of DevOps: A Guide
91ºÚÁÏÍø Brings Generative AI to Its DevOps Platform to Improve Software Development for Enterprise SaaS
91ºÚÁÏÍø Celebrates 10 Years of DevOps for Enterprise SaaS Solutions
Go back to resources
There is no previous posts
Go back to resources
There is no next posts

Explore more about

Quality Assurance
Articles
April 14, 2026
91ºÚÁÏÍø Introduces ´¡²µ±ð²Ô³Ù¾±²¹â„¢, Bringing Context-Aware AI Agents to Salesforce DevOps
Articles
March 4, 2026
DevOps Pipeline Best Practices
Articles
February 25, 2026
DevSecOps vs. DevOps
Articles
February 23, 2026
DevOps vs. Agile

Activate AI — Accelerate DevOps

Release Faster, Eliminate Risk, and Enjoy Your Work.
Try 91ºÚÁÏÍø Devops.

Resources

Explore our DevOps resource library. Level up your Salesforce DevOps skills today.

Upcoming Events & Webinars

E-Books and Whitepapers

Support and Documentation

Demo Library