Code intelligent review method, system, program product and device
By integrating code review plugins with backend services, and combining static code analysis tools and LLM models, automated and intelligent code review is achieved. This solves the technical problems of time-consuming and inefficient code review in existing technologies, and realizes efficient and effective technical means to improve the code quality and efficiency of code review.
Patent Information
- Application Number
- CN202511610835.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-05
- Publication Date
- 2026-02-17
AI Technical Summary
In existing technologies, enterprise code review relies on manual line-by-line review or scattered tools, which is time-consuming, difficult to meet the needs of rapid iteration, and lacks in-depth automated and intelligent review capabilities.
By integrating code review plugins with backend services, and combining static code analysis tools and LLM models, automated code review is achieved, including vulnerability scanning and discrepancy analysis. This assists reviewers in conducting code reviews and displays review results and suggestions on the front-end platform.
It significantly improves the efficiency and quality of code review, shortens the review cycle, enhances the collaboration experience, improves the ability to control code quality, and reduces operational complexity and security risks.
Smart Images

Figure CN121541918A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and more specifically, to intelligent code review methods, systems, program products, and devices. Background Technology
[0002] As enterprise software development scales up and becomes more complex, code review, as a crucial step in ensuring code quality and reducing security risks, is becoming increasingly important. Currently, internal code review within enterprises mainly relies on manual line-by-line review or a combination of fragmented tools for vulnerability scanning. Manual review is time-consuming and labor-intensive, especially when facing large-scale code changes, resulting in long review cycles that are difficult to meet the demands of rapid iterative development. Summary of the Invention
[0003] This invention provides a method, system, program product, and device for intelligent code review, in order to address the shortcomings of existing manual review methods.
[0004] One aspect of the present invention relates to an intelligent code review method, comprising:
[0005] When a submitter initiates a code review through a code review plugin integrated into a software development tool, the code review plugin starts a backend service to automatically review the code and sends a code review request to the frontend code review platform.
[0006] After receiving a code review application, the front-end code review platform records the application information related to the application in the database and notifies the reviewer.
[0007] The application information and the automatic review results provided by the backend service are displayed to the reviewer through the front-end code review platform, and the reviewer's review feedback is received.
[0008] The front-end code review platform sends the review feedback to the code review plugin;
[0009] The code review plugin displays the review feedback to the submitter.
[0010] In some implementations, the code review plugin initiates a backend service to automatically review the code, including:
[0011] The backend service obtains the Git address and submission branch information of the current project.
[0012] The backend service calls a static code analysis tool to scan the submitted branch code for vulnerabilities.
[0013] The backend service invokes the LLM model to assist in the review of the submitted branch code.
[0014] The automatic review results include scanning results and auxiliary review results.
[0015] In some implementations, the vulnerability scanning includes:
[0016] The backend service downloads the submitted branch code from the Git code repository based on the Git address;
[0017] The backend service decompresses the downloaded code and performs a scan using the static code analysis tool on the local server;
[0018] The backend service inserts the scan results into the corresponding lines of code reviewed by the frontend code review platform to assist reviewers in their code review.
[0019] In some implementations, the auxiliary review includes:
[0020] The backend service clones the submission branch code and the main branch code from the Git code repository via the Git address;
[0021] The backend service compares the submitted branch code with the main branch code and generates the differences between the two branch codes.
[0022] The backend service inputs the discrepancies into the LLM model, and the LLM model generates a problem description and corresponding suggestions for the discrepancies.
[0023] The backend service inserts the problem description and corresponding suggestions into the corresponding lines of code reviewed by the frontend code review platform to assist reviewers in code review.
[0024] In some implementations, the review feedback includes review status and review recommendations.
[0025] In some implementations, the code review plugin provides a suggestion list to display the review suggestions; wherein the suggestion list includes the following items: file path, code snippet, comment, and reply; each item is configured with a mouse hover event to view the specific information of the corresponding item by hovering the mouse over it.
[0026] In some implementations, the code review plugin is configured to only display review feedback for code that has not passed approval.
[0027] In some implementations, the front-end code review platform allows the corresponding reviewer or submitter to perform operations according to their permissions.
[0028] In some implementations, the code review plugin communicates in real time with the front-end code review platform to exchange opinions from the submitter and reviewer.
[0029] Another aspect of the present invention relates to a code intelligent review system for performing the method described in any one embodiment of the present invention. The system includes the code review plugin, a backend module for executing the backend service, and a frontend code review platform.
[0030] This invention also relates to a computer program product, comprising a computer program, characterized in that, when executed by a processor, the computer program implements the steps of the method described in any embodiment of this invention. Accordingly, this invention provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the method described in any embodiment of this invention.
[0031] Furthermore, embodiments of the present invention provide a computer device comprising: a memory storing a computer program thereon; and a processor that executes the computer program to implement the steps of the method described in any embodiment of the present invention.
[0032] The present invention has the following advantages over the prior art:
[0033] (I) Significantly improved efficiency
[0034] According to the embodiments of the present invention, the code review plugin triggers the backend service to automatically obtain code, perform scanning and send notifications, which reduces the time spent by humans in code acquisition, scanning configuration, notification transmission and organizing review meetings, and greatly improves the efficiency of the review process.
[0035] By synchronizing review status and suggestions in real time through the front-end code review platform and code review plugin, the fragmentation of information in traditional email, meetings, and IM communication is avoided, and the review cycle is greatly shortened.
[0036] (II) Improvement of Review Quality
[0037] By using static code analysis tools to automatically scan submitted code, the ability to identify problems has been enhanced, effectively improving the depth and accuracy of code review.
[0038] The scan results are inserted into the corresponding lines of code reviewed by the front-end code review platform, achieving a precise association between code and suggestions. Reviewers can directly view and respond to suggestions in the code context, greatly improving their work efficiency.
[0039] (III) Enhanced Collaborative Experience
[0040] The code review plugin's real-time interaction with the front-end code review platform ensures that both submitters and reviewers can keep track of the review progress at any time, reducing communication delays. The visual display of the suggestion list and convenient reply functionality enhance the smoothness of collaboration.
[0041] By working in tandem with the code review plugin and the front-end code review platform, developers can submit code for review and process suggestions without leaving their development environment. Reviewers can conduct code reviews anytime, anywhere through the front-end code review platform, adapting to the high-efficiency collaboration needs of agile development models.
[0042] By tightly integrating the code review plugin with the front-end code review platform, developers and reviewers can complete the entire code review process in a familiar development environment without having to switch between multiple tools, reducing operational complexity and improving the development experience.
[0043] (iv) Enhanced security and standardization
[0044] By displaying information to submitters and reviewers according to their permissions, unauthorized personnel are prevented from modifying the review content or accessing sensitive code, thus reducing the risk of code leakage.
[0045] (V) Enhanced Review Depth and Intelligent Assistance
[0046] Leveraging the powerful analytical capabilities of the LLM model, it is possible to delve into the complex issues that may arise from code changes (differences), such as logical vulnerabilities, security risks, and performance bottlenecks. The introduction of the LLM model compensates for the potential limitations of static code analysis tools in specific scenarios, providing reviewers with more comprehensive and in-depth review suggestions, thereby further improving the quality and depth of code reviews.
[0047] By inserting the LLM model's review results into the corresponding lines of code reviewed on the front-end code review platform, and integrating them into the code review page in an intuitive way, reviewers can obtain the model's analysis opinions without switching to other tools or platforms, greatly improving the convenience and efficiency of the review process. At the same time, the model's assistance also helps reviewers broaden their review perspectives and improve their ability to control code quality.
[0048] Various aspects, features, and advantages of the embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Attached Figure Description
[0049] Figure 1 This is a block diagram illustrating an example of an intelligent code review system according to an embodiment of the present invention.
[0050] Figure 2 This is a flowchart illustrating an example of an intelligent code review method according to an embodiment of the present invention.
[0051] Figure 3 This is a schematic diagram illustrating the overall logic of an intelligent code review method according to an exemplary implementation.
[0052] Figure 4 This is a schematic diagram illustrating the automatic vulnerability scanning logic in an intelligent code review method of an exemplary implementation.
[0053] Figure 5 This is a schematic diagram illustrating the LLM-assisted review logic in an intelligent code review method according to an exemplary implementation.
[0054] Figure 6 This is a block diagram illustrating an example structure of a computer device according to an embodiment of the present invention. Detailed Implementation
[0055] The exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. It should be noted that the present invention can be implemented in various forms and is not limited to the specific embodiments described herein or shown in the accompanying drawings.
[0056] In this document, the terms “comprising,” “including,” and “having” are used to indicate the presence of certain features, steps, operations, elements, and / or components, but do not exclude the presence or addition of other features, steps, operations, elements, components, or combinations thereof. Unless explicitly defined by context, the terms “first,” “second,” and similar terms do not indicate any priority or order, but are used only to distinguish different elements in the description.
[0057] Figure 1 An example of an intelligent code review system according to an embodiment of the present invention is shown. The system includes a code review plugin 101 installed in a software development tool 100, a backend module 200 (e.g., a backend server) that executes a backend service 201, and a frontend code review platform 300. The code review plugin 101, the backend service 201, and the frontend code review platform 300 communicate with each other to achieve automation, intelligence, and collaboration throughout the entire code review process.
[0058] In some implementations, the code review plugin 101, developed within the IDEA (Integrated Development Environment) development tool, provides a function to create new code review (CodeReview) applications. Developers (i.e., reviewers) simply click the "Add" button, and the plugin automatically retrieves information such as the current project's Git address and the branch to be submitted. The plugin is also configured to allow developers to fill in the submission title, select a remote main branch, and choose reviewers through fuzzy search and multiple selection methods. After submission, the CodeReview application information is sent to the front-end code review platform 300, thereby simplifying the application process and improving efficiency.
[0059] In some implementations, backend service 201 integrates with the enterprise's internal code repository (GitLab). By calling the GitLab interface, backend service 201 can obtain project information, code branches, code content, and compare the differences between two branches (such as the submission branch and the main branch), generating a code change list. This provides accurate basic code information and version difference comparisons for code review, allowing reviewers to quickly understand the code changes.
[0060] In some implementations, backend service 201 uses the GitLab interface to download and decompress the source code of the submitted branch to the server, and then calls Maven commands to execute a SonarQube scan. By analyzing the scan results, data with severe vulnerabilities and bugs, along with problem descriptions, are accurately displayed on the corresponding code pages, allowing developers to intuitively see potential problems in the code and improving their ability to control code quality.
[0061] In some implementations, during the code review process, the backend service 201 will use the notification function of WeChat Work to promptly send notifications to the reviewers after submission. Once approved or if there are suggestions, feedback information can also be promptly sent to the submitter, ensuring efficient communication and information transmission in the review process.
[0062] In some implementations, the plugin 101 is configured to provide developers with a CodeReview list, displaying only the developer's own rejected application records, while approved records are not displayed, enabling developers to clearly understand their pending review tasks, avoiding information overload, and improving work efficiency.
[0063] In some implementations, plugin 101 is configured such that when a reviewer comments on the code, the status of the corresponding application record in the CodeReview list displays "View Suggestions". Plugin 101 is also configured such that when a developer clicks the "View Suggestions" button, a detailed list of suggestions is rendered in the lower area. Furthermore, plugin 101 is configured such that mouse hover events are set for file paths, code snippets, comments, and reply information in the suggestion list, displaying information not fully shown in the list in a floating box. Additionally, plugin 101 is configured such that double-clicking a file path allows for quick location and opening of the file in the IDEA project, and selection of the code area with suggestions (CodeReview for this project only), facilitating direct viewing and handling of problematic code by developers. Finally, plugin 101 is configured such that developers can directly confirm and reply to suggestions in the suggestion list, with selectable confirmation types and the ability to double-click to fill in reply information, thus implementing a convenient communication and feedback mechanism.
[0064] In some implementations, the CodeReview application information submitted by the plugin 101 will be displayed in the code review list menu bar of the front-end code review platform 300. The submitter can modify and delete the submission information on the platform 300, and can access the function page of the submission branch and main branch diffs through the review button to view the code with suggestions and confirm and reply to the suggestions, thus realizing comprehensive management and tracking of the review process.
[0065] In some implementations, reviewers can review and process submitted information on the front-end code review platform 300. In some implementations, the diffs function page of the front-end code review platform 300 displays a file directory tree with discrepancies on the left, and after clicking on a file, displays the diff content of the two branches of code on the right. In some implementations, the front-end code review platform 300 is configured so that reviewers can select problematic code and fill in suggestions, providing detailed feedback to the submitter, which helps improve code quality.
[0066] In some implementations, the front-end code review platform 300 has an access control mechanism, which allows only reviewers and submitters to make changes and respond to the submitted code, while other personnel only have viewing permissions, thus ensuring the standardization of the review process and the security of the data.
[0067] Figure 2 An example of the intelligent code review method performed by the system according to an embodiment of the present invention is shown. Figure 2 The method includes:
[0068] S201, when the submitter initiates a code review through the code review plugin 101 integrated into the software development tool 100, the code review plugin 101 starts the backend service 201 to automatically review the code and sends the code review application to the frontend code review platform 300.
[0069] S202, after receiving a code review application, the front-end code review platform 300 records the application information related to the code review application in the database and notifies the reviewer;
[0070] S203, the application information and the automatic review results provided by the backend service 201 are displayed to the reviewer through the front-end code review platform 300, and the reviewer's review feedback is received;
[0071] S204, the front-end code review platform 300 sends the review feedback to the code review plugin 101;
[0072] S205, the code review plugin 101 displays the review feedback to the submitter.
[0073] In some implementations, step S201, where the code review plugin initiates a backend service to automatically review the code, includes: the backend service 201 obtaining the Git address and submission branch information of the current project; the backend service 201 calling a static code analysis tool to perform vulnerability scanning on the submission branch code; and the backend service 201 calling an LLM (Large Language Model) model to perform auxiliary review on the submission branch code. The automatic review results include both the scanning results and the auxiliary review results.
[0074] In some implementations, the vulnerability scanning includes: the backend service 201 downloading the submitted branch code from the Git code repository according to the Git address; the backend service 201 decompressing the downloaded code and performing a scan by the static code analysis tool on a local server; and the backend service 201 inserting the scan results into the corresponding lines of code reviewed by the frontend code review platform 300 to assist the reviewer in code review.
[0075] In some implementations, the auxiliary review includes: the backend service 201 cloning the submitted branch code and the main branch code from the Git code repository via the Git address; the backend service 201 comparing the submitted branch code and the main branch code to generate diffs between the two branches; the backend service 201 inputting the diffs into the LLM model, which generates a problem description and corresponding suggestions for the diffs; and the backend service 201 inserting the problem description and corresponding suggestions into the corresponding lines of code reviewed by the frontend code review platform 300 to assist the reviewer in code review.
[0076] In some implementations, the review feedback includes review status and review suggestions. The code review plugin 101 provides a suggestion list to display the review suggestions. The suggestion list includes the following items: file path, code snippet, comment, and reply; each item is configured with a mouse hover event to view specific information by hovering the mouse over it. In some implementations, the code review plugin 101 is configured to only display review feedback for applications that have not passed approval, and not display approved application records. In some implementations, the code review plugin 101 communicates in real time with the front-end code review platform 300 to exchange opinions between the submitter and the reviewer, enabling timely communication between the submitter and the reviewer.
[0077] In some implementations, the front-end code review platform 300 implements access control, allowing only reviewers and submitters to make changes and respond to submitted code reviews, while other personnel only have viewing permissions, thus ensuring the standardization of the review process and the security of the data.
[0078] The following is combined Figures 3 to 5 Exemplary embodiments of the intelligent code review method of the present invention will be described.
[0079] Figure 3 This illustrates the overall logic of the intelligent code review method of the present invention. First, the user (i.e., the developer, and also the reviewer) installs and configures the code review plugin of the present invention in the IDEA development tool, enabling the plugin to communicate normally with the Git code repository and the front-end code review (CodeReview) platform. When the developer needs to initiate a code review, they click the "Add CodeReview Request" button in the plugin to trigger the backend service. The backend service automatically obtains project information such as the current project's Git address and the branch to be reviewed, and displays it in the corresponding fields. The developer fills in the review title on the plugin, selects the remote main branch (such as master or main), and selects suitable reviewers (multiple can be selected) using the fuzzy search filtering function. After completing the form, the developer clicks the submit button, and the plugin sends the CodeReview request information to the front-end CodeReview platform. Then, after receiving the CodeReview request, the front-end CodeReview platform records the request information in the database and notifies the selected reviewers. For example, the review task can be promptly pushed to the selected reviewers via the WeChat Work notification function. Furthermore, the backend service utilizes static code analysis tools (such as SonarQube) to scan the code of the submitted branch, performing quality checks and displaying detected vulnerabilities, bugs, and issue descriptions on the corresponding code pages. This provides a reference for submitters and reviewers, helping them better identify and resolve problems. In addition, the backend service uses an LLM model to analyze the code, generating diffs between the submitted branch and the main branch. This identifies logical vulnerabilities, security vulnerabilities, performance defects, etc., in the changed code, and displays specific issues, suggestions, and corresponding line numbers on the corresponding code pages. This broadens the reviewers' perspectives and enhances their ability to control code quality.
[0080] After receiving the notification, the reviewer logs into the front-end CodeReview platform and finds the corresponding CodeReview application in the code review list menu. Clicking on the applicant enters the review page, where the reviewer can view the diffs of the submitted branch and the main branch. By analyzing the diffs, the reviewer can clearly understand the code changes and select problematic code areas to fill in review suggestions. Meanwhile, the submitter, after seeing their CodeReview record status change to "View Suggestions" in the plugin's CodeReview list, or after receiving a notification from WeChat Work, can click the corresponding button to view the specific list of review suggestions. On the suggestion list, hovering the mouse over the suggestion allows viewing detailed information, double-clicking the file path locates the problematic code, and the submitter can directly confirm and reply to suggestions in the suggestion list for real-time communication with the reviewer. After modifying and improving the code based on the reviewer's suggestions, the submitter can resubmit the review application, repeating the above process until the code passes review.
[0081] When the reviewer deems the code to meet the requirements, they click the "Approved" button. At this point, the front-end CodeReview platform marks the CodeReview application as approved and can optionally notify the submitter that the code review has been approved via WeChat notification.
[0082] Figure 4 This demonstrates the vulnerability scanning logic executed by the backend service. After initiating a CodeReview, the backend service downloads the submission branch code from the Git repository via the Git address using the GitLab API; then, it decompresses the submission branch code to the local server. Next, the backend service executes Maven commands to run the SonarQube Maven plugin, performing a vulnerability scan on the decompressed submission branch code. After the scan is complete, the SonarQube Maven plugin reports the scan results to SonarQube. The backend service calls the SonarQube API to retrieve the scan results, including vulnerability and bug information. The backend service then inserts the vulnerability and bug information into the review code on the frontend CodeReview platform to display it to reviewers, assisting their code review process.
[0083] Figure 5This demonstrates the LLM (Large Language Model) auxiliary review logic executed by the backend service. Upon initiating a CodeReview, the backend service obtains the Git address of the submitted project by calling the GitLab interface. The backend service then clones the branch code of the submitted project using Git commands, including the submission branch and the main branch. The two branch codes are compared, generating the differences between them. The differences in each code file are then formatted according to a preset format and, along with the SYSTEM_PROMPT (prompt message), are sent to the LLM in a loop.
[0084] For example, the LLM large model PROMPT is as follows:
[0085] private static final String SYSTEM_PROMPT="#role\n"+
[0086] "You are a code review expert, capable of identifying logical flaws and security vulnerabilities in modified code."
[0087] "\n"+
[0088] "##Abilities\n"+
[0089] - Identify logical vulnerabilities in the modified code, such as null pointer exceptions\n"+
[0090] - Identify security vulnerabilities in the modified code, such as SQL injection.
[0091] "-Identified performance defects in the modified code, such as large-scale data loading leading to memory overflow\n"+
[0092] "\n"+
[0093] "##Restriction\n"+
[0094] "- Ignore code risks in the modified code\n"+
[0095] "- Ignore variable naming issues in the modified code\n"+
[0096] "- Focus only on changed code files, ignore changed non-code files such as images\n"+
[0097] Please output your questions and suggestions in Chinese.
[0098] "\n"+
[0099] "## Output\n"+
[0100] "[\n"+
[0101] "\t{\n"+
[0102] "\t\t\"file\":\" / data / path / main.java\",\n"+
[0103] "line": "11-22",\n"+
[0104] "\t\t\"question\":\"OOM Exception\",\n"+
[0105] "\t\t\"suggest\":\"\"\n"+
[0106] "\t},\n"+
[0107] "\t{\n"+
[0108] "\t\t\"file\":\" / data / path / main.java\",\n"+
[0109] "line": "11-22",\n"+
[0110] "\t\t\"question\":\"OOM Exception\",\n"+
[0111] "\t\t\"suggest\":\"\"\n"+
[0112] "\t},\n"+
[0113] "]\n"+
[0114] Only JSON content can be output; using Markdown wrappers for output is prohibited.
[0115] The LLM (Large Language Model) analyzes and infers from the received discrepancies in the code and accompanying hints, generating descriptions of potential issues and corresponding suggestions, and returning the results in a specified JSON format. The backend service receives the model's results, parses and processes them to match the display requirements of the frontend CodeReview platform's code review page. The processed LLM review results are then inserted into the frontend CodeReview platform's code review page, displayed in a manner consistent with SonarQube scan results. This allows reviewers to visually view different dimensions of review information provided by the scanning tool and the intelligent model on a single page, aiding in a more comprehensive evaluation of code quality.
[0116] Based on the above implementation methods, seamless integration with code repositories and scanning tools automates code acquisition, vulnerability scanning, and review notification processes, reducing manual intervention and improving review efficiency. Combined with static code analysis tools (SonarQube), automated vulnerability detection is achieved, and scan results are accurately linked to lines of code, assisting reviewers in quickly locating and resolving issues. Through a code review plugin based on the Integrated Development Environment (IDEA) and a front-end code review platform, real-time review information synchronization and interaction are provided, enabling efficient communication and feedback tracking between submitters and reviewers. Access control ensures that only authorized submitters and reviewers can modify and respond to code review content; other authorized personnel only have viewing permissions, guaranteeing code security and the standardization of the review process. Centralized display and management of code review information facilitates tracking review progress and statistical analysis of review results, providing data support for code quality assessment and development process optimization. Furthermore, structured storage of review records and associated code versions creates a traceable and reusable review knowledge base, providing experience references and risk prediction basis for subsequent code reviews. By invoking the LLM (Large Language Model), the code changes are analyzed in depth to identify potential logical flaws, security vulnerabilities, and performance issues, providing reviewers with more comprehensive review suggestions and improving the accuracy and efficiency of code reviews.
[0117] It should be understood that the steps, processes, and operations described in the above embodiments can be implemented by computer software programs. Therefore, the embodiments of the present invention also relate to a computer program product, which includes a computer program that, when executed by a processor, implements the steps, processes, or operations of the intelligent code review method described in any embodiment of the present invention. In some embodiments, program code for executing the computer program of the embodiments of the present invention can be written in any combination of one or more programming languages. For example, the computer program can be written using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, languages such as Java, C++, Python, "C", or similar programming languages. The program code can be executed entirely on a personal computing device, partially on a personal computing device, partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the personal computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0118] It should also be understood that the computer program product may be stored on a computer-readable storage medium, such as hard disks, floppy disks, magnetic tapes, optical disks, solid-state drives, flash memory, etc.
[0119] Furthermore, it can be understood that the method of any embodiment of the present invention can be executed by a computer device. Accordingly, embodiments of the present invention also relate to a computer device comprising: a memory storing a computer program thereon; and a processor that, when executing the computer program, implements the steps (processing, operations, etc.) of the intelligent code review method described in any embodiment of the present invention.
[0120] Figure 6 An exemplary structure of a computer device is shown. Figure 6 As shown, the computer device 100 may include at least a processor 101 and a memory 102, wherein the memory 102 may be or include a storage medium storing a computer program (or computer-readable instructions), and the processor 101 executes the computer program to perform some or all of the operations in the intelligent code review method described in any embodiment of the present invention.
[0121] In some embodiments, the computer device 100 may further include a data storage device 103, a display 104, a speaker 105, and a communication module 106. The processor 101, memory 102, and data storage device 103 communicate with each other via a bus and interact with peripheral devices, such as the display 104 and communication module 106, via the bus and I / O module 107.
[0122] Specifically, data storage device 103 can store applications and their various configuration files and data. Computer programs are stored on memory 102. Processor 101 executes various processes, operations, or steps of the intelligent review method for computer program execution code. Display 104 can be used to display various data, images, etc.
[0123] In optional embodiments, the communication module 106 may be omitted where communication with the other systems, devices, or equipment is not required. In some embodiments, the computer device 100 may further include a speaker 105 for voice output.
[0124] In some implementations, processor 101 may include any suitable semiconductor-based electronic processing unit, chip, microchip, or integrated circuit (IC). Memory 102 is a programmable memory, which may include any suitable electronic storage device configured to store instructions and be reprogrammable. For example, programmable memory may include an erasable programmable read-only memory (EPROM) device. Data storage device 103 may be a persistent storage device, which may include any suitable electronic storage configured to retain stored information as power cycles. For example, data storage device 103 may include a hard disk drive, solid-state drive (SSD), flash memory drive, hybrid drive, etc., or any combination thereof.
[0125] Therefore, processor 101 can control the output of information on I / O module 107 by storing information in memory and / or executing programs / instructions stored in memory. For example, several aspects of the methods described herein can be executed by processor 101 according to programs / instructions stored in memory (e.g., memory 102 and / or data storage device 103).
[0126] Furthermore, the processor 101 can electronically communicate with the I / O module 107 and / or the communication module 106 to receive or send relevant instructions and information. The I / O module 107 may include any suitable mechanical or virtual user interface configured to enable a user to interact with the computer device 100 or to allow the user to perform one or more functions of the computer device 100 itself, such as a graphical user interface (GUI) on a screen or other display. In some instances, the user interface may include a voice interface capable of speech recognition, through which an operator can provide voice commands to the processor.
[0127] The communication module 106 may include any suitable devices and / or structures configured to facilitate information exchange between the computer device 100 and external electronic devices. The communication module 106 may include devices configured to send and / or receive wireless or wired information with other devices. For example, the communication module 106 may include an antenna, a transceiver, a connector for wired reception and / or transmission of data, a data exchange device, etc., or any combination thereof. The communication module 106 may also include ancillary components, such as filtering circuits, encryption / decryption circuits, and / or integrated circuit (IC) chips for processing signals (e.g., (Chip). In some implementations, the communication module 106 may include a WiFi device configured to connect to a local wireless network.
[0128] In some implementations, computer device 100 may include a smartphone, wearable computer, portable / mobile electronic device, tablet computer, smartwatch, personal digital assistant (PDA), personal computer (PC), desktop computer, laptop computer, server, etc. Computer device 100 may include or have installed one or more application programs (APPs), one of which is configured to perform the intelligent code review methods described herein.
[0129] Although not shown, it should be understood that the computer device 100 also includes a power supply component, which may include any suitable device and / or structure configured to provide an electrical interface between the computer device 100 and a power source. The power source may include any suitable source of electrical energy, such as a battery, socket, capacitor, fuel cell, etc., or any combination thereof. Additionally or optionally, the power source may be included within the power supply component. For example, a battery or battery pack may be included within the computer device 100. In some embodiments, the battery may be rechargeable, for example, charged via a cable or an interface provided by the power supply component. In some embodiments, the power supply component may share features with or repeat features of the communication module 106. For example, a USB or micro-USB cable connector may be included in the computer device 100, so that power supply or data communication is performed by the same component.
[0130] Those skilled in the art should understand that the above disclosure is merely illustrative of embodiments of the present invention, and the scope of patent protection claimed in this application is not limited thereto. Various modifications, alterations, substitutions, and other changes can be made to the embodiments disclosed herein without departing from the spirit of the invention, and such changes are within the scope covered by the claims of this application.
Claims
1. A method for intelligent code review, characterized in that, The method comprises the following steps: When the submitter initiates a code review through a code review plug-in integrated in a software development tool, the code review plug-in starts a backend service to automatically review the code and sends a code review application to a front-end code review platform; After the front-end code review platform receives the code review application, it records the application information related to the code review application in a database and notifies the reviewer; The front-end code review platform displays the application information and the automatic review results provided by the backend service to the reviewer and receives the reviewer's review feedback; The front-end code review platform sends the review feedback to the code review plug-in; The code review plug-in displays the review feedback to the submitter.
2. The method of claim 1, wherein, The code review plug-in starts a backend service to automatically review the code, which comprises the following steps: The backend service obtains the Git address and the submit branch information of the current project; The backend service calls a static code analysis tool to perform vulnerability scanning on the submit branch code; The backend service calls an LLM model to perform auxiliary review on the submit branch code; The automatic review results include scanning results and auxiliary review results.
3. The method of claim 2, wherein, The vulnerability scanning comprises the following steps: The backend service downloads the submit branch code from the Git code repository according to the Git address; The backend service decompresses the downloaded code and executes the scanning of the static code analysis tool on the local server; The backend service inserts the scanning results into the corresponding code lines for review on the front-end code review platform, so as to assist the reviewer in code review.
4. The method of claim 2, wherein, The auxiliary review comprises the following steps: The backend service clones the submit branch code and the trunk branch code from the Git code repository through the Git address; The backend service compares the submit branch code and the trunk branch code to generate the difference content of the two branch codes; The backend service inputs the difference content into the LLM model, and the LLM model generates problem descriptions and corresponding suggestions for the difference content; The backend service inserts the problem descriptions and corresponding suggestions into the corresponding code lines for review on the front-end code review platform, so as to assist the reviewer in code review.
5. The method of claim 1, wherein, The review feedback includes review status and review suggestions.
6. The method of claim 5, wherein, The code review plug-in provides a suggestion list to display the review suggestions; The suggestion list includes the following items: file path, code snippet, comment, and reply; Each item is configured with a mouse hover event to view the specific information of the corresponding item by mouse hovering.
7. The method of claim 6, wherein, Further comprising: The code review plug-in communicates with the front-end code review platform in real time to exchange the opinions of the submitter and the reviewer.
8. The method of claim 1, wherein, The code review plug-in is configured to only display the review feedback that fails to pass the review.
9. The method of claim 1, wherein, The front-end code review platform operates according to the permissions of the reviewer or the submitter.
10. A code intelligence review system for performing the method of any one of claims 1 to 9, characterized by The method comprises the following steps:
11. A computer program product comprising a computer program, characterized in that, The computer program is stored on a memory and is executed by a processor to implement the steps of the method of any one of claims 1 to 9.
12. A computer apparatus, comprising: The computer program product comprises: a memory having a computer program stored thereon; a processor which, when executing the computer program, implements the steps of the method of any one of claims 1 to 9.