Code change problem scanning method and device, equipment and storage medium

By recording code change information and performing before-and-after scans of local code, and updating the full code scan problem list, the problem of increased scanning time and resources caused by large code volume and frequent changes is solved, achieving efficient code change scanning.

CN121326705APending Publication Date: 2026-01-13INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511297256.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-11
Publication Date
2026-01-13

AI Technical Summary

Technical Problem

With the increasing volume of code and the faster frequency of changes, the time and hardware resources required for code scanning are gradually increasing, leading to increased pressure on problem scanning.

Method used

By recording information about code change events, responding to code save events, performing pre- and post-code problem scans on local code, and updating the full code scan problem list, efficient scanning of changed code is achieved.

Benefits of technology

It shortens the scanning time when code changes are made, reduces the demand for hardware resources, and lowers the pressure of problem scanning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121326705A_ABST
    Figure CN121326705A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a code change problem scanning method and device, equipment and a storage medium. The method comprises the steps that in response to triggering of a target code change event, code change information corresponding to the target code change event is recorded; in response to triggering of a code saving event, performing problem scanning on the local code before and after change according to the code change information to obtain problem comparison information before and after change; and obtaining a pre-generated full-amount code scanning problem list, and updating the full-amount code scanning problem list according to the problem comparison information before and after the change so as to complete problem scanning of the change code. Based on this, by recording the code change information, problem scanning is only carried out on the changed local code, and the full-amount code scanning problem list is updated based on the problem comparison information before and after the change, so that the scanning time of the changed code is greatly shortened.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of code scanning technology, and in particular to a method, apparatus, device, and storage medium for scanning modified code. Background Technology

[0002] With the development of the computer age, people's work and life are inseparable from software applications. Software applications and other functional tools are usually implemented using code. The development team continuously develops new functions of applications by developing code, so the amount of code will become larger and larger.

[0003] When modifying code, code scanning is usually performed to check for potential vulnerabilities and defects in the software source code. However, with the increasing volume of code, the time required for code scanning is also increasing, and the hardware resources consumed by scanning are also increasing. With the increasing frequency of code changes, the pressure on code scanning is also increasing. Summary of the Invention

[0004] This application provides a method, apparatus, device, and storage medium for scanning code changes, thereby shortening the scanning time during code changes, reducing the hardware resources required for scanning, and lowering the pressure of scanning for code changes.

[0005] In a first aspect, embodiments of this application provide a method for scanning for code changes, the method comprising:

[0006] In response to the triggering of a target code change event, record the code change information corresponding to this target code change event;

[0007] In response to the code save event, a problem scan is performed on the local code before and after the change based on the code change information to obtain a comparison of the problems before and after the change;

[0008] Obtain a pre-generated full code scan issue list and update the full code scan issue list based on the issue comparison information before and after the change, in order to complete the issue scan of the changed code.

[0009] Secondly, embodiments of this application also provide an electronic device, the electronic device comprising:

[0010] One or more processors;

[0011] Storage device for storing one or more programs.

[0012] When one or more programs are executed by one or more processors, the one or more processors implement the problem scanning method for modified code as provided in any embodiment of this application.

[0013] Thirdly, embodiments of this application also provide a computer-readable storage medium storing a computer program thereon, characterized in that, when the program is executed by a processor, it implements the problem scanning method for modified code as provided in any embodiment of this application.

[0014] Fourthly, embodiments of this application also provide a computer program product, including a computer program / instruction, characterized in that, when the computer program / instruction is executed by a processor, it implements the problem scanning method for modified code as provided in any embodiment of this application.

[0015] The technical solution of this application embodiment records the code change information corresponding to the target code change event in response to the triggering of the target code change event; in response to the triggering of the code save event, it performs a problem scan on the local code before and after the change based on the code change information to obtain problem comparison information before and after the change; it obtains a pre-generated full code scan problem list and updates the full code scan problem list based on the problem comparison information before and after the change to complete the problem scan of the changed code. Based on this, by recording the code change information, it is possible to perform a problem scan only on the changed local code and update the full code scan problem list based on the problem comparison information before and after the change, which greatly shortens the scanning time of the changed code. Attached Figure Description

[0016] Figure 1 A flowchart illustrating the problem scanning method for modified codes provided in Embodiment 1 of this application;

[0017] Figure 2 This is a schematic diagram of the structure of a code-changing scanning device provided in Embodiment 2 of this application;

[0018] Figure 3 This is a schematic diagram of the structure of an electronic device provided in Embodiment 3 of this application. Detailed Implementation

[0019] The present application will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the application and not intended to limit it. Furthermore, it should be noted that, for ease of description, the accompanying drawings show only the parts relevant to the present application, not the entire structure.

[0020] Example 1

[0021] Figure 1 A flowchart illustrating the problem scanning method for modified codes provided in Embodiment 1 of this application is shown below. Figure 1As shown, the code change scanning method provided in this embodiment can be applied to code change scanning platforms mounted on devices with data processing capabilities, such as computers. It can be used in conjunction with some application software to achieve a better user experience. Specifically, it can include the following steps:

[0022] Step 101: In response to the triggering of the target code change event, record the code change information corresponding to this target code change event.

[0023] In this step, target code change events may include, but are not limited to, events involving adding a line of code, deleting a line of code, and changing the target line of code. Specifically, an event involving adding one or more lines of program code, an event involving deleting one or more lines of program code, and an event involving changing the target line of code are events involving editing or modifying the code of that target line. The target line can be any single line.

[0024] To achieve the response in this step, you can add a tracking point to the above event. This tracking point points to a custom handler, in which you can add scanning and statistical processing, as well as processing logic used by other tool plugins.

[0025] It should be noted that the method in this embodiment can be applied to local programming clients, such as code development clients. By embedding event points in some events in the code development client, the corresponding program code and other processing logic can be triggered in response to the event.

[0026] In addition, after the corresponding processing logic is triggered, the change type, code change location, and code change line number of the target code change event can be obtained; the change type, code change location, and code change line number are stored in the local cache as the code change information corresponding to the target code change event.

[0027] In a specific example, when developers add lines, delete lines, edit code, and save code in the code development client, the tool's built-in processing is triggered. When a new line is added, all line numbers of the newly added line are recorded in the local cache. When a line is deleted, the line number of the deleted line is recorded in the local cache. When a line of code is modified, the line number of the modified line is recorded in the local cache.

[0028] It should be noted that, to facilitate subsequent location of the modified program, this embodiment records not only the line number (i.e., the location of the code change), but also the change type and the number of lines of code changed. Different change types result in different degrees of change to the line number. For example, adding or deleting a line will inevitably change the line number, while editing the program may not change the line number. Recording this information makes the subsequent partial scanning and update processes more flexible and accurate.

[0029] To facilitate retrieval by subsequent processing programs, the code change information obtained in this step can be stored in a local cache, from which subsequent processing programs can directly retrieve the code change information.

[0030] Step 102: In response to the code save event, perform a problem scan on the local code before and after the change based on the code change information to obtain the problem comparison information before and after the change.

[0031] This step primarily lays the groundwork for partial code scanning and updating the subsequent issue list using the results of that scanning. The partial scanning in this step mainly responds to code save events; that is, when a developer triggers a code save event, the relevant processing logic for this step is invoked.

[0032] Specifically, during the local scan in this step, the current code can be switched to its state before the change, and the local code before the change can be identified based on the code change information; a problem scan is performed on the local code before the change to obtain the problem scan results before the change; the current code is switched to its state after the change, and the local code after the change can be identified based on the code change information; a problem scan is performed on the local code after the change to obtain the problem scan results after the change; the problem scan results before and after the change are compared to obtain the problem comparison information before and after the change.

[0033] The current code is typically the modified version, i.e., the code after the developer's changes. Developers usually modify local code. To define the extent of this local code, this embodiment can pre-set that the lines before and after the modified line are local code. For example, if the modified line is line 51, then lines 49, 50, 51, 52, and 53 can be set as the local code corresponding to that modified line, ensuring that a relatively complete code segment is scanned during the problem scan.

[0034] Of course, there may be multiple modified lines. For example, lines 51 and 52 are both modified lines. The local code corresponding to line 52 may overlap with the local code corresponding to line 51. Therefore, we can take the union of the two lines to obtain the local code that corresponds to both lines 51 and 52.

[0035] Therefore, code change information includes the location of the code change and the number of lines of code changed. When determining the local code after the change, the changed code lines can be identified based on the location of the code change and the number of lines of code changed, and the code corresponding to the code lines can be identified as the local code after the change.

[0036] When determining the local code before the change, the changed code line can be identified based on the location and number of lines changed, and the code corresponding to that line can be identified as the local code before the change.

[0037] Based on the above principles, since the modified lines recorded above are usually the modified lines corresponding to the original code (recording the modified lines of the original code makes it easier to reflect and unify the modification location), when determining the local code before the change, the local code determined by the above principles can be directly extracted.

[0038] Additionally, when performing issue scanning, you can refer to relevant issue scanning techniques, which will not be elaborated here. It should be noted that this embodiment scans local code, which is faster and more targeted.

[0039] In this step, a problem scan is performed on the local code before the change to obtain the problem scan results before the change, and a problem scan is performed on the local code after the change to obtain the problem scan results after the change. By comparing these two results, it can be determined whether the previous legacy issues still exist in the local code after the change.

[0040] In a specific example, the problems in the two scan results can be listed, and then the similarity of each problem can be compared. If two problem items with a similarity exceeding a preset threshold are found, it means that the problem has been modified by the developers but has not been resolved.

[0041] The before-and-after issue comparison information in this step lists the issue items in the two issue scan results, as well as some related similarity results, which helps developers or subsequent processes to evaluate the change.

[0042] In addition, since multiple developers may modify the same code at the same time or around the same time, in order to avoid code modification conflicts, the code scan problem of the current modification (i.e., the code scan problem after the change) can be compared with the currently saved code scan problem on the server (which may be the code that was just modified by other developers or the original code).

[0043] Specifically, you can first obtain the initial problem information corresponding to the target code change event in the full code scan problem list; then compare the initial problem information with the problem scan results before the change in the problem comparison information before and after the change.

[0044] If a difference is found during the comparison, the latest code corresponding to the code change location in the code change information is obtained, and the difference between the latest code and the locally modified code is displayed so that the user can process the locally modified code based on the displayed difference.

[0045] It should be noted that using questions for comparison has two advantages. First, the output results of the aforementioned steps can be used directly without secondary code analysis. Second, the scanned questions may directly reflect the code modifications. For example, if the scanned questions are the same as those recorded on the server (meaning the number of questions is the same and they correspond one-to-one, and the similarity between the corresponding questions exceeds a preset threshold), then there is no difference. Otherwise, there is a difference.

[0046] In addition, during this step, when displaying the differences, you can directly display the latest code on the server and the locally modified code side by side (split into two vertical windows, one window displays the latest code on the server, and the other window displays the locally modified code).

[0047] When processing, users can either replace the server's code with the modified code or vice versa.

[0048] In this step, change criteria can also be set to gradually resolve code-related technical debt. Specifically, in response to a code save trigger, the system compares the issues before and after the change to determine whether the target code change event meets the change criteria. If it does, the changed code is saved; otherwise, a save failure message is displayed.

[0049] In other words, only changes that meet the change criteria can be submitted and saved successfully. In a specific example, the change criteria can have two levels: the first level is the compliance standard, which means no new problems have appeared; the second level is the advanced standard, which means no new problems have appeared and at least one old problem has not recurred.

[0050] Step 103: Obtain the pre-generated full code scan problem list, and update the full code scan problem list according to the problem comparison information before and after the change, so as to complete the problem scan of the changed code.

[0051] In this step, in response to the successful code save event, the latest problem information and line number change information for the corresponding code line are determined based on the problem comparison information before and after the change; the problem information corresponding to the code line in the full code scan problem list is updated to the latest problem information; and the code line in the full code scan problem list is updated based on the line number change information.

[0052] It should be noted that this step can remove resolved issues from the full code scan issue list, or it can modify lines of code. For example, if a line of code is deleted in this modification, then the code count of subsequent lines of code in the full code scan issue list should be decremented by 1.

[0053] In this embodiment, in response to the triggering of a target code change event, the code change information corresponding to this target code change event is recorded; in response to the triggering of a code save event, a problem scan is performed on the local code before and after the change based on the code change information to obtain problem comparison information before and after the change; a pre-generated full code scan problem list is obtained, and the full code scan problem list is updated based on the problem comparison information before and after the change to complete the problem scan of the changed code. Based on this, by recording the code change information, problem scanning is performed only on the changed local code, and the full code scan problem list is updated based on the problem comparison information before and after the change, which greatly shortens the scanning time for the changed code.

[0054] Example 2

[0055] Figure 2 This is a schematic diagram of a code-scanning device according to Embodiment 2 of this application. The code-scanning device provided in this embodiment can execute the code-scanning method provided in any embodiment of this application, and has the corresponding functional modules and beneficial effects of the method. This device can be implemented in software and / or hardware, such as... Figure 2 As shown, the problem scanning device for the changed code specifically includes: a recording module 201, a local scanning module 202, and a list updating module 203.

[0056] The recording module is used to record the code change information corresponding to the target code change event in response to the triggering of the target code change event.

[0057] The local scanning module is used to respond to the code save event and scan the local code before and after the change based on the code change information to obtain the problem comparison information before and after the change;

[0058] The list update module is used to obtain a pre-generated full code scan issue list and update the full code scan issue list based on the issue comparison information before and after the change, so as to complete the issue scan of the changed code.

[0059] Furthermore, the recording module specifically includes:

[0060] The acquisition unit is used to acquire the change type, code change location, and code change line number of the target code change event.

[0061] The recording unit is used to store the change type, code change location, and code change line number as the code change information corresponding to the current target code change event in the local cache.

[0062] Furthermore, local scanning issues include:

[0063] The first switching unit is used to switch the current code to the state before the change, and to determine the local code before the change based on the code change information;

[0064] The first scanning unit is used to perform a problem scan on the local code before the change and obtain the problem scan results before the change.

[0065] The second switching unit is used to switch the current code to the modified state and determine the modified local code based on the code change information;

[0066] The second scanning unit is used to scan for problems in the modified local code and obtain the results of the problem scan after the change.

[0067] The first comparison unit is used to compare the problem scanning results before and after the change to obtain the problem comparison information before and after the change.

[0068] Furthermore, the code change information includes the location of the code change and the number of lines of code changed;

[0069] The first switching unit includes:

[0070] The first switching subunit is used to determine the line of code that has been changed based on the location and number of lines of code that have been changed, and to identify the code corresponding to the line of code as the local code after the change.

[0071] The second switching unit includes:

[0072] The second switching subunit is used to determine the line of code that has been changed based on the location and number of lines of code that have been changed, and to identify the code corresponding to the line of code as the local code before the change.

[0073] Furthermore, the inventory update module includes:

[0074] The determination unit is used to respond to the successful code save event and determine the latest problem information and code line number change information of the corresponding code line based on the problem comparison information before and after the change;

[0075] The first update unit is used to update the problem information corresponding to the lines of code in the full code scan problem list to the latest problem information;

[0076] The second update unit is used to update the lines of code in the full code scan issue list based on the line number change information.

[0077] Furthermore, the device also includes:

[0078] The judgment module is used to respond to the code save trigger operation. It judges whether the target code change event meets the change criteria based on the before and after problem comparison information. If it meets the criteria, the changed code is saved; otherwise, a save failure message is displayed.

[0079] Furthermore, the device also includes:

[0080] The initial issue acquisition module is used to acquire the initial issue information corresponding to the target code change event in the full code scan issue list;

[0081] The problem comparison module is used to compare the initial problem information with the problem scan results before the change in the problem comparison information before and after the change;

[0082] The code change module is used to retrieve the latest code corresponding to the code change location in the code change information if there are differences, and display the differences between the latest code and the locally changed code so that users can process the locally changed code according to the displayed differences.

[0083] Example 3

[0084] Figure 3 This is a schematic diagram of the structure of an electronic device provided in Embodiment 3 of this application, as shown below. Figure 3 As shown, the electronic device includes a processor 310, a memory 320, an input device 330, and an output device 340; the number of processors 310 in the electronic device can be one or more. Figure 3 Taking a processor 310 as an example; the processor 310, memory 320, input device 330, and output device 340 in the electronic device can be connected via a bus or other means. Figure 3 Taking the example of a connection between China and Israel via a bus.

[0085] The memory 320, as a computer-readable storage medium, can be used to store software programs, computer-executable programs, and modules, such as the program instructions / modules corresponding to the code-changing problem scanning method in this embodiment of the invention. The processor 310 executes various functional applications and data processing of the electronic device by running the software programs, instructions, and modules stored in the memory 320, thereby implementing the aforementioned code-changing problem scanning method.

[0086] In response to the triggering of a target code change event, record the code change information corresponding to this target code change event;

[0087] In response to the code save event, a problem scan is performed on the local code before and after the change based on the code change information to obtain a comparison of the problems before and after the change;

[0088] Obtain a pre-generated full code scan issue list and update the full code scan issue list based on the issue comparison information before and after the change, in order to complete the issue scan of the changed code.

[0089] Furthermore, record the code change information corresponding to this target code change event, including:

[0090] Obtain the change type, code change location, and code change line number for the target code change event;

[0091] The change type, code change location, and code change line number are stored in the local cache as the code change information corresponding to this target code change event.

[0092] Furthermore, based on the code change information, a problem scan is performed on the local code before and after the change to obtain a comparison of problems before and after the change, including:

[0093] Switch the current code to its previous state and determine the original code based on the code change information;

[0094] Perform a problem scan on the local code before the change to obtain the problem scan results before the change;

[0095] Switch the current code to the modified state, and determine the modified local code based on the code change information;

[0096] Perform a problem scan on the modified local code to obtain the problem scan results.

[0097] By comparing the problem scan results before and after the change, we can obtain the problem comparison information before and after the change.

[0098] Furthermore, the code change information includes the location of the code change and the number of lines of code changed;

[0099] Based on the code change information, determine the modified local code, including:

[0100] Based on the location and number of lines of code that were changed, the lines of code that were changed are identified, and the code corresponding to those lines is identified as the modified local code.

[0101] Identify the original code sections based on the code change information, including:

[0102] Based on the location and number of lines of code that were changed, the lines of code that were changed are identified, and the code corresponding to those lines is identified as the local code before the change.

[0103] Furthermore, the full code scan issue list was updated based on the issue comparison information before and after the change, including:

[0104] In response to the successful saving event, determine the latest problem information and line number change information for the corresponding line of code based on the problem comparison information before and after the change;

[0105] Update the issue information corresponding to the lines of code in the full code scan issue list to the latest issue information;

[0106] Update the lines of code in the full code scan issue list based on the changes in the number of lines of code.

[0107] Furthermore, the methods also include:

[0108] In response to a code save trigger operation, determine whether the target code change event meets the change criteria based on the before-and-after problem comparison information.

[0109] If the changes are successful, the modified code will be saved; otherwise, a save failure message will be displayed.

[0110] Furthermore, the methods also include:

[0111] Retrieve the initial issue information corresponding to the target code change event from the full code scan issue list;

[0112] Compare the initial problem information with the problem scan results before the change in the problem comparison information before and after the change;

[0113] If a difference is found during the comparison, the latest code corresponding to the code change location in the code change information is obtained, and the difference between the latest code and the locally modified code is displayed so that the user can process the locally modified code based on the displayed difference.

[0114] The memory 320 may primarily include a program storage area and a data storage area. The program storage area may store the operating system and at least one application program required for a given function; the data storage area may store data created based on terminal usage. Furthermore, the memory 320 may include high-speed random access memory and non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 320 may further include memory remotely located relative to the processor 310, which can be connected to the electronic device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0115] Example 4

[0116] Embodiment 4 of this application also provides a storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to perform a method for scanning for changes in code. The method includes:

[0117] In response to the triggering of a target code change event, record the code change information corresponding to this target code change event;

[0118] In response to the code save event, a problem scan is performed on the local code before and after the change based on the code change information to obtain a comparison of the problems before and after the change;

[0119] Obtain a pre-generated full code scan issue list and update the full code scan issue list based on the issue comparison information before and after the change, in order to complete the issue scan of the changed code.

[0120] Furthermore, record the code change information corresponding to this target code change event, including:

[0121] Obtain the change type, code change location, and code change line number for the target code change event;

[0122] The change type, code change location, and code change line number are stored in the local cache as the code change information corresponding to this target code change event.

[0123] Furthermore, based on the code change information, a problem scan is performed on the local code before and after the change to obtain a comparison of problems before and after the change, including:

[0124] Switch the current code to its previous state and determine the original code based on the code change information;

[0125] Perform a problem scan on the local code before the change to obtain the problem scan results before the change;

[0126] Switch the current code to the modified state, and determine the modified local code based on the code change information;

[0127] Perform a problem scan on the modified local code to obtain the problem scan results.

[0128] By comparing the problem scan results before and after the change, we can obtain the problem comparison information before and after the change.

[0129] Furthermore, the code change information includes the location of the code change and the number of lines of code changed;

[0130] Based on the code change information, determine the modified local code, including:

[0131] Based on the location and number of lines of code that were changed, the lines of code that were changed are identified, and the code corresponding to those lines is identified as the modified local code.

[0132] Identify the original code sections based on the code change information, including:

[0133] Based on the location and number of lines of code that were changed, the lines of code that were changed are identified, and the code corresponding to those lines is identified as the local code before the change.

[0134] Furthermore, the full code scan issue list was updated based on the issue comparison information before and after the change, including:

[0135] In response to the successful saving event, determine the latest problem information and line number change information for the corresponding line of code based on the problem comparison information before and after the change;

[0136] Update the issue information corresponding to the lines of code in the full code scan issue list to the latest issue information;

[0137] Update the lines of code in the full code scan issue list based on the changes in the number of lines of code.

[0138] Furthermore, the methods also include:

[0139] In response to a code save trigger operation, determine whether the target code change event meets the change criteria based on the before-and-after problem comparison information.

[0140] If the changes are successful, the modified code will be saved; otherwise, a save failure message will be displayed.

[0141] Furthermore, the methods also include:

[0142] Retrieve the initial issue information corresponding to the target code change event from the full code scan issue list;

[0143] Compare the initial problem information with the problem scan results before the change in the problem comparison information before and after the change;

[0144] If a difference is found during the comparison, the latest code corresponding to the code change location in the code change information is obtained, and the difference between the latest code and the locally modified code is displayed so that the user can process the locally modified code based on the displayed difference.

[0145] Of course, the computer-executable instructions provided in the embodiments of this application are not limited to the above-described method operations, but can also perform related operations in the problem scanning method for modified code provided in any embodiment of this application.

[0146] Based on the above description of the implementation methods, those skilled in the art can clearly understand that this application can be implemented using software and necessary general-purpose hardware, and of course, it can also be implemented using hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory, hard disk, or optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods of the various embodiments of this application.

[0147] It is worth noting that in the embodiments of the above-mentioned device, the various units and modules included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be realized; in addition, the specific names of each functional unit are only for easy differentiation and are not used to limit the scope of protection of this application.

[0148] Example 5

[0149] This embodiment provides a computer program product, including a computer program / instructions, which, when executed by a processor, implements the problem scanning method for modified code provided in any embodiment of this application. Specific details of this method can be found in the foregoing embodiments and will not be repeated here.

[0150] Note that the above description is merely a preferred embodiment and the technical principles employed in this application. Those skilled in the art will understand that this application is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions can be made without departing from the scope of protection of this application. Therefore, although this application has been described in detail through the above embodiments, this application is not limited to the above embodiments. Many other equivalent embodiments may be included without departing from the concept of this application, and the scope of this application is determined by the scope of the appended claims.

Claims

1. A method for scanning for code changes, characterized in that, The method includes: In response to the triggering of a target code change event, record the code change information corresponding to this target code change event; In response to the code save event, a problem scan is performed on the local code before and after the change based on the code change information to obtain problem comparison information before and after the change; Obtain a pre-generated full code scan problem list, and update the full code scan problem list according to the problem comparison information before and after the change, so as to complete the problem scan of the changed code.

2. The method according to claim 1, characterized in that, The recorded code change information corresponding to this target code change event includes: Obtain the change type, code change location, and code change line number for the target code change event; The change type, code change location, and code change line number are stored in the local cache as the code change information corresponding to this target code change event.

3. The method according to claim 1, characterized in that, The step of scanning the local code before and after the code change based on the code change information to obtain problem comparison information before and after the change includes: Switch the current code to its previous state, and determine the original code based on the code change information. A problem scan was performed on the local code before the change, and the problem scan results before the change were obtained; Switch the current code to the modified state, and determine the modified local code based on the code change information; A problem scan was performed on the modified local code to obtain the problem scan results. The problem scan results before and after the change are compared to obtain the problem comparison information before and after the change.

4. The method according to claim 3, characterized in that, The code change information includes the location of the code change and the number of lines of code changed; The step of determining the modified local code based on the code change information includes: Based on the location of the code change and the number of lines of code changed, the lines of code that have been changed are identified, and the code corresponding to the lines of code is identified as the modified local code. The step of determining the local code before the change based on the code change information includes: Based on the location of the code change and the number of lines of code changed, the lines of code that have been changed are identified, and the code corresponding to these lines is identified as the local code before the change.

5. The method according to claim 1, characterized in that, The step of updating the full code scan issue list based on the issue comparison information before and after the change includes: In response to the successful saving of the code event, the latest problem information and the code line number change information of the corresponding code line are determined based on the problem comparison information before and after the change; Update the issue information corresponding to the code line in the full code scan issue list to the latest issue information; The code lines in the full code scan problem list are updated based on the code line number change information.

6. The method according to claim 1, characterized in that, The method further includes: In response to the code save trigger operation, determine whether the target code change event meets the change criteria based on the before-and-after problem comparison information; If the changes are successful, the modified code will be saved; otherwise, a save failure message will be displayed.

7. The method according to claim 1, characterized in that, The method further includes: Obtain the initial issue information corresponding to the target code change event mentioned in the full code scan issue list; The initial problem information is compared with the problem scan results before the change in the problem comparison information before and after the change; If a difference is found during the comparison, the latest code corresponding to the code change location in the code change information is obtained, and the difference between the latest code and the locally modified code is displayed so that the user can process the locally modified code based on the displayed difference.

8. A problem scanning device for modified codes, characterized in that, The device includes: The recording module is used to record the code change information corresponding to the target code change event in response to the triggering of the target code change event; The local scanning module is used to respond to the code save event and scan the local code before and after the change based on the code change information to obtain the problem comparison information before and after the change. The list update module is used to obtain a pre-generated full code scan problem list and update the full code scan problem list according to the problem comparison information before and after the change, so as to complete the problem scan of the changed code.

9. An electronic device, characterized in that, include: One or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the problem scanning method for modified code as described in any one of claims 1-7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by the processor, the program implements the problem scanning method for modified code as described in any one of claims 1-7.

11. A computer program product, comprising a computer program / instructions, characterized in that, When the computer program / instruction is executed by the processor, it implements the problem scanning method for modified code as described in any one of claims 1-7.