Updated on 2025-06-23 GMT+08:00

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.

Table 1 Preset rule sets

Language

System Rule Set

Default Rule Set

Extension of Supported File

C++

  • Huawei C Coding Standard Rule Set
  • Huawei C Enhanced Coding Standard Rule Set
  • Huawei C++ Enhanced Coding Standard Rule Set
  • Huawei C++ Coding Standard Rule Set
  • CodeArts Check C Recommended Criterion Set
  • CodeArts Check C++ Recommended Criterion Set
  • Huawei C Codestyle Specification Criterion Set
  • Huawei CPP Codestyle Specification Criterion Set
  • Huawei C/C++ Codestyle Specification Criterion Set
  • Comprehensive Criterion Set
  • Critical Criterion Set
  • General Criterion Set
  • Generic Inspection Rule Set

General Criterion Set

Generic Inspection Rule Set

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

Java

  • Huawei Java Coding Standard Rule Set
  • Huawei Java Enhanced Coding Standard Rule Set
  • CodeArts Check JAVA Recommended Criterion Set
  • Huawei Codestyle Specification Criterion Set
  • DevCloud Recommended Criterion Set
  • Security Criterion Set
  • Mobile Field-Android Criterion Set
  • General Criterion Set
  • Critical Criterion Set
  • Google Codestyle Specification Criterion Set
  • Comprehensive Criterion Set
  • Generic Inspection Rule Set

General Criterion Set

Generic Inspection Rule Set

.java

Go

  • CodeArts Check GO Recommended Criterion Set
  • Huawei Codestyle Specification Criterion Set
  • Critical Criterion Set
  • General Criterion Set
  • Comprehensive Criterion Set
  • Generic Inspection Rule Set

General Criterion Set

Generic Inspection Rule Set

.go

Python

  • CodeArts Check PYTHON Recommended Criterion Set
  • Huawei Codestyle Specification Criterion Set
  • Critical Criterion Set
  • General Criterion Set
  • Generic Inspection Rule Set

General Criterion Set

Generic Inspection Rule Set

.py

JavaScript

  • Huawei Codestyle Specification Criterion Set
  • Critical Criterion Set
  • General Criterion Set
  • Comprehensive Criterion Set
  • Generic Inspection Rule Set

General Criterion Set

Generic Inspection Rule Set

.js/.jsx

C#

  • Critical Criterion Set
  • General Criterion Set
  • Comprehensive Criterion Set
  • Generic Inspection Rule Set

General Criterion Set

Generic Inspection Rule Set

.cs

TypeScript

  • Critical Criterion Set
  • General Criterion Set
  • Comprehensive Criterion Set
  • Generic Inspection Rule Set

General Criterion Set

Generic Inspection Rule Set

.ts/.tsx

CSS

  • General Criterion Set
  • Generic Inspection Rule Set

General Criterion Set

Generic Inspection Rule Set

.css

HTML

  • General Criterion Set
  • Generic Inspection Rule Set

General Criterion Set

Generic Inspection Rule Set

.html

PHP

  • Critical Criterion Set
  • General Criterion Set
  • Generic Inspection Rule Set

General Criterion 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

SCALA

General Criterion Set

General Criterion Set

.scala

ArkTS

General Criterion Set

General Criterion Set

.ets

SQL

General Criterion Set

General Criterion Set

.sql

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.
  • To use a code security enhanced package, configure check parameters.

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.

  1. Access CodeArts Check through a project.
  2. Click the Rule Sets tab.
  3. Click the rule set name to go to the details page and view the rule usage details.

    Figure 1 Viewing rules in a rule set

    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.

  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.

    (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, configure check parameters.