Updated on 2025-07-31 GMT+08:00

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.

  1. Access CodeArts Check.
  2. Click the Rule Sets tab.

    By default, the check engine used by the rule is not displayed. To view the check engine, choose Services > Check on the navigation bar, click the Config Center tab, click Advanced, and toggle on the switch of Display Engine.

    Note: This function requires the tenant permission or the te_admin role in IAM 3.0.
    Figure 1 Switch of display engine

    You 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.

  3. 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.

Viewing Tasks Using a Rule Set

  1. On the rule set list page, click a rule set name. The rule set details page is displayed.
  2. 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.

  1. On the Rule Sets tab page, filter the target language in the Language column.
  2. 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.

  1. Go to the task page. In the task list, click a task name.
  2. On the task details page, choose Settings > Rule Sets.
  3. In the Languages Included area, enable the switch of target language.
  4. 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

Table 1 Preset rule sets

Language

System Rule Set

Default Rule Set

Extension of Supported File

C++

  • Generic Inspection Rule Set

Generic Inspection Rule Set

.c/.cc/.cpp/.cxx/.cp/.c++/.inc/.inl/.mm/.h/.hh/.hpp/.hxx/.h++

Java

  • Generic Inspection Rule Set

Generic Inspection Rule Set

.java

Go

  • Generic Inspection Rule Set

Generic Inspection Rule Set

.go

Python

  • Generic Inspection Rule Set

Generic Inspection Rule Set

.py

JavaScript

  • Generic Inspection Rule Set

Generic Inspection Rule Set

.js/.jsx

C#

  • Generic Inspection Rule Set

Generic Inspection Rule Set

.cs

TypeScript

  • Generic Inspection Rule Set

Generic Inspection Rule Set

.ts/.tsx

CSS

  • Generic Inspection Rule Set

Generic Inspection Rule Set

.css

HTML

  • Generic Inspection Rule Set

Generic Inspection Rule Set

.html

PHP

  • Generic Inspection Rule Set

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