CN112925564B - Method and device for cleaning redundant import class of source code - Google Patents

Method and device for cleaning redundant import class of source code Download PDF

Info

Publication number
CN112925564B
CN112925564B CN202110342299.9A CN202110342299A CN112925564B CN 112925564 B CN112925564 B CN 112925564B CN 202110342299 A CN202110342299 A CN 202110342299A CN 112925564 B CN112925564 B CN 112925564B
Authority
CN
China
Prior art keywords
class
import
nodes
node
syntax tree
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.)
Active
Application number
CN202110342299.9A
Other languages
Chinese (zh)
Other versions
CN112925564A (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.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
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 Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202110342299.9A priority Critical patent/CN112925564B/en
Publication of CN112925564A publication Critical patent/CN112925564A/en
Application granted granted Critical
Publication of CN112925564B publication Critical patent/CN112925564B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/75Structural analysis for program understanding

Abstract

The embodiment of the application provides a method and a device for cleaning a redundant import class of a source code, which can be used in the technical field of information security, and the method comprises the following steps: dividing all nodes on the abstract syntax tree into import class nodes and non-import class nodes according to a preset abstract syntax tree; determining redundant import class nodes according to the reference relation between the non-import class nodes and the import class nodes; in the abstract syntax tree, all non-redundant import class nodes are placed before the non-import class nodes, and an updated abstract syntax tree is generated; and correspondingly generating cleaned source codes according to the updated abstract syntax tree. The method and the device obviously improve the working efficiency of the developer in reconstructing the stock code, greatly reduce the workload of the developer, ensure that the developer does not need to consider deleting redundant code to import deleting logic and checking logic when reconstructing the stock code, and provide technical support for reducing application technical liabilities.

Description

Method and device for cleaning redundant import class of source code
Technical Field
The application relates to the technical field of computers, in particular to a method and a device for cleaning redundant import classes of source codes.
Background
With the development of internet technology and financial science and technology, the project iteration speed is faster and faster, but the practically unnecessary classes are introduced in the development process caused by the problems of uneven level of developers, history carry-over and the like, so that a large amount of open source jar package dependence is caused, the project engineering is heavy and the like, and the application volume is especially heavy under the application scenes such as application clouds and the like. And from the single class, the development tool participates in identifying whether the single class has import, the fact that how many classes exist in the current class is superfluous import needs to be identified, unnecessary codes need to be cleaned after manual screening, deleting and modifying, and the whole project and a plurality of projects are traversed manually, so that the reconstruction of the stock codes is realized. In case of stock projects of millions of lines on a scale or the occurrence of multiple sub-projects, which need to be reconstructed, there is no difference for developers, which is a huge technical liability, and an automatic method capable of automatically cleaning up code import classes is needed.
Disclosure of Invention
Aiming at the problems in the prior art, the application provides a method and a device for cleaning a redundant import class of source codes, wherein the method comprises the following steps: dividing all nodes on the abstract syntax tree into import class nodes and non-import class nodes according to a preset abstract syntax tree; determining redundant import class nodes according to the reference relation between the non-import class nodes and the import class nodes; in the abstract syntax tree, all non-redundant import class nodes are placed before the non-import class nodes, and an updated abstract syntax tree is generated; and correspondingly generating cleaned source codes according to the updated abstract syntax tree. The method and the device obviously improve the working efficiency of the developer in reconstructing the stock code, greatly reduce the workload of the developer, ensure that the developer does not need to consider deleting redundant code to import deleting logic and checking logic when reconstructing the stock code, and provide technical support for reducing application technical liabilities.
In one aspect of the present invention, a method for cleaning a redundant import class of source code is provided, including:
dividing all nodes on the abstract syntax tree into import class nodes and non-import class nodes according to a preset abstract syntax tree;
determining redundant import class nodes according to the reference relation between the non-import class nodes and the import class nodes;
in the abstract syntax tree, all non-redundant import class nodes are placed before the non-import class nodes, and an updated abstract syntax tree is generated;
and correspondingly generating cleaned source codes according to the updated abstract syntax tree.
In a preferred embodiment, further comprising: the abstract syntax tree is generated.
In a preferred embodiment, according to a preset abstract syntax tree, dividing all nodes on the abstract syntax tree into import class nodes and non-import class nodes, including:
traversing the abstract syntax tree, and marking each node on the abstract syntax tree as one of an import class node and a non-import class node.
In a preferred embodiment, further comprising:
all the imported class nodes are classified into an imported class set, and all the non-imported class nodes are classified into a non-imported set;
Rejecting redundant import class nodes in the import class set;
the step of placing all non-redundant import class nodes before the non-import class nodes comprises the following steps:
and placing the import class set after redundancy elimination in the head of the non-import class set.
In a preferred embodiment, the determining the redundant import class node according to the reference relation between the non-import class node and the import class node includes:
if one import class node is not referenced by the non-import class node, the import class node is determined to be a redundant import class node.
In a preferred embodiment, the generating cleaned source code according to the updated abstract syntax tree includes:
traversing the updated abstract syntax tree to obtain all nodes;
source code is generated from all nodes.
In a preferred embodiment, the abstract syntax tree comprises a class root node, a packet name node, an external class node, and a class body node; the generating source code according to all nodes comprises: and outputting the class root node, the packet name node, the external class node and the class main body node to the character stream according to the class, and generating the source code.
In a preferred embodiment, further comprising: and covering the cleaned source codes under the appointed directory.
In still another aspect of the present invention, there is provided a redundant import class cleaning apparatus for source code, including:
the node dividing module divides all nodes on the abstract syntax tree into an import class node and a non-import class node according to a preset abstract syntax tree;
the redundant node determining module is used for determining redundant imported class nodes according to the reference relation between the non-imported class nodes and the imported class nodes;
the abstract syntax tree updating module is used for generating an updated abstract syntax tree before all non-redundant import class nodes are placed in the abstract syntax tree;
and the source code updating module correspondingly generates cleaned source codes according to the updated abstract syntax tree.
In a preferred embodiment, further comprising: and the abstract syntax tree generating module is used for generating the abstract syntax tree.
In a preferred embodiment, according to a preset abstract syntax tree, dividing all nodes on the abstract syntax tree into import class nodes and non-import class nodes, including:
traversing the abstract syntax tree, and marking each node on the abstract syntax tree as one of an import class node and a non-import class node.
In a preferred embodiment, further comprising:
The set generation module is used for classifying all the imported class nodes into an imported class set and classifying all the non-imported class nodes into a non-imported set;
the redundant class eliminating module eliminates redundant import class nodes in the import class set;
an abstract syntax tree reconstruction module, wherein the step of placing all non-redundant import class nodes before the non-import class nodes comprises the steps of:
and placing the import class set after redundancy elimination in the head of the non-import class set.
In a preferred embodiment, the determining the redundant import class node according to the reference relation between the non-import class node and the import class node includes:
if one import class node is not referenced by the non-import class node, the import class node is determined to be a redundant import class node.
In a preferred embodiment, the generating cleaned source code according to the updated abstract syntax tree includes:
the node acquisition unit traverses the updated abstract syntax tree to obtain all nodes;
and the source code generating unit generates source codes according to all the nodes.
In a preferred embodiment, the abstract syntax tree comprises a class root node, a packet name node, an external class node, and a class body node; the generating source code according to all nodes comprises: and outputting the class root node, the packet name node, the external class node and the class main body node to the character stream according to the class, and generating the source code.
In a preferred embodiment, further comprising: and covering the cleaned source codes under the appointed directory.
In yet another aspect of the present invention, an electronic device is provided, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements the method for cleaning a redundant import class of source code when the program is executed.
In yet another aspect of the present invention, a computer readable storage medium is provided, on which a computer program is stored, which when executed by a processor implements the method of redundant import class cleaning of source code.
According to the technical scheme, the method for cleaning the redundant import class of the source code comprises the following steps: dividing all nodes on the abstract syntax tree into import class nodes and non-import class nodes according to a preset abstract syntax tree; determining redundant import class nodes according to the reference relation between the non-import class nodes and the import class nodes; in the abstract syntax tree, all non-redundant import class nodes are placed before the non-import class nodes, and an updated abstract syntax tree is generated; and correspondingly generating cleaned source codes according to the updated abstract syntax tree. The method and the device obviously improve the working efficiency of the developer in reconstructing the stock code, greatly reduce the workload of the developer, ensure that the developer does not need to consider deleting redundant code to import deleting logic and checking logic when reconstructing the stock code, and provide technical support for reducing application technical liabilities.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, and it is obvious that the drawings in the following description are some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow diagram of a method for cleaning up redundant import classes of source code.
FIG. 2 is a flow diagram of a reconstruction of an abstract syntax tree using a set of nodes.
FIG. 3 is a schematic diagram of a process flow for reconstructing source code from an abstract syntax tree.
FIG. 4 is a schematic diagram of a redundant import class cleaning device architecture for source code.
Fig. 5 is a schematic structural diagram of an electronic device in an embodiment of the present application.
Detailed Description
For the purposes of making the objects, technical solutions and advantages of the embodiments of the present application more clear, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application.
It should be noted that the method and the device for cleaning the redundant import class of the source code disclosed in the present application may be used in the technical field of information security, and may also be used in any field other than the technical field of information security, and the application field of the method and the device for cleaning the redundant import class of the source code disclosed in the present application is not limited.
With the development of internet technology and financial science and technology, the project iteration speed is faster and faster, but the practically unnecessary classes are introduced in the development process caused by the problems of uneven level of developers, history carry-over and the like, so that a large amount of open source jar package dependence is caused, the project engineering is heavy and the like, and the application volume is especially heavy under the application scenes such as application clouds and the like.
And from the single class, the development tool participates in identifying whether the single class has import, the fact that how many classes exist in the current class is superfluous import needs to be identified, unnecessary codes need to be cleaned after manual screening, deleting and modifying, and the whole project and a plurality of projects are traversed manually, so that the reconstruction of the stock codes is realized.
In case of stock projects of millions of lines on a scale or the occurrence of multiple sub-projects, which need to be reconstructed, there is no difference for developers, which is a huge technical liability, and an automatic method capable of automatically cleaning up code import classes is needed.
Aiming at least one of the existing problems, the application provides a method and a device for cleaning a redundant import class of source codes, wherein the method comprises the following steps: dividing all nodes on the abstract syntax tree into import class nodes and non-import class nodes according to a preset abstract syntax tree; determining redundant import class nodes according to the reference relation between the non-import class nodes and the import class nodes; in the abstract syntax tree, all non-redundant import class nodes are placed before the non-import class nodes, and an updated abstract syntax tree is generated; and correspondingly generating cleaned source codes according to the updated abstract syntax tree. The method and the device obviously improve the working efficiency of the developer in reconstructing the stock code, greatly reduce the workload of the developer, ensure that the developer does not need to consider deleting redundant code to import deleting logic and checking logic when reconstructing the stock code, and provide technical support for reducing application technical liabilities.
The method and the device for cleaning the redundant import class of the source code provided by the invention are described in detail below with reference to the accompanying drawings.
The application provides a source code redundancy import class cleaning method, as shown in fig. 1, comprising the following steps:
S1, dividing all nodes on an abstract syntax tree into an import class node and a non-import class node according to a preset abstract syntax tree;
specifically, in computer science, an abstract syntax tree is an abstract representation of the source code syntax structure. It represents the syntax structure of a programming language in the form of a tree, each node on the tree representing a structure in the source code. This is abstract in that the abstract syntax tree does not show every detail of the actual syntax appearance, for example nested brackets are implicit in the tree structure and are not presented in the form of nodes. The abstract syntax tree does not depend on the grammar of the source language, that is, the context used in the grammar analysis stage is free of grammar, because when grammar is written, equivalent conversion (elimination of left recursion, backtracking, ambiguity, etc.) is often performed on the grammar, so that some redundant components are introduced into grammar analysis, which adversely affects the subsequent stage and even causes confusion of the stage. Therefore, many compilers often independently construct parse trees to create a clear interface for the front-end and the back-end. It will be appreciated that an abstract syntax tree is generated by analysing the source code of a software item. Generally, source codes are scanned in a file stream form, all the source codes are formed into a code file stream, the code file stream is read as a text, and the file is used as a basic compiling unit for lexical analysis. In a specific embodiment process, the step of performing lexical analysis by taking the file as a basic compiling unit includes firstly reading a code file in a computer memory into a basic compiling unit object in a character form according to rows, then stopping reading the last row of the file, finishing reading the source code of the file, finishing preparation of the basic compiling unit object, and finishing rule verification on symbols and grammar keywords in the basic compiling unit based on programming language grammar rules through analyzing the object data of the basic compiling unit. And finally, analyzing the basic compiling unit data into a class root node, a packet name node, an external class node set and a class main body node set, and ending the lexical analysis. And marking that the lexical analysis is unsuccessful if the rule check is not completed. After the lexical analysis is completed, a basic compiling unit in the file stream set which is successfully analyzed by the lexical analysis is screened, and the basic compiling unit is output and imported into an empty grammar tree, so that an abstract grammar tree of a source code is generated. From the generation process of the abstract syntax tree, it can be understood that the abstract syntax tree includes a class root node, a packet name node, an external class node and a class main body node according to the structure of the source code.
In a specific embodiment, all nodes in the generated abstract syntax tree are traversed, if the node corresponds to an import external preset class function structure, the node is marked as an import class node, and if the node does not correspond to an import class function structure, the node is marked as a non-import class node. For example, a preset class function for matrix operation is predefined, the matrix operation class is directly imported into the source code, and the node importing the matrix operation class is an importing class node; for another example, a summation function, which has no import of an external preset class, marks the node corresponding to the summation function as a non-import class node. All nodes in the abstract syntax tree can be divided into two major classes, namely an import class node and a non-import class node by the method.
S2, determining redundant import class nodes according to the reference relation between the non-import class nodes and the import class nodes;
specifically, the present application aims to remove redundant external classes that are not functional in code, it can be understood that if an external import class is referenced by a non-import class, it is a valid import class for source code, while if an import class is not referenced by all non-import classes, it is a redundant external import class, it can be deleted, it has no effect on the logic of source code, and at the same time, the data size of source code can be reduced. The step of determining whether an import class node is a redundant node includes: if one import class node is not referenced by the non-import class node, the import class node is determined to be a redundant import class node. For example, for an import class node a, by traversing non-import class nodes, searching whether the import class node a is referenced, and assuming that the import class node a is referenced by a non-import class node b, the import class node a is a valid node and needs to be reserved; if the imported class node is found not to be referenced by any of the non-imported class nodes by traversing the non-imported class nodes, it is stated that the imported class node a is redundant to the logic of the source code and is a redundant imported class node.
S3, in the abstract syntax tree, all non-redundant import class nodes are placed in front of the non-import class nodes, and an updated abstract syntax tree is generated;
specifically, after the redundant import class is determined, all nodes in the entire abstract syntax tree are marked as three classes: redundant import class nodes, non-redundant import class nodes and non-import class nodes. Traversing all nodes of the whole abstract syntax tree, if the nodes are non-redundant import class nodes, placing the nodes at the front part of a set, and if the nodes are non-import classes, placing the nodes at the rear part of the set, thereby obtaining a set, wherein the set comprises all non-redundant import class nodes and non-import class nodes in the abstract syntax tree. It will be appreciated that the set is the result of the redundant import class nodes being deleted from the abstract syntax tree. For example, an abstract syntax tree includes 10 nodes { a.b, c, d, e, f, g, h, I, j } in total, wherein non-importation class nodes are a, c, d, h, j, non-redundant importation class nodes are b, I, and redundant importation class nodes are e, f, g. In this particular embodiment, 10 nodes of the abstract syntax tree are traversed, starting from node a, which is placed at the end of the newly created empty set, resulting in { a }, since a is a non-import class node. Traversing to node b, since node b has no non-redundant import class nodes, it is placed in the head of the set, resulting in { b, a }. Traversing to node c, since c is a non-import class node, put it at the end of the set to get { b, a, c }. Traversing to node d, since it is a node in a non-imported class, put it at the end of the set, get { b, a, c, d }. Traversing to the e-node, skipping, traversing to the f-node, and so on, since it is a redundant import class node. And finally obtaining a set { I, b, a, c, d, h, j }, namely the abstract syntax tree node set with redundant import class nodes removed. It can be found from the above process that, in order to reduce the cycle consumption caused by traversing the abstract syntax tree by performing two times of traversing all nodes of the abstract syntax tree, in another specific embodiment, after traversing the syntax tree for the first time, dividing all nodes of the abstract syntax tree into import class nodes and non-import class nodes, as shown in fig. 2, the following steps are performed:
S31, classifying all import class nodes into an import class set, and classifying all non-import class nodes into a non-import set;
specifically, assuming that an abstract syntax tree has 8 nodes { a.b, c, d, e, f, g, h }, all nodes are divided into imported class nodes a, c, d and non-imported class nodes b, e, f, g, h by a first traversal. All imported class nodes are classified into an imported class set to obtain { a, c, d }, and all non-imported class nodes are classified into a non-imported class set to obtain { b, e, f, g, h }.
S32, eliminating redundant import class nodes in the import class set;
specifically, in the above specific embodiment, according to the reference relation between the import class and the non-import class, if it is determined that the redundant import class node in the import class is d, d is rejected to obtain the set { a, c }, that is, the import class set after redundancy rejection.
S33, placing all non-redundant import class nodes in front of the non-import class nodes, wherein the method comprises the following steps:
and placing the import class set after redundancy elimination in the head of the non-import class set.
Specifically, in the above specific embodiment, the import class set after redundancy elimination is placed at the head of the non-import class set, that is { a, c } is placed at the head of { b, e, f, g, h } to obtain { a, c, b, e, f, g, h }, so that an abstract syntax tree node set with redundancy removed import class nodes is also obtained. In the concrete embodiment, the abstract syntax tree is traversed only once, so that the consumption is reduced.
And S4, correspondingly generating cleaned source codes according to the updated abstract syntax tree.
Specifically, the step of generating the cleaned source code according to the abstract syntax tree includes:
s41, traversing the updated abstract syntax tree to obtain all nodes;
specifically, all nodes in the updated abstract syntax tree include a class root node, a packet name node, an external class node, and a class body node.
And S42, generating source codes according to all the nodes.
Specifically, after all the nodes of the updated abstract syntax tree are obtained, outputting all the nodes into a character stream according to the types of the nodes, compiling the output character stream according to units by using a corresponding compiler of the source code, and finally generating a source code text. For example, for JavaScript source code, the library may be used to generate node character streams for abstract syntax trees.
After the source code text is generated, the read code export configuration rule configures the designated directory, i.e., selects whether to overwrite and export to the new directory. And reading the generated cleaned source code text into a file stream and writing the file stream into a hard disk designated directory.
The present application is further described in connection with one particular implementation scenario.
The source code of an existing JavaScript item needs to clean up the import class in which redundancy exists. In the field of grammar parsing of JavaScript, one popular open source item is Esprima, which uses this tool to accomplish tasks. Furthermore, a JS code that can run on the command line needs to be built by means of the Node. First a basic directory structure of items is created and the NPM is initialized. Resolving the code by Esprima is very simple, as long as one method is used: var ast = esprima. The esprima. Parameter () method receives two types of parameters: a string or Buffer object of a Node, which may also receive additional options as parameters. The result returned after parsing is an Abstract Syntax Tree (AST) that complies with the API of the parser of Mozilla SpiderMonkey. By observing the generated grammar tree, each node can be found to have a type, and the type of the root node is a Program. type is also common to all nodes, other attributes depending on the type of the node.
After the abstract syntax tree of the code is obtained, traversing the abstract syntax tree, and marking the imported class node and the non-imported class node by traversing the nodes by means of Estraverse. Two l objects are created to store the import class node and the non-import class node, respectively, wherein the object storing the import class node is named as an Inversion, and the object storing the non-import class node is named as a non-Inversion.
After dividing all nodes into an import class node and a non-import class node, traversing the nodes with types in the non-import class node as declaration classes, judging whether the called classes exist in an import class node object set if the nodes relate to the calling of other classes, and marking the import class node as effective nodes if the called classes exist, namely adding an attribute value effect with a true value as effective nodes and a false value as redundant nodes into the nodes. After the traversal of the non-importation class node is completed, an object inverse effect is created to store all nodes with attribute value effect being true in the import class node. Then, the abstract syntax tree is reconstructed, and the object cross effect and the object non-cross are combined to form a new object newAST, wherein the head part of the new object newAST is a node of the object cross effect, and the tail part of the new object newAST is a node of the object non-cross. And finally, outputting all nodes in the object newAST as character streams according to types, compiling the character streams by using a transformation method in the babel, and generating a source code text.
And overlaying the generated cleaned source code into the catalog of the original source code so that the project can be rerun.
As can be seen from the above description, the method for cleaning the redundant import class of the source code provided by the present invention includes: dividing all nodes on the abstract syntax tree into import class nodes and non-import class nodes according to a preset abstract syntax tree; determining redundant import class nodes according to the reference relation between the non-import class nodes and the import class nodes; in the abstract syntax tree, all non-redundant import class nodes are placed before the non-import class nodes, and an updated abstract syntax tree is generated; and correspondingly generating cleaned source codes according to the updated abstract syntax tree. The method and the device obviously improve the working efficiency of the developer in reconstructing the stock code, greatly reduce the workload of the developer, ensure that the developer does not need to consider deleting redundant code to import deleting logic and checking logic when reconstructing the stock code, and provide technical support for reducing application technical liabilities.
From the software aspect, the application provides an embodiment of a source code redundancy import class cleaning device for executing all or part of the content in the source code redundancy import class cleaning method, referring to fig. 4, where the source code redundancy import class cleaning device specifically includes the following contents:
The node dividing module 1 divides all nodes on the abstract syntax tree into import class nodes and non-import class nodes according to a preset abstract syntax tree;
the redundant node determining module 2 determines redundant imported class nodes according to the reference relation between the non-imported class nodes and the imported class nodes;
an abstract syntax tree updating module 3, configured to generate an updated abstract syntax tree before all non-redundant import class nodes are placed in the abstract syntax tree;
and the source code updating module 4 correspondingly generates cleaned source codes according to the updated abstract syntax tree.
As can be seen from the above description, the device for cleaning the redundant import class of the source code provided by the present invention divides all nodes on an abstract syntax tree into an import class node and a non-import class node according to a preset abstract syntax tree; determining redundant import class nodes according to the reference relation between the non-import class nodes and the import class nodes; in the abstract syntax tree, all non-redundant import class nodes are placed before the non-import class nodes, and an updated abstract syntax tree is generated; and correspondingly generating cleaned source codes according to the updated abstract syntax tree. The method and the device obviously improve the working efficiency of the developer in reconstructing the stock code, greatly reduce the workload of the developer, ensure that the developer does not need to consider deleting redundant code to import deleting logic and checking logic when reconstructing the stock code, and provide technical support for reducing application technical liabilities.
In an embodiment of the present invention, a redundant import class cleaning device for source code is provided, and the method includes the following steps:
s1, dividing all nodes on an abstract syntax tree into an import class node and a non-import class node according to a preset abstract syntax tree;
specifically, in computer science, an abstract syntax tree is an abstract representation of the source code syntax structure. It represents the syntax structure of a programming language in the form of a tree, each node on the tree representing a structure in the source code. This is abstract in that the abstract syntax tree does not show every detail of the actual syntax appearance, for example nested brackets are implicit in the tree structure and are not presented in the form of nodes. The abstract syntax tree does not depend on the grammar of the source language, that is, the context used in the grammar analysis stage is free of grammar, because when grammar is written, equivalent conversion (elimination of left recursion, backtracking, ambiguity, etc.) is often performed on the grammar, so that some redundant components are introduced into grammar analysis, which adversely affects the subsequent stage and even causes confusion of the stage. Therefore, many compilers often independently construct parse trees to create a clear interface for the front-end and the back-end. It will be appreciated that an abstract syntax tree is generated by analysing the source code of a software item. Generally, source codes are scanned in a file stream form, all the source codes are formed into a code file stream, the code file stream is read as a text, and the file is used as a basic compiling unit for lexical analysis. In a specific embodiment process, the step of performing lexical analysis by taking the file as a basic compiling unit includes firstly reading a code file in a computer memory into a basic compiling unit object in a character form according to rows, then stopping reading the last row of the file, finishing reading the source code of the file, finishing preparation of the basic compiling unit object, and finishing rule verification on symbols and grammar keywords in the basic compiling unit based on programming language grammar rules through analyzing the object data of the basic compiling unit. And finally, analyzing the basic compiling unit data into a class root node, a packet name node, an external class node set and a class main body node set, and ending the lexical analysis. And marking that the lexical analysis is unsuccessful if the rule check is not completed. After the lexical analysis is completed, a basic compiling unit in the file stream set which is successfully analyzed by the lexical analysis is screened, and the basic compiling unit is output and imported into an empty grammar tree, so that an abstract grammar tree of a source code is generated. From the generation process of the abstract syntax tree, it can be understood that the abstract syntax tree includes a class root node, a packet name node, an external class node and a class main body node according to the structure of the source code.
In a specific embodiment, all nodes in the generated abstract syntax tree are traversed, if the node corresponds to an import external preset class function structure, the node is marked as an import class node, and if the node does not correspond to an import class function structure, the node is marked as a non-import class node. For example, a preset class function for matrix operation is predefined, the matrix operation class is directly imported into the source code, and the node importing the matrix operation class is an importing class node; for another example, a summation function, which has no import of an external preset class, marks the node corresponding to the summation function as a non-import class node. All nodes in the abstract syntax tree can be divided into two major classes, namely an import class node and a non-import class node by the method.
S2, determining redundant import class nodes according to the reference relation between the non-import class nodes and the import class nodes;
specifically, the present application aims to remove redundant external classes that are not functional in code, it can be understood that if an external import class is referenced by a non-import class, it is a valid import class for source code, while if an import class is not referenced by all non-import classes, it is a redundant external import class, it can be deleted, it has no effect on the logic of source code, and at the same time, the data size of source code can be reduced. The step of determining whether an import class node is a redundant node includes: if one import class node is not referenced by the non-import class node, the import class node is determined to be a redundant import class node. For example, for an import class node a, by traversing non-import class nodes, searching whether the import class node a is referenced, and assuming that the import class node a is referenced by a non-import class node b, the import class node a is a valid node and needs to be reserved; if the imported class node is found not to be referenced by any of the non-imported class nodes by traversing the non-imported class nodes, it is stated that the imported class node a is redundant to the logic of the source code and is a redundant imported class node.
S3, in the abstract syntax tree, all non-redundant import class nodes are placed in front of the non-import class nodes, and an updated abstract syntax tree is generated;
specifically, after the redundant import class is determined, all nodes in the entire abstract syntax tree are marked as three classes: redundant import class nodes, non-redundant import class nodes and non-import class nodes. Traversing all nodes of the whole abstract syntax tree, if the nodes are non-redundant import class nodes, placing the nodes at the front part of a set, and if the nodes are non-import classes, placing the nodes at the rear part of the set, thereby obtaining a set, wherein the set comprises all non-redundant import class nodes and non-import class nodes in the abstract syntax tree. It will be appreciated that the set is the result of the redundant import class nodes being deleted from the abstract syntax tree. For example, an abstract syntax tree includes 10 nodes { a.b, c, d, e, f, g, h, I, j } in total, wherein non-importation class nodes are a, c, d, h, j, non-redundant importation class nodes are b, I, and redundant importation class nodes are e, f, g. In this particular embodiment, 10 nodes of the abstract syntax tree are traversed, starting from node a, which is placed at the end of the newly created empty set, resulting in { a }, since a is a non-import class node. Traversing to node b, since node b has no non-redundant import class nodes, it is placed in the head of the set, resulting in { b, a }. Traversing to node c, since c is a non-import class node, put it at the end of the set to get { b, a, c }. Traversing to node d, since it is a node in a non-imported class, put it at the end of the set, get { b, a, c, d }. Traversing to the e-node, skipping, traversing to the f-node, and so on, since it is a redundant import class node. And finally obtaining a set { I, b, a, c, d, h, j }, namely the abstract syntax tree node set with redundant import class nodes removed. It can be found from the above process that, in order to reduce the cycle consumption caused by traversing, in another specific embodiment, after traversing the syntax tree for the first time, dividing all the nodes of the abstract syntax tree into import class nodes and non-import class nodes, the following steps are performed:
S31, classifying all import class nodes into an import class set, and classifying all non-import class nodes into a non-import set;
specifically, assuming that an abstract syntax tree has 8 nodes { a.b, c, d, e, f, g, h }, all nodes are divided into imported class nodes a, c, d and non-imported class nodes b, e, f, g, h by a first traversal. All imported class nodes are classified into an imported class set to obtain { a, c, d }, and all non-imported class nodes are classified into a non-imported class set to obtain { b, e, f, g, h }.
S32, eliminating redundant import class nodes in the import class set;
specifically, in the above specific embodiment, according to the reference relation between the import class and the non-import class, if it is determined that the redundant import class node in the import class is d, d is rejected to obtain the set { a, c }, that is, the import class set after redundancy rejection.
S33, placing all non-redundant import class nodes in front of the non-import class nodes, wherein the method comprises the following steps:
and placing the import class set after redundancy elimination in the head of the non-import class set.
Specifically, in the above specific embodiment, the import class set after redundancy elimination is placed at the head of the non-import class set, that is { a, c } is placed at the head of { b, e, f, g, h } to obtain { a, c, b, e, f, g, h }, so that an abstract syntax tree node set with redundancy removed import class nodes is also obtained. In the concrete embodiment, the abstract syntax tree is traversed only once, so that the consumption is reduced.
And S4, correspondingly generating cleaned source codes according to the updated abstract syntax tree.
Specifically, the reconstructed abstract syntax tree needs to correspondingly generate source codes with redundant import classes cleaned, and the cleaned source codes, namely a source code updating module, are generated according to the abstract syntax tree and used for executing the following steps:
s41, traversing the updated abstract syntax tree to obtain all nodes;
specifically, all nodes in the updated abstract syntax tree include a class root node, a packet name node, an external class node, and a class body node.
And S42, generating source codes according to all the nodes.
Specifically, after all the nodes of the updated abstract syntax tree are obtained, outputting all the nodes into a character stream according to the types of the nodes, compiling the output character stream according to units by using a corresponding compiler of the source code, and finally generating a source code text. For example, for JavaScript source code, the library may be used to generate node character streams for abstract syntax trees.
After the source code text is generated, the read code export configuration rule configures the designated directory, i.e., selects whether to overwrite and export to the new directory. And reading the generated cleaned source code text into a file stream and writing the file stream into a hard disk designated directory.
The present application is further described in connection with one particular implementation scenario.
The source code of an existing JavaScript item needs to clean up the import class in which redundancy exists. In the field of grammar parsing of JavaScript, one popular open source item is Esprima, which uses this tool to accomplish tasks. Furthermore, a JS code that can run on the command line needs to be built by means of the Node. First a basic directory structure of items is created and the NPM is initialized. Resolving the code by Esprima is very simple, as long as one method is used: var ast = esprima. The esprima. Parameter () method receives two types of parameters: a string or Buffer object of a Node, which may also receive additional options as parameters. The result returned after parsing is an Abstract Syntax Tree (AST) that complies with the API of the parser of Mozilla SpiderMonkey. By observing the generated grammar tree, each node can be found to have a type, and the type of the root node is a Program. type is also common to all nodes, other attributes depending on the type of the node.
After the abstract syntax tree of the code is obtained, traversing the abstract syntax tree, and marking the imported class node and the non-imported class node by traversing the nodes by means of Estraverse. Two l objects are created to store the import class node and the non-import class node, respectively, wherein the object storing the import class node is named as an Inversion, and the object storing the non-import class node is named as a non-Inversion.
After dividing all nodes into an import class node and a non-import class node, traversing the nodes with types in the non-import class node as declaration classes, judging whether the called classes exist in an import class node object set if the nodes relate to the calling of other classes, and marking the import class node as effective nodes if the called classes exist, namely adding an attribute value effect with a true value as effective nodes and a false value as redundant nodes into the nodes. After the traversal of the non-importation class node is completed, an object inverse effect is created to store all nodes with attribute value effect being true in the import class node. Then, the abstract syntax tree is reconstructed, and the object cross effect and the object non-cross are combined to form a new object newAST, wherein the head part of the new object newAST is a node of the object cross effect, and the tail part of the new object newAST is a node of the object non-cross. And finally, outputting all nodes in the object newAST as character streams according to types, compiling the character streams by using a transformation method in the babel, and generating a source code text.
And overlaying the generated cleaned source code into the catalog of the original source code so that the project can be rerun.
As can be seen from the above description, the device for cleaning the redundant import class of the source code provided by the present invention divides all nodes on an abstract syntax tree into an import class node and a non-import class node according to a preset abstract syntax tree; determining redundant import class nodes according to the reference relation between the non-import class nodes and the import class nodes; in the abstract syntax tree, all non-redundant import class nodes are placed before the non-import class nodes, and an updated abstract syntax tree is generated; and correspondingly generating cleaned source codes according to the updated abstract syntax tree. The method and the device obviously improve the working efficiency of the developer in reconstructing the stock code, greatly reduce the workload of the developer, ensure that the developer does not need to consider deleting redundant code to import deleting logic and checking logic when reconstructing the stock code, and provide technical support for reducing application technical liabilities.
From the aspect of hardware, the application provides an embodiment of an electronic device for implementing all or part of contents in a method for cleaning a redundant import class of source code, where the electronic device specifically includes the following contents:
fig. 5 is a schematic block diagram of a system configuration of an electronic device 9600 of an embodiment of the present application. As shown in fig. 5, the electronic device 9600 may include a central processor 9100 and a memory 9140; the memory 9140 is coupled to the central processor 9100. Notably, this fig. 5 is exemplary; other types of structures may also be used in addition to or in place of the structures to implement telecommunications functions or other functions.
In one embodiment, the redundant import class cleaning function of the source code may be integrated into the central processor.
Wherein the central processor may be configured to control:
s1, dividing all nodes on an abstract syntax tree into an import class node and a non-import class node according to a preset abstract syntax tree;
s2, determining redundant import class nodes according to the reference relation between the non-import class nodes and the import class nodes;
s3, in the abstract syntax tree, all non-redundant import class nodes are placed in front of the non-import class nodes, and an updated abstract syntax tree is generated;
and S4, correspondingly generating cleaned source codes according to the updated abstract syntax tree.
From the above description, the electronic device provided in the embodiment of the present application obviously improves the working efficiency of the developer in reconstructing the stock code, and greatly reduces the workload of the developer, so that the developer does not need to consider deleting the redundant code to import the deletion logic and the inspection logic when reconstructing the stock code, and provides technical support for reducing the application technology liabilities.
In another embodiment, the source code redundant import class cleaning device may be configured separately from the cpu 9100, for example, the source code redundant import class cleaning device may be configured as a chip connected to the cpu 9100, and the source code redundant import class cleaning function is implemented under the control of the cpu.
As shown in fig. 5, the electronic device 9600 may further include: a communication module 9110, an input unit 9120, an audio processor 9130, a display 9160, and a power supply 9170. It is noted that the electronic device 9600 need not include all of the components shown in fig. 5; in addition, the electronic device 9600 may further include components not shown in fig. 5, and reference may be made to the related art.
As shown in fig. 5, the central processor 9100, sometimes referred to as a controller or operational control, may include a microprocessor or other processor device and/or logic device, which central processor 9100 receives inputs and controls the operation of the various components of the electronic device 9600.
The memory 9140 may be, for example, one or more of a buffer, a flash memory, a hard drive, a removable media, a volatile memory, a non-volatile memory, or other suitable device. The information about failure may be stored, and a program for executing the information may be stored. And the central processor 9100 can execute the program stored in the memory 9140 to realize information storage or processing, and the like.
The input unit 9120 provides input to the central processor 9100. The input unit 9120 is, for example, a key or a touch input device. The power supply 9170 is used to provide power to the electronic device 9600. The display 9160 is used for displaying display objects such as images and characters. The display may be, for example, but not limited to, an LCD display.
The memory 9140 may be a solid state memory such as Read Only Memory (ROM), random Access Memory (RAM), SIM card, etc. But also a memory which holds information even when powered down, can be selectively erased and provided with further data, an example of which is sometimes referred to as EPROM or the like. The memory 9140 may also be some other type of device. The memory 9140 includes a buffer memory 9141 (sometimes referred to as a buffer). The memory 9140 may include an application/function storage portion 9142, the application/function storage portion 9142 storing application programs and function programs or a flow for executing operations of the electronic device 9600 by the central processor 9100.
The memory 9140 may also include a data store 9143, the data store 9143 for storing data, such as contacts, digital data, pictures, sounds, and/or any other data used by an electronic device. The driver storage portion 9144 of the memory 9140 may include various drivers of the electronic device for communication functions and/or for performing other functions of the electronic device (e.g., messaging applications, address book applications, etc.).
The communication module 9110 is a transmitter/receiver 9110 that transmits and receives signals via an antenna 9111. A communication module (transmitter/receiver) 9110 is coupled to the central processor 9100 to provide input signals and receive output signals, as in the case of conventional mobile communication terminals.
Based on different communication technologies, a plurality of communication modules 9110, such as a cellular network module, a bluetooth module, and/or a wireless local area network module, etc., may be provided in the same electronic device. The communication module (transmitter/receiver) 9110 is also coupled to a speaker 9131 and a microphone 9132 via an audio processor 9130 to provide audio output via the speaker 9131 and to receive audio input from the microphone 9132 to implement usual telecommunications functions. The audio processor 9130 can include any suitable buffers, decoders, amplifiers and so forth. In addition, the audio processor 9130 is also coupled to the central processor 9100 so that sound can be recorded locally through the microphone 9132 and sound stored locally can be played through the speaker 9131.
The embodiments of the present application further provide a computer readable storage medium capable of implementing all the steps in the method for cleaning a redundant import class of source codes in the above embodiments, where the computer readable storage medium stores a computer program, and when the computer program is executed by a processor, the computer program implements all the steps in the method for cleaning a redundant import class of source codes in which an execution subject in the above embodiments is a server or a client, for example, the processor implements the following steps when executing the computer program:
S1, dividing all nodes on an abstract syntax tree into an import class node and a non-import class node according to a preset abstract syntax tree;
s2, determining redundant import class nodes according to the reference relation between the non-import class nodes and the import class nodes;
s3, in the abstract syntax tree, all non-redundant import class nodes are placed in front of the non-import class nodes, and an updated abstract syntax tree is generated;
and S4, correspondingly generating cleaned source codes according to the updated abstract syntax tree.
As can be seen from the above description, the computer readable storage medium provided in the embodiments of the present application obviously improves the working efficiency of the developer in reconstructing the stock code, and greatly reduces the workload of the developer, so that the developer does not need to consider deleting the redundant code to import the deletion logic and the inspection logic when reconstructing the stock code, and provides technical support for reducing the application technology liabilities.
It will be apparent to those skilled in the art that embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (devices), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The principles and embodiments of the present invention have been described in detail with reference to specific examples, which are provided to facilitate understanding of the method and core ideas of the present invention; meanwhile, as those skilled in the art will have variations in the specific embodiments and application scope in accordance with the ideas of the present invention, the present description should not be construed as limiting the present invention in view of the above.

Claims (14)

1. A method for cleaning a redundant import class of source code, comprising:
dividing all nodes on the abstract syntax tree into import class nodes and non-import class nodes according to a preset abstract syntax tree;
determining redundant import class nodes according to the reference relation between the non-import class nodes and the import class nodes;
In the abstract syntax tree, all non-redundant import class nodes are placed before the non-import class nodes, and an updated abstract syntax tree is generated;
correspondingly generating cleaned source codes according to the updated abstract syntax tree;
the method for cleaning the redundant import class of the source code further comprises the following steps:
classifying all import class nodes into an import class set, classifying all non-import class nodes into a non-import class set;
rejecting redundant import class nodes in the import class set;
the step of placing all non-redundant import class nodes before the non-import class nodes comprises the following steps:
placing the import class set after redundancy elimination at the head of the non-import class set;
the determining the redundant import class node according to the reference relation between the non-import class node and the import class node comprises the following steps:
if one import class node is not referenced by the non-import class node, the import class node is determined to be a redundant import class node.
2. The method of claim 1, further comprising: the abstract syntax tree is generated.
3. The method for cleaning up a redundant import class of source code according to claim 1, wherein dividing all nodes in a predetermined abstract syntax tree into import class nodes and non-import class nodes comprises:
Traversing the abstract syntax tree, and marking each node on the abstract syntax tree as one of an import class node and a non-import class node.
4. The method for cleaning up a redundant import class of source code according to claim 1, wherein generating cleaned up source code from the updated abstract syntax tree comprises:
traversing the updated abstract syntax tree to obtain all nodes;
source code is generated from all nodes.
5. The method of claim 4, wherein the abstract syntax tree comprises a class root node, a packet name node, an external class node, and a class body node; the generating source code according to all nodes comprises: and outputting the class root node, the packet name node, the external class node and the class main body node to the character stream according to the class, and generating the source code.
6. The method of claim 1, further comprising: and covering the cleaned source codes under the appointed directory.
7. A redundant import class cleaning apparatus for source code, comprising:
the node dividing module divides all nodes on the abstract syntax tree into an import class node and a non-import class node according to a preset abstract syntax tree;
The redundant node determining module is used for determining redundant imported class nodes according to the reference relation between the non-imported class nodes and the imported class nodes;
the abstract syntax tree updating module is used for generating an updated abstract syntax tree before all non-redundant import class nodes are placed in the abstract syntax tree;
the source code updating module correspondingly generates cleaned source codes according to the updated abstract syntax tree;
the redundant import class cleaning device of the source code further comprises:
the set generation module is used for classifying all the imported class nodes into an imported class set, and classifying all the non-imported class nodes into a non-imported class set;
the redundant class eliminating module eliminates redundant import class nodes in the import class set;
the abstract syntax tree reconstruction module is used for placing the import class set after redundancy elimination at the head of the non-import class set;
the determining the redundant import class node according to the reference relation between the non-import class node and the import class node comprises the following steps:
if one import class node is not referenced by the non-import class node, the import class node is determined to be a redundant import class node.
8. The redundant import class cleaning apparatus of claim 7, further comprising: and the abstract syntax tree generating module is used for generating the abstract syntax tree.
9. The apparatus according to claim 7, wherein the partitioning of all nodes in the abstract syntax tree into import class nodes and non-import class nodes according to a predetermined abstract syntax tree comprises:
traversing the abstract syntax tree, and marking each node on the abstract syntax tree as one of an import class node and a non-import class node.
10. The apparatus for cleaning redundant import class of source code of claim 7, wherein generating cleaned source code from the updated abstract syntax tree comprises:
the node acquisition unit traverses the updated abstract syntax tree to obtain all nodes;
and the source code generating unit generates source codes according to all the nodes.
11. The apparatus according to claim 10, wherein the abstract syntax tree comprises a class root node, a packet name node, an external class node, and a class body node; the generating source code according to all nodes comprises: and outputting the class root node, the packet name node, the external class node and the class main body node to the character stream according to the class, and generating the source code.
12. The redundant import class cleaning apparatus of claim 7, further comprising: and covering the cleaned source codes under the appointed directory.
13. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of cleaning the redundant import class of source code of any of claims 1 to 6 when the program is executed by the processor.
14. A computer readable storage medium having stored thereon a computer program, which when executed by a processor implements the method of redundant import class cleaning of source code of any of claims 1 to 6.
CN202110342299.9A 2021-03-30 2021-03-30 Method and device for cleaning redundant import class of source code Active CN112925564B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110342299.9A CN112925564B (en) 2021-03-30 2021-03-30 Method and device for cleaning redundant import class of source code

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110342299.9A CN112925564B (en) 2021-03-30 2021-03-30 Method and device for cleaning redundant import class of source code

Publications (2)

Publication Number Publication Date
CN112925564A CN112925564A (en) 2021-06-08
CN112925564B true CN112925564B (en) 2024-03-05

Family

ID=76176680

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110342299.9A Active CN112925564B (en) 2021-03-30 2021-03-30 Method and device for cleaning redundant import class of source code

Country Status (1)

Country Link
CN (1) CN112925564B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110007920A (en) * 2018-01-04 2019-07-12 阿里巴巴集团控股有限公司 A kind of method, apparatus and electronic equipment obtaining code dependence
CN110928550A (en) * 2019-11-19 2020-03-27 上海工程技术大学 Method for eliminating redundancy of GCC abstract syntax tree based on keyword Trie tree
CN111782265A (en) * 2020-06-28 2020-10-16 中国工商银行股份有限公司 Software resource system based on field level blood relationship and establishment method thereof

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110007920A (en) * 2018-01-04 2019-07-12 阿里巴巴集团控股有限公司 A kind of method, apparatus and electronic equipment obtaining code dependence
CN110928550A (en) * 2019-11-19 2020-03-27 上海工程技术大学 Method for eliminating redundancy of GCC abstract syntax tree based on keyword Trie tree
CN111782265A (en) * 2020-06-28 2020-10-16 中国工商银行股份有限公司 Software resource system based on field level blood relationship and establishment method thereof

Also Published As

Publication number Publication date
CN112925564A (en) 2021-06-08

Similar Documents

Publication Publication Date Title
AU2018272840B2 (en) Automated dependency analyzer for heterogeneously programmed data processing system
CN106775770B (en) Search method for constructing query statement based on class information
US10437574B2 (en) System and method for providing code completion features for code modules
US9524279B2 (en) Help document animated visualization
CN110502227B (en) Code complement method and device, storage medium and electronic equipment
CN112860264B (en) Method and device for reconstructing abstract syntax tree
CN108469955B (en) Annotation-based Android injection framework implementation method
US11573790B2 (en) Generation of knowledge graphs based on repositories of code
CN113468534B (en) Vulnerability detection method and related device for android application program
CN115904480B (en) Code reconstruction method, device, electronic equipment and storage medium
CN112925564B (en) Method and device for cleaning redundant import class of source code
CN115951890B (en) Method, system and device for transcoding between different front end frameworks
CN112970011A (en) Recording pedigrees in query optimization
US8825588B2 (en) Rule correlation to rules input attributes according to disparate distribution analysis
CN113419957A (en) Rule-based big data offline batch processing performance capacity scanning method and device
CN113762702A (en) Workflow deployment method, device, computer system and readable storage medium
CN112860265A (en) Method and device for detecting operation abnormity of source code database
CN109992293B (en) Method and device for assembling Android system component version information
Gabrijelčič Delphi High Performance: Build fast Delphi applications using concurrency, parallel programming and memory management
CN115543323B (en) Page development method and device
CN110334098A (en) A kind of database combining method and system based on script
CN111797636B (en) Offline semantic analysis method and system
CN116860227B (en) Data development system and method based on big data ETL script arrangement
US20180032929A1 (en) Risk-adaptive agile software development
CN117724702A (en) Component configuration generation method, device, computing equipment and computer storage medium

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