Home » Blog » LWS Code Quality Scan

LWS Code Quality Scan

Lucidware Solutions provides a free code quality scan. We utilize static analysis tools and unit test results to identify issues, then provide a summary and recommendations in a customized report. Using this report and other quality indicators, you’ll be able to assess the state of your custom code and take action.

Scan Report

We’ll analyze the results of your scan and create a report for your team. The report includes a high-level summary of the most serious issues, along with suggestions for resolution. The raw results of the scan can be found in the detailed analysis section.

Static Analysis

Static analysis is performed with tools that look at your code, but don’t execute it. These tools are configured to identify and prioritize issues such as likely defects, dangerous practices, coding standard violations, and security threats. This analysis can be performed on your production code, in-progress development, or some subset of your code base.

PMD (Programming Mistake Detector)

PMD is a static analysis tool that identifies common programming flaws. Its Apex-specific rules recognize error handling, scalability, security, and maintainability problems. A scan of your code will identify and prioritize issues that should be addressed.

CPD (Copy Paste Detector)

CPD identifies duplicated segments of code. Business logic (code, SOQL queries, tests, documentation, etc.) should have a single representation in the system in order to prevent defects and delays in maintenance.

ESLint

ESLint statically analyzes your Javascript code to find problems in Aura components and LWCs. Salesforce provides linting rules specific to Aura and LWC development, to further enhance the quality of this scan.

Unit Testing

Execution of unit tests is dynamic – as opposed to the static analysis methods discussed above. With your permission, we’ll execute local tests, then report back on failures and any coverage concerns.

Apex

Salesforce requires a level of unit testing for Apex code. Unit tests are Apex class methods that verify whether a particular piece of code is working properly. Test code does not count against the custom code limit, and can greatly enhance the quality of your solutions. Unit test methods commit no data to the database and send no emails.

Lightning Components and LWCs (Javascript)

Salesforce does not yet require unit testing of Javascript code. Despite that, we highly recommend adding Jest unit tests to validate functionality and enhance maintainability.