Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Method, system, computer equipment and storage medium for detecting source code quality

A code quality and source code technology, applied in the field of source code quality detection based on the code developer dimension, can solve the problem that the source code detection tool SonarQube cannot meet the source code quality detection and other problems

Active Publication Date: 2022-04-05
SICHUAN CHANGHONG ELECTRIC CO LTD
View PDF7 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0003] The purpose of the present invention is to overcome the deficiencies in the above-mentioned background technology, to provide a method, system, computer equipment and storage medium for detecting the quality of source code based on the dimension of the code developer, and to combine the user Id of the current code submitter (developer) with the source code The strategy of binding quality inspection results, using the method of differentially comparing the quality inspection results of the current submitted source code with the last inspection results, to obtain the source code submitted by the current developer (the source code of this change, that is, the newly added, modified or deleted source code) quality inspection result data, which solves the technical problem that the source code inspection tool SonarQube cannot satisfy the quality inspection of source code according to the code submitter dimension

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Method, system, computer equipment and storage medium for detecting source code quality

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0045] Such as figure 1 As shown, a method of detecting source code quality based on the code developer dimension, the specific steps are as follows:

[0046] Step 1. Configure the user ID of the current developer at the code quality inspection command in the drone.yml file of the source code pipeline, and bind the current developer to this code quality inspection.

[0047] The specific examples in this embodiment are as follows:

[0048] echo sonar.analysis.userId=1>$SONAR_PROJECT_BASE_DIR / sonar-project.properties;

[0049] Among them, sonar.analysis.userId=1 is the user Id of the current developer.

[0050]Step 2. After the developer completes the code editing, submit the source code to the gitea source code warehouse and trigger the SonarQube tool to perform quality inspection on the source code. After the inspection, activate the Webhooks hook function to call the restful API interface.

[0051] Among them, the URL of the Webhooks hook needs to configure the address of ...

Embodiment 2

[0065] A system for detecting source code quality based on the dimension of code developers, including: a configuration module, a detection module, a parameter acquisition module, a measurement index configuration module, a parameter generation module, a detection result acquisition module, a query module, a quality comparison module, and a storage module, Among them, the parameter acquisition module is connected with the detection module and the configuration module respectively, the measurement indicator configuration module is connected with the parameter generation module, the detection result acquisition module is connected with the parameter generation module and the parameter acquisition module, and the quality comparison module is respectively connected with the query module and the detection result acquisition module , Storage module connection.

[0066] Specifically, the configuration module is used to configure the user ID of the current code developer in the source ...

Embodiment 3

[0077] This embodiment discloses a computer device, which may be a server, and the computer device includes a processor, a memory, a network interface, and a database connected through a system bus. Wherein, the processor of the computer device is used to provide calculation and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs and databases. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The database of the computer device is used to store data involved in the method of checking the quality of the source code. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a method for detecting the quality of the source co...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a method for detecting the quality of source code based on the dimension of the code developer, a strategy of binding the user ID of the current code developer with the quality detection result of the source code, and using the quality detection result of the currently submitted source code and the previous detection The method of differentially comparing the results obtains the source code quality inspection result data submitted by the current developer. The method of the invention solves the technical problem that the source code detection tool SonarQube cannot satisfy the quality detection of the source code according to the dimension of the code submitter.

Description

technical field [0001] The present invention relates to the technical field of software source code quality detection, in particular to a method, system, computer equipment and storage medium for detecting source code quality based on the dimension of code developers. Background technique [0002] With the rapid development of computer and software technology, the development cycle of software projects is getting shorter and shorter. Therefore, adopting rapid iteration and continuous delivery has become an inevitable choice for most software companies, and it is particularly important to ensure the quality of software code in this process. . After the developer completes the code development, he uses the SonarQube tool to detect the source code. In this working mode, the developer repairs the source code with quality problems by checking the quality inspection of the source code. The disadvantage is that it cannot meet the code submission requirements. Developers (developer...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Patents(China)
IPC IPC(8): G06F8/41
CPCG06F8/43
Inventor 林正勇
Owner SICHUAN CHANGHONG ELECTRIC CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products