CN117290239A - Code detection method, device, equipment and storage medium - Google Patents

Code detection method, device, equipment and storage medium Download PDF

Info

Publication number
CN117290239A
CN117290239A CN202311307641.7A CN202311307641A CN117290239A CN 117290239 A CN117290239 A CN 117290239A CN 202311307641 A CN202311307641 A CN 202311307641A CN 117290239 A CN117290239 A CN 117290239A
Authority
CN
China
Prior art keywords
change
code
file
target
change file
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311307641.7A
Other languages
Chinese (zh)
Inventor
杜家伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Boguan Information Technology Co Ltd
Original Assignee
Netease Hangzhou Network Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN202311307641.7A priority Critical patent/CN117290239A/en
Publication of CN117290239A publication Critical patent/CN117290239A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/366Software debugging using diagnostics
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3604Software analysis for verifying properties of programs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The application provides a code checking method, a code checking device, code checking equipment and a storage medium, and relates to the technical field of data processing. The method comprises the following steps: determining at least one change file and change code blocks corresponding to the change files according to code change contents of the target program; displaying each of the change files in a first area on a graphical user interface; responding to the selection operation of the target change file in the at least one change file, displaying a change code block corresponding to the target change file in a second area on the graphical user interface, and checking the target change file according to a preset checking rule; displaying the target change file inspection result in the second area of the graphical user interface; the check result indicates whether the target change file passes the check. Compared with the prior art, the method and the device avoid the problems that the code detection time is long and the accuracy of the detection result is not guaranteed.

Description

Code detection method, device, equipment and storage medium
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a code checking method, device, apparatus, and storage medium.
Background
In the daily development process, it is often necessary to manually check whether the code submitted by us has potential problems or obvious problems, and the code is usually checked by combining some existing coding specifications or some custom rules in the project group.
In the prior art, a Git tool is generally used for checking the content of code modification, checking whether the modification has a problem or not, checking the code by combining the prior experience of the user, and judging whether the code has the problem or not by the technical level of the user and the carefully degree of error checking.
However, when the function iteration is frequent, the manual auditing of the code takes a long time, and the continuous checking of the code also easily ensures that the accuracy of the detection result of the code is not ensured.
Disclosure of Invention
The invention aims to provide a code checking method, a device, equipment and a storage medium for solving the problems that the code checking time is long and the accuracy of a checking result is not guaranteed in the prior art.
In order to achieve the above purpose, the technical solution adopted in the embodiment of the present application is as follows:
in a first aspect, an embodiment of the present application provides a code checking method, including:
Determining at least one change file and change code blocks corresponding to the change files according to code change contents of the target program;
displaying each of the change files in a first area on a graphical user interface;
responding to the selection operation of the target change file in the at least one change file, displaying a change code block corresponding to the target change file in a second area on the graphical user interface, and checking the target change file according to a preset checking rule;
displaying the target change file inspection result in the second area of the graphical user interface; the check result indicates whether the target change file passes the check.
In a second aspect, another embodiment of the present application provides a code checking apparatus, the apparatus including: a determining module and a display module, wherein:
the determining module is used for determining at least one change file and change code blocks corresponding to the change files according to code change contents of the target program;
the display module is used for displaying each change file in a first area on the graphical user interface; responding to the selection operation of the target change file in the at least one change file, displaying a change code block corresponding to the target change file in a second area on the graphical user interface, and checking the target change file according to a preset checking rule; displaying the target change file inspection result in the second area of the graphical user interface; the check result indicates whether the target change file passes the check.
In a third aspect, another embodiment of the present application provides a code inspection apparatus, including: a processor, a storage medium and a bus, the storage medium storing machine-readable instructions executable by the processor, the processor and the storage medium communicating over the bus when the code checking device is running, the processor executing the machine-readable instructions to perform the steps of the method according to any of the first aspects above.
In a fourth aspect, another embodiment of the present application provides a storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the method according to any of the first aspects described above.
The beneficial effects of this application are: by adopting the code checking method provided by the application, after the code changing content of the target program is determined, at least one changing file and the changing code blocks corresponding to each changing file can be determined according to the code changing content, after the user determines the target changing file in the at least one changing file, each changing code block corresponding to the target changing file is checked based on the preset checking rule, and the checking result is displayed on the graphical user interface and used for indicating whether the target changing file passes the checking, so that the checking mode can divide the changing content according to the code changing content of the target program respectively according to the granularity of the file and the code blocks, and can check each changing code block in each changing file directly based on the preset checking rule, thereby realizing automatic checking of the code, greatly improving the code detecting efficiency and reducing the labor cost.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the embodiments will be briefly described below, it being understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered limiting the scope, and that other related drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a code checking method according to an embodiment of the present application;
FIG. 2 is a flowchart illustrating a code checking method according to another embodiment of the present application;
FIG. 3 is a flowchart illustrating a code checking method according to another embodiment of the present disclosure;
FIG. 4 is a flowchart illustrating a code checking method according to another embodiment of the present disclosure;
FIG. 5 is a flowchart illustrating a code checking method according to another embodiment of the present application;
FIG. 6 is a schematic diagram of a code checking device according to an embodiment of the present disclosure;
FIG. 7 is a schematic diagram of a code inspection apparatus according to another embodiment of the present disclosure;
fig. 8 is a schematic structural diagram of a code inspection apparatus according to an embodiment of the present application.
Detailed Description
For the purposes of making the objects, technical solutions and advantages of the embodiments of the present application more clear, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments.
The components of the embodiments of the present application, which are generally described and illustrated in the figures herein, may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present application, as provided in the accompanying drawings, is not intended to limit the scope of the application, as claimed, but is merely representative of selected embodiments of the application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present application without making any inventive effort, are intended to be within the scope of the present application.
Additionally, a flowchart, as used in this application, illustrates operations implemented in accordance with some embodiments of the present application. It should be understood that the operations of the flow diagrams may be implemented out of order and that steps without logical context may be performed in reverse order or concurrently. Moreover, one or more other operations may be added to the flow diagrams and one or more operations may be removed from the flow diagrams as directed by those skilled in the art.
A code inspection method provided in the embodiments of the present application is explained below in conjunction with a plurality of specific application examples. Fig. 1 is a flow chart of a code checking method according to an embodiment of the present application, as shown in fig. 1, the method includes:
s101: and determining at least one change file and a change code block corresponding to each change file according to the code change content of the target program.
In the embodiment of the application, at least one change file of the target program is determined according to the code change content, and then each change file is split according to a preset splitting rule to obtain at least one change code block corresponding to each change file.
The setting mode enables the code detection to be carried out on the follow-up change files, and the code detection can be accurate to take change code blocks as units, so that the follow-up accurate positioning and checking of the code positions with faults are facilitated.
In the embodiment of the present application, the basis for dividing the change files and the change code blocks may be defined by different character strings, for example, each change file in the code change content is divided by a first character string, and each change code block in each change file is divided by a second character string.
S102: each change file is displayed in a first area on the graphical user interface.
In some possible embodiments, for example, a change file list may be displayed in the first area, where the change file list includes change files, where the change files may be ordered, for example, based on detected or undetected change files, for example, with undetected change files being ordered above the change file list and detected change files being ordered below the change file list; or, the sorting may be performed based on the last time of modification of each change file, for example, the earlier the last time of modification is, the earlier the sorting of change files in the change files is; it should be understood that the foregoing embodiments are merely illustrative, and the ordering basis and ordering manner of each change file in the specific change file list may be flexibly adjusted according to the needs of the user, and are not limited to the foregoing embodiments.
FIG. 2 is an interface schematic diagram of a graphical user interface according to an embodiment of the present application, where, as shown in FIG. 2, the first area further includes a first sub-area and a second sub-area, and the temporarily stored change files are displayed in the first sub-area on the graphical user interface according to the temporary storage status of each change file; displaying the change file which is not temporarily stored in the second subarea; the placement mode enables a user to clearly determine which of the change files are temporarily stored and which of the change files are not temporarily stored, and if the temporary storage of the change file A which is not temporarily stored is successful, the change file A is moved from the second subarea to the first subarea.
In the embodiment of the present application, in order to make the visual effect more intuitive for the user, for example, each change file and the first sub-area title in the first sub-area may be displayed in a first display manner, and each change file and the second sub-area title in the second sub-area may be displayed in a second display manner, where the first display manner may be, for example, green, and the second display manner may be, for example, yellow, and it should be understood that the foregoing embodiment is only an exemplary illustration, and that the settings of the specific first display manner and the second display manner may be flexibly adjusted according to the user's needs, and not limited to the foregoing embodiment, and the first display manner may also be, for example, highlighting, the second display manner may be gray setting display, and the like, and only the first display manner and the second display manner may be kept different, and not limited to the foregoing embodiment.
Alternatively, the detected change files and the undetected change files may be displayed in different display modes according to whether each change file is detected, for example, the detected change files are displayed in a green or highlighting display mode, the undetected change files are gray-set or displayed in a red display mode, which should be understood that the foregoing embodiments are only exemplary, and the display modes and specific display effects of the contents of each region in the first screenshot region may be flexibly adjusted according to the needs of the user, and are not limited to the foregoing embodiments.
S103: and responding to the selection operation of the target change file in the at least one change file, displaying a change code block corresponding to the target change file in a second area on the graphical user interface, and checking the target change file according to a preset checking rule.
In the embodiment of the present application, the selection of the target change file needs to be performed in at least one change file that is temporarily stored, and the change file that is not temporarily stored needs to be successfully temporarily stored before the checking.
The change files displayed in the first subarea and the second subarea in the first area in the graphical user interface are dynamically updated according to the temporary storage condition and the checking condition of each change file, for example, the change file 1 in the second subarea is displayed in the first subarea after temporary storage is successful; or, when the change file 2 in the first sub-area is not checked, the identification information displayed after the change file 2 is "? After the change file 2 is checked, the identification information displayed after the change file 2 is changed to be 'v'; it should be understood that the foregoing embodiments are merely illustrative, and the division of the regions in the specific gui and the display style of the identification information may be flexibly adjusted according to the needs of the user, and are not limited to the foregoing embodiments.
S104: and displaying the target change file inspection result in a second area of the graphical user interface.
The checking result indicates whether the target change file passes the checking or not; if the inspection is passed, the detection result corresponding to the target change file may be displayed as "pass", or "YES", and if the inspection is not passed, the detection result corresponding to the target change file may be displayed as "fail", or "NO".
In some possible embodiments, in order to make the user more intuitively check whether the inspection result passes or not, the "pass" may be displayed in a first preset color, for example, green when the inspection result is "pass"; when the checking result is 'failed', displaying 'failed' in a second preset color, such as red; the display identifier and the display mode of the specific detection result can be flexibly adjusted according to the needs of the user, and the display method is not limited by the embodiment.
As shown in fig. 2, each change file and the inspection state corresponding to each change file are displayed in the first area on the graphical user interface.
For example, if the inspection status of the changed file is not inspected, the changed file may be displayed with "? "identification; if the inspection status of the changed file is that inspection has been performed, a "check" mark may be displayed after the changed file, for example.
It should be noted that, in the embodiment of the present application, in order to make the user determine the inspection state of each change file more intuitively, in the embodiment of the present application, "? The "identifier may be displayed, for example, in a gray form, and for the" v "identifier may be displayed, for example, in a preset color, for example, green, it should be understood that the foregoing embodiment is only illustrative, and the setting of the display identifier of the inspection status corresponding to each change file and the setting of the display manner of each display identifier may be displayed according to the user's needs, for example, may also be displayed in other preset colors, or may be distinguished by highlighting and gray displaying, and the specific setting may be flexibly adjusted according to the user's needs, and not limited to the foregoing embodiment, only by enabling the user to determine the inspection status corresponding to the change file through the display manner.
By adopting the code checking method provided by the application, after the code changing content of the target program is determined, at least one changing file and the changing code blocks corresponding to each changing file can be determined according to the code changing content, after the user determines the target changing file in the at least one changing file, each changing code block corresponding to the target changing file is checked based on the preset checking rule, and the checking result is displayed on the graphical user interface and used for indicating whether the target changing file passes the checking, so that the checking mode can divide the changing content according to the code changing content of the target program respectively according to the granularity of the file and the code blocks, and can check each changing code block in each changing file directly based on the preset checking rule, thereby realizing automatic checking of the code, greatly improving the code detecting efficiency and reducing the labor cost.
Optionally, on the basis of the foregoing embodiment, the embodiment of the present application may further provide a code checking method, where an implementation procedure of the foregoing method is illustrated in the following description with reference to the accompanying drawings. Fig. 2 is a flow chart of a code checking method according to another embodiment of the present application, as shown in fig. 2, the method may further include:
s111: code change content is determined from a code folder of the target program.
In the embodiment of the present application, for example, a plurality of code folders corresponding to a target program may be obtained by specifying a directory corresponding to the target program, and code modification contents in the plurality of code folders may be obtained; alternatively, a code folder or the like of a plurality of target programs uploaded by the user may be acquired; the method for determining the code change content from the code folder of the target program can be flexibly adjusted according to the needs of the user, and is not limited to the above embodiments.
In the embodiment of the present application, the code change of the temporarily stored change file displayed in the first sub area may be acquired by the difference acquisition command "gitdiff-cached" command, for example, an open Process may be written by using a shift to execute a command line by using the open Process, and then the current at least one code acquisition path (the code folder of the target program) of the change file is set for execution, and the execution result is stored as a string.
Code changes in the change files which are not temporarily stored are obtained through a difference obtaining command 'gitdiff', specifically, a starting Process is written by using a shift to execute a command line through the starting Process, the code obtaining path of at least one current change file is set for execution, and the execution result is stored as a character string StringB (to display all changed files and folders between two submissions and the contents of the changes).
In the embodiment of the present application, for splitting the change code block, splitting may be performed by splitting the character string using "diff—git", for example, by presetting a code sentence: the let allfiles=string. Components (separation by: "diff-git") obtains changes to different change files, wherein the code is a line of Swift code that divides a string into strings, each string representing the content of a file or folder. This code uses a components (separator by:) method that partitions a string into specified separators. In this example, the separator is "diff-git", so that all content in the string will be split into strings and stored in allFiles variable, which is a string array containing the path of each change file and the changes to each change file.
For each data element Item of allFiles, filtering out the character string content in 'b/< code root directory name >', storing the character string content as a code path in an array of allFilePaths, then taking the last separated character string as a file name by taking "/" as a separator, and storing the file names in the array of allFileNames; the code paths of the target program (the code folders of the target program) are merely illustrative, and the content of the character strings of the specific code paths is flexibly adjusted according to the actual storage path of the code and the user needs, which is not limited to the above embodiments.
For each string of the allFiles array, the content beginning with "@" to the end is filtered out as a change to the file and stored in the allFileChanges array.
For each Item of the allFileChanges array, using regular matching, for example, each code block with changes can be obtained by the following regular matching method "+@@d+, \\d+, \d+ @ @", and stored as fileChanges, and each file contains all the changed blocks.
And then, the content is wholly sub-packaged into a change file list and a change code block list in a traversing way, wherein the change file list can be in the form of:
FileDiff
Filename: string < File name >
Originaldiff: string < original diff >)
Diffs [ LineBlockDiffer ] < diff after treatment >
The list of change code blocks may be in the form of, for example:
line String < number of lines changed)
Diffs [ String ] < modified content per line ]
review result, string < audit results >
review status, status type < audit State)
It should be understood that the foregoing embodiments are merely illustrative, and that the forms in the specific change file list and the forms in the change code block list may be flexibly adjusted according to the needs of the user, and are not limited to the foregoing embodiments.
Optionally, on the basis of the foregoing embodiment, the embodiment of the present application may further provide a code checking method, where an implementation procedure of the foregoing method is illustrated in the following description with reference to the accompanying drawings. Fig. 4 is a flow chart of a code checking method according to another embodiment of the present application, as shown in fig. 4, the method may further include:
s121: and responding to clicking operation aiming at the setting control, and displaying the setting popup on the graphical user interface.
Fig. 5 is an interface schematic diagram of a graphical user interface provided in another embodiment of the present application, where, as shown in fig. 5, setting a popup window may include, for example, setting identity information of a person, at least one rule information, an added rule control, a save control, and a close control, where the identity information of the person is used to record an identity of the person setting a preset rule; the at least one rule information is used for displaying at least one preset rule preset by the setting personnel.
If the preset rules are multiple, before checking the change file, selecting a target rule from the multiple preset rules as a checking basis; if the preset rule is only one, the preset rule can be defaulted as a target rule, and the change file is checked by taking the target rule as a check basis.
If the setting personnel needs to newly add the preset rules, the setting personnel can click on the newly added rule control to trigger the display of the rule configuration window, and the user can realize the configuration of the newly added rules by inputting the rules in the preset language in the rule configuration window.
If the setting personnel need to modify or check the existing preset rules, the setting personnel can select the target rule information from at least one rule information, the display of a display window aiming at the target rule information can be triggered, and the user can check or modify the target rule information in the display window.
For example, in one embodiment of the present application, the preset rule information may be configured to:
“Let content=
you are now a senior \ (developerName) that will check my code, which is diff \ (code) of my code to help me see if there is a potential problem with this piece of code?
The answer format is as follows, first line "YES" or "NO" second line, dotted list questions you need to follow the following rules:
\(rules)”
if a preset inspection rule is configured, the preset inspection rule is used as a precondition as an input condition for inspecting the target change file each time; it should be understood that the foregoing preset checking rules are merely illustrative, and the configuration manner and configuration content of the specific preset checking rules may be flexibly adjusted according to the needs of the user, and are not limited to the foregoing embodiments.
S122: in response to a configuration operation within the setup popup, a preset check rule is configured.
The method for pre-configuring the preset inspection rules enables the preset inspection rules to be configured before detection, so that in the inspection process, the change files can be inspected directly depending on the preset inspection rules, for example, the inspection rules can be pre-unified when the change files corresponding to different sub-items are inspected for the same item group, the uniformity of the inspection rules is improved, and theoretical basis is provided for subsequent automatic inspection.
After determining the code change content of the target program, determining at least one change file and change code blocks corresponding to each change file according to the code change content, checking each change code block corresponding to the target change file based on a preset check rule after determining the target change file in the at least one change file by a user, and displaying a check result on a graphical user interface, wherein the check result is used for indicating whether the target change file passes the check; the method provided by the application can be used for presetting the checking rules by a user, so that the checking rules/checking standards are unified, the checking mode can be used for directly dividing the changing contents according to the code changing contents of the target program by the granularity of the files and the code blocks, and checking each changed code block in each changed file directly based on the preset checking rules, thereby realizing automatic checking of codes, greatly improving the code detection efficiency and reducing the labor cost.
The following explains the code inspection device provided in the present application with reference to the accompanying drawings, and the code inspection device may perform any one of the code inspection methods shown in fig. 1 to 5, and the specific implementation and the beneficial effects thereof are referred to above and are not repeated herein.
Fig. 6 is a schematic structural diagram of a code checking device according to an embodiment of the present application, as shown in fig. 6, the device includes: a determining module 201 and a display module 202, wherein:
a determining module 201, configured to determine at least one change file and a change code block corresponding to each change file according to code change content of the target program;
a display module 202 for displaying each change file in a first area on the graphical user interface; responding to the selection operation of the target change file in at least one change file, displaying a change code block corresponding to the target change file in a second area on the graphical user interface, and checking the target change file according to a preset checking rule; displaying the target change file inspection result in a second area of the graphical user interface; the check result indicates whether the check is passed in the target change file.
Optionally, the determining module 201 is specifically configured to determine the code change content from the code folder of the target program.
Optionally, on the basis of the foregoing embodiment, the embodiment of the present application may further provide a code checking device, where an implementation procedure of the device shown in fig. 6 is described below by way of example with reference to the accompanying drawings. Fig. 7 is a schematic structural diagram of a code checking device according to another embodiment of the present application, as shown in fig. 7, where the device further includes: a splitting module 203, wherein:
a determining module 201, specifically configured to determine at least one change file according to the code change content;
the splitting module 203 is configured to split each change file according to a preset splitting rule, so as to obtain a change code block corresponding to each change file.
Optionally, the first area further includes a first sub-area and a second sub-area, and the display module 202 is specifically configured to display the temporarily stored change files in the first sub-area on the graphical user interface according to the temporary storage status of each change file; and displaying the change file which is not temporarily stored in the second subarea.
Optionally, the display module 202 is specifically configured to display each change file and a check state corresponding to each change file in the first area on the graphical user interface.
Optionally, the graphical user interface further includes: the display module 202 is specifically configured to respond to a click operation for the setting control, and display a setting popup window on the graphical user interface; in response to a configuration operation within the setup popup, a preset check rule is configured.
Optionally, the display module 202 is specifically configured to display, in the second area of the graphical user interface, a result of the inspection of the target update file, and a detail control; responding to clicking operation for the detail control, and displaying the detail content of the checking result on a graphical user interface; the details are used to indicate the target change code blocks in the target change file that failed the examination.
By adopting the code checking device provided by the application, after the code changing content of the target program is determined, at least one changing file and the changing code blocks corresponding to each changing file can be determined according to the code changing content, after the user determines the target changing file in the at least one changing file, each changing code block corresponding to the target changing file is checked based on the preset checking rule, and the checking result is displayed on the graphical user interface and used for indicating whether the target changing file passes the checking, so that the checking mode can divide the changing content according to the code changing content of the target program respectively according to the granularity of the file and the code blocks, and can check each changing code block in each changing file directly based on the preset checking rule, thereby realizing automatic checking of the code, greatly improving the code detection efficiency and reducing the labor cost.
The above modules may be one or more integrated circuits configured to implement the above methods, for example: one or more application specific integrated circuits (Application Specific Integrated Circuit, abbreviated as ASICs), or one or more microprocessors, or one or more field programmable gate arrays (Field Programmable Gate Array, abbreviated as FPGAs), etc. For another example, when a module above is implemented in the form of a processing element scheduler code, the processing element may be a general-purpose processor, such as a central processing unit (Central Processing Unit, CPU) or other processor that may invoke the program code. For another example, the modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
Fig. 8 is a schematic structural diagram of a code checking device according to an embodiment of the present application, where the code checking device may be integrated in a terminal device or a chip of the terminal device.
As shown in fig. 8, the code inspection apparatus includes: a processor 501, a bus 502, and a storage medium 503.
The processor 501 is configured to store a program, and the processor 501 invokes the program stored in the storage medium 503 to execute the method embodiments corresponding to fig. 1 to 5.
The specific processor 501 performs the steps of the code checking method described above, including:
determining at least one change file and change code blocks corresponding to the change files according to code change contents of the target program;
displaying each of the change files in a first area on a graphical user interface;
responding to the selection operation of the target change file in the at least one change file, displaying a change code block corresponding to the target change file in a second area on the graphical user interface, and checking the target change file according to a preset checking rule;
displaying the target change file inspection result in the second area of the graphical user interface; the check result indicates whether the target change file passes the check.
In some embodiments, before executing the determining at least one change file and at least one change code block according to the code change content, the processor 501 is further configured to execute:
and determining the code change content from the code folder of the target program.
In some embodiments, when executing the code change content according to the target program, the processor 501 determines at least one change file and a change code block corresponding to each change file, and further includes:
Determining at least one change file according to the code change content;
splitting each change file according to a preset splitting rule to obtain change code blocks corresponding to each change file.
In some embodiments, the processor 501 further includes a first sub-region and a second sub-region in executing the first region, and when displaying each of the change files in the first region on the graphical user interface, further includes:
displaying the temporarily stored change files in the first subarea on the graphical user interface according to the temporary storage condition of each change file;
and displaying the change file which is not temporarily stored in the second subarea.
In some embodiments, when executing the displaying each of the change files in the first area on the graphical user interface, the processor 501 further includes:
and displaying each change file and the checking state corresponding to each change file in a first area on the graphical user interface.
In some embodiments, executing on the graphical user interface further comprises: setting controls, the processor 501 is further configured to perform:
responding to clicking operation aiming at the setting control, and displaying a setting popup window on the graphical user interface;
And responding to the configuration operation in the setting popup window, and configuring the preset check rule.
In some embodiments, when executing the displaying the target change file inspection result on the second area of the graphical user interface, the processor 501 further includes:
displaying the checking result of the target update file and a detail control in a second area of the graphical user interface;
responsive to a click operation for the detail control, displaying the detail of the inspection result on the graphical user interface; the details are used for indicating the target change code blocks which do not pass the inspection in the target change file.
By adopting the code checking equipment provided by the application, after the code changing content of the target program is determined, at least one changing file and the changing code blocks corresponding to each changing file are determined according to the code changing content, after the user determines the target changing file in the at least one changing file, each changing code block corresponding to the target changing file is checked based on the preset checking rule, and the checking result is displayed on the graphical user interface and used for indicating whether the target changing file passes the checking, so that the checking mode can divide the changing content according to the code changing content of the target program respectively according to the granularity of the file and the code blocks, and can check each changing code block in each changing file directly based on the preset checking rule, thereby realizing automatic checking of the code, greatly improving the code detecting efficiency and reducing the labor cost.
Optionally, the present application also provides a program product, such as a storage medium, on which a computer program is stored, including a program which, when being executed by a processor, performs the corresponding embodiments of the above-mentioned method.
The specific processor executing the code checking method comprises the following steps:
determining at least one change file and change code blocks corresponding to the change files according to code change contents of the target program;
displaying each of the change files in a first area on a graphical user interface;
responding to the selection operation of the target change file in the at least one change file, displaying a change code block corresponding to the target change file in a second area on the graphical user interface, and checking the target change file according to a preset checking rule;
displaying the target change file inspection result in the second area of the graphical user interface; the check result indicates whether the target change file passes the check.
In some embodiments, the processor, prior to executing the determining the at least one change file and the at least one change code block based on the code change content, is further configured to:
And determining the code change content from the code folder of the target program.
In some embodiments, when executing the code change content according to the target program, the processor determines at least one change file and change code blocks corresponding to each change file, and further includes:
determining at least one change file according to the code change content;
splitting each change file according to a preset splitting rule to obtain change code blocks corresponding to each change file.
In some embodiments, the processor further includes a first sub-region and a second sub-region in executing the first region, and when each of the change files is displayed in the first region on the graphical user interface, the processor further includes:
displaying the temporarily stored change files in the first subarea on the graphical user interface according to the temporary storage condition of each change file;
and displaying the change file which is not temporarily stored in the second subarea.
In some embodiments, the processor, when executing the displaying each of the change files in the first area on the graphical user interface, further comprises:
and displaying each change file and the checking state corresponding to each change file in a first area on the graphical user interface.
In some embodiments, executing on the graphical user interface further comprises: the control is set, and the processor is further configured to perform:
responding to clicking operation aiming at the setting control, and displaying a setting popup window on the graphical user interface;
and responding to the configuration operation in the setting popup window, and configuring the preset check rule.
In some embodiments, the processor, when executing the displaying the target change file inspection result on the second area of the graphical user interface, further comprises:
displaying the checking result of the target update file and a detail control in a second area of the graphical user interface;
responsive to a click operation for the detail control, displaying the detail of the inspection result on the graphical user interface; the details are used for indicating the target change code blocks which do not pass the inspection in the target change file.
By adopting the storage medium provided by the application, after the code change content of the target program is determined, at least one change file and the change code blocks corresponding to each change file can be determined according to the code change content, after the user determines the target change file in the at least one change file, each change code block corresponding to the target change file is checked based on the preset check rule, and the check result is displayed on the graphical user interface and used for indicating whether the target change file passes the check, so that the check mode can divide the change content according to the code change content of the target program respectively according to the granularity of the file and the code blocks, and can check each change code block in each change file directly based on the preset check rule, thereby realizing automatic check of codes, greatly improving the detection efficiency of the codes, and reducing the labor cost.
In the several embodiments provided in this application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in hardware plus software functional units.
The integrated units implemented in the form of software functional units described above may be stored in a computer readable storage medium. The software functional unit is stored in a storage medium, and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (english: processor) to perform part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: u disk, mobile hard disk, read-Only Memory (ROM), random access Memory (Random Access Memory, RAM), magnetic disk or optical disk, etc.

Claims (10)

1. A code checking method, the method comprising:
determining at least one change file and change code blocks corresponding to the change files according to code change contents of the target program;
displaying each of the change files in a first area on a graphical user interface;
responding to the selection operation of the target change file in the at least one change file, displaying a change code block corresponding to the target change file in a second area on the graphical user interface, and checking the target change file according to a preset checking rule;
Displaying the target change file inspection result in the second area of the graphical user interface; the check result indicates whether the target change file passes the check.
2. The method of claim 1, wherein before determining at least one change file and the change code block corresponding to each change file according to the code change content of the target program, the method further comprises:
and determining the code change content from the code folder of the target program.
3. The method of claim 1, wherein determining at least one change file and a change code block corresponding to each change file according to code change contents of the target program comprises:
determining at least one change file according to the code change content;
splitting each change file according to a preset splitting rule to obtain change code blocks corresponding to each change file.
4. The method of claim 1, further comprising a first sub-region and a second sub-region within the first region, wherein displaying each of the change files within the first region on the graphical user interface comprises:
Displaying the temporarily stored change files in the first subarea on the graphical user interface according to the temporary storage condition of each change file;
and displaying the change file which is not temporarily stored in the second subarea.
5. The method of claim 1, wherein displaying each of the change files in a first area on a graphical user interface comprises:
and displaying each change file and the checking state corresponding to each change file in a first area on the graphical user interface.
6. The method of claim 1, wherein the graphical user interface further comprises: setting a control, the method further comprising:
responding to clicking operation aiming at the setting control, and displaying a setting popup window on the graphical user interface;
and responding to the configuration operation in the setting popup window, and configuring the preset check rule.
7. The method of claim 1, wherein said displaying the target change file inspection result on the second area of the graphical user interface comprises:
displaying the checking result of the target update file and a detail control in a second area of the graphical user interface;
Responsive to a click operation for the detail control, displaying the detail of the inspection result on the graphical user interface; the details are used for indicating the target change code blocks which do not pass the inspection in the target change file.
8. A code inspection apparatus, the apparatus comprising: a determining module and a display module, wherein:
the determining module is used for determining at least one change file and change code blocks corresponding to the change files according to code change contents of the target program;
the display module is used for displaying each change file in a first area on the graphical user interface; responding to the selection operation of the target change file in the at least one change file, displaying a change code block corresponding to the target change file in a second area on the graphical user interface, and checking the target change file according to a preset checking rule; displaying the target change file inspection result in the second area of the graphical user interface; the check result indicates whether the target change file passes the check.
9. A code inspection apparatus, the apparatus comprising: a processor, a storage medium and a bus, the storage medium storing machine-readable instructions executable by the processor, the processor and the storage medium communicating over the bus when the code checking device is running, the processor executing the machine-readable instructions to perform the method of any of the preceding claims 1-7.
10. A storage medium having stored thereon a computer program which, when executed by a processor, performs the method of any of the preceding claims 1-7.
CN202311307641.7A 2023-10-10 2023-10-10 Code detection method, device, equipment and storage medium Pending CN117290239A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311307641.7A CN117290239A (en) 2023-10-10 2023-10-10 Code detection method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311307641.7A CN117290239A (en) 2023-10-10 2023-10-10 Code detection method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117290239A true CN117290239A (en) 2023-12-26

Family

ID=89256933

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311307641.7A Pending CN117290239A (en) 2023-10-10 2023-10-10 Code detection method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117290239A (en)

Similar Documents

Publication Publication Date Title
US8627290B2 (en) Test case pattern matching
US10824593B2 (en) User interface features to manage a large number of files and their application to management of a large number of test scripts
EP3165984B1 (en) An event analysis apparatus, an event analysis method, and an event analysis program
US10839504B2 (en) User interface for managing defects
CN110928772A (en) Test method and device
US10929004B2 (en) Diagrams for structured data
JPWO2017081865A1 (en) Log analysis system, method, and recording medium
WO2014188502A1 (en) Management system, management program, and management method
CN111106965B (en) Intelligent log analysis method, tool, equipment and medium for complex system
CN113688288B (en) Data association analysis method, device, computer equipment and storage medium
US9557989B2 (en) Comparison and merging of IC design data
US20140181006A1 (en) Extract-transform-load processor controller
CN109271315B (en) Script code detection method, script code detection device, computer equipment and storage medium
EP3547110A1 (en) Code correction
US9262310B2 (en) Methods, apparatuses and computer program products for bulk assigning tests for execution of applications
JP5294675B2 (en) Software migration system and method
US10042638B2 (en) Evaluating documentation coverage
CN112818937A (en) Excel file identification method and device, electronic equipment and readable storage medium
CN117290239A (en) Code detection method, device, equipment and storage medium
CN112765041B (en) Game automation testing method and device and electronic equipment
CN115202535A (en) Icon editing method and device, electronic equipment and storage medium
CN115098362A (en) Page testing method and device, electronic equipment and storage medium
Le Zou et al. On synchronizing with web service evolution
US20150199183A1 (en) Program analysis apparatus and program analysis method
CN116136825B (en) Data detection method and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right

Effective date of registration: 20240220

Address after: Room 801901, building 5, No.16 Keyun Road, Tianhe District, Guangzhou City, Guangdong Province 510000

Applicant after: GUANGZHOU BOGUAN INFORMATION SCIENCE & TECHNOLOGY Co.,Ltd.

Country or region after: China

Address before: 310052 Netease building, No. 599, Wangshang Road, Binjiang District, Hangzhou City, Zhejiang Province

Applicant before: NETEASE (HANGZHOU) NETWORK Co.,Ltd.

Country or region before: China

TA01 Transfer of patent application right