CN113722221A - Method and device for automatically detecting source codes and putting source codes into storage - Google Patents

Method and device for automatically detecting source codes and putting source codes into storage Download PDF

Info

Publication number
CN113722221A
CN113722221A CN202111002432.2A CN202111002432A CN113722221A CN 113722221 A CN113722221 A CN 113722221A CN 202111002432 A CN202111002432 A CN 202111002432A CN 113722221 A CN113722221 A CN 113722221A
Authority
CN
China
Prior art keywords
code
detection
source code
target source
codes
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
CN202111002432.2A
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.)
Sichuan Hongmei Intelligent Technology Co Ltd
Original Assignee
Sichuan Hongmei Intelligent Technology 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 Sichuan Hongmei Intelligent Technology Co Ltd filed Critical Sichuan Hongmei Intelligent Technology Co Ltd
Priority to CN202111002432.2A priority Critical patent/CN113722221A/en
Publication of CN113722221A publication Critical patent/CN113722221A/en
Pending legal-status Critical Current

Links

Images

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/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • 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)

Abstract

The application provides a method and a device for automatically detecting and warehousing source codes, wherein the scheme comprises the following steps: monitoring whether a code cache region has new target source codes to submit and store; when monitoring that a new target source code is submitted and stored, calling CI JOB in Jenkins tool, automatically detecting the target source code through an automatic detection case compiled by a code detection tool, and issuing a detection result; if the detection is passed, the target source code is obtained from the code cache region and is merged into a library for storage; and if the detection is not passed, indicating the developer to modify the target source code based on the issued detection result so as to facilitate resubmission again. According to the scheme, the code auditing accuracy can be effectively improved, the manpower and material resources are saved, and the product development efficiency is improved.

Description

Method and device for automatically detecting source codes and putting source codes into storage
Technical Field
The present document relates to the technical field of code management, and in particular, to a method and an apparatus for automatically detecting source codes for storage.
Background
With the continuous development and growth of companies, more and more projects are developed by each department, and in order to ensure the normal development of the company projects, the source codes entering the version library must be checked first and then put in storage, so as to avoid that the errors and confusion of the version which passes the detection of the version library occur and the normal development of the company projects is influenced because the codes developed by developers who are neglected or have insufficient experience are directly put in the library.
Code auditing refers to auditing and scoring the source codes submitted to the Gerrit version library, and only codes with scores exceeding the warehousing score (the warehousing standard is generally 2 points) can be warehoused. In the existing code checking and warehousing, a manual checking and warehousing mode is adopted, namely, a developer submits a code, and the code is previewed and checked by a checker (usually assumed by a manager of a service line where the developer is located or old staff with a little experience), and if the submitted code is not provided with obvious defects or accords with a warehousing standard, 2 points are given to the submitted code, and the code is put into a version library; and if the submitted code does not accord with the warehousing standard, returning the code to development and modification, and entering the process of submitting, checking and warehousing again after modification.
The manual review warehousing has the defects that firstly, if the number of projects is too many, the reviewers may not review the codes submitted each time one by one; secondly, auditors may not be familiar with each business of the project, and the auditing effect is limited; thirdly, each warehouse requires auditors, hundreds of company project source code libraries, and when developers submit frequently, waste of manpower and material resources is caused.
Disclosure of Invention
The invention provides a method and a device for automatically detecting and warehousing source codes, which are used for effectively improving the code auditing accuracy, saving manpower and material resources and improving the product development efficiency.
To solve the above technical problem, one or more embodiments of the present specification are implemented as follows:
in a first aspect, a method for automatically detecting and warehousing source codes is provided, which includes:
monitoring whether a code cache region has new target source codes to submit and store;
when monitoring that a new target source code is submitted and stored, calling CI JOB in Jenkins tool, automatically detecting the target source code through an automatic detection case compiled by a code detection tool, and issuing a detection result;
if the detection is passed, the target source code is obtained from the code cache region and is merged into a library for storage;
and if the detection is not passed, indicating the developer to modify the target source code based on the issued detection result so as to facilitate resubmission again.
Optionally, the code cache region is specifically a git source code version library, and is used for temporarily caching one or more target source codes submitted by developers.
Optionally, after issuing the detection result, the method further includes: comparing the detection result with a local preset standard; if the target source code is higher than the preset standard score, determining that the target source code passes automatic detection; and if the target source code is not higher than the preset standard score, determining that the target source code automatic detection fails.
Optionally, monitoring whether a new target source code is submitted and stored in the code cache region specifically includes: and sending a monitoring instruction based on a Jenkins tool, and regularly monitoring whether the polling has new target source code updating.
Optionally, calling CI JOB in Jenkins tool, performing automatic detection on the target source code through an automatic detection use case written by a code detection tool, and issuing a detection result, specifically including:
executing code detection CI JOB, compiling an automatic detection case based on a code detection tool sonar, detecting a source code by taking the source code as a carrier through one or more combinations of at least three code rule detection tools of PMD, CheckStyle and Findbugs to determine the loophole and abnormal information of the source code, and sorting according to the loophole and abnormal information to obtain a detection value reflecting a detection result.
In a second aspect, an apparatus for automatically detecting source codes for storage is provided, which includes:
the monitoring module is used for monitoring whether a code cache region has new target source codes to submit and store;
the detection module is used for calling CI JOB in Jenkins tools when monitoring that a new target source code is submitted and stored, automatically detecting the target source code through an automatic detection case compiled by the code detection tools, and issuing a detection result;
the storage module is used for acquiring the target source code from the code cache area and storing the target source code in a storage if the detection is passed;
and the return module is used for indicating the developer to correct the target source code based on the issued detection result so as to be convenient for resubmission again if the detection is not passed.
Optionally, the code cache region is specifically a git source code version library, and is used for temporarily caching one or more target source codes submitted by developers.
Optionally, after the detection module issues the detection result, the method is further configured to: comparing the detection result with a local preset standard; if the target source code is higher than the preset standard score, determining that the target source code passes automatic detection; and if the target source code is not higher than the preset standard score, determining that the target source code automatic detection fails.
Optionally, the monitoring module is specifically configured to: and sending a monitoring instruction based on a Jenkins tool, and regularly monitoring whether the polling has new target source code updating.
Optionally, the detection module calls CI JOB in Jenkins tool, automatically detects the target source code through an automatic detection use case written by the code detection tool, and when a detection result is issued, is specifically configured to:
executing code detection CI JOB, compiling an automatic detection case based on a code detection tool sonar, detecting a source code by taking the source code as a carrier through one or more combinations of at least three code rule detection tools of PMD, CheckStyle and Findbugs to determine the loophole and abnormal information of the source code, and sorting according to the loophole and abnormal information to obtain a detection value reflecting a detection result.
In a third aspect, an electronic device is provided, including:
at least one memory and at least one processor; the at least one memory to store a machine readable program; the at least one processor is configured to invoke the machine-readable program to perform the method of the first aspect.
In a fourth aspect, a computer-readable storage medium is presented, having computer instructions stored thereon, which, when executed by a processor, cause the processor to perform the method of the first aspect.
According to the technical scheme provided by one or more embodiments of the specification, the developed codes are submitted by project developers, and the submitted codes enter the cache region of the remote warehouse firstly; the code detection platform monitors that the version library has new submission, calls CI JOB developed in advance by a Jenkins platform to automatically detect the code, and issues a detection report; and detecting the passed version, executing a warehousing name to warehouse the code, detecting the failed version, modifying the code according to the detection report by a developer, and submitting the verification flow again. The method can effectively improve the code auditing accuracy, saves manpower and material resources and improves the product development efficiency.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a schematic flow chart of manual code checking and warehousing in the prior art.
Fig. 2 is a schematic diagram illustrating steps of a method for automatically detecting and warehousing source codes according to an embodiment of the present disclosure.
Fig. 3 is a schematic diagram of an automatic detection warehousing system provided in an embodiment of the present specification.
Fig. 4 is a schematic diagram illustrating a principle that a Jenkins platform performs automatic detection and warehousing according to an embodiment of the present disclosure.
Fig. 5 is a schematic structural diagram of an apparatus for automatically detecting and warehousing source codes according to an embodiment of the present disclosure.
Fig. 6 is a schematic structural diagram of an electronic device provided in an embodiment of the present specification.
Detailed Description
In order to make the technical solutions in the present specification better understood, the technical solutions in one or more embodiments of the present specification will be clearly and completely described below with reference to the accompanying drawings in one or more embodiments of the present specification, and it is obvious that the one or more embodiments described are only a part of the embodiments of the present specification, and not all embodiments. All other embodiments that can be derived by a person skilled in the art from one or more of the embodiments described herein without making any inventive step shall fall within the scope of protection of this document.
FIG. 1 illustrates a process for manually reviewing and warehousing existing code. Manually checking codes in a warehouse mainly refers to a process of manually checking the codes in the warehouse in order to ensure that the project codes can be effectively stored and the version can be traced or backed, submitting the codes to a Git version library and manually checking the codes in the warehouse; because of numerous projects developed by a company, in the actual product development process, the same project may involve development at multiple ends (such as android, ios, eos, H5, and the like), so that one project may need to establish several code warehouses, and a plurality of projects may have hundreds of code warehouses in addition, so as to avoid that the code developed by developers with carelessness or insufficient experience enters the warehouse directly, so that errors and confusion occur in the version which passes the detection of the version library occur, the normal development of the company project is affected, and all the codes must be checked and passed before being warehoused. The current method is that each warehouse is provided with an auditor, after a developer submits a code, the auditor scores the submitted code at a center interface of the warehouse, and the code with the score exceeding 2 scores is put into the warehouse at the center interface of the warehouse.
Therefore, the invention provides a method and a device for automatically detecting and warehousing source codes, developed codes are submitted by project developers, and the submitted codes enter a cache region of a remote warehouse firstly; the method comprises the steps that a Jenkins platform sends a monitoring instruction, namely, a specific time length is set for carrying out timing monitoring, whether new updating codes exist or not is continuously polled, when the Jenkins platform monitors the new updating, a pulling request is triggered, codes located in a cache region of a git version library (git is a version management tool) are pulled to a work area of Jenkins for waiting for detection, CI JOB which is developed in advance by the Jenkins platform is called to carry out automatic detection on the codes, and a detection report is issued; defining a standard detection value for the warehousing criterion in advance according to the warehousing standard of a company, and when the detection result is equal to or higher than the detection standard value, automatically executing warehousing operation when the detected code meets the warehousing standard; when the detection result is lower than the standard value, the detection result report and the problem report are directly exported, and the mail is automatically sent to developers, so that the developers can modify and submit the audit again. The method can effectively improve the code auditing accuracy, saves manpower and material resources and improves the product development efficiency.
Jenkins is an open-source Continuous Integration (CI) tool providing friendly operation interface, originated from Hudson (Hudson is commercially available), and is mainly used for continuously and automatically building/testing software projects and monitoring the running of external tasks. Jenkins are written in Java language, and can run in popular servlet containers such as Tomcat and the like and can also run independently. Typically used in conjunction with a configuration manager (SCM), build tool.
The embodiments of the present invention will be described in detail with reference to the following examples.
Example one
Referring to fig. 2, a schematic step diagram of a method for automatically detecting source codes for warehousing provided in an embodiment of this specification, where the method may include the following steps:
step 202: and monitoring whether a code cache area has new target source codes to be submitted for storage.
And developing the project to form source codes by the project development member according to the project requirements, and submitting the source codes to a code cache region in time to perform temporary cache in the development process. Wherein the code cache may be a version library cache.
Optionally, the code cache region is specifically a git source code version library, and is used for temporarily caching one or more target source codes submitted by developers.
Step 204: and when monitoring that a new target source code is submitted and stored, calling CI JOB in a Jenkins tool, automatically detecting the target source code through an automatic detection case compiled by a code detection tool, and issuing a detection result.
Optionally, code detection CI JOB is executed, an automatic detection case is compiled based on a code detection tool sonar, a source code is used as a carrier, the source code is detected through one or more combinations of at least three code rule detection tools of PMD, CheckStyle and Findbugs, so as to determine vulnerability and abnormal information of the source code, and a detection value reflecting a detection result is obtained according to the vulnerability and abnormal information.
During concrete implementation, the Jenkins platform sends a monitoring instruction, namely, the timed monitoring of 1 minute is set, whether new updating codes exist is continuously polled, when the Jenkins platform monitors the new updating, a pulling request is triggered, and codes located in a git version library cache region are pulled to a Jenkins work area to wait for detection. And then, automatically triggering and executing code detection CI JOB, compiling an automatic detection case based on a code detection tool sonar, detecting the code through code rule detection tools such as PMD, checkStyle, Findbugs and the like, finding information such as bugs, anomalies and the like of the code in time, and analyzing and processing the detected result to derive a detection value.
Step 206: and if the detection is passed, acquiring the target source code from the code cache region, and merging the target source code into a library for storage.
Step 208: and if the detection is not passed, indicating the developer to modify the target source code based on the issued detection result so as to facilitate resubmission again.
Finally, according to the warehousing standard of a company, defining a standard detection value for the warehousing criterion in advance, and when the detection result is equal to or higher than the detection standard value, the code of the detection accords with the warehousing standard, and the warehousing operation can be automatically executed; when the detection result is lower than the standard value, the detection result report and the problem report are directly exported, and the mail is automatically sent to developers, so that the developers can modify and submit the audit again.
Optionally, after issuing the detection result, the method further includes: comparing the detection result with a local preset standard; if the target source code is higher than the preset standard score, determining that the target source code passes automatic detection; and if the target source code is not higher than the preset standard score, determining that the target source code automatic detection fails.
Fig. 3 is a schematic diagram illustrating the principle of the automatic detection warehousing system according to the present invention, wherein after a developer submits a code, the developer monitors whether a new version library is submitted through a Jenkins platform; : monitoring is set by a Jenkins platform, the change of a git version library is inquired once every minute, polling is carried out continuously, and when the version library is detected to be updated, updated codes are automatically pulled for code detection; after receiving the updated code, the Jenkins platform automatically triggers and executes CI JOB execution detection established in Jenkins in advance, wherein the detection method mainly comprises the steps of compiling an automatic detection case for code detection through a code detection tool sonar, automatically sorting results after detection, presetting a warehousing standard value in advance, and judging that the detection passes the warehousing execution operation when the detection result meets the preset standard value; and when the detection result does not meet the standard score, exporting a detection report automatic mail and sending the detection report automatic mail to a developer who submits the code to modify the code, and after the modification, initiating the submission process again.
Referring to fig. 4, a principle that a Jenkins platform executes automatic detection and warehousing is described, wherein firstly, a monitoring instruction is sent to the Jenkins platform, namely, 1-minute timing monitoring is set, and whether new updates exist is continuously polled; when the Jenkins platform monitors new updates, triggering a pulling request, and pulling codes located in a cache area of the git version library to a workplace working area of Jenkins to wait for detection; after the code is pulled, automatically triggering and executing code detection CI JOB, compiling an automatic detection case based on a code detection tool sonar, taking the existing item source code of a company as a carrier, covering code language detection mechanisms such as java, C #, C, C + +, PL/SQL, JavaScript, Groovy and the like, detecting the code by the sonar through code rule detection tools such as PMD, CheckStyle, Findbugs and the like, finding information such as bugs, exceptions and the like of the code in time, and analyzing and processing the detected result to derive a detection value; defining a standard detection value for the warehousing criterion in advance according to the warehousing standard of a company, and automatically executing warehousing operation when the detected code meets the warehousing standard when the detected result is equal to or higher than the detection standard value; when the detection result is lower than the standard value, the detection result report and the problem report are directly exported, and the mail is automatically sent to developers, so that the developers can modify and submit the audit again.
In the embodiment of the specification, the developed codes are submitted by project developers, and the submitted codes enter a cache region of a remote warehouse firstly; the code detection platform monitors that the version library has new submission, calls CI JOB developed in advance by a Jenkins platform to automatically detect the code, and issues a detection report; and detecting the passed version, executing a warehousing name to warehouse the code, detecting the failed version, modifying the code according to the detection report by a developer, and submitting the verification flow again. The method can effectively improve the code auditing accuracy, saves manpower and material resources and improves the product development efficiency.
Example two
Referring to fig. 5, a schematic structural diagram of an apparatus for automatically detecting and warehousing source codes provided in an embodiment of this specification, the apparatus 500 may include: a monitoring module 502, a detection module 504, a warehousing module 506, and a return module 508; wherein the content of the first and second substances,
a monitoring module 502, configured to monitor whether a new target source code is submitted and stored in the code cache region;
the detection module 504 is configured to, when it is monitored that a new target source code is submitted for storage, call a CI JOB in a Jenkins tool, automatically detect the target source code through an automatic detection case compiled by a code detection tool, and issue a detection result;
the storage module 506 is configured to, if the detection is passed, acquire the target source code from the code cache area, and store the target source code in a storage;
and a returning module 508, configured to instruct the developer to modify the target source code for resubmission again based on the issued detection result if the detection fails.
Optionally, as an embodiment, the code cache region is specifically a git source code version library, and is used for temporarily caching one or more target source codes submitted by a developer.
In a specific implementation manner of the embodiment of this specification, after the detection module issues the detection result, the detection module is further configured to: comparing the detection result with a local preset standard; if the target source code is higher than the preset standard score, determining that the target source code passes automatic detection; and if the target source code is not higher than the preset standard score, determining that the target source code automatic detection fails.
In another specific implementation manner of the embodiment of the present specification, the monitoring module is specifically configured to: and sending a monitoring instruction based on a Jenkins tool, and regularly monitoring whether the polling has new target source code updating.
In another specific implementation manner of the embodiment of the present specification, when the detection module calls a CI JOB in a Jenkins tool, performs automatic detection on the target source code through an automatic detection case written by a code detection tool, and issues a detection result, the detection module is specifically configured to: executing code detection CI JOB, compiling an automatic detection case based on a code detection tool sonar, detecting a source code by taking the source code as a carrier through one or more combinations of at least three code rule detection tools of PMD, CheckStyle and Findbugs to determine the loophole and abnormal information of the source code, and sorting according to the loophole and abnormal information to obtain a detection value reflecting a detection result.
In the embodiment of the specification, the developed codes are submitted by project developers, and the submitted codes enter a cache region of a remote warehouse firstly; the code detection platform monitors that the version library has new submission, calls CI JOB developed in advance by a Jenkins platform to automatically detect the code, and issues a detection report; and detecting the passed version, executing a warehousing name to warehouse the code, detecting the failed version, modifying the code according to the detection report by a developer, and submitting the verification flow again. The method can effectively improve the code auditing accuracy, saves manpower and material resources and improves the product development efficiency.
It is to be understood that the schematic structure in the embodiment of the present invention does not constitute a specific limitation on the apparatus for automatically detecting and warehousing source codes. In other embodiments of the invention, the means for automatically detecting source codes for warehousing may include more or fewer components than shown, or some components may be combined, some components may be split, or a different arrangement of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
Because the information interaction, execution process, and other contents between the units in the device are based on the same concept as the method embodiment of the present invention, specific contents may refer to the description in the method embodiment of the present invention, and are not described herein again.
An embodiment of the present invention further provides an electronic device, shown in fig. 6, including: at least one memory and at least one processor;
the at least one memory to store a machine readable program;
the at least one processor is configured to invoke the machine-readable program to execute the method for automatically detecting and warehousing the source code according to any embodiment of the present invention.
The embodiment of the invention also provides a computer readable medium, wherein a computer instruction is stored on the computer readable medium, and when the computer instruction is executed by a processor, the processor is enabled to execute the method for automatically detecting and warehousing the source code in any embodiment of the invention. Specifically, a system or an apparatus equipped with a storage medium on which software program codes that realize the functions of any of the above-described embodiments are stored may be provided, and a computer (or a CPU or MPU) of the system or the apparatus is caused to read out and execute the program codes stored in the storage medium.
In this case, the program code itself read from the storage medium can realize the functions of any of the above-described embodiments, and thus the program code and the storage medium storing the program code constitute a part of the present invention.
Examples of the storage medium for supplying the program code include a floppy disk, a hard disk, a magneto-optical disk, an optical disk (e.g., CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD + RW), a magnetic tape, a nonvolatile memory card, and a ROM. Alternatively, the program code may be downloaded from a server computer via a communications network.
Further, it should be clear that the functions of any one of the above-described embodiments may be implemented not only by executing the program code read out by the computer, but also by causing an operating system or the like operating on the computer to perform a part or all of the actual operations based on instructions of the program code.
Further, it is to be understood that the program code read out from the storage medium is written to a memory provided in an expansion board inserted into the computer or to a memory provided in an expansion unit connected to the computer, and then causes a CPU or the like mounted on the expansion board or the expansion unit to perform part or all of the actual operations based on instructions of the program code, thereby realizing the functions of any of the above-described embodiments.
It should be noted that not all steps and modules in the above flows and system structure diagrams are necessary, and some steps or modules may be omitted according to actual needs. The execution order of the steps is not fixed and can be adjusted as required. The system structure described in the above embodiments may be a physical structure or a logical structure, that is, some modules may be implemented by the same physical entity, or some modules may be implemented by a plurality of physical entities, or some components in a plurality of independent devices may be implemented together.
In the above embodiments, the hardware unit may be implemented mechanically or electrically. For example, a hardware element may comprise permanently dedicated circuitry or logic (such as a dedicated processor, FPGA or ASIC) to perform the corresponding operations. The hardware elements may also comprise programmable logic or circuitry, such as a general purpose processor or other programmable processor, that may be temporarily configured by software to perform the corresponding operations. The specific implementation (mechanical, or dedicated permanent, or temporarily set) may be determined based on cost and time considerations.
While the invention has been shown and described in detail in the drawings and in the preferred embodiments, it is not intended to limit the invention to the embodiments disclosed, and it will be apparent to those skilled in the art that various combinations of the code auditing means in the various embodiments described above may be used to obtain further embodiments of the invention, which are also within the scope of the invention.

Claims (10)

1. A method for automatically detecting and warehousing source codes is characterized by comprising the following steps:
monitoring whether a code cache region has new target source codes to submit and store;
when monitoring that a new target source code is submitted and stored, calling CI JOB in Jenkins tool, automatically detecting the target source code through an automatic detection case compiled by a code detection tool, and issuing a detection result;
if the detection is passed, the target source code is obtained from the code cache region and is merged into a library for storage;
and if the detection is not passed, indicating the developer to modify the target source code based on the issued detection result so as to facilitate resubmission again.
2. The method according to claim 1, wherein the code buffer is a git source code version library, and is configured to temporarily buffer one or more target source codes submitted by a developer.
3. The method for automatically detecting and warehousing source codes according to claim 2, wherein after issuing the detection result, the method further comprises:
comparing the detection result with a local preset standard;
if the target source code is higher than the preset standard score, determining that the target source code passes automatic detection;
and if the target source code is not higher than the preset standard score, determining that the target source code automatic detection fails.
4. The method for automatically detecting and warehousing source codes according to claim 1, wherein monitoring whether a new target source code is submitted and stored in a code cache area specifically comprises:
and sending a monitoring instruction based on a Jenkins tool, and regularly monitoring whether the polling has new target source code updating.
5. The method for automatically detecting and warehousing source codes according to any one of claims 1 to 4, wherein a CIJOB in a Jenkins tool is called, the target source codes are automatically detected through an automatic detection case written by the code detection tool, and a detection result is issued, and the method specifically comprises the following steps:
executing code detection CIJOB, compiling an automatic detection case based on a code detection tool sonar, detecting a source code by taking the source code as a carrier through one or more combinations of at least three code rule detection tools of PMD, checkStyle and Findbugs to determine the loophole and abnormal information of the source code, and sorting according to the loophole and abnormal information to obtain a detection value reflecting a detection result.
6. The utility model provides a device to source code automated inspection warehouse entry which characterized in that includes:
the monitoring module is used for monitoring whether a code cache region has new target source codes to submit and store;
the detection module is used for calling CIJOB in Jenkins tools when monitoring that a new target source code is submitted and stored, automatically detecting the target source code through an automatic detection case compiled by the code detection tools, and issuing a detection result;
the storage module is used for acquiring the target source code from the code cache area and storing the target source code in a storage if the detection is passed;
and the return module is used for indicating the developer to correct the target source code based on the issued detection result so as to be convenient for resubmission again if the detection is not passed.
7. The apparatus according to claim 6, wherein the code buffer is a git source code version library, and is configured to temporarily buffer one or more target source codes submitted by developers.
8. The apparatus for automatically detecting and warehousing source codes according to claim 7, wherein after the detection module issues the detection result, the apparatus is further configured to:
comparing the detection result with a local preset standard;
if the target source code is higher than the preset standard score, determining that the target source code passes automatic detection;
and if the target source code is not higher than the preset standard score, determining that the target source code automatic detection fails.
9. The apparatus for automatically detecting source codes for storage according to claim 6, wherein the monitoring module is specifically configured to:
and sending a monitoring instruction based on a Jenkins tool, and regularly monitoring whether the polling has new target source code updating.
10. The apparatus for automatically detecting source codes according to any of claims 6 to 9, wherein the detection module is specifically configured to, when calling CI JOB in Jenkins tool, automatically detect the target source codes through an automatic detection case written by code detection tool, and issue a detection result:
executing code detection CIJOB, compiling an automatic detection case based on a code detection tool sonar, detecting a source code by taking the source code as a carrier through one or more combinations of at least three code rule detection tools of PMD, checkStyle and Findbugs to determine the loophole and abnormal information of the source code, and sorting according to the loophole and abnormal information to obtain a detection value reflecting a detection result.
CN202111002432.2A 2021-08-30 2021-08-30 Method and device for automatically detecting source codes and putting source codes into storage Pending CN113722221A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111002432.2A CN113722221A (en) 2021-08-30 2021-08-30 Method and device for automatically detecting source codes and putting source codes into storage

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111002432.2A CN113722221A (en) 2021-08-30 2021-08-30 Method and device for automatically detecting source codes and putting source codes into storage

Publications (1)

Publication Number Publication Date
CN113722221A true CN113722221A (en) 2021-11-30

Family

ID=78678881

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111002432.2A Pending CN113722221A (en) 2021-08-30 2021-08-30 Method and device for automatically detecting source codes and putting source codes into storage

Country Status (1)

Country Link
CN (1) CN113722221A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107729247A (en) * 2017-10-13 2018-02-23 郑州云海信息技术有限公司 The method and apparatus that source program code mistake is checked based on jenkins
CN109491663A (en) * 2018-11-01 2019-03-19 北京车和家信息技术有限公司 Code inspection method and device
CN110928780A (en) * 2019-11-19 2020-03-27 深圳前海环融联易信息科技服务有限公司 Code quality control method and device, computer equipment and storage medium
CN112860548A (en) * 2021-01-29 2021-05-28 北京罗克维尔斯科技有限公司 Code automatic detection method and device, electronic equipment and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107729247A (en) * 2017-10-13 2018-02-23 郑州云海信息技术有限公司 The method and apparatus that source program code mistake is checked based on jenkins
CN109491663A (en) * 2018-11-01 2019-03-19 北京车和家信息技术有限公司 Code inspection method and device
CN110928780A (en) * 2019-11-19 2020-03-27 深圳前海环融联易信息科技服务有限公司 Code quality control method and device, computer equipment and storage medium
CN112860548A (en) * 2021-01-29 2021-05-28 北京罗克维尔斯科技有限公司 Code automatic detection method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN111240994B (en) Vulnerability processing method and device, electronic equipment and readable storage medium
US8954930B2 (en) System and method for reducing test effort by object risk analysis
US20160004517A1 (en) SOFTWARE DEVELOPMENT IMPROVEMENT TOOL - iREVIEW
CN107678936B (en) Business system pre-inspection method, server and computer readable storage medium
CN112506799A (en) Business abnormity positioning method and device, electronic equipment, medium and product
CN115269444B (en) Code static detection method and device and server
CN112650670A (en) Application testing method, device, system, electronic equipment and storage medium
CN113971031A (en) Software package dependency relationship checking method and device
CN111475408A (en) Quality management method based on code inspection tool
CN116627848B (en) Automatic test method and system for application program
CN111813382A (en) Intangible asset management system and method
CN113722221A (en) Method and device for automatically detecting source codes and putting source codes into storage
CN111258562A (en) Java code quality inspection method, device, equipment and storage medium
CN116415258A (en) Vulnerability detection method, device, equipment, medium and program product
JP2010198522A (en) Method and support system for analyzing source code
CN113672512A (en) Code inspection rule generating method, code inspection method, device and medium
CN110633204B (en) Program defect detection method and device
CN112328503A (en) Task acceptance method for software development working platform
CN112632174A (en) Data inspection method, device and system
CN111611173A (en) System and method applied to micro-service engineering interface document detection
CN115795488B (en) Code detection system and code detection method
CN114625557B (en) Abnormality processing method and device, electronic equipment and storage medium
CN116932007A (en) Method and device for processing upgrading risk of process instance and electronic equipment
CN117608965A (en) Method, device, equipment and medium for monitoring progress of meter processing
CN117556421A (en) Security scanning result checking method and device, storage medium and electronic equipment

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

Application publication date: 20211130

RJ01 Rejection of invention patent application after publication