Configuring a Preset Rule Set
A rule set is a collection of rules for checking code. Rule sets are categorized based on their targets, including security, Android apps, programming styles, and coding standards.
You can modify the rule sets as needed, and the updated rules will be applied during the next check.
Constraints
- Rule sets of multiple languages cannot be used to check a task at the same time. Example: C# rule sets cannot be applied with other language rule sets to check a task.
- Preset rule sets are uneditable, while custom rule sets can be edited. If needed, you can create custom rule sets based on preset ones by referring to Customizing a Rule Set.
Viewing Preset Rule Sets
CodeArts Check supports rule sets in multiple languages at different levels. For details about system rule sets, see Table 1.
View the rule details in rules sets, such as issue levels, compliant and non-compliant examples, and fix suggestions, to select a desired rule set.
- Access CodeArts Check.
- Click the Rule Sets tab.
By default, the check engine used by the rule is not displayed. To view the check engine, choose Config Center tab, click Advanced, and toggle on the switch of Display Engine.
on the navigation bar, click theNote: This function requires the tenant permission or the te_admin role in IAM 3.0.Figure 1 Switch of display engineYou can sort rule sets by Rules or Modified. The two sorting criteria are exclusive. For example, if rules are sorted by Modified, the sorting by Rules becomes invalid.
- Click the rule set name to go to the details page and view the rule usage details.
- Online viewing:
Figure 2 Viewing rules in a rule set
- Offline viewing: Choose
> Export to export enabled rules from the rule set to your local PC.
- Online viewing:
Viewing Tasks Using a Rule Set
- On the rule set list page, click a rule set name. The rule set details page is displayed.
- Choose
> Task Usage to view the tasks using the rule set.
When you view how many tasks are using a rule set, if the task count exceeds 10,000 and fluctuates, the count updates with a one-hour delay. However, on first view, there is no delay.
Modifying the Default Rule Set
Each language has its default set, as shown in Table 1. Perform the following operations to modify the default rule set if needed.

To view the default rule sets, access CodeArts Check through a project.
- On the Rule Sets tab page, filter the target language in the Language column.
- Click
in the row where the rule set locates and select Default Set to set the current rule set as default.
Configuring the Rule Set to Be Used
Perform the following operations to use other preset rule sets. Alternatively, customize rule sets if needed. For details, see Configuring a Custom Rule Set.
- Go to the task page. In the task list, click a task name.
- On the task details page, choose Settings > Rule Sets.
- In the Languages Included area, enable the switch of target language.
- In the Enable Rule Set area, click
to select the rule set to be used.
To configure extended parameters for the selected rule set, click Parameter, configure extended parameters, enable the configuration function, and click Confirm.
To use a code security enhanced package, configure check parameters.- If Arm servers are used, select ARM from the Machine drop-down list box on the Parameter dialog box.
- If the selected rule set uses the secbrella engine, configure Parameter based on the site requirements and enable the configuration function.
- If the selected rule set uses the OAT engine, configure Parameter and enable the configuration function (enabled by default). The repository address is the -n parameter of the OAT (OSS Audit Tool), which is used to match the default policy. You can use the default value or configure the repository address based on the site requirements.
Preset Rule Sets
Language |
System Rule Set |
Default Rule Set |
Extension of Supported File |
---|---|---|---|
C++ |
|
Generic Inspection Rule Set |
.c/.cc/.cpp/.cxx/.cp/.c++/.inc/.inl/.mm/.h/.hh/.hpp/.hxx/.h++ |
Java |
|
Generic Inspection Rule Set |
.java |
Go |
|
Generic Inspection Rule Set |
.go |
Python |
|
Generic Inspection Rule Set |
.py |
JavaScript |
|
Generic Inspection Rule Set |
.js/.jsx |
C# |
|
Generic Inspection Rule Set |
.cs |
TypeScript |
|
Generic Inspection Rule Set |
.ts/.tsx |
CSS |
|
Generic Inspection Rule Set |
.css |
HTML |
|
Generic Inspection Rule Set |
.html |
PHP |
|
Generic Inspection Rule Set |
.php |
LUA |
General Criterion Set |
General Criterion Set |
.lua |
RUST |
General Criterion Set |
General Criterion Set |
.rs |
Shell |
General Criterion Set |
General Criterion Set |
.sh |
KOTLIN |
General Criterion Set |
General Criterion Set |
.kt |
Related Operations
- For details about APIs related to rule sets, see Rule Management, Querying Selected Rule Sets of a Task (Version 2), Querying Selected Rule Sets of a Task (Version 3), Querying the Check Parameters of a Rule Set (Version 2), Querying the Check Parameters of a Rule Set (Version 3), and Modifying the Rule Set in a Task.
- For details about the best practices of using preset rule sets, see Checking Code from Git with Preset Rules.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot