CN111008017A - Oclint-based file to be submitted prequalification method and related components - Google Patents

Oclint-based file to be submitted prequalification method and related components Download PDF

Info

Publication number
CN111008017A
CN111008017A CN201911214989.5A CN201911214989A CN111008017A CN 111008017 A CN111008017 A CN 111008017A CN 201911214989 A CN201911214989 A CN 201911214989A CN 111008017 A CN111008017 A CN 111008017A
Authority
CN
China
Prior art keywords
file
oclint
review
submitted
rule
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.)
Granted
Application number
CN201911214989.5A
Other languages
Chinese (zh)
Other versions
CN111008017B (en
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.)
Shenzhen Xunlei Network Technology Co Ltd
Original Assignee
Shenzhen Xunlei Network 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 Shenzhen Xunlei Network Technology Co Ltd filed Critical Shenzhen Xunlei Network Technology Co Ltd
Priority to CN201911214989.5A priority Critical patent/CN111008017B/en
Publication of CN111008017A publication Critical patent/CN111008017A/en
Application granted granted Critical
Publication of CN111008017B publication Critical patent/CN111008017B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses a pre-review method for files to be submitted based on oclint, which is different from the prior scheme, the application adds predefined rule data to a cpp file generated by calling an oclint source code, the cpp file is a file used for indicating code analysis logic in the oclint, and adds logic judgment data generated by calling a derivative class according to a pre-review rule, so that automatic rule review logic based on the oclint can be realized. The application also discloses a pending file prequalification device, an intelligent terminal and a readable storage medium based on the oclint, and the intelligent terminal and the readable storage medium have the beneficial effects.

Description

Oclint-based file to be submitted prequalification method and related components
Technical Field
The application relates to the technical field of electronics, in particular to a method and a device for prereviewing files to be submitted based on oclint, an intelligent terminal and a readable storage medium.
Background
Due to the requirement of development and setting of the application of the apple terminal, a developer needs to submit an ipa file (a software installation entity file of an iPhone) generated by development and coding to an apple application Store (App Store), and the App Store has many audit rules for the submitted ipa file, including audit of aspects such as setting modes, field types and the like, and the number of the audit is hundreds. If the iPa file is judged to be invalid by App Store audit, the development time of development setting is prolonged seriously, the audit cost is increased, the evaluation level of an apple on a developer submitting the iPa file is influenced, the normal submission of a subsequent iPa file is influenced, and the development setting cannot be released on an application market and huge loss is brought to the developer due to the fact that rules are violated for many times and the risk of number sealing exists.
At present, in order to ensure a high audit passing rate of an ipa file, before the file is submitted, a developer needs to audit the ipa file to be submitted, which mainly includes: and the developers can select one or more auditing modes according to the auditing requirements to audit the ipa file before submitting the ipa file. In the preliminary stage, implementation schemes of related technologies are all manually carried out, development of self-constraint specifications during development/test of manual self-checking and code coding is completely relied on, a large amount of codes and rules are added, manual checking takes a large amount of time, and the manual checking is executed after each edition of archive, so that the efficiency is extremely low; and some check points are easily ignored in manual inspection; in addition, different developers have different evasion modes for the audit rules, personnel replace potential violation risks, and coding self-constraint may trigger rule violation projects in a wrong way.
Therefore, how to overcome the defects of the existing file pre-review on the implementation mechanism is a problem to be solved urgently by those skilled in the art.
Disclosure of Invention
The application aims to provide a method and a device for prereviewing a to-be-submitted file based on oclint, an intelligent terminal and a computer readable storage medium, and aims to overcome the defects of the conventional file prereviewing on an implementation mechanism.
In order to achieve the above object, the present application provides, in a first aspect, a method for pre-reviewing oclinet-based documents to be submitted, including:
downloading and compiling an oclint source code to obtain an oclint execution tool;
calling the oclinet execution tool to generate an xcodeprox project;
importing the xcodeprox item into xcode to generate a cpp file;
adding predefined rule data to the cpp file, and compiling to obtain a dynamic library file of dylib; the rule data is logic judgment data generated by calling a derived class according to a prequalification rule;
and calling an execution inlet of the oclint, carrying out logic judgment on the file to be submitted according to the dylib dynamic library file, and generating a pre-review report.
Optionally, the oclinet-based file to be submitted prequalification method further includes: and sending the pre-review report to sonarqube for integrated display.
Optionally, the oclinet-based file to be submitted prequalification method further includes:
screening out file data which do not accord with the rule data according to the pre-review report, and generating warning information according to the file data;
and carrying out warning reminding according to the warning information.
Optionally, performing warning reminding according to the warning information, including:
setting a warning grade for the warning information;
and carrying out warning reminding according to the preset reminding modes corresponding to the levels.
Optionally, performing warning reminding according to the warning information, including:
and calling a pre-accessed mail system and/or a nailing robot system to output the warning information.
Optionally, the oclinet-based file to be submitted prequalification method further includes:
exporting the cpp file;
adding and/or deleting rules to the cpp file by using the rule data of the new version to obtain a corrected cpp file;
compiling the modified cpp file to generate a modified dylib dynamic library file so as to perform logic judgment on the file to be submitted according to the modified dylib dynamic library file.
On the other hand, the application also provides a pending file prequalification device based on oclint, which comprises:
the source code compiling unit is used for downloading and compiling the oclint source code to obtain an oclint execution tool;
the project generating unit is used for calling the oclint executing tool to generate an xcodeprox project;
the item import unit is used for importing the xcodeprox item into the xcode to generate a cpp file;
a rule adding unit, configured to add predefined rule data to the cpp file, and compile the cpp file to obtain a dynamic library file of dylib; the rule data is logic judgment data generated by calling a derived class according to a prequalification rule;
and the logic judgment unit is used for calling an execution inlet of the oclint, carrying out logic judgment on the file to be submitted according to the dylib dynamic library file and generating a pre-review report.
Optionally, the oclinet-based file to be submitted prequalification apparatus is specifically: and calling the gitlab of jenkins, wherein scripts are deployed on the jenkins, and the steps of the method for prejudging the files to be submitted based on the oclint are realized when the scripts are executed.
On the other hand, this application still provides an intelligent terminal, includes: a memory, a processor, and a bus;
wherein the memory is used for storing programs;
the processor is used for realizing the steps of the oclinet-based file pre-review method to be submitted when the program is executed.
In another aspect, the present application further provides a readable storage medium, where a program is stored, and when the program is executed by a processor, the program implements the steps of the oclin-based pending file pre-review method.
According to the technical scheme provided by the application, the pre-defined rule data are added into the cpp file generated by calling the oclint source code, the cpp file is a file used for indicating code analysis logic in the oclint, and the logic judgment data generated by calling the derived type according to the pre-review rule are added, so that the automatic rule review logic based on the oclint can be realized.
The application also correspondingly provides a device, an intelligent terminal and a readable storage medium corresponding to the method, and the device, the intelligent terminal and the readable storage medium have the beneficial effects and are not repeated herein.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
FIG. 1 is a flowchart of a method for prereviewing documents to be submitted based on oclint according to an embodiment of the present application;
fig. 2 is a schematic diagram illustrating a logic implementation of the oclinet logic determination according to an embodiment of the present application;
fig. 3 is a schematic diagram of a call relationship provided in an embodiment of the present application;
FIG. 4 is a schematic diagram of a pre-review implementation process provided by an embodiment of the present application;
fig. 5 is a schematic diagram of a dylib file according to an embodiment of the present application;
FIG. 6 is a schematic diagram of a pre-review report provided by an embodiment of the present application;
fig. 7 is a schematic structural diagram of an oclinet-based pending document review device according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of an intelligent terminal provided in an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. 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.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims of the present application and in the drawings described above, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that the embodiments described herein may be practiced otherwise than as specifically illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It should be noted that the description relating to "first", "second", etc. in the present invention is for descriptive purposes only and is not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In addition, technical solutions between various embodiments may be combined with each other, but must be realized by a person skilled in the art, and when the technical solutions are contradictory or cannot be realized, such a combination should not be considered to exist, and is not within the protection scope of the present invention.
Compared with other code analysis tools, the oclin is a static code analysis tool, and has the advantages of more checker rules, higher analysis efficiency, high integration level, capability of supporting complex logic support and code style support and capability of giving a user greater freedom. In order to realize rule self-definition and ensure the support of high integration level and complex logic, oclinet with strong comprehensive capability is called in the application to realize the prequalification of the file to be submitted.
The first embodiment is as follows:
referring to fig. 1, fig. 1 is a flowchart of a method for prereviewing documents to be submitted based on oclint according to an embodiment of the present application, which mainly includes the following steps:
s110: downloading an oclin source code and compiling to obtain an oclin execution tool;
in this embodiment, the way of downloading the oclint source code is not limited, and the oclint source code may be downloaded according to the existing oclint source code downloading manner, for example, may be obtained from a GitHub related source code website.
In this step, the oclin execution tool is mainly used for generating an xcodeprox (a project category expression generated by the apple development tool xcode indicates a project type and a suffix name of the project file) project, and the specifically called oclin execution tool may include: build (which is a process that refers to a project that is compiled by a single or multiple tools to form a new product), llvm (which is an underlying virtual machine that is a collection of modular and reusable compilers and tool technologies), oclin-json-compilation-database (a tool name that represents a data type conversion module), and oclin-xcodeb (a tool name that represents a building module associated with an apple development tool), etc., may refer to implementations in the related art to determine an execution tool to be invoked, and in this embodiment, the type of the execution tool itself is not limited.
S120: calling an oclint execution tool to generate an xcodeprox project;
the specific implementation process of calling the oclinet execution tool to generate the xcodeprox project may refer to the related prior art, and is not described herein again.
S130: importing the xcodeprox item into xcode to generate a cpp (cpp is another writing form of programming language C + +, is short for "C Plus", and is also a suffix name of the file) file;
the cpp file generated in this step is an empty file, the cpp file is a file in the oclinet for storing the specified code logic analysis rule data, and a dynamic library file which can be directly called can be generated after the relevant rule data is added, so that code analysis is realized.
S140: adding predefined rule data to the cpp file, and compiling to obtain a dynamic library file;
the rule data is logic judgment data generated by calling a derived class according to a prequalification rule, inherits (a new class is allowed to have the same attribute or method as an existing class and adds a new attribute or behavior of the method) rules from RuleBase (a class name defined in a program indicates a reading source code rule), performs rule addition through three derived classes abstract sourcecode readderrule (a class name defined in a program indicates a reading source code rule), abstract asteatcherrule (a class name defined in a program indicates a matching rule) and abstract asttvistorritorrule (a class name defined in a program indicates an access rule), and compiles into a dylib dynamic library.
The pre-review rule is an audit rule of the App Store, the current audit rule updated by the App Store is 5 large items, 26 small items and 117 thin items, logic conversion can be performed on the 117 thin items according to the current audit rule to generate 117 pieces of logic judgment data, the logic judgment data specifically can include data which can realize code logic judgment, such as keyword identification logic, code rule logic and the like, a specific conversion mode is not limited in the embodiment, and the conversion can be set according to actual rule conversion requirements.
After the rule data meeting the current auditing rule is generated, the data can be repeatedly called to realize comprehensive rule auditing of the ipa file to be submitted, the conditions of missing test, rule error touch and the like are avoided, and the auditing effect is improved.
The rule data may be general rule data for different types of files to be submitted, or may also be corresponding rule data set according to the type of the file to be submitted, configured with multiple types of rule data, and the like, and if the rule data is the latter, the specific execution step when the logic judgment is performed on the file to be submitted according to the dynamic library file of dylib in the following step s150 may be: determining the type information of a file to be submitted; determining a logic rule corresponding to the type information in the dynamic library file of the dylib; and carrying out logic judgment on the file to be submitted according to the determined logic rule. The type may be an application type for the file to be submitted, or a setting type, and may be specifically configured according to actual setting needs, which is not limited herein.
The implementation process of adding rule data and compiling to generate a dynamic library file of the dynamic library can refer to the related technology using oclin, and specifically may call one or more of an oclin tool, an xcode (integrated development tool running on the operating system Mac OS X), a Clang tool (a lightweight compiler of C, C + +, Objective-C), and an llvm tool.
S150: and calling an execution inlet of the oclint, carrying out logic judgment on the file to be submitted according to the dynamic dylib library file, and generating a pre-review report.
The file to be submitted is specifically an ipa (software installation entity file of the iPhone) file to be submitted. After the dylib dynamic library file is generated, background execution and implementation processes for calling the oclint to carry out logic judgment can refer to the related introduction of the oclint, FIG. 2 is a schematic diagram of a logic implementation of the logic determination by oclin, from which we can see that oclin depends on the abstract syntax number (AST) -open source Clang is the dependency tool for oclin to obtain AST, a takeoff method is invoked during analyzer (a loading rule), but all rule base classes (class types with entity commonalities) are RuleBase, under which there is a member called RuleCarrierde, which checks whether ASTContext (representing the text content itself obtained by AST) meets the rules, if the file is not consistent with the file, outputting the file to be submitted to a violationset (a method name defined in a program indicates that the inconsistent scene is logically processed) method, and realizing the logical judgment of the file to be submitted through the above process. The specific implementation calling relationship of the above steps is shown in fig. 3.
The pre-review report comprises the review result of the code logic in the file to be submitted based on the current rule data, and the part of the file to be submitted which does not accord with the pre-review rule can be viewed according to the pre-review report, so that the part of the data can be corrected in time until the part of the data accords with the pre-review rule.
According to the method for prereviewing the files to be submitted based on the oclint provided by the embodiment, the method is different from the existing starting scheme, predefined rule data are added into a cpp file generated by calling an oclint source code, the cpp file is a file used for indicating code analysis logic in the oclint, and logic judgment data generated by calling a derived class (a new class derived from the existing class by using an inheritance mechanism) according to a prereviewing rule are added, so that automatic rule reviewing logic based on the oclint can be realized.
Example two:
different from the first embodiment, the present embodiment mainly increases the specific pre-review mode of the file to be submitted on the basis of the first embodiment from the viewpoint of promoting the user to quickly acquire the key information in the pre-review report.
Optionally, after the pre-review report is generated, the pre-review report can be further sent to the sonarqube for integrated exhibition.
The report is finally displayed integrally by means of a quality management platform sonarqube (an inspection result aggregation platform), wherein the sonarqube is an inspection result aggregation platform and comprises a project page, an evaluation report page, a problem page and the like, the overview of various types of information can be achieved, condition screening is provided, and the sonarqube is called for integrated display, so that the user viewing experience can be optimized, and efficient data output is achieved. Of course, other tools or components may be invoked to output the pre-review report, which may refer to the related art, and is not limited herein.
In addition, because the pre-audit report contains the audit result of all the data rules, the user needs to perform corresponding correction on the file to be submitted according to the pre-audit report, so as to facilitate the user to obtain the relevant data information which does not conform to the audit rule, optionally, after the pre-audit report is generated, the file data which does not conform to the rule data can be further screened out according to the pre-audit report, and warning information can be generated according to the file data; and carrying out warning reminding according to the warning information.
The warning reminding means such as pop-up window reminding, mail reminding and the like can adopt a single reminding mode, can also adopt different reminding means aiming at different error types, and specifically can refer to the implementation mode of related reminding technologies, which is not limited herein.
For the requirement of displaying the error levels differently, it is preferable that the warning information is further configured to set a warning level, and the setting of the warning level may be set according to parameters such as error type and error data amount, which is not limited herein. A method for carrying out warning reminding according to warning information comprises the following steps:
setting a warning grade for the warning information;
and carrying out warning reminding according to the preset reminding modes corresponding to the levels.
The mail system can be called to output the warning information due to the requirements of mass sending, low cost and the like, so that the large-range output of the warning information can be realized, and the overall realization cost is controlled; the nailing robot system can be called to output warning information according to the requirements of unification, integrated management, multi-output modes and the like. Optionally, one way of warning is as follows: and calling a pre-accessed mail system and/or a nailing robot system to output warning information.
The warning reminder can be configured with a single output mode, such as output only through mail, and can also be configured with a plurality of output modes simultaneously, such as output of warning information through a mail system and a nailing robot system, and the warning reminder is not limited herein and can be set according to the actual reminding requirements.
Specifically, a warning reminding mode based on differentiation reminding and multi-means reminding is as follows: and the warning prompt is accessed into the mail system and the nailing robot system, carries out mail prompt aiming at the high-priority warning result in the report, and directly sends a nailing prompt.
The cpp file stores customized rule data aiming at an App Store rule, the adjustment of the customized mode and the adjustment of the App Store rule have the requirement on the adjustment of the cpp file, in order to meet the actual use requirement, preferably, the method can be further configured with a rule data adjustment step, the triggering mode is not limited, page configuration rule adjustment options can be displayed for an oclinet user, the user can automatically trigger the adjustment, and the specific rule data adjustment implementation steps are as follows:
exporting the cpp file;
adding and/or deleting rules to the cpp file by using the rule data of the new version to obtain a corrected cpp file;
compiling the modified cpp file to generate a modified dylib dynamic library file so as to perform logic judgment on the file to be submitted according to the modified dylib dynamic library file.
In this embodiment, only the above-mentioned pre-review steps are added for description, and other pre-review methods based on the first embodiment can be regarded as the protection scope of the present invention, and are not described herein again.
Example three:
in order to deepen understanding of the oclint-based document pre-review method to be submitted described in the above embodiment, in this embodiment, a pre-review process under specific review terms is taken as an example, and fig. 4 is a schematic diagram of a pre-review implementation process.
5.2.3 Audio/video download: apps must not facilitate illegal file sharing or provide the ability to save, convert, or download media resources from third party sources (e.g., Apple Music, YouTube, soundlog, Vimeo) without explicit authorization for these resources. The video/audio content stream may also violate terms of use so that the app must check before accessing these services. If the corresponding requirements exist, the related manuscript must be provided.
For the above review terms, an audit point is obtained by conversion, the ipa package is not allowed to have the function of downloading the internet resource, and then whether the code is written with a code having a keyword "BT" (taking a keyword example) can be considered, if so, the keyword is likely to be rejected.
Downloading and compiling the oclint source code;
running and generating an xcodeprox project by using compiled oclin execution tools (Build, llvm, oclin-json-compilation-database and oclin-xcodebiuld);
importing the items into the xcode, and writing a cpp rule file, wherein one predefined rule data for the examination terms is as follows:
Figure BDA0002299263390000101
the compilation generates a dylib file, which is shown in FIG. 5.
The oclinet is executed to obtain the result of the pre-audit report, and one type of the pre-audit report is shown in FIG. 6.
Compared with the traditional pre-review method, the manual review is converted into the automatic review, so that the time and labor cost are saved, the working efficiency is improved, the review quality is improved, the review risk is reduced, the review coverage is complete, multiple projects can be maintained by the dylib, the application range is wide, and the dylib can be repeatedly used.
Because the situation is complicated and cannot be illustrated by a list, a person skilled in the art can realize that many examples exist according to the basic method principle provided by the application and the practical situation, and the protection scope of the application should be protected without enough inventive work.
Example four:
in the foregoing, detailed descriptions have been given to the principle implementation, advantages, specific implementation manners, and the like of the oclint-based document pre-review process through some embodiments, and the present application further provides an apparatus 200 corresponding to the method, where the content principle of this portion corresponds to the scheme portion, and the portion implementing the principle is not described herein again, and the following will describe the hardware composition of the entity hardware apparatus, please refer to fig. 7, where fig. 7 is a schematic structural diagram of an oclint-based document pre-review apparatus provided in an embodiment of the present application, and the apparatus mainly includes: a source code compiling unit 210, an item generating unit 220, an item importing unit 230, a rule adding unit 240, and a logic judging unit 250.
The source code compiling unit 210 is mainly configured to download and compile an oclinet source code to obtain an oclinet execution tool;
the item generating unit 220 is mainly used for calling an oclinet execution tool to generate an xcodeprox item;
the item import unit 230 is mainly used for importing the xcodeprox item into xcode to generate a cpp file;
the rule adding unit 240 is mainly configured to add predefined rule data to the cpp file, and compile the cpp file to obtain a dynamic library file of dylib; the rule data is logic judgment data generated by calling a derived class according to a prequalification rule;
the logic judgment unit 250 is mainly used for calling an execution entry of the oclint, performing logic judgment on the file to be submitted according to the dynamic library file of the dylib, and generating a pre-review report.
Optionally, the oclinet-based document pre-review device to be submitted may further include: and the report sending unit is used for sending the pre-review report to the sonarqube for integrated display.
Optionally, the oclinet-based document pre-review device to be submitted may further include: the warning reminding unit specifically includes in the warning reminding unit:
the data screening subunit is used for screening out the file data which does not accord with the rule data according to the pre-review report and generating warning information according to the file data;
and the reminding subunit is used for carrying out warning reminding according to the warning information.
Optionally, the reminding sub-unit may specifically be a first reminding sub-unit, and the first reminding sub-unit specifically includes:
the grade determining subunit is used for setting an alarm grade for the alarm information;
and the grade reminding subunit is used for carrying out warning reminding according to a preset reminding mode corresponding to each grade.
Optionally, the reminding sub-unit may specifically be a first reminding sub-unit, and the first reminding sub-unit is specifically configured to: and calling a pre-accessed mail system and/or a nailing robot system to output warning information.
Optionally, the oclinet-based document pre-review device to be submitted may further include: the cpp file adjusting unit specifically comprises:
an export subunit for exporting the cpp file;
the correcting subunit is used for adding and/or deleting rules to the cpp file by using the rule data of the new version to obtain a corrected cpp file;
and the compiling subunit is used for compiling the modified cpp file to generate a modified dylib dynamic library file so as to perform logic judgment on the file to be submitted according to the modified dylib dynamic library file.
Specifically, the oclinet-based document pre-review device to be submitted may specifically be: a gitlab (an open source project for a file warehouse management system) of jenkins (a continuous integration platform) can be called, scripts are deployed on the jenkins, and the steps of the method for prereviewing the files to be submitted based on the oclin are realized when the scripts are executed.
The automatic triggering is erected in the form of a continuous integration platform and a webhook (a self-defined function which can transfer data to other applications when being called) of the gitlab, the written rules and the process scripts are deployed on jenkins, the fact that push triggering operation exists on the gitlab is checked, jenkins are called back to execute tasks, and pre-auditing work is carried out. Wherein, gitlab is an open source project used for the file warehouse management system; the webhook is a self-defined function and can realize data transmission to other applications when being called; jenkins is a continuous integration platform. The invoked tools are project platforms which are open sources at present and are simple to invoke, and a developer can be given greater freedom. In addition, other parallel tools that can implement the above functions may also be called, and in this embodiment, only the tool calling is taken as an example for description, and further details of other forms are omitted here.
The oclinet-based document pre-review device to be submitted can overcome the defects of the existing document pre-review on the implementation mechanism, and realize rapid automatic detection.
Example five:
the present application further provides an intelligent terminal corresponding to the method, where the principle of this part of content corresponds to the scheme part, and details of a part implementing the principle are not repeated here, and a description will be given below on a hardware composition of the intelligent terminal, please refer to fig. 8, where fig. 8 is a schematic structural diagram of an intelligent terminal provided in an embodiment of the present application, and the intelligent terminal mainly includes:
the intelligent terminal 300 comprises a memory 310, a processor 320 and a bus 330, wherein the memory 310 stores a pending file pre-review program which can run on the processor 320, the program is transmitted to the processor 320 through the bus 330, and when being executed by the processor 320, the program can implement the steps in the pending file pre-review method based on oclint as given in the above embodiments;
the memory 310 includes at least one type of readable storage medium, and the readable storage medium includes a flash memory, a hard disk, a multimedia card, a card type memory (e.g., SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, and the like. The memory 310 may be an internal storage unit of the smart terminal 300, such as a hard disk of the smart terminal 300, in some embodiments. The memory 310 may also be an external storage device of the Smart terminal 300 in other embodiments, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, provided on the Smart terminal 300. Further, the memory 310 may also be simultaneously composed of an internal storage unit and an external storage device. Further, the memory 310 may be used not only to store various application software and various types of data installed in the smart terminal 300, but also to temporarily store data that has been output or will be output.
Processor 320, which in some embodiments may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor, or other data Processing chip, executes program code or processes data stored in memory 310, such as an Android App boot program.
The bus 330 may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one bi-directional hollow indicator line is shown in FIG. 8, but does not indicate only one bus or one type of bus.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, a division of a unit is merely a logical division, and an actual implementation may have another division, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
Units described as separate parts may or may not be physically separate, and parts displayed 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 can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method provided in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
It should be noted that the above-mentioned numbers of the embodiments of the present invention are merely for description, and do not represent the merits of the embodiments. And the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, apparatus, article, or method. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, apparatus, article, or method that includes the element.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. A pre-review method for files to be submitted based on oclint is characterized by comprising the following steps:
downloading and compiling an oclint source code to obtain an oclint execution tool;
calling the oclinet execution tool to generate an xcodeprox project;
importing the xcodeprox item into xcode to generate a cpp file;
adding predefined rule data to the cpp file, and compiling to obtain a dynamic library file of dylib; the rule data is logic judgment data generated by calling a derived class according to a prequalification rule;
and calling an execution inlet of the oclint, carrying out logic judgment on the file to be submitted according to the dylib dynamic library file, and generating a pre-review report.
2. The oclint-based document pre-review method for files to be submitted according to claim 1, further comprising: and sending the pre-review report to sonarqube for integrated display.
3. The oclint-based document pre-review method for files to be submitted according to claim 1, further comprising:
screening out file data which do not accord with the rule data according to the pre-review report, and generating warning information according to the file data;
and carrying out warning reminding according to the warning information.
4. The oclint-based document pre-review method for files to be submitted according to claim 3, wherein the warning reminding according to the warning information comprises:
setting a warning grade for the warning information;
and carrying out warning reminding according to the preset reminding modes corresponding to the levels.
5. The oclint-based document pre-review method for files to be submitted according to claim 3, wherein the warning reminding according to the warning information comprises:
and calling a pre-accessed mail system and/or a nailing robot system to output the warning information.
6. The oclint-based document pre-review method for files to be submitted according to claim 1, further comprising:
exporting the cpp file;
adding and/or deleting rules to the cpp file by using the rule data of the new version to obtain a corrected cpp file;
compiling the modified cpp file to generate a modified dylib dynamic library file so as to perform logic judgment on the file to be submitted according to the modified dylib dynamic library file.
7. A pending file prequalification device based on oclint, comprising:
the source code compiling unit is used for downloading and compiling the oclint source code to obtain an oclint execution tool;
the project generating unit is used for calling the oclint executing tool to generate an xcodeprox project;
the item import unit is used for importing the xcodeprox item into the xcode to generate a cpp file;
a rule adding unit, configured to add predefined rule data to the cpp file, and compile the cpp file to obtain a dynamic library file of dylib; the rule data is logic judgment data generated by calling a derived class according to a prequalification rule;
and the logic judgment unit is used for calling an execution inlet of the oclint, carrying out logic judgment on the file to be submitted according to the dylib dynamic library file and generating a pre-review report.
8. The oclint-based document pre-review device for files to be submitted according to claim 7, wherein the oclint-based document pre-review device for files to be submitted specifically comprises: a gitlab of jenkins can be called, wherein scripts are deployed on the jenkins, and when executed, the steps of the oclin-based document to be submitted prequalification method according to any one of claims 1 to 7 are realized.
9. An intelligent terminal, comprising: a memory, a processor, and a bus;
wherein the memory is used for storing programs;
the processor is configured to implement the steps of the oclinet-based document pre-review method according to any one of claims 1 to 6 when executing the program.
10. A readable storage medium, wherein a program is stored on the readable storage medium, and when the program is executed by a processor, the program implements the steps of the oclint-based document pre-review method according to any of claims 1 to 6.
CN201911214989.5A 2019-12-02 2019-12-02 Oclin-based pre-review method for files to be submitted and related components Active CN111008017B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911214989.5A CN111008017B (en) 2019-12-02 2019-12-02 Oclin-based pre-review method for files to be submitted and related components

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911214989.5A CN111008017B (en) 2019-12-02 2019-12-02 Oclin-based pre-review method for files to be submitted and related components

Publications (2)

Publication Number Publication Date
CN111008017A true CN111008017A (en) 2020-04-14
CN111008017B CN111008017B (en) 2024-04-09

Family

ID=70113860

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911214989.5A Active CN111008017B (en) 2019-12-02 2019-12-02 Oclin-based pre-review method for files to be submitted and related components

Country Status (1)

Country Link
CN (1) CN111008017B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111610999A (en) * 2020-05-26 2020-09-01 北京字节跳动网络技术有限公司 Checking method, checking device, computer equipment and storage medium
CN112256272A (en) * 2020-10-19 2021-01-22 四川长虹电器股份有限公司 Method, system, computer device and storage medium for detecting source code quality
CN113312617A (en) * 2021-05-24 2021-08-27 南京大学 Code security oriented submission priority ordering method and system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109445836A (en) * 2018-09-03 2019-03-08 平安普惠企业管理有限公司 A kind of management method of sound code file, server and computer readable storage medium
CN109739507A (en) * 2018-12-28 2019-05-10 睿驰达新能源汽车科技(北京)有限公司 A kind of code continuous integrating method and code continue delivery method
CN110297656A (en) * 2019-05-23 2019-10-01 重庆金融资产交易所有限责任公司 Method, apparatus and computer equipment based on allocation models evaluation code

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109445836A (en) * 2018-09-03 2019-03-08 平安普惠企业管理有限公司 A kind of management method of sound code file, server and computer readable storage medium
CN109739507A (en) * 2018-12-28 2019-05-10 睿驰达新能源汽车科技(北京)有限公司 A kind of code continuous integrating method and code continue delivery method
CN110297656A (en) * 2019-05-23 2019-10-01 重庆金融资产交易所有限责任公司 Method, apparatus and computer equipment based on allocation models evaluation code

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
LARRY: "iOS预审总被拒?腾讯教你提升iOS审核通过率!", pages 1 - 4 *
ZLAYNE: "OCLint+Xcode实现Code Review", pages 1 - 4 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111610999A (en) * 2020-05-26 2020-09-01 北京字节跳动网络技术有限公司 Checking method, checking device, computer equipment and storage medium
CN112256272A (en) * 2020-10-19 2021-01-22 四川长虹电器股份有限公司 Method, system, computer device and storage medium for detecting source code quality
CN112256272B (en) * 2020-10-19 2022-04-05 四川长虹电器股份有限公司 Method, system, computer device and storage medium for detecting source code quality
CN113312617A (en) * 2021-05-24 2021-08-27 南京大学 Code security oriented submission priority ordering method and system
CN113312617B (en) * 2021-05-24 2023-11-03 南京大学 Code security-oriented submission priority ordering method and system

Also Published As

Publication number Publication date
CN111008017B (en) 2024-04-09

Similar Documents

Publication Publication Date Title
US5617533A (en) System and method for determining whether a software package conforms to packaging rules and requirements
US8005803B2 (en) Best practices analyzer
US7069474B2 (en) System and method for assessing compatibility risk
US11036491B1 (en) Identifying and resolving firmware component dependencies
CN107451474B (en) Software bug fixing method and device for terminal
CN111008017A (en) Oclint-based file to be submitted prequalification method and related components
US11599654B2 (en) Method and apparatus for authority control, computer device and storage medium
US9965257B2 (en) Automatic configuration of project system from project capabilities
CN109446753A (en) Detect method, apparatus, computer equipment and the storage medium of pirate application program
US8661414B2 (en) Method and system for testing an order management system
CN111367531B (en) Code processing method and device
CN114327390A (en) Micro-service generation method and device based on scaffold
CN106708897B (en) Data warehouse quality guarantee method, device and system
CN108595656B (en) Data processing method and system
CN111352631B (en) Interface compatibility detection method and device
CN113238739A (en) Plug-in development and data acquisition method, device, electronic equipment and medium
CN111258562A (en) Java code quality inspection method, device, equipment and storage medium
CN110826074A (en) Application vulnerability detection method and device and computer readable storage medium
CN115525561A (en) Protocol interface testing method, device, terminal equipment and storage medium
CN110765003B (en) Code detection method, device and equipment and storage medium
CN111027073B (en) Vulnerability detection method, device, equipment and storage medium
CN113886239A (en) Method and device for checking Maven dependence
CN109828752B (en) Project code automatic generation method, device, computer equipment and storage medium
CN113778451A (en) File loading method and device, computer system and computer readable storage medium
CN111399842A (en) Code compiling method and device

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
GR01 Patent grant
GR01 Patent grant