Application code quality management method and device, equipment, medium and product

By performing multi-dimensional inspections on application code through automated quality inspection components in the version control repository, the inefficiency of traditional manual code review is solved, and the overall quality of code is improved, as well as the reliability and stability of software products.

CN120687344APending Publication Date: 2025-09-23SHANDONG LANGCHAO YUNTOU INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510698051.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-28
Publication Date
2025-09-23

AI Technical Summary

Technical Problem

Traditional manual code review methods are inefficient and difficult to fully cover, and cannot meet the requirements of modern software development for efficiency and high quality.

Method used

After the application code is submitted to the version control repository, the code inspection component performs automated quality checks, including checks such as the proportion of duplicate items, the number of errors, the number of security vulnerabilities, and unit test coverage, to ensure that it is deployed after passing the quality threshold.

Benefits of technology

Significantly improve code quality, reduce runtime errors and failures, increase development efficiency, reduce maintenance costs, and improve the reliability and stability of software products.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120687344A_ABST
    Figure CN120687344A_ABST
Patent Text Reader

Abstract

The invention provides an application code quality management method and device, equipment, a medium and a product. The method comprises the following steps: after an application code is submitted to a version control warehouse, reminding a reviewer to manually review the application code; after the manual auditing is passed, constructing a continuous deployment task; pulling the application code from the version control warehouse through the continuous deployment task; performing quality inspection on the pulled application code through a code inspection component; and after the quality inspection is passed, performing application deployment. Various quality problems can be found through automatic quality inspection of the code inspection component, the code quality of software products is remarkably improved, and errors and faults during operation are reduced. The automatic code quality detection process reduces the time and workload of manual review, so that developers can concentrate on implementation and innovation work of business logic. And meanwhile, the rapid feedback mechanism is beneficial to rapid positioning and problem solving, and the development process is accelerated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of software development technology, and in particular to an application code quality management method and apparatus, equipment, medium, and product. Background Art

[0002] As software development becomes increasingly complex, code quality becomes a key factor affecting the reliability, maintainability, and efficiency of software products. Traditional manual code review methods are inefficient and lack comprehensive coverage, making them unable to meet the demands of modern software development for high efficiency and quality. Therefore, automated code quality detection and analysis has become a pressing issue. Summary of the Invention

[0003] In response to at least one of the above technical problems, embodiments of the present invention provide an application code quality management method, apparatus, device, medium, and product.

[0004] According to a first aspect, an embodiment of the present invention provides an application code quality management method including:

[0005] After the application code is submitted to the version control repository, the reviewer is reminded to manually review the application code;

[0006] After manual review, build a continuous deployment task;

[0007] Pulling the application code from the version control repository through the continuous deployment task;

[0008] Performing a quality check on the pulled application code using a code checking component;

[0009] After the quality check passes, the application is deployed.

[0010] In one embodiment, the prompting of the reviewer to manually review the application code includes:

[0011] Identify pre-appointed reviewers;

[0012] Push manual review information to the reviewer to remind the reviewer to manually review the application code.

[0013] In one embodiment, the quality check of the pulled application code by the code check component includes:

[0014] Performing a quality check on at least one check item on the application code;

[0015] If the quality inspection results corresponding to each inspection item pass the corresponding quality gate, the quality inspection is passed;

[0016] If the quality check result corresponding to at least one check item does not pass the corresponding quality threshold, the quality check fails.

[0017] In one embodiment, the at least one inspection item includes at least one of: a percentage of duplicate items, a number of errors, a number of security vulnerabilities, unit test coverage, and compliance with preset coding rules.

[0018] In one embodiment, after the quality check is passed, application deployment is performed, including:

[0019] After passing the quality check, generating an executable file of the application code;

[0020] Testing the functionality of the application code according to the executable file;

[0021] After passing the test, the software code is released to the production environment or pre-production environment for application deployment.

[0022] In one embodiment, the method further comprises:

[0023] Monitor the running status of deployed applications;

[0024] Collect user feedback and log information about the application;

[0025] The application code is optimized according to the running status, the feedback information and the log information.

[0026] According to a second aspect, an application code quality management device provided by an embodiment of the present invention includes:

[0027] A code submission module is used to remind reviewers to manually review the application code after the application code is submitted to the version control repository;

[0028] The task construction module is used to build continuous deployment tasks after manual review;

[0029] A code pulling module, configured to pull the application code from the version control repository through the continuous deployment task;

[0030] A quality inspection module, configured to perform a quality inspection on the pulled application code through a code inspection component;

[0031] The application deployment module is used to deploy the application after passing the quality inspection.

[0032] According to a third aspect, an embodiment of the present invention provides a computing device, comprising a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the method provided in the first aspect is implemented.

[0033] According to a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, enables the computer to execute the method provided in the first aspect.

[0034] According to a fifth aspect, an embodiment of the present invention provides a computer program product, comprising a computer program, which implements the method provided in the first aspect when executed by a processor.

[0035] The application code quality management method, apparatus, equipment, medium, and product provided by the embodiments of the present invention, after the application code is submitted to the version control warehouse, reminds the reviewer to manually review the application code. After the manual review is passed, a continuous deployment task is constructed, so that the application code is pulled from the version control warehouse through the continuous deployment task, and then the pulled application code is quality checked by the code inspection component, and finally the application is deployed after the quality check is passed. Various quality problems can be discovered and then repaired through the automated quality inspection of the code inspection component, which significantly improves the code quality of the software product and reduces runtime errors and failures. The automated code quality inspection process reduces the time and workload of manual review, allowing developers to focus more on the implementation and innovation of business logic. At the same time, the rapid feedback mechanism helps to quickly locate and solve problems, accelerating the development process. High-quality code that passes quality inspection means that it is more reliable and stable, requires lower maintenance costs, and reduces the subsequent repair workload and maintenance difficulty caused by code quality problems. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 Schematic diagram of a flow chart of a code quality management method according to an embodiment of the present invention;

[0037] Figure 2 FIG. 1 is a structural block diagram of an application code quality management device in an embodiment of the present invention. DETAILED DESCRIPTION

[0038] In the first aspect, the embodiment of the present invention provides an application code quality management method, see Figure 1 The method includes the following steps S110 to S150:

[0039] S110. After the application code is submitted to the version control repository, a reviewer is prompted to manually review the application code.

[0040] Among them, the version control repository is the Git repository.

[0041] Among them, this application can be executed by a continuous integration / deployment platform, for example, the Jenkins platform.

[0042] In one embodiment, the step of prompting the reviewer to manually review the application code in S110 may include:

[0043] S111. Determine the pre-appointed reviewers;

[0044] S112: Push manual review information to the reviewer to remind the reviewer to manually review the application code.

[0045] For example, the application code is manually reviewed by a reviewer via email.

[0046] Among them, reviewers can check whether there are obvious logical loopholes and other problems. If so, they can promptly send it back for modification to ensure the compliance and stability of the application code.

[0047] S120: After manual review, build a continuous deployment task;

[0048] Specifically, you can trigger the build of a continuous deployment task through a scheduled task. You can also trigger the build of a continuous deployment task through a webhook. For example, the webhook can trigger the build of a continuous deployment task after detecting that the manual review has passed.

[0049] S130: Pull the application code from the version control repository through the continuous deployment task;

[0050] S140: Performing a quality check on the pulled application code using a code check component;

[0051] Among them, code inspection components, such as the Sonar component, are open source components used for code quality management. They help development teams detect problems in the code, thereby improving code quality, increasing project or product development efficiency, and safely and reliably releasing software.

[0052] In one embodiment, the quality check of the pulled application code by the code check component in S140 may include:

[0053] S141. Perform a quality check on at least one check item on the application code.

[0054] In one embodiment, the at least one inspection item may include: at least one of the following: the proportion of duplicate items, the number of errors, the number of security vulnerabilities, the unit test coverage, and compliance with preset coding rules.

[0055] The duplication ratio refers to the percentage of duplicated code. Duplicate code not only increases maintenance complexity but can also introduce errors. The Sonar component can highlight areas of significant duplication in source code, helping developers with refactoring.

[0056] The number of errors refers to the number of bugs. Integrated tools detect potential errors. These errors may not affect the current code execution, but may cause problems during future maintenance or expansion.

[0057] Among them, security vulnerabilities, such as potential SQL statement injection, cross-site scripting attacks, etc. Detect security vulnerabilities in the code, which, if maliciously exploited, may lead to data leakage or system attacks.

[0058] Among them, the unit test coverage is counted and displayed, which helps developers and testers understand the coverage of the test code, thereby optimizing test cases and improving code quality.

[0059] Among them, integrated tools (such as Findbugs, PMD, CheckStyle, etc.) check whether the code complies with specific coding rules, which help avoid common programming errors and bad practices.

[0060] S142. If the quality inspection results corresponding to each inspection item pass the corresponding quality gate, the quality inspection passes; if the quality inspection result corresponding to at least one inspection item does not pass the corresponding quality gate, the quality inspection fails.

[0061] Each check item has its own quality threshold. For example, the quality threshold for duplicate item ratio is 20%, the quality threshold for error number is 10, the quality threshold for security vulnerability number is 5, and the quality threshold for unit test coverage is 60.

[0062] If the result of the check on whether the preset coding rules are met is yes, it means that the corresponding quality gate has been passed. If the result is no, it means that the corresponding quality gate has not been passed.

[0063] S150: After the quality check is passed, the application is deployed.

[0064] In one embodiment, after the quality check is passed in S150, application deployment is performed, including:

[0065] S151. After the quality check passes, generate an executable file of the application code;

[0066] S152. Testing the functionality of the application code according to the executable file;

[0067] That is, by executing the executable file, it is determined whether the execution result meets the functional requirements of the application code. If it does, the test passes; otherwise, the test fails.

[0068] S153: After the test is passed, the software code is released to a production environment or a pre-production environment for application deployment.

[0069] Specifically, the software code can be released to the production environment or pre-production environment by executing the script.

[0070] After the functional test is passed, the software code can be released and deployed.

[0071] In one embodiment, the method may further include:

[0072] Monitor the running status of deployed applications;

[0073] Collect user feedback and log information about the application;

[0074] The application code is optimized according to the running status, the feedback information and the log information.

[0075] It can be seen that the application code is continuously optimized through real-time monitoring and feedback.

[0076] For example, by integrating the Sonar platform's rich code detection plug-ins with the CI platform's automated build process, continuous, automated monitoring and optimization of code quality are achieved. The Sonar component's multi-dimensional code detection capabilities can deeply analyze code structure and identify potential defects, complexity issues, and duplicate code, while the CI platform ensures that each code submission triggers an automated detection process, forming a closed-loop feedback mechanism. Through this invention, developers can promptly identify and fix problems in their code, significantly improving code quality, reducing technical costs, and simultaneously increasing development efficiency and software product reliability.

[0077] The beneficial effects of this application are as follows:

[0078] 1. Significantly improve code quality: Through deep code inspection of the code inspection component, potential code defects, excessive complexity, duplicate code and other problems can be discovered and fixed, thereby significantly improving the code quality of software products and reducing runtime errors and failures.

[0079] 2. Improve development efficiency: Automated code quality testing reduces the time and workload of manual review, allowing developers to focus more on business logic implementation and innovation. At the same time, a rapid feedback mechanism helps quickly identify and resolve problems, accelerating the development process.

[0080] 3. Reduce maintenance costs: High-quality code means lower maintenance costs. By promptly fixing code issues, the workload and maintenance difficulty caused by subsequent code quality issues are reduced, reducing technical debt.

[0081] 4. Improve software reliability: Code that has undergone rigorous quality testing is more reliable and stable. This helps improve user satisfaction and market competitiveness of software products, bringing better economic benefits to enterprises.

[0082] 5. Combine manual review with automated testing to ensure overall improvement in code quality.

[0083] 6. R&D personnel can set quality access control according to specific needs to ensure code compliance and stability.

[0084] 7. By integrating code inspection components with continuous deployment tasks, we achieve automated, comprehensive detection and continuous optimization of code quality. Through automated code inspection, we ensure that each code submission triggers the inspection process, forming a closed-loop feedback mechanism.

[0085] It can be seen that this application reduces code maintenance costs, improves the work efficiency of the development team, and enables developers to focus more on innovation in business logic; ultimately, it enhances the market competitiveness of software products and brings users a more stable and reliable software experience.

[0086] In the second aspect, this application provides an application code quality management device, see Figure 2 , the apparatus 100 comprises:

[0087] The code submission module 110 is used to remind the reviewer to manually review the application code after the application code is submitted to the version control repository;

[0088] The task construction module 120 is used to construct a continuous deployment task after manual review;

[0089] A code pulling module 130 is configured to pull the application code from the version control repository through the continuous deployment task;

[0090] A quality inspection module 140 is configured to perform a quality inspection on the pulled application code through a code inspection component;

[0091] The application deployment module 150 is used to deploy the application after passing the quality inspection.

[0092] In one embodiment, the code submission module 110 is specifically configured to: determine a preset reviewer; and push manual review information to the reviewer to remind the reviewer to manually review the application code.

[0093] In one embodiment, the quality inspection module 140 is specifically used to: perform a quality inspection on at least one inspection item of the application code; if the quality inspection results corresponding to each inspection item pass the corresponding quality gate, the quality inspection passes; if the quality inspection result corresponding to at least one inspection item does not pass the corresponding quality gate, the quality inspection fails.

[0094] In one embodiment, the at least one inspection item includes at least one of: a percentage of duplicate items, a number of errors, a number of security vulnerabilities, unit test coverage, and compliance with preset coding rules.

[0095] In one embodiment, the application deployment module 150 is specifically used to: generate an executable file of the application code after passing the quality check; test the functionality of the application code based on the executable file; and release the software code to a production environment or a pre-production environment for application deployment after passing the test.

[0096] In one embodiment, the apparatus further comprises:

[0097] The feedback processing module is used to monitor the running status of the deployed application; collect user feedback information and log information about the application; and optimize the application code based on the running status, the feedback information and the log information.

[0098] In a third aspect, the present application provides a computing device comprising a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, it implements the method in any one of the above embodiments.

[0099] It is understandable that the explanation, specific implementation, beneficial effects, examples, etc. of the relevant contents in the computing device provided by the embodiment of the present invention can be found in the corresponding parts of the method provided in the first aspect, and will not be repeated here.

[0100] In a fourth aspect, the present application provides a computer-readable medium having computer instructions stored thereon. When the computer instructions are executed by a processor, the processor executes the method provided in the first aspect.

[0101] Specifically, a system or device equipped with a storage medium can be provided, on which software program codes that implement the functions of any of the above-mentioned embodiments are stored, and a computer (or CPU or MPU) of the system or device can be enabled to read and execute the program codes stored in the storage medium.

[0102] In this case, the program code itself read from the storage medium can realize the function of any one of the above-mentioned embodiments, and thus the program code and the storage medium storing the program code constitute part of the present invention.

[0103] Examples of storage media for providing program code include floppy disks, hard disks, magneto-optical disks, optical disks (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), magnetic tapes, non-volatile memory cards, and ROMs. Alternatively, the program code can be downloaded from a server computer via a communication network.

[0104] In addition, it should be clear that the functions of any of the above embodiments can be achieved not only by executing the program code read by the computer, but also by enabling the operating system operating on the computer to complete part or all of the actual operations based on the instructions of the program code.

[0105] In addition, it can be understood that the program code read from the storage medium is written into a memory provided in an expansion board inserted into the computer or into a memory provided in an expansion module connected to the computer, and then based on the instructions of the program code, a CPU installed on the expansion board or expansion module is enabled to perform part or all of the actual operations, thereby realizing the functions of any of the above embodiments.

[0106] It is understandable that the explanation, specific implementation methods, beneficial effects, examples, etc. of the relevant contents in the computer-readable medium provided in the embodiment of the present invention can be found in the corresponding parts of the method provided in the first aspect, and will not be repeated here.

[0107] In a fifth aspect, the present application provides a computer program product, comprising a computer program, which implements the method provided in the first aspect when executed by a processor.

[0108] It is understandable that the explanation, specific implementation methods, beneficial effects, examples, etc. of the relevant contents in the computer program product provided by the embodiment of the present invention can be found in the corresponding parts of the method provided in the first aspect, and will not be repeated here.

[0109] The various embodiments in this specification are described in a progressive manner. Similar parts between the various embodiments can be referred to in conjunction with each other. Each embodiment focuses on the differences from other embodiments. In particular, the device embodiments are generally similar to the method embodiments, so the description is relatively simple. For relevant parts, refer to the description of the method embodiments.

[0110] Those skilled in the art will appreciate that in one or more of the above examples, the functions described in the present invention may be implemented using hardware, software, widgets, or any combination thereof. When implemented using software, these functions may be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium.

[0111] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent replacements, improvements, etc. made on the basis of the technical solution of the present invention should be included in the scope of protection of the present invention.

Claims

1. A method for managing application code quality, characterized in that: include: After the application code is submitted to the version control repository, the reviewer is reminded to manually review the application code; After manual review, build a continuous deployment task; Pulling the application code from the version control repository through the continuous deployment task; Performing a quality check on the pulled application code using a code checking component; After the quality check passes, the application is deployed.

2. The method according to claim 1, characterized in that The reminding reviewer to manually review the application code includes: Identify pre-appointed reviewers; Push manual review information to the reviewer to remind the reviewer to manually review the application code.

3. The method according to claim 1, characterized in that The code checking component performs a quality check on the pulled application code, including: Performing a quality check on at least one check item on the application code; If the quality inspection results corresponding to each inspection item pass the corresponding quality gate, the quality inspection is passed; If the quality check result corresponding to at least one check item does not pass the corresponding quality threshold, the quality check fails.

4. The method according to claim 3, characterized in that The at least one inspection item includes: the proportion of duplicate items, the number of errors, the number of security vulnerabilities, the unit test coverage, and whether it complies with preset coding rules.

5. The method according to claim 1, wherein After the quality check is passed, the application is deployed, including: After passing the quality check, generating an executable file of the application code; Testing the functionality of the application code according to the executable file; After passing the test, the software code is released to the production environment or pre-production environment for application deployment.

6. The method according to claim 1, characterized in that Also includes: Monitor the running status of deployed applications; Collect user feedback and log information about the application; The application code is optimized according to the running status, the feedback information and the log information.

7. An application code quality management device, characterized in that: include: A code submission module is used to remind reviewers to manually review the application code after the application code is submitted to the version control repository; The task construction module is used to build continuous deployment tasks after manual review; A code pulling module, configured to pull the application code from the version control repository through the continuous deployment task; A quality inspection module, configured to perform a quality inspection on the pulled application code through a code inspection component; The application deployment module is used to deploy the application after passing the quality inspection.

8. A computing device, characterized in that The method comprises a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the method according to any one of claims 1 to 6 is implemented.

9. A computer-readable storage medium, characterized in that A computer program is stored thereon, and when the computer program is executed in a computer, the computer is caused to execute the method according to any one of claims 1 to 6.

10. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.