Get your Salesforce Org health at your fingertip with Bluefactory Code Quality.
From the dashboard home page, click on the Code Quality tab at the top to access Code Quality module main page.
When you have launched code scan on an Org, it will appear in this page. Each row corresponds to a Salesforce Org linked to Bluefactory Code Quality.
First, let's create an automated code review for your Org.
1. Create a new Code Quality
From the Code Quality main page, click on Setup a new Code Quality (at the top right).
On the New Code Quality page, give your Code Quality a name and select the Org to analyze.
Step 2 allows you to exclude Code Quality rules (i.e. Code Style, Performance, Security, Best Practices, Design, and Error Prone)
Step 3 is advanced options allowing you to exclude specific code classes/files:
- Apex Classes and Triggers
- Visualforce files
- Lightning files
Click on Save to launch the code analysis.
Note that only one code quality can be set up per Org. Also, all rules and classes/files excluded from the review in steps 2 and 3 won’t be part of the Grade calculation (Representative of the global health of the Salesforce Org).
2. Access to Code Quality dashboard
To access the Code Quality dashboard, from the main page, click on the Org name.
Code Quality dashboard tabs display the metrics of the last analysis:
- The Grade (declining from A to F)
- Number of Apex issues
- Number of Lightning issues
- Number of Code duplications
- Level of Code Coverage
- Number of files analyzed
The chart below represents the issues (Apex & Lightning) trend over time. It only gives you a quantitative overview as all rule categories (Security, Performance, Code Style…) are aggregated.
Scroll down to see code coverage trend over time. For each analysis, Bluefactory Code Quality estimate the global level of coverage from the one in each metadata file. All unit tests are reported per analysis, aggregated by Pass or Fail status.
Scroll down again to see code duplications chart. Duplications are dispatched into Major, Moderate and Minor, regarding how important is the number of lines duplicated.
The bottom Build History table reports all analysis for the Org by Start date. Bluefactory Code Quality runs daily. Each new analysis will be reported in this table every day.
Click on one start date or one of the Code Quality dashboard tabs (at the top page) to access the detailed analysis.
3. Access to Code Quality details
1. Apex/Lightning Issues
From the Code Quality dashboard, click on either Apex Issues or Lightning Issues dashboard tabs to see the report on code issues. Use the picklists to filter on your report. Use the search bar to find issues by their description.
In the report, click on one File Name to access the code segment where the issue is located. The line is highlighted with a tip on how to solve it.
2. Code Duplications
From the Code Quality dashboard, click on the Code Duplications tab. In the report, use the search bar to find a duplicated code segment. Click on the columns name to reorder the report.
Click on one Duplication to see the code segment duplicated and where it is located (class name and line number).
3. Code Coverage
From the Code Quality dashboard, click on the Code Coverage tab.
The left menu allows you to choose how to display the report: by Class (by code coverage level) or by Method (by unit test).
Click on by Class and on one class name to see the code segment by line covered or uncovered in this class.
Click on by Method to see the report on unit tests by the test method. Each test method is detailed: duration, result, and an error message when the test failed.
From the Code Quality dashboard, click on the Files tab.
The left menu allows you to choose the file type to report on Apex, Visualforce or Lightning files.
Click on a File Name to access the File information:
- File overview (Grade, Test coverage and Complexity level)
- File size (Total lines of code, Source lines of code, and Commented lines of code)
- File Duplications (Number of Clones and Duplicated lines of code)
Scroll down to see the Source Code, reports on the Code coverage, the duplications, and issues if there are ones.
You can click on Exclude from analysis button at the top to rule out this file from future Bluefactory Code Quality scans.
Click on Include in analysis to re-introduce the file in future Code Quality analysis.
3. Edit Code Quality setup
From the Code Quality main page click on an Org name to access its dashboard. From there, click on the Edit button at the top right.
The Edit Code Quality setup page allows you to:
- Modify the Code Quality name
- Exclude/re-include Coe Quality rules (Code Style, Performance, Security, Best Practices, Design, and Error Prone)
- Exclude/re-include Apex Classes and Triggers from future analysis
- Exclude/re-include Visualforce files from future analysis
- Exclude/re-include Lightning files from future analysis
When finished, click on Save.