Configuring a Preset Rule Set
A rule set is a set of rules used for code checks, with variations within different sets. These sets are classified based on different objectives, such as security, Android apps, and coding styles.
You can modify the rule sets as needed, and the updated rules will be applied during the next check.
CodeArts Check supports rule sets in multiple languages at different levels. For details about system rule sets, see Table 1.
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.
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 |
/ |
detektout |
Viewing Rule Details in a Rule Set
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 through a project.
- Click the Rule Sets tab.
- Click the rule set name to go to the details page.
Alternatively, click Export to export the enabled rules in the rule set to the local PC and view the rule details.
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.
(Optional) To configure extended parameters for the selected rule set, click Parameter, configure extended parameters, enable the configuration function, and click OK.
To use a code security enhanced package, you need to configure check parameters.
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