SPCAF by default comes with 7 standard rulesets which will cover the general requirements needed to scan the majority of files. However, we do recommend that you create your own custom ruleset to be used for analyzing your specific project. This means you can ignore specific files/folders, use which rules you want and set the desired severity of these rules.
Although a custom ruleset can be created by .xml we do recommend our settings editor which is automatically installed with the settings editor. If you are not using the client application the settings editor can be download here, run the installer to install the settings editor.
You can either create a new ruleset from scratch or editing an existing one, we advise starting by editing an existing ruleset so that you have the foundation already in place. Later on, you can create a new ruleset from the ground up.
You now have our Settings Editor Tool and by default, if you use our client app you have the standard ruleset. If you do not use our client app you can get the current release of our rulesets here.
Unless your project is specifically an Angular or SharePoint Framework project we recommend using the Extended Recommended Rules ruleset as ruleset to edit.
The left side of the screen is the general settings of the ruleset, here you can change the name of the ruleset and description, once the ruleset has been saved via a new name and path it will also be displayed here.
It is here where you define Global properties which include "ApprovedScriptLocations", "ApprovedSourceLocations" and "IgnoreFiles". If the property is not present add the property by clicking the "Add" button, enter the key and value.
SPCAF uses wildcards for ignoring a selection of files or folders, such as "Aspose.*.dll" for files or "/node_modules/" to exclude folders. Each item you want to exclude you must separate them via semicolon (;). For more details of excluding files please follow the details on the knowledge base article How to: Exclude files from the analysis.
The final section of the "Global Properties" is where you dictate whether new rules that may be generated by Rencore in new releases of SPCAF get added to the ruleset.
The center of the "Settings Editor" is where you enable or disable analyzers (rules) and reports via the tabs at the top, which will be applied during analysis.
The default selection will be on "Analyzers", here is where you can:
The Analyzers, categories, and rules are configured via a hierarchy tree.
The first level of checkboxes permits you to enable or disable an analyzer, categories it contains and the rules with the categories. To enable the analyzer click on the checkbox to place a tick in it.
Clicking on the arrow next to the analyzer will display the categories for that analyzer. As before the checkbox is how you enable or disable the category and all the rules for that category. To enable the category click on the checkbox to place a tick in it.
Finally, click the arrow next to the category to display the rules with that category. As before the checkbox is how you enable or disable the rule. Also if you were to click on a rule, the details about that rule will be displayed including a link to the documentation for the rule where further information will be shown. For more details what is shown please see the "Configuration and Details" section below.
Selecting the "Reports" tab is where you can:
As with Analyzers, the options are organized by a hierarchy tree.
Here you can disable complete sections of a report (Code Dependencies, Code Inventory, Code Metric, Quality Assessment, or SPCAF Analysis Summary) or parts of each section. To disable part of a section or a complete section click on the checkbox and remove the tick.
The right side of the "Settings Editor" is where you the "Configuration and Details" section is where you can add additional configuration to the analyzer and view details of the selected element: