CN113032286A - Code quality scanning method and device and storage medium - Google Patents
Code quality scanning method and device and storage medium Download PDFInfo
- Publication number
- CN113032286A CN113032286A CN202110562164.3A CN202110562164A CN113032286A CN 113032286 A CN113032286 A CN 113032286A CN 202110562164 A CN202110562164 A CN 202110562164A CN 113032286 A CN113032286 A CN 113032286A
- Authority
- CN
- China
- Prior art keywords
- code
- scanning
- scanning unit
- target
- scanned
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Prevention of errors by analysis, debugging or testing of software
- G06F11/3604—Analysis of software for verifying properties of programs
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Prevention of errors by analysis, debugging or testing of software
- G06F11/3668—Testing of software
- G06F11/3672—Test management
- G06F11/3688—Test management for test execution, e.g. scheduling of test suites
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/50—Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
- G06F21/57—Certifying or maintaining trusted computer platforms, e.g. secure boots or power-downs, version controls, system software checks, secure updates or assessing vulnerabilities
- G06F21/577—Assessing vulnerabilities and evaluating computer system security
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- Computer Security & Cryptography (AREA)
- Quality & Reliability (AREA)
- Computing Systems (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention relates to a code quality scanning method, a device and a storage medium, wherein when a scanning trigger signal is detected, a target scanning unit corresponding to a code to be scanned is controlled to be in a working state, the target scanning unit is used for scanning the code to be scanned and generating a first scanning result, the first scanning result sent by the target scanning unit is received and sent to a target server, the code to be scanned and the target scanning unit are deleted, and the target server is used for storing the first scanning result. Based on the embodiment of the application, the workload can be reduced, the code leakage risk can also be reduced, and the centralized leakage risk of the codes to be scanned can be reduced by storing the corresponding codes to be scanned in each candidate scanning unit.
Description
Technical Field
The present invention relates to the field of software development technologies, and in particular, to a method and an apparatus for scanning code quality, and a storage medium.
Background
In the development process of software, in order to ensure the quality of a code and reduce the pressure of testing, static scanning and code coverage rate scanning are generally performed on the code before the code is submitted to testing, wherein the static scanning is to scan an irregular and a bug existing in the code, and the coverage rate scanning is to run a unit test case written by a developer, that is, to detect whether a very small and definite function of the written code is correct.
Whether static scanning or coverage scanning, is based on obtaining source code. At present, the method of scanning the code is that a developer performs the scanning by himself and generates a data report or directly uploads the data and stores the data in a server, which not only increases the development work, but also causes the authenticity of the scanning result to be uncontrolled. For such a situation, a unified person may perform scanning of part of project codes of a department or all project codes of a company, and since each execution requires acquiring a source code and storing the source code in the same server for scanning, concentrated leakage of the codes may be caused, and in the execution process, if an abnormal situation occurs, after the scanning program is terminated halfway, manual restarting of scanning is also required, which increases the scanning workload.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method, an apparatus, and a storage medium for scanning code quality, which can reduce the risk of code leakage and reduce the risk of centralized leakage of codes to be scanned.
The embodiment of the invention provides a code quality scanning method, which comprises the following steps:
when a scanning trigger signal is detected, controlling a target scanning unit corresponding to a code to be scanned to be in a working state; the target scanning unit is used for scanning a code to be scanned and generating a first scanning result;
receiving a first scanning result sent by a target scanning unit;
sending the first scanning result to a target server, and deleting the code to be scanned and the target scanning unit; the target server is used for storing the first scanning result.
Further, the method further comprises:
when the scanning abnormal signal is detected, creating a candidate scanning unit;
sending a first pulling code instruction to the candidate scanning unit, wherein the first pulling code instruction is used for indicating the candidate scanning unit to read and store the codes to be scanned from the code warehouse;
controlling the candidate scanning unit to be in a working state, wherein the candidate scanning unit is used for scanning the code to be scanned and generating a second scanning result;
receiving a second scanning result sent by the candidate scanning unit;
sending the second scanning result to a target server, and deleting the code to be scanned and the candidate scanning unit; the target server is used for storing the second scanning result.
Further, when the scanning trigger signal is detected, before controlling the target scanning unit corresponding to the code to be scanned to be in the working state, the method further includes:
and sending a second pulling code instruction to the target scanning unit, wherein the second pulling code instruction is used for instructing the target scanning unit to read and store the code to be scanned from the code warehouse.
Further, the scan trigger signal includes any one of a create branch signal, a code commit signal, and a rescan signal.
Correspondingly, the embodiment of the application also provides a code quality scanning device, which comprises the code quality scanning device.
The control target scanning unit module is used for controlling a target scanning unit corresponding to a code to be scanned to be in a working state when the scanning trigger signal is detected; the target scanning unit is used for scanning a code to be scanned and generating a first scanning result;
the first receiving module is used for receiving a first scanning result sent by the target scanning unit;
the first sending module is used for sending the first scanning result to the target server and deleting the code to be scanned and the target scanning unit; the target server is used for storing the first scanning result.
Further, the apparatus further comprises:
a creation module for creating a candidate scanning unit when a scanning abnormality signal is detected;
the first pulling module is used for sending a first pulling code instruction to the candidate scanning unit, and the first pulling code instruction is used for indicating the candidate scanning unit to read and store the codes to be scanned from the code warehouse;
the control candidate scanning unit module is used for controlling the candidate scanning unit to be in a working state, and the candidate scanning unit is used for scanning the code to be scanned and generating a second scanning result;
the second receiving module is used for receiving a second scanning result sent by the candidate scanning unit;
the second sending module is used for sending the second scanning result to the target server and deleting the code to be scanned and the candidate scanning unit; the target server is used for storing the second scanning result.
Further, the apparatus further comprises:
and the second pulling module is used for sending a second pulling code instruction to the target scanning unit, and the second pulling code instruction is used for indicating the target scanning unit to read and store the code to be scanned from the code warehouse.
Accordingly, an embodiment of the present invention further provides an electronic device, which includes a processor and a memory, where the memory stores at least one instruction, at least one program, a code set, or a set of instructions, and the at least one instruction, the at least one program, the code set, or the set of instructions is loaded and executed by the processor to implement the above-mentioned scanning method for code quality.
Accordingly, an embodiment of the present invention further provides a computer-readable storage medium, in which at least one instruction, at least one program, a code set, or a set of instructions is stored, and the at least one instruction, the at least one program, the code set, or the set of instructions is loaded and executed by a processor to implement the above-mentioned scanning method for code quality.
The embodiment of the invention has the following beneficial effects:
the embodiment of the invention provides a code quality scanning method, a code quality scanning device, electronic equipment and a storage medium, wherein when a scanning trigger signal is detected, a target scanning unit corresponding to a code to be scanned is controlled to be in a working state, the target scanning unit is used for scanning the code to be scanned and generating a first scanning result, the first scanning result sent by the target scanning unit is received, the first scanning result is sent to a target server, the code to be scanned and the target scanning unit are deleted, and the target server is used for storing the first scanning result. Based on the embodiment of the application, the workload can be reduced, the code leakage risk can also be reduced, and the centralized leakage risk of the codes to be scanned can be reduced by storing the corresponding codes to be scanned in each candidate scanning unit.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions and advantages of the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
FIG. 1 is a flow chart of a method for scanning code quality according to an embodiment of the present invention;
FIG. 2 is a flow chart of a method for scanning code quality according to an embodiment of the present invention;
FIG. 3 is a flowchart of a method for scanning code quality according to an embodiment of the present invention;
FIG. 4 is a schematic structural diagram of a scanning apparatus for scanning a code quality according to an embodiment of the present invention;
FIG. 5 is a schematic structural diagram of a scanning apparatus for scanning a code quality according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a server according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail with reference to the accompanying drawings. It should be apparent that the described embodiment is only one embodiment of the invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
An "embodiment" as referred to herein relates to a particular feature, structure, or characteristic that may be included in at least one implementation of the invention. In the description of the embodiments of the present invention, it should be understood that the terms "comprises" and "comprising," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, apparatus, article, or apparatus that comprises a list of steps or modules is not necessarily limited to those steps or modules explicitly listed, but may include other steps or modules not expressly listed or inherent to such process, method, apparatus, article, or apparatus.
Fig. 1 is a schematic diagram of an application environment provided in an embodiment of the present application, and includes a server 110, a target scanning unit 130, and a target server 150, where when a scan trigger signal is detected, the server may create a target scanning container 130, and control the target scanning unit 130 corresponding to a code to be scanned to be in an operating state, the target scanning unit 130 is configured to perform a scanning process on the code to be scanned and generate a first scanning result, further, the server 110 may receive the first scanning result sent by the target scanning unit 130 and send the first scanning result to the target server 150, and the server 110 may perform a deletion process on the code to be scanned and the target scanning unit 130, and the target server 150 is configured to store the first scanning result.
While specific embodiments of a method for scanning a code mass according to the present application are described below, fig. 2 is a flow chart of a method for scanning a code mass according to an embodiment of the present application, and the present specification provides the method operation steps as shown in the embodiments or the flow chart, but may include more or less operation steps based on conventional or non-inventive labor. The order of steps recited in the embodiments is only one of many possible orders of execution and does not represent the only order of execution, and in actual execution, the steps may be performed sequentially or in parallel as in the embodiments or methods shown in the figures (e.g., in the context of parallel processors or multi-threaded processing). Specifically, as shown in fig. 2, the method may include:
s201: when a scanning trigger signal is detected, controlling a target scanning unit corresponding to a code to be scanned to be in a working state; the target scanning unit is used for scanning the code to be scanned and generating a first scanning result.
In the embodiment of the application, when the scanning trigger signal is detected, the server controls a target scanning unit corresponding to the code to be scanned to be in a working state, and the target scanning unit is used for scanning the code to be scanned and generating a first scanning result. Namely, the server controls the target scanning unit to start, scans the code to be scanned and generates a first scanning result.
In this embodiment of the application, before the server controls the target scanning unit corresponding to the code to be scanned to be in the working state, the target scanning unit may be created, and a second code pulling instruction may be sent to the target scanning unit, where the second code pulling instruction is used to instruct the target scanning unit to read and store the code to be scanned from the code warehouse. For example, a code warehouse includes code 1, code 2, and code 3, and the code to be scanned includes code 1 and code 2, a target scanning unit a and a target scanning unit b may be created, and a second pull instruction may be sent to the target scanning unit a to instruct the target scanning unit a to read and store code 1 from the code warehouse, and control the target scanning unit a to perform scanning processing on code 1, and generate a corresponding scanning result, and at the same time, a second pull instruction may be sent to the target scanning unit b to instruct the target scanning unit b to read and store code 2 from the code warehouse, and control the target scanning unit b to perform scanning processing on code 2, and generate a corresponding scanning result.
In an alternative embodiment, the scan trigger signal may be any one of a create branch signal, a code commit signal, and a rescan signal. That is, in the software development process, if the server detects that a branch is created, a code is submitted, or rescanning is performed, the target scanning unit corresponding to the code to be scanned is controlled to scan the code to be scanned, wherein the code to be scanned is a code stored in a code warehouse of the development software, that is, a part of the code in the software development process. For example, the container cluster management technique k8s may be used to control each target scan cell to scan the corresponding code to be scanned in batch.
S203: and receiving a first scanning result sent by the target scanning unit.
In this embodiment of the application, after the server controls the target scanning unit corresponding to the code to be scanned to be in the working state, the first scanning result sent by the target scanning unit may be received, where the first scanning result may include an error rate of the code to be scanned and a location of an error code in the code to be scanned.
S205: sending the first scanning result to a target server, and deleting the code to be scanned and the target scanning unit; the target server is used for storing the first scanning result.
In this embodiment of the application, after receiving the first scanning result, the server may send the first scanning result to the target server to store the first scanning result, and delete the target scanning unit and the code to be scanned stored in the target scanning unit, that is, after the scanning task of the target scanning unit is finished, the scanning result is generated and sent to the server, and the code to be scanned and the target scanning unit need to be deleted.
In this embodiment of the application, the target server may be a scan data hosting server, and the scan results are stored in a unified manner.
By adopting the scanning method of the code quality provided by the embodiment of the application, the workload can be reduced, the risk of code leakage can also be reduced, and the centralized leakage risk of the codes to be scanned can be reduced by storing the corresponding codes to be scanned in each target scanning unit.
In the embodiment of the application, if an abnormal condition occurs in the process of controlling the target scanning unit corresponding to the code to be scanned to be in the working state, the scanning unit needs to be created again to perform scanning processing on the code to be scanned. Fig. 3 is a flowchart of a method for scanning a code quality according to an embodiment of the present application, where as shown in fig. 3, the method may include:
s301: when a scan abnormality signal is detected, a candidate scan cell is created.
In the embodiment of the application, when the scanning abnormal signal is detected, the server creates a candidate scanning unit.
S303: and sending a first pulling code instruction to the candidate scanning unit, wherein the first pulling code instruction is used for instructing the candidate scanning unit to read and store the code to be scanned from the code warehouse.
In this embodiment, the server may send a first pull code instruction to the candidate scanning unit to instruct the candidate scanning unit to read and store the code to be scanned from the code repository. For example, if the code warehouse includes code 1, code 2, and code 3, and the code to be scanned is code 1, a candidate scan unit c may be created and a first pull instruction may be sent to the target scan unit c to instruct the target scan unit c to read and store code 1 from the code warehouse.
S305: and controlling the candidate scanning unit to be in a working state, wherein the candidate scanning unit is used for scanning the code to be scanned and generating a second scanning result.
In this embodiment, the server may control the candidate scanning unit to be in a working state, where the candidate scanning unit is configured to perform scanning processing on the code to be scanned and generate a second scanning result. Namely, the server controls the starting of the candidate scanning unit, performs scanning processing on the code to be scanned and generates a second scanning result.
S307: and receiving a second scanning result sent by the candidate scanning unit.
In this embodiment of the application, after the server controls the candidate scanning unit to be in the working state, a second scanning result sent by the candidate scanning unit may be received, where the second scanning result may include an error rate of the code to be scanned and a location of an error code in the code to be scanned.
S309: sending the second scanning result to a target server, and deleting the code to be scanned and the candidate scanning unit; the target server is used for storing the second scanning result.
In this embodiment of the application, after receiving the second scanning result, the server may send the second scanning result to the target server to store the second scanning result, and delete the candidate scanning unit and the code to be scanned stored in the candidate scanning unit, that is, after the scanning task of the candidate scanning unit is finished, the scanning result is generated and sent to the server, and the code to be scanned and the candidate scanning unit need to be deleted.
By adopting the scanning method of the code quality provided by the embodiment of the application, the workload can be reduced, the risk of code leakage can also be reduced, and the centralized leakage risk of the codes to be scanned can be reduced by storing the corresponding codes to be scanned in each candidate scanning unit.
Fig. 4 is a schematic structural diagram of a scanning apparatus for code quality according to an embodiment of the present invention, and as shown in fig. 4, the scanning apparatus for code quality may include:
the control target scanning unit module 401 is configured to control a target scanning unit corresponding to a code to be scanned to be in a working state when the scanning trigger signal is detected; the target scanning unit is used for scanning a code to be scanned and generating a first scanning result;
the first receiving module 403 is configured to receive a first scanning result sent by the target scanning unit;
the first sending module 405 is configured to send the first scanning result to the target server, and delete the code to be scanned and the target scanning unit; the target server is used for storing the first scanning result.
In this embodiment, the apparatus may further include:
and the second pulling module is used for sending a second pulling code instruction to the target scanning unit, and the second pulling code instruction is used for indicating the target scanning unit to read and store the code to be scanned from the code warehouse.
By adopting the scanning device of the code quality provided by the embodiment of the application, the workload can be reduced, the risk of code leakage can also be reduced, and the centralized leakage risk of the codes to be scanned can be reduced by storing the corresponding codes to be scanned in each target scanning unit.
Fig. 5 is a schematic structural diagram of a scanning apparatus for scanning a code quality according to an embodiment of the present application, and as shown in fig. 5, the apparatus may include:
the creating module 501 is configured to create a candidate scan unit when a scan abnormal signal is detected;
the first pulling module 503 is configured to send a first pulling code instruction to the candidate scanning unit, where the first pulling code instruction is used to instruct the candidate scanning unit to read and store a code to be scanned from the code repository;
the control candidate scanning unit module 505 is configured to control the candidate scanning unit to be in a working state, where the candidate scanning unit is configured to perform scanning processing on a code to be scanned, and generate a second scanning result;
the second receiving module 507 is configured to receive a second scanning result sent by the candidate scanning unit;
the second sending module 509 is configured to send the second scanning result to the target server, and delete the to-be-scanned code and the candidate scanning unit; the target server is used for storing the second scanning result.
By adopting the scanning device of the code quality provided by the embodiment of the application, the workload can be reduced, the risk of code leakage can also be reduced, and the centralized leakage risk of the codes to be scanned can be reduced by storing the corresponding codes to be scanned in each candidate scanning unit.
The device and method embodiments in the embodiments of the invention are based on the same inventive concept.
The present application further provides an electronic device, which may be disposed in a server to store at least one instruction, at least one program, a code set, or a set of instructions related to a scanning method for implementing a code quality in the method embodiment, where the at least one instruction, the at least one program, the code set, or the set of instructions are loaded from the memory and executed to implement the above-mentioned scanning method for the code quality.
The present application further provides a storage medium, which may be disposed in a server to store at least one instruction, at least one program, a code set, or a set of instructions related to a scanning method for implementing a code quality in the method embodiment, where the at least one instruction, the at least one program, the code set, or the set of instructions are loaded and executed by the processor to implement the scanning method for the code quality.
Optionally, in this embodiment, the storage medium may be located in at least one network server of a plurality of network servers of a computer network. Optionally, in this embodiment, the storage medium may include, but is not limited to, a storage medium including: various media that can store program codes, such as a usb disk, a Read-only Memory (ROM), a removable hard disk, a magnetic disk, or an optical disk.
Referring to fig. 6, fig. 6 is a schematic structural diagram of a server according to an embodiment of the present invention, where the server 600 is used to implement the scanning method for code quality provided in the above embodiment, and specifically, the server structure may include an automatic control device for the progress and quality of the above project. The server 600 may have a large difference due to different configurations or performances, and may include one or more Central Processing Units (CPUs) 601 and a memory 603, wherein the CPU may be one or more processors, and the storage medium 602 may be one or more mass storage devices, and the storage medium 602 may store one or more application programs 6023 or data 6022. The memory 603 and the storage medium 602 may be, among other things, transient storage or persistent storage. The program stored on the storage medium 602 may include one or more modules, each of which may include a series of instruction operations for the server. Still further, the central processor 601 may be configured to communicate with the storage medium 602, and execute a series of instruction operations in the storage medium 602 on the server 600. The server 600 may also include one or more power supplies 606, one or more wired or wireless network interfaces 605, one or more input-output interfaces 604, and/or one or more operating systems 6021, such as Windows server, Mac OS XTM, unix, linux, FreeBSDTM, and the like.
Embodiments of the present invention also provide a storage medium, which may be disposed in a server to store at least one instruction and at least one program for implementing a scanning method for a code quality in the method embodiment, where the at least one instruction and the at least one program are loaded and executed by the processor to implement the scanning method for a code quality corresponding to fig. 2 or fig. 3.
Alternatively, in this embodiment, the storage medium may be located in at least one network server of a plurality of network servers of a computer network. Optionally, in this embodiment, the storage medium may include, but is not limited to: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
The embodiment of the invention also provides a storage medium, which has higher requirements on the specialty when test data are written. Alternatively, in the present embodiment, the storage medium may be a program code for executing a scanning method of code quality.
Optionally, in this embodiment, the storage medium may be located on at least one of a plurality of network devices in a network shown in the above embodiment.
Optionally, in this embodiment, the storage medium is configured to store data for performing the method steps as shown in fig. 2 or fig. 3.
Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment is not described herein again.
Optionally, in this embodiment, the storage medium may include, but is not limited to: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
Embodiments of the present invention also provide a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the computer device to perform the scanning method for the code quality provided in the various alternative implementations described above.
An embodiment of the present invention provides an electronic device, which includes a processor and a memory, where at least one instruction and at least one program are stored in the memory, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the scanning method for code quality corresponding to fig. 2 or fig. 3.
The memory may be used to store software programs and modules, and the processor may execute various functional applications and data processing by operating the software programs and modules stored in the memory. The memory can mainly comprise a program storage area and a data storage area, wherein the program storage area can store an operating system, application programs needed by functions and the like; the storage data area may store data created according to use of the apparatus, and the like. Further, the memory may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, the memory may also include a memory controller to provide the processor access to the memory.
It should be noted that: the foregoing descriptions of the embodiments of the present invention are provided for illustration only, and not for the purpose of limiting the invention as defined by the appended claims. In some cases, the actions or steps recited in the claims can be performed in the order of execution in different embodiments and achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown or connected to enable the desired results to be achieved, and in some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
All the embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment is described with emphasis on differences from other embodiments. Especially, for the embodiment of the device, since it is based on the embodiment similar to the method, the description is simple, and the relevant points can be referred to the partial description of the method embodiment.
While the foregoing is directed to the preferred embodiment of the present invention, it will be understood by those skilled in the art that various changes and modifications may be made without departing from the spirit and scope of the invention.
Claims (9)
1. A method for scanning code quality, comprising:
when a scanning trigger signal is detected, controlling a target scanning unit corresponding to a code to be scanned to be in a working state; the target scanning unit is used for scanning the code to be scanned and generating a first scanning result;
receiving the first scanning result sent by the target scanning unit;
sending the first scanning result to a target server, and deleting the code to be scanned and the target scanning unit; the target server is used for storing the first scanning result.
2. The method of claim 1, further comprising:
when the scanning abnormal signal is detected, creating a candidate scanning unit;
sending a first pull code instruction to the candidate scanning unit, wherein the first pull code instruction is used for instructing the candidate scanning unit to read and store the code to be scanned from a code warehouse;
controlling the candidate scanning unit to be in a working state, wherein the candidate scanning unit is used for scanning the code to be scanned and generating a second scanning result;
receiving the second scanning result sent by the candidate scanning unit;
sending the second scanning result to the target server, and deleting the code to be scanned and the candidate scanning unit; the target server is used for storing the second scanning result.
3. The method according to claim 1, wherein before controlling the target scanning unit corresponding to the code to be scanned to be in the working state when the scanning trigger signal is detected, the method further comprises:
and sending a second pulling code instruction to the target scanning unit, wherein the second pulling code instruction is used for instructing the target scanning unit to read and store the code to be scanned from a code warehouse.
4. The method of claim 1, wherein the scan trigger signal comprises any one of a create branch signal, a code commit signal, and a rescan signal.
5. A code quality scanning apparatus, comprising:
the control target scanning unit module is used for controlling a target scanning unit corresponding to a code to be scanned to be in a working state when the scanning trigger signal is detected; the target scanning unit is used for scanning the code to be scanned and generating a first scanning result;
the first receiving module is used for receiving the first scanning result sent by the target scanning unit;
the first sending module is used for sending the first scanning result to a target server and deleting the code to be scanned and the target scanning unit; the target server is used for storing the first scanning result.
6. The apparatus of claim 5, further comprising:
a creation module for creating a candidate scanning unit when a scanning abnormality signal is detected;
the first pulling module is used for sending a first pulling code instruction to the candidate scanning unit, wherein the first pulling code instruction is used for instructing the candidate scanning unit to read and store the code to be scanned from a code warehouse;
the control candidate scanning unit module is used for controlling the candidate scanning unit to be in a working state, and the candidate scanning unit is used for scanning the code to be scanned and generating a second scanning result;
a second receiving module, configured to receive the second scanning result sent by the candidate scanning unit;
the second sending module is used for sending the second scanning result to the target server and deleting the code to be scanned and the candidate scanning unit; the target server is used for storing the second scanning result.
7. The apparatus of claim 5, further comprising:
and the second pulling module is used for sending a second pulling code instruction to the target scanning unit, wherein the second pulling code instruction is used for instructing the target scanning unit to read and store the code to be scanned from a code warehouse.
8. An electronic device, comprising a processor and a memory, wherein at least one instruction, at least one program, a set of codes, or a set of instructions is stored in the memory, and wherein the at least one instruction, the at least one program, the set of codes, or the set of instructions is loaded and executed by the processor to implement the code quality scanning method of any of claims 1-4.
9. A computer readable storage medium having stored therein at least one instruction, at least one program, a set of codes, or a set of instructions, which is loaded and executed by a processor to implement a method of scanning for code quality as claimed in any one of claims 1 to 4.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202110562164.3A CN113032286A (en) | 2021-05-24 | 2021-05-24 | Code quality scanning method and device and storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202110562164.3A CN113032286A (en) | 2021-05-24 | 2021-05-24 | Code quality scanning method and device and storage medium |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN113032286A true CN113032286A (en) | 2021-06-25 |
Family
ID=76455542
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202110562164.3A Pending CN113032286A (en) | 2021-05-24 | 2021-05-24 | Code quality scanning method and device and storage medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN113032286A (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN113505373A (en) * | 2021-07-09 | 2021-10-15 | 福建健康之路信息技术有限公司 | Software code quality testing method and storage device |
Citations (8)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20060021040A1 (en) * | 2004-07-22 | 2006-01-26 | International Business Machines Corporation | Apparatus, method and program to detect and control deleterious code (virus) in computer network |
| US20130311975A1 (en) * | 2012-05-16 | 2013-11-21 | International Business Machines Corporation | Automated tagging and tracking of defect codes based on customer problem management record |
| CN103500295A (en) * | 2013-10-10 | 2014-01-08 | 上海理工大学 | Method preventing copying of source codes by identifying ID dynamically |
| CN106528427A (en) * | 2016-11-24 | 2017-03-22 | 上海携程商务有限公司 | Code quality inspection method and system |
| CN109684226A (en) * | 2018-12-29 | 2019-04-26 | 携程计算机技术(上海)有限公司 | Java code coverage rate statistical system |
| CN110674035A (en) * | 2019-09-12 | 2020-01-10 | 上海麦克风文化传媒有限公司 | Automatic code scanning method, system, device and storage medium |
| CN111414302A (en) * | 2020-02-28 | 2020-07-14 | 天津车之家数据信息技术有限公司 | Static code quality analysis method and computing device for continuous integration process |
| CN112256580A (en) * | 2020-10-23 | 2021-01-22 | 济南浪潮数据技术有限公司 | Code scanning method, device, equipment and storage medium |
-
2021
- 2021-05-24 CN CN202110562164.3A patent/CN113032286A/en active Pending
Patent Citations (8)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20060021040A1 (en) * | 2004-07-22 | 2006-01-26 | International Business Machines Corporation | Apparatus, method and program to detect and control deleterious code (virus) in computer network |
| US20130311975A1 (en) * | 2012-05-16 | 2013-11-21 | International Business Machines Corporation | Automated tagging and tracking of defect codes based on customer problem management record |
| CN103500295A (en) * | 2013-10-10 | 2014-01-08 | 上海理工大学 | Method preventing copying of source codes by identifying ID dynamically |
| CN106528427A (en) * | 2016-11-24 | 2017-03-22 | 上海携程商务有限公司 | Code quality inspection method and system |
| CN109684226A (en) * | 2018-12-29 | 2019-04-26 | 携程计算机技术(上海)有限公司 | Java code coverage rate statistical system |
| CN110674035A (en) * | 2019-09-12 | 2020-01-10 | 上海麦克风文化传媒有限公司 | Automatic code scanning method, system, device and storage medium |
| CN111414302A (en) * | 2020-02-28 | 2020-07-14 | 天津车之家数据信息技术有限公司 | Static code quality analysis method and computing device for continuous integration process |
| CN112256580A (en) * | 2020-10-23 | 2021-01-22 | 济南浪潮数据技术有限公司 | Code scanning method, device, equipment and storage medium |
Non-Patent Citations (2)
| Title |
|---|
| 刘敏等: "《大学计算机应用基础》", 31 August 2018, 华中科技大学出版社 * |
| 青岛英谷教育科技股份有限公司等: "《大数据高可用环境搭建与运维》", 31 January 2019, 西安电子科技大学出版社 * |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN113505373A (en) * | 2021-07-09 | 2021-10-15 | 福建健康之路信息技术有限公司 | Software code quality testing method and storage device |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US11714663B2 (en) | Application environment that implements native code functionality in progressive web applications | |
| US9386079B2 (en) | Method and system of virtual desktop infrastructure deployment studio | |
| CN105808778B (en) | A kind of mass data extracts, conversion, loading method and device | |
| CN113434180B (en) | Data processing method and device for application, server and storage medium | |
| CN111061489A (en) | Multi-platform compiling detection method, device, equipment and medium | |
| CN113138768A (en) | Application package generation method and device, electronic equipment and readable storage medium | |
| CN114706658A (en) | Container mirror image data processing method, device, equipment and medium | |
| CN111752822A (en) | A containerized pressure measurement scheduling method, computer device and readable storage medium | |
| CN113032286A (en) | Code quality scanning method and device and storage medium | |
| CN112214413B (en) | Application program testing method, device, equipment and storage medium | |
| US6502176B1 (en) | Computer system and methods for loading and modifying a control program without stopping the computer system using reserve areas | |
| CN111680302A (en) | Third-party component vulnerability scanning method and device | |
| CN113467893B (en) | Automatic testing method and device for virtual machine, storage medium and processor | |
| US9317273B2 (en) | Information processing apparatus and information processing method | |
| US20180373512A1 (en) | Method and device for simulating synchronous blocking in asynchronous environment, storage medium, server and terminal | |
| CN112416698A (en) | Monitoring system expansion method and device, storage medium and electronic equipment | |
| CN115544496A (en) | Server-free computing method, device and equipment based on trusted execution environment | |
| CN110955498B (en) | Process processing method, device and equipment and computer readable storage medium | |
| CN112667463A (en) | Application system baseline state monitoring method and device | |
| US12360754B2 (en) | Refining software package installation processes using configuration management files | |
| CN113886003A (en) | Ocean satellite remote sensing data mining model scheduling method, system, equipment and medium | |
| CN113721954A (en) | Code file deployment method and device, electronic equipment and storage medium | |
| CN117632428B (en) | Resource scheduling management method, device, equipment and storage medium | |
| CN116303067B (en) | Testing method, device, equipment and medium based on cloud testing platform | |
| CN111240752B (en) | Operating system self-adaption 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 | ||
| RJ01 | Rejection of invention patent application after publication | ||
| RJ01 | Rejection of invention patent application after publication |
Application publication date: 20210625 |