- What's New
- Function Overview
- Service Overview
- Getting Started
-
User Guide
- Working with CodeArts Check
- Purchasing CodeArts Check
- Configuring Project-level Role Permissions
- Creating a Task
- Configuring a Task
- Executing a Task
- Viewing Check Results
- Querying Audit Logs
- Reference
- Best Practices
-
API Reference
- Before You Start
- API Overview
- Calling APIs
-
APIs
-
Task Management
- Creating a Check Task
- Deleting a Check Task
- Querying Tasks
- Executing a Check Task
- Stopping a Check Task
- Querying the Status of a Task
- Querying Historical Check Results
- 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)
- Configuring the Check Parameters of a Task
- Modifying the Rule Set in a Task
- Querying Check Failure Logs
- Obtaining the Directory Tree of a Task
- Ignoring Directories of a Task
- Querying Advanced Configurations of a Task
- Configuring Advanced Configurations for a Task
- Issue Management
- Rule Management
-
Task Management
- Application Examples
- Appendixes
- Description
-
FAQs
-
General Issues
- Why Am I Told that a Task Is Running and I Should Try Again Later?
- Why Am I Told that I Don't Have Sufficient Permissions and I Should Check and Try Again?
- Why Am I Told that Cppcheck Cannot Tokenize the Code Correctly?
- Why Am I Told that No Dependency Exists in the Maven Repository?
- Why Am I Seeing Error CC.00070400.500?
- Why Don't I Have Enough Permissions When Clicking a Task Name?
- Why Does a Project with WPF in C# Fail?
- Why Is No Data Displayed After a Task Is Complete?
- Why Does a TypeScript Task Fail with a 404 Error in the Log?
- API Issues
-
General Issues
- Videos
- General Reference
Copied.
Checking Code from Git with Preset Rules
Scenario
Check Java code from Git to protect quality.
Preparation
- You have obtained permissions of CodeArts Check.
- There is Java code in the Git repository.
Process
No. |
Step |
Description |
---|---|---|
1 |
Create a project. |
|
2 |
Use a service endpoint to connect to a third-party repository. |
|
3 |
Create a task. |
|
4 |
Execute a task. |
|
5 |
View check results. |
Creating a Project
- Log in to the Huawei Cloud console.
- Click
in the upper left corner and choose Developer Services > CodeArts from the service list.
- Click Access Service.
- Click Create Project, and select the Scrum template. Set the project name to Scrum01 and retain the default values for other parameters.
- Click OK to access the project.
Creating a Git Service Endpoint
A service endpoint is an extension to CodeArts and supports connection to third-party repositories.
With a service endpoint, CodeArts Check supports repositories either of CodeArts Repo and third-parties.
- Enter a task through a project. In the navigation pane, choose Settings > General > Service Endpoints.
- Click Create Endpoint and choose Git repository from the drop-down list.
- Configure the following information and click Confirm.
Table 2 Creating a Git service endpoint Parameter
Description
Service Endpoint Name
Enter a maximum of 256 characters, including letters, digits, hyphens (-), underscores (_), periods (.), and spaces. For example, Endpoint01.
Git Repository URL
Enter the HTTPS address of the Git repository to connect.
Username
Enter the username of the Git repository to connect (max. 300 characters).
Password or Access Token
Enter the password of the Git repository to connect (max. 300 characters).
Creating a Task to Check Code from Git
- In the navigation pane, choose Code > Check.
- Click Create Task. Set parameters by referring to the following table.
Table 3 Task parameters Parameter
Description
Project
Project that the task belongs to. Retain the default value (the Scrum01 project created in Creating a Project).
Code Source
Select Git.
Name
Customize a task name, for example, CheckTask01.
Endpoint
Select the Endpoint01 service endpoint created in Creating a Git Service Endpoint.
Repository
Retain the default value.
Branch
Retain the default value master.
Language
Select the code language to be checked, for example, Java.
- Click Create Task.
Executing the Task
- In the Tasks page, click
to execute the task.
- Wait until the task is complete as prompted.
Viewing Check Results
- In the Tasks page, search for the CheckTask01 task created in Creating a Task to Check Code from Git.
- Click the task name to view the check details, including overview, issues, metrics, logs, and settings.
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