You can modify the default properties of static analysis rules, such as category, severity, and name by applying a rule map. Rule maps consist of a rulemap.xml file and other configurations set in the DTP UI. You can upload rulemap.xml files and download files that have already been implemented. You can also create new rule maps directly in the UI.
In this section:
Creating New Rule Maps
Before you can customize rule properties or upload custom rules, you must create a rule map.
- Choose Test Configurations from the Report Center settings drop-down menu (gear icon).
- Click on the rule map editor (gear icon) button in the sidebar and click Create New Rule Map.
- Enter the basic rule map information and click Create.
- Associate test configurations with the rule map by clicking the move button in the Available Test Configurations panel to move them to the Associated Test Configurations panel. This enables the test configurations to use the rule map during code analysis. You can dissociate test configuration from the rule map by clicking the move button in the Associated Test Configurations panel.
- Click the Rule Customization tab and configure the rule map settings. See Customizing Rule Properties for details.
- Click Save when finished.
Editing Rule Map Information
- Choose Test Configurations from your profile drop-down menu to open the test configurations page.
- Click on the rule map editor (gear icon) button in the sidebar.
- Choose a rule map file from the Rule Map drop-down menu.
- Click the Rule Map Information tab and make your changes. If you want to preserve the original rule map, you can click Clone and edit the duplicated file.
You can perform the following actions:- Change the name of the rule map in the Rule Map Name field.
- Enter a DTP user in the Owner(s) field to specify a new owner. Ownership allows users to manage rule map files. The user name entered will be validated against the user database.
- Enter information about the rule map file in the description field.
- Click on the double angle button in the Associated Test Configurations or Available Test configurations field to remove or associate test configurations with the rule map. Associating a test configuration with a rule map allows you to use rule customizations made in the rule map in the selected test configurations. You can mouse over the information icon to see information about a test configuration in a tooltip:
- Click Save when you are finished making changes.
Uploading Rule Map Files (rulemap.xml)
- Choose Test Configurations from the Report Center settings drop-down menu (gear icon).
- Click on the rule map editor (gear icon) button in the sidebar.
- Click the Upload/Download tab and click Select File in the Rule mapping (e.g. rulemap.xml) section.
- Browse to the file you want to upload and click Upload.
Downloading Rule Map Files (rulemap.xml)
- Choose Test Configurations from the Report Center settings drop-down menu (gear icon).
- Click on the rule map editor (gear icon) button in the sidebar.
- Choose the rule map you want to download from the Rule Map drop-down menu and click the Upload/Download tab.
- Click Download in the Rule Maping (e.g. rulemap.xml) section.
Deleting Rule Maps
The following instructions describe how to delete the entire rule map definition, including the rule mapping file (rulemap.xml) and any custom rules.
- Choose Test Configurations from the Report Center settings drop-down menu (gear icon).
- Click on the rule map editor (gear icon) button in the sidebar.
- Choose the rule map you want to delete from the Rule Map drop-down menu and click Delete.
About Rule Map Permissions
- Any DTP user can view the rule map definitions.
- Only rule map users listed in Owners field (and DTP administrators) can modify the rule map definition.
- Only DTP administrators and team leaders can create a new rule map
- When DTP administrators and team leaders create new rule maps, they are listed in the rule map Owner(s) field.
- Owners can add any DTP user, including users that are not team leaders to the Owner(s) field, thereby granting these users permission to manage (save, clone, delete) the rule map.