-
DarkLight
Enable CodeScan Cloud Metadata Rules (BETA)
This article guides you on enabling the Salesforce Metadata (BETA) rules in the CodeScan Cloud environment.
-
Login to your CodeScan account.
-
Click on the Quality profiles on your main organization page and then click on Create button.
-
Create a new rule by selecting the language as Salesforce Metadata (BETA) and name your New Profile. You can choose the parent rule as an optional.
-
When you have created the new Quality Profile, you will be taken to a new page where you can click the Activate More button on the left.
-
Now, make sure on your left side of the page where you see the name of the rule you created, it is marked as inactive, which you can activate at this time.
-
Make sure that you activate the four rules referenced below by clicking on the Activate button beside the rule.
- Record Type ID is Missing
- Object Permissions should not be permissive
- Enforce Org Security Settings
- Custom fields must have a description field
-
Once activated, select the Active button under filters (beside the rule’s name).
-
Now, go to the project with the rules you wish to run the analysis, and click on Project Settings > General settings.
-
Select the CodeScan tab and scroll down to Scope, where you see Metadata File Suffixes.
a. Add the following suffixes for Classic Project and click on Save button:
- settings
- profile
- object
- sharingRules
b. Add the following suffixes SFDX Projects, add then click on Save button:
- settings-meta.xml
- object-meta.xml
- profile-meta.xml
- sharingRules-meta.xml
-
Now, Run the Analysis. If your metadata files contain issues, you will see that reflected in the issues list.
Make sure the line count will not show up on the line count breakdown as it is not a language. However, the issues will show up in the issues list as seen in the above figure.
If you're still having trouble setting up Metadata rules after reading the complete documentation, please contact the support team, and we'll be happy to help.