A code quality analysis alarm repair method and device, equipment and medium

By creating repair branches in automotive electronic software development and using language models to automatically repair QAC alarms, the problems of high cost, low efficiency and poor standardization of manual repair are solved, and efficient and standardized code quality analysis alarm repair is achieved.

CN122489333APending Publication Date: 2026-07-31SHANGHAI KOSTAL HUAYANG AUTOMOTIVE ELECTRIC +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHANGHAI KOSTAL HUAYANG AUTOMOTIVE ELECTRIC
Filing Date
2026-05-11
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

Existing technologies for manually repairing QAC alarms are costly, inefficient, and poorly standardized, failing to effectively address code quality analysis alarm issues related to MISRA 2012 and SEI CERT C standards in automotive electronic software development.

Method used

By creating a repair branch on the project's main branch, parsing the QAC detection report to obtain the core alarm information, and using a language model combined with coding standards and industry standards to automatically generate repair code, the repair operation is isolated and performed within the repair branch, and finally the changes are synchronized back to the main branch.

Benefits of technology

It significantly reduced labor costs, eliminated inconsistencies in fixes, improved fix efficiency, shortened iteration cycles, and ensured the stability of the main codebase and the continuity of the development process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122489333A_ABST
    Figure CN122489333A_ABST
Patent Text Reader

Abstract

This application discloses a method, apparatus, device, and medium for code quality analysis alarm repair, relating to the field of artificial intelligence technology. Specifically, when a project triggers QAC alarm repair, a repair branch is created based on the project's main branch. The automatic repair operation is completely isolated within this repair branch, avoiding direct modifications to the main development branch, thus ensuring the stability of the main code and the continuity of the development process. In the repair branch, the core alarm information from the QAC detection report is parsed and input into a language model along with the project's coding specifications and industry coding standards. The model directly generates repair code that conforms to the rules, eliminating the need for manual analysis, writing, and verification, significantly reducing labor costs and eliminating inconsistencies in repair caused by differences in developer understanding. After modification, only the changes in the repair branch are synchronized back to the corresponding location in the main branch, significantly improving repair efficiency and shortening the overall iteration cycle.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, and in particular to a method, apparatus, device and medium for code quality analysis alarm repair. Background Technology

[0002] In automotive electronic software development, a trunk / branch multi-branch management model is commonly used for code iteration. Projects require quality analysis (QAC) tools to perform checks and generate reports incorporating industry standards such as MISRA 2012 and SEI CERT C. For mandatory alerts requiring repair, developers must address them one by one to ensure code security and compliance.

[0003] Currently, QAC alarm repair relies entirely on manual work, resulting in high labor costs and a large number of alarms consuming core development time. Secondly, the repair efficiency is low, with cumbersome manual analysis, coding, and verification processes, and each alarm taking a long time to process. Moreover, the repair standardization is low, and different personnel have inconsistent understandings of alarms, which can easily lead to differences in repair results or even introduce new defects.

[0004] Given the above, how to solve the problems of high cost, low efficiency and poor standardization in the current manual repair of QAC alarms is an urgent issue for technicians in this field. Summary of the Invention

[0005] The purpose of this application is to provide a method, apparatus, equipment, and medium for repairing code quality analysis alarms, in order to solve the problems of high cost, low efficiency, and poor standardization in the current manual repair of QAC alarms.

[0006] To address the aforementioned technical problems, this application provides a method for repairing code quality analysis alarms, including:

[0007] When a project triggers a QAC alarm repair, a repair branch is created based on the project's main branch.

[0008] Obtain and parse the QAC detection report to obtain the core alarm information;

[0009] The alarm core information, along with the project's coding specifications and industry coding standards, are input into the language model so that the code in the repair branch can be modified through the language model.

[0010] Based on the code modifications made in the repair branch, the corresponding code in the main branch is modified.

[0011] On the one hand, a fix branch is created based on the main branch of the project, including:

[0012] Based on the main branch, create the corresponding repair branch in the SVN repository;

[0013] Configure the core configuration items of the project based on the Jenkins platform;

[0014] The core configuration items include at least the main branch SVN repository URL, the repair branch path, and the source code path.

[0015] On the other hand, the QAC detection report is acquired and parsed to obtain the core alarm information, including:

[0016] Obtain the last generated QAC test report for the project;

[0017] The QAC detection report is structured and parsed using regular expressions to obtain the core alarm information; wherein, the core alarm information includes at least the code file name, line number, alarm description, alarm level, and the detection standard to which the alarm belongs;

[0018] The core alarm information is converted into structured data.

[0019] On the other hand, the core alarm information, along with the project's coding specifications and industry coding standards, are input into a language model to modify the code in the repair branch through the language model, including:

[0020] The structured core alarm information, along with the coding specifications and industry coding standards, are uniformly input into the language model via an API interface;

[0021] The language model is used to analyze the core information of each alarm to identify the alarm type;

[0022] Based on the coding specifications and industry coding standards, the language model generates a standardized code repair scheme that matches the alarm type.

[0023] The language model modifies a specified line in the corresponding code file within the repair branch according to the standardized code repair scheme.

[0024] Identify the repaired code files using the SVN command-line tool;

[0025] Using the `svn add` and `svn commit` commands, the repaired code files are uploaded to the repair branch in the SVN repository.

[0026] On the other hand, before modifying the corresponding code in the main branch based on the code modifications in the repair branch, after inputting the alarm core information, the project's coding specifications, and industry coding standards into the language model so that the code in the repair branch can be modified through the language model, the process further includes:

[0027] The QAC detection process is started based on the repair branch, and the detection file list of the QAC detection tool is set to the repaired code file in the repair branch;

[0028] Perform targeted QAC detection on the repaired code file to obtain the targeted QAC detection results.

[0029] On the other hand, after performing targeted QAC checks on the repaired code files, the process also includes:

[0030] The targeted QAC detection results are automatically statistically analyzed using scripts to generate core statistical indicators; wherein, the core statistical indicators include at least the total number of alarms, the number of successfully repaired alarms, the number of alarms that were not repaired, the number of new alarms, and the repair rate.

[0031] Generate a QAC alarm repair comparison report; wherein, the QAC alarm repair comparison report shall include at least the alarm repair result, the file corresponding to the alarm repair, the line number, the alarm description, and the Jenkins pipeline access link;

[0032] The directional QAC test results are written into the project database.

[0033] On the other hand, before inputting the core alarm information along with the project's coding specifications and industry coding standards into the language model, the following steps are also included:

[0034] Replace all source code paths in the repair branch with source code paths in the main branch.

[0035] To address the aforementioned technical problems, this application also provides a code quality analysis alarm repair device, comprising:

[0036] The branch creation module is used to create a repair branch based on the main branch of the project when a QAC alarm repair is triggered in the project.

[0037] The acquisition and parsing module is used to acquire and parse the QAC detection report to obtain the core alarm information;

[0038] The code repair module is used to input the core alarm information, the project's coding specifications, and industry coding standards into the language model, so as to modify the code in the repair branch through the language model;

[0039] The compilation module is used to modify the corresponding code in the main branch based on the modified code in the repair branch.

[0040] To address the aforementioned technical problems, this application also provides a code quality analysis alarm repair device, comprising:

[0041] Memory, used to store computer programs;

[0042] A processor is used to implement the steps of the above-described code quality analysis alarm repair method when executing the computer program.

[0043] To address the aforementioned technical problems, this application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the aforementioned code quality analysis alarm repair method.

[0044] The code quality analysis and alert repair method provided in this application creates a repair branch based on the project's main branch when a QAC alert is triggered. This isolates the automatic repair operation entirely within the repair branch, avoiding direct modifications to the main development branch and thus ensuring the stability of the main codebase and the continuity of the development process. Within the repair branch, the core alert information from the QAC detection report is parsed and input into a language model along with the project's coding standards and industry coding standards. The model directly generates repair code that conforms to the rules, eliminating the need for manual analysis, writing, and verification. This significantly reduces labor costs and eliminates inconsistencies in repairs caused by differences in developer understanding. After modification, only the changes in the repair branch are synchronized back to the corresponding location in the main branch, significantly improving repair efficiency and shortening the overall iteration cycle.

[0045] In addition, this application also provides a code quality analysis alarm repair device, equipment and medium, with the same effect as above. Attached Figure Description

[0046] To more clearly illustrate the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0047] Figure 1 A flowchart illustrating a code quality analysis alarm repair method provided in this application embodiment;

[0048] Figure 2 An alarm repair flowchart provided for embodiments of this application;

[0049] Figure 3A flowchart of automated repair process for QAC code alarms based on a language model is provided for embodiments of this application.

[0050] Figure 4 A schematic diagram of a code quality analysis alarm repair device provided in this application embodiment;

[0051] Figure 5 This is a structural diagram of a code quality analysis alarm repair device provided in an embodiment of this application. Detailed Implementation

[0052] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.

[0053] The core of this application is to provide a method, apparatus, equipment, and medium for repairing code quality analysis alarms, in order to solve the problems of high cost, low efficiency, and poor standardization in the current manual repair of QAC alarms.

[0054] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0055] In automotive electronic software development, a trunk / branch multi-branch management model is typically used for code iteration, and QAC tools are used to perform code quality checks, generating reports that comply with industry standards such as MISRA 2012 and SEI CERT C. After QAC testing, projects often generate a large number of mandatory alerts, which need to be fixed one by one to ensure code security and compliance. Currently, these alerts rely entirely on manual handling by developers: developers must review the file, line number, and description of each alert, analyze the cause, write fix code according to coding standards, and then resubmit and run QAC testing to verify the effect. This manual approach has significant drawbacks: first, it is labor-intensive, with a large number of alerts consuming core development effort; second, it is inefficient, with a cumbersome analysis, writing, and verification process, and each alert taking a long time to resolve; third, the standardization of fixes is low, and differences in understanding and habits among different personnel can easily lead to inconsistent fixes or even introduce new problems; fourth, it is redundant, requiring a full re-test of the code after each fix, further lengthening the cycle.

[0056] Currently, while some automatic code repair technologies exist, they mostly target common syntax errors and fail to incorporate the QAC testing standards (such as MISRA 2012) and trunk / branch development models specific to the automotive electronics industry. Therefore, they cannot effectively address the core pain point of manually repairing QAC Mandatory alarms in the automotive electronics field. To solve this problem, this application provides a code quality analysis alarm repair method.

[0057] Figure 1 This is a flowchart illustrating a code quality analysis alarm repair method provided in an embodiment of this application. Figure 1 As shown, the method includes:

[0058] S10: When a project triggers a QAC alarm repair, a repair branch is created based on the project's main branch.

[0059] Specifically, the execution status of the QAC_NB pipeline in the automotive electronics project is monitored in real time. Once the QAC_NB pipeline completes execution and generates a QAC test report, it automatically determines whether to trigger automatic alarm repair. This embodiment does not restrict the triggering conditions; for example, it can be due to the presence of a Mandatory level alarm in the QAC test report, or the number of Mandatory level alarms in the QAC test report exceeding a preset threshold for the project, depending on the specific implementation.

[0060] Figure 2 This is a flowchart illustrating the alarm repair process provided in an embodiment of this application. Figure 2 As shown, when the repair trigger conditions are met and a QAC alarm repair is triggered, a repair branch QAC_Auto_Fix is ​​created based on the project's main branch. It's important to note that the main branch is the project's stable development backbone, containing verified core code and ensuring continuity of team collaboration and version iteration. The repair branch QAC_Auto_Fix is ​​temporarily created based on the main branch, specifically for isolating alarm repair operations and avoiding direct modification of the main branch code. After the repair is complete, the changes are merged back into the main branch, and the branch is then deleted. This ensures that the repair process does not affect the stability of the main branch and reduces the risk of concurrent development conflicts.

[0061] S11: Obtain and parse the QAC detection report to obtain the core alarm information.

[0062] Further, the QAC (Quality Control and Analysis) report is obtained. The QAC report is a document generated by the code quality analysis tool, recording warning information about code violations, including file location, line number, description, and severity level. After obtaining the QAC report, it is parsed to obtain the core warning information. This embodiment does not limit the specific content of the core warning information; it depends on the specific implementation.

[0063] S12: Input the core alarm information, project coding specifications, and industry coding standards into the language model so that the code in the repair branch can be modified through the language model.

[0064] Subsequently, the core alarm information, along with the project's coding standards and industry coding conventions, is input into the language model. It's important to note that the project coding standards are internally defined team guidelines and rules, including naming conventions, comments, and formatting, used to standardize development practices. Industry coding standards, on the other hand, refer to external authoritative standards such as the Software Reliability Association for the Automotive Industry (MISRA2012) and the Carnegie Mellon University Software Engineering Institute C Coding Standard (SEI CERT C), which enforce code constraints to ensure security and reliability. The combination of these two standards ensures that code quality meets the requirements of the automotive electronics industry.

[0065] Furthermore, a language model, also known as a Large Language Model (LLM), is an artificial intelligence model based on deep learning. It is trained on massive amounts of text data to learn the statistical patterns and semantic representations of language. It can understand context, generate natural language text, and perform tasks such as code generation, translation, and question answering.

[0066] Therefore, after obtaining the core alarm information, coding specifications, and industry coding standards, the language model modifies the code in the repair branch based on these specifications and standards, combined with the core alarm information. This modification process is automated and requires no manual coding. It's important to note that this embodiment does not restrict the specific process by which the language model modifies the code in the repair branch, nor does it limit the specific type of language model; it depends on the specific implementation.

[0067] S13: Modify the corresponding code in the main branch based on the code changes made in the repair branch.

[0068] Finally, after modifying the code in the repair branch, the corresponding code in the main branch is modified based on the changes made in the repair branch. It's important to note that before modifying the corresponding code in the main branch, the modified code in the repair branch is often verified. Only after successful verification can the changes made in that branch for each warning point be precisely matched and synchronized with the corresponding code locations in the main branch. Since this process only updates the repaired code snippets to the corresponding lines in the original files of the main branch, it avoids introducing additional changes while preserving normal iteration content submitted by other developers in the main branch during this period. This ensures that repair updates and main branch evolution do not interfere with each other, thus achieving safe and controllable code merging. This embodiment does not restrict the specific process of verifying the modified code in the repair branch.

[0069] In this embodiment, when a QAC alarm is triggered for repair, a repair branch is created based on the project's main branch. The automatic repair operation is completely isolated within this repair branch, avoiding direct modifications to the main development branch and thus ensuring the stability of the main codebase and the continuity of the development process. Within the repair branch, the core alarm information is obtained by parsing the QAC detection report. This information, along with the project's coding standards and industry coding standards, is input into the language model. The model directly generates repair code that conforms to the rules, eliminating the need for manual analysis, writing, and verification. This significantly reduces labor costs and eliminates inconsistencies in repairs caused by differences in developer understanding. After modification, only the changes in the repair branch are synchronized back to the corresponding location in the main branch, significantly improving repair efficiency and shortening the overall iteration cycle.

[0070] Figure 3 This document provides a flowchart for automated repair of QAC code alarms based on a language model, as illustrated in the embodiments of this application. Building upon the above embodiments, some embodiments, such as... Figure 3 As shown, a fix branch is created based on the project's main branch, including:

[0071] S101: Create a corresponding repair branch in the SVN repository based on the main branch.

[0072] S102: Core configuration items for configuring projects based on the Jenkins platform.

[0073] The core configuration items include at least the main branch SVN repository URL, the repair branch path, and the source code path.

[0074] To create a fix branch, this embodiment specifically creates a corresponding fix branch in the SVN repository based on the main branch. An SVN repository is a version control tool used to store the complete historical versions and metadata of all files. It supports multiple branches and tag management, facilitating collaborative development within a team. Developers can check out code from the repository, modify it, and commit updates, with the repository automatically recording the changes. It is understood that in practice, in addition to an SVN repository, other version control tools such as Git and GitLab can also be used.

[0075] Furthermore, the core configuration items for the project are configured based on the Jenkins platform. Jenkins is an open-source automation server widely used in Continuous Integration and Continuous Delivery (CI / CD). It offers a rich plugin ecosystem, seamlessly integrates with version control systems such as SVN and Git, and supports tasks such as automated builds, code inspection, and test deployment. Understandably, in practical implementations, in addition to the Jenkins platform, pipeline platforms such as GitLab CI / CD, GitHub Actions, and Jenkins X can also be used.

[0076] It is important to note that the core configuration items in this embodiment include at least the main branch SVN repository URL, the repair branch path, and the source code path. They may also include the project name, variant name, target path, tools path, email recipients, and email notification on / off. The main branch SVN repository URL specifies the storage address of the project's main branch in the SVN repository, used to detect stable trunk code. The repair branch path defines the location of the dedicated repair branch QAC_Auto_Fix created based on the main branch in SVN, used to isolate alarm repair operations. The source code path points to the directory containing the source code to be detected and repaired, allowing QAC tools and language models to locate files. The project name identifies the project to which the current repair task belongs, facilitating multi-project management and report differentiation. The variant name indicates different configurations or target platform versions of the code, used to distinguish different compilation or runtime environments within the same project. The target path specifies the output or merging target location of the repaired code, often related to the main branch or build output. The tools path is the storage path for executable programs or scripts such as configuration QAC detection tools and language model calling scripts. The email recipients can be set to receive repair results, alarm statistics, or failure notifications; multiple recipients are supported. The email notification switch controls whether to automatically send email notifications upon completion of the repair process or in the event of an anomaly, facilitating team status tracking. It's understood that the above configuration items are persistently stored after configuration and can be flexibly modified.

[0077] In this way, a corresponding repair branch is created in the SVN repository based on the main branch, and the core configuration items of the project are configured based on the Jenkins platform. This enables the creation of the repair branch and the configuration of project-specific parameters, so as to facilitate subsequent automated code modifications.

[0078] Based on the above embodiments, in some embodiments, the QAC detection report is acquired and parsed to obtain core alarm information, including:

[0079] S111: Retrieve the last QAC test report generated for the project.

[0080] S112: The QAC detection report is structured and parsed using regular expressions to obtain the core alarm information.

[0081] S113: Convert alarm core information into structured data.

[0082] To obtain the core alarm information, this embodiment automatically retrieves the most recently generated QAC detection report from the designated storage path of the QAC_NB pipeline. Subsequently, the QAC detection report is structured and parsed using regular expressions to extract the core alarm information.

[0083] It is important to note that the core information of an alarm should include at least the corresponding code file name, line number, alarm description, alarm level, and the corresponding detection standard. Specifically, the alarm level can be limited to the Mandatory level, and the corresponding detection standard can be MISRA 2012 / SEI CERT C.

[0084] Finally, the extracted core alarm information is converted into structured data in key-value pair format, such as JSON. This achieves the extraction and structured parsing of QAC alarm reports, facilitating subsequent reading and analysis using the language model.

[0085] To avoid ineffective repairs due to code version inconsistencies, in some embodiments, in addition to the above embodiments, the following is also included before inputting the core alarm information and the project's coding specifications and industry coding standards into the language model:

[0086] S120: Replace the source code paths in the repair branch with the source code paths in the main branch.

[0087] Specifically, by performing code synchronization operations through the SVN command-line tool, the source code path in the repair branch QAC_Auto_Fix is ​​completely replaced with the latest source code path in the main branch. This ensures that the code version of the repair branch is completely consistent with the main development branch, avoiding the problem of invalid language model repair due to inconsistent code versions, and ensuring that the repair results can be directly migrated to the main branch.

[0088] Based on the above embodiments, in some embodiments, the core alarm information, along with the project's coding specifications and industry coding standards, are input into the language model to modify the code in the repair branch through the language model, including:

[0089] S121: The structured alarm core information, along with coding specifications and industry coding standards, are uniformly input into the language model through the API interface.

[0090] S122: The language model analyzes the core information of each alarm to identify the alarm type.

[0091] S123: The language model generates a standardized code repair solution that matches the alarm type based on coding specifications and industry coding standards.

[0092] S124: The language model modifies a specified line in the corresponding code file in the repair branch according to the standardized code repair scheme.

[0093] S125: Identify the repaired code files using the SVN command-line tool.

[0094] S126: Using the svn add and svn commit commands, upload the repaired code files to the repair branch of the SVN repository.

[0095] Specifically, the structured core alarm information, combined with the automotive electronics project's proprietary coding specifications and industry coding standards such as MISRA2012 and SEICERTC, is uniformly input into the language model via an API interface. It's understandable that this API interface refers to the language model's API interface.

[0096] Subsequently, the language model independently analyzes the core information of each alarm to identify the alarm type, such as missing function declarations, pointer dereference risks, and non-standard encoding formats. The language model further generates standardized code repair solutions matching the alarm type based on industry coding standards and project coding specifications. For example, it adds function declaration statements for missing functions and adds NOT NULL checks for pointer dereference risks. Finally, based on the generated repair solutions, the language model performs automated code modification on specified lines in the corresponding code files within the QAC_Auto_Fix repair branch, without requiring any manual coding.

[0097] After the language model completes the code modifications, the SVN command-line tool automatically identifies all modified code files and executes the `svn add` and `svn commit` commands sequentially. This synchronizes the fixed code files to the fix branch `QAC_Auto_Fix` in the SVN repository, ultimately completing the code commit. Furthermore, a fixed comment "QAC Auto Fix by AI" can be added during the commit for easier tracking of subsequent code changes and project management.

[0098] In this embodiment, QAC alarm information is combined with the automotive electronics industry MISRA 2012 and SEI CERT C coding standards to input the language model, allowing the model to generate standardized repair solutions that conform to industry specifications, thus ensuring the standardization of the repair code.

[0099] To ensure the accuracy of code repair and address the issue of time-consuming QAC re-execution of the entire codebase after manual repair, which further reduces overall efficiency, based on the above embodiments, some embodiments, before modifying the corresponding code in the main branch based on the code modifications in the repair branch, further include inputting the core alarm information along with the project's coding specifications and industry coding standards into the language model. This allows the code in the repair branch to be modified through the language model.

[0100] S131: Start the QAC detection process based on the repair branch, and set the QAC detection tool's detection file list to the repaired code files in the repair branch.

[0101] S132: Perform targeted QAC testing on the repaired code file and obtain the targeted QAC test results.

[0102] After modifying the code in the fix branch using the language model, the QAC detection process is initiated based on the fix branch QAC_Auto_Fix. By modifying the configuration file of the QAC detection tool, the list of files to be detected is limited to code files modified by the language model. Subsequently, targeted QAC detection is performed, only checking the code quality of the modified code files and skipping the full code that has not been modified, thereby significantly reducing detection time and improving process efficiency.

[0103] To enable the statistical analysis and feedback of code repair results, based on the above embodiments, some embodiments further include, after performing targeted QAC testing on the repaired code files:

[0104] S141: Automated statistical analysis of targeted QAC detection results is performed using scripts to generate core statistical indicators.

[0105] The core statistical indicators include at least the total number of alarms, the number of successfully repaired alarms, the number of alarms that were not repaired, the number of new alarms, and the repair rate.

[0106] S142: Generate a QAC alarm repair comparison report.

[0107] S143: Write the directional QAC test results into the project database.

[0108] After completing the targeted QAC detection, the results can be further automated and statistically analyzed using Python scripts. Key statistical metrics include at least the total number of alarms, the number of successfully fixed alarms, the number of unfixed alarms, the number of new alarms, and the fix rate.

[0109] Subsequently, a QAC alarm repair comparison report is generated. This embodiment does not restrict the specific format of the QAC alarm repair comparison report; for example, it can be in Excel format. The QAC alarm repair comparison report should at least include the alarm repair result (repair successful / not repaired / new), the file corresponding to the alarm repair, the line number, and the alarm description. It should also include a dedicated access link for the Jenkins pipeline to facilitate developers reviewing the details.

[0110] Finally, the structured, targeted QAC test results are synchronously written to the project database, enabling persistent storage and traceable querying of the remediation results. Simultaneously, if the email notification switch configured in the Jenkins platform is enabled, the email plugin is automatically invoked, attaching the remediation comparison report and combining it with key statistical indicators to push it to the preset email recipients, ensuring timely notification of the remediation results.

[0111] The code quality analysis alarm repair method has been described in detail in the above embodiments. This application also provides embodiments of the code quality analysis alarm repair device.

[0112] Figure 4 This is a schematic diagram of a code quality analysis alarm repair device provided in an embodiment of this application. Figure 4 As shown, the device includes:

[0113] Branch creation module 10 is used to create a repair branch based on the project's main branch when the project triggers a QAC alarm repair.

[0114] The acquisition and parsing module 11 is used to acquire and parse the QAC detection report to obtain the core alarm information.

[0115] The code repair module 12 is used to input the core alarm information, the project's coding specifications, and industry coding standards into the language model, so as to modify the code in the repair branch through the language model.

[0116] Compilation module 13 is used to modify the corresponding code in the main branch based on the code changes made in the repair branch.

[0117] In some embodiments, the branch creation module 10 includes:

[0118] Create a submodule to create a corresponding repair branch in the SVN repository based on the main branch;

[0119] The configuration submodule is used to configure the core configuration items of a project based on the Jenkins platform.

[0120] The core configuration items include at least the main branch SVN repository URL, the repair branch path, and the source code path.

[0121] In some embodiments, the acquisition and parsing module 11 includes:

[0122] The `get` submodule is used to retrieve the last QAC test report generated by the project.

[0123] The parsing submodule is used to perform structured parsing of the QAC detection report using regular expressions to obtain the core alarm information. The core alarm information includes at least the code file name, line number, alarm description, alarm level, and the detection standard to which the alarm belongs.

[0124] The transformation submodule is used to convert alarm core information into structured data.

[0125] In some embodiments, the code repair module 12 includes:

[0126] The input submodule is used to uniformly input structured alarm core information, coding specifications, and industry coding standards into the language model through the API interface;

[0127] The analysis submodule is used to analyze the core information of each alarm using a language model in order to identify the alarm type;

[0128] The generation submodule is used to generate standardized code repair solutions that match the alarm type based on the language model, coding specifications, and industry coding standards.

[0129] The modification submodule is used by the language model to perform modifications on specified lines of the corresponding code files in the repair branch according to the standardized code repair scheme;

[0130] The identification submodule is used to identify repaired code files using the SVN command-line tools;

[0131] The commit submodule is used to upload the fixed code files to the fix branch of the SVN repository based on the svn add and svn commit commands.

[0132] In some embodiments, it also includes:

[0133] The targeted detection configuration submodule is used to start the QAC detection process based on the repair branch and set the list of detection files of the QAC detection tool to the repaired code files in the repair branch;

[0134] The targeted detection execution submodule is used to perform targeted QAC detection on the repaired code files and obtain the targeted QAC detection results.

[0135] In some embodiments, it also includes:

[0136] The statistics submodule is used to perform automated statistical analysis on the targeted QAC detection results through scripts to generate core statistical indicators. Among them, the core statistical indicators include at least the total number of alarms, the number of successfully repaired alarms, the number of unrepaired alarms, the number of new alarms, and the repair rate.

[0137] The report generation module is used to generate QAC alarm repair comparison reports. The QAC alarm repair comparison reports should include at least the alarm repair results, the files corresponding to the alarm repairs, line numbers, alarm descriptions, and Jenkins pipeline access links.

[0138] The write submodule is used to write the directional QAC test results into the project database.

[0139] In some embodiments, it also includes:

[0140] The Replace submodule is used to completely replace the source code paths in the Fix branch with the source code paths in the main branch.

[0141] Since the embodiments of the apparatus and the embodiments of the method correspond to each other, please refer to the description of the embodiments of the method for the embodiments of the apparatus, which will not be repeated here.

[0142] Figure 5 This is a structural diagram of a code quality analysis and alarm repair device provided in an embodiment of this application. Figure 5 As shown, the code quality analysis alarm repair equipment includes:

[0143] Memory 20 is used to store computer programs;

[0144] The processor 21 is used to implement the steps of the code quality analysis alarm repair method mentioned in the above embodiments when executing a computer program.

[0145] The code quality analysis alarm repair device provided in this embodiment may include, but is not limited to, smartphones, tablets, laptops, or desktop computers.

[0146] The processor 21 may include one or more processing cores, such as a quad-core processor or an octa-core processor. The processor 21 may be implemented using at least one of the following hardware forms: Digital Signal Processor (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). The processor 21 may also include a main processor and a coprocessor. The main processor, also known as the Central Processing Unit (CPU), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor 21 may integrate a Graphics Processing Unit (GPU), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, the processor 21 may also include an Artificial Intelligence (AI) processor, which handles computational operations related to machine learning.

[0147] The memory 20 may include one or more computer-readable storage media, which may be non-transitory. The memory 20 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In this embodiment, the memory 20 is used to store at least the following computer program 201, which, after being loaded and executed by the processor 21, can implement the relevant steps of the code quality analysis alarm repair method disclosed in any of the foregoing embodiments. In addition, the resources stored in the memory 20 may also include an operating system 202 and data 203, and the storage method may be temporary storage or permanent storage. The operating system 202 may include Windows, Unix, Linux, etc. The data 203 may include, but is not limited to, the data involved in the code quality analysis alarm repair method.

[0148] In some embodiments, the code quality analysis alarm repair device may further include a display screen 22, an input / output interface 23, a communication interface 24, a power supply 25, and a communication bus 26.

[0149] Those skilled in the art will understand that Figure 5 The structure shown does not constitute a limitation on the code quality analysis alarm remediation device and may include more or fewer components than shown.

[0150] Finally, this application also provides an embodiment corresponding to a computer-readable storage medium. The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps described in the above method embodiments.

[0151] It is understood that if the methods in the above embodiments are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and executes all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0152] The foregoing provides a detailed description of a code quality analysis alarm repair method, apparatus, device, and medium provided in this application. The various embodiments in the specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section. It should be noted that those skilled in the art can make several improvements and modifications to this application without departing from the principles of this application, and these improvements and modifications also fall within the protection scope of this application.

[0153] It should also be noted that, in this specification, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

Claims

1. A method for repairing code quality analysis alarms, characterized in that, include: When a project triggers a QAC alarm repair, a repair branch is created based on the project's main branch. Obtain and parse the QAC detection report to obtain the core alarm information; The alarm core information, along with the project's coding specifications and industry coding standards, are input into the language model so that the code in the repair branch can be modified through the language model. Based on the code modifications made in the repair branch, the corresponding code in the main branch is modified.

2. The code quality analysis alarm repair method according to claim 1, characterized in that, Create a fix branch based on the project's main branch, including: Based on the main branch, create the corresponding repair branch in the SVN repository; Configure the core configuration items of the project based on the Jenkins platform; The core configuration items include at least the main branch SVN repository URL, the repair branch path, and the source code path.

3. The code quality analysis alarm repair method according to claim 1, characterized in that, Obtain and parse the QAC detection report to obtain the core alarm information, including: Obtain the last generated QAC test report for the project; The QAC detection report is structured and parsed using regular expressions to obtain the core alarm information; wherein, the core alarm information includes at least the code file name, line number, alarm description, alarm level, and the detection standard to which the alarm belongs; The core alarm information is converted into structured data.

4. The code quality analysis alarm repair method according to claim 3, characterized in that, The core alarm information, along with the project's coding specifications and industry coding standards, are input into a language model to modify the code in the repair branch using the language model, including: The structured core alarm information, along with the coding specifications and industry coding standards, are uniformly input into the language model via an API interface; The language model is used to analyze the core information of each alarm to identify the alarm type; Based on the coding specifications and industry coding standards, the language model generates a standardized code repair scheme that matches the alarm type. The language model modifies a specified line in the corresponding code file within the repair branch according to the standardized code repair scheme. Identify the repaired code files using the SVN command-line tool; Using the `svn add` and `svn commit` commands, the repaired code files are uploaded to the repair branch in the SVN repository.

5. The code quality analysis alarm repair method according to claim 1, characterized in that, Before modifying the corresponding code in the main branch based on the code modifications in the repair branch, after inputting the alarm core information, the project's coding specifications, and industry coding standards into the language model so that the code in the repair branch can be modified through the language model, the process further includes: The QAC detection process is started based on the repair branch, and the detection file list of the QAC detection tool is set to the repaired code file in the repair branch; Perform targeted QAC detection on the repaired code file to obtain the targeted QAC detection results.

6. The code quality analysis alarm repair method according to claim 5, characterized in that, After performing targeted QAC checks on the repaired code files, the process also includes: The targeted QAC detection results are automatically statistically analyzed using scripts to generate core statistical indicators; wherein, the core statistical indicators include at least the total number of alarms, the number of successfully repaired alarms, the number of alarms that were not repaired, the number of new alarms, and the repair rate. Generate a QAC alarm repair comparison report; wherein, the QAC alarm repair comparison report shall include at least the alarm repair result, the file corresponding to the alarm repair, the line number, the alarm description, and the Jenkins pipeline access link; The directional QAC test results are written into the project database.

7. The code quality analysis alarm repair method according to any one of claims 1 to 6, characterized in that, Before inputting the core alarm information along with the project's coding specifications and industry coding standards into the language model, the following steps are also included: Replace all source code paths in the repair branch with source code paths in the main branch.

8. A code quality analysis alarm repair device, characterized in that, include: The branch creation module is used to create a repair branch based on the main branch of the project when a QAC alarm repair is triggered in the project. The acquisition and parsing module is used to acquire and parse the QAC detection report to obtain the core alarm information; The code repair module is used to input the core alarm information, the project's coding specifications, and industry coding standards into the language model, so as to modify the code in the repair branch through the language model; The compilation module is used to modify the corresponding code in the main branch based on the modified code in the repair branch.

9. A code quality analysis alarm repair device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the code quality analysis alarm repair method as described in any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the code quality analysis alarm repair method as described in any one of claims 1 to 7.