CN112965695A - Front-end code access detection method, device, equipment and storage medium - Google Patents

Front-end code access detection method, device, equipment and storage medium Download PDF

Info

Publication number
CN112965695A
CN112965695A CN202110270341.0A CN202110270341A CN112965695A CN 112965695 A CN112965695 A CN 112965695A CN 202110270341 A CN202110270341 A CN 202110270341A CN 112965695 A CN112965695 A CN 112965695A
Authority
CN
China
Prior art keywords
project
code
detection tool
code detection
access
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110270341.0A
Other languages
Chinese (zh)
Inventor
朱涛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Property and Casualty Insurance Company of China Ltd
Original Assignee
Ping An Property and Casualty Insurance Company of China 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 Ping An Property and Casualty Insurance Company of China Ltd filed Critical Ping An Property and Casualty Insurance Company of China Ltd
Priority to CN202110270341.0A priority Critical patent/CN112965695A/en
Publication of CN112965695A publication Critical patent/CN112965695A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/20Software design
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3692Test management for test results analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/42Syntactic analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/42Syntactic analysis
    • G06F8/425Lexical analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

The invention relates to the field of computer software development, and discloses a front-end code access detection method, a device, equipment and a storage medium, which are used for carrying out front-end code access detection, and the method comprises the following steps: acquiring a project configuration file and a project file of a current front-end project; reading the project configuration information in the project configuration file, and generating a project configuration table of the current front-end project according to the project configuration information; screening a code detection tool access rule of the current front-end project from a preset code detection tool rule system according to the project configuration table; accessing a preset code detection tool according to the code detection tool access rule; and constructing an abstract syntax tree according to the codes of the project engineering files, inputting the abstract syntax tree into the code detection tool, and completing code detection through the code detection tool. In addition, the invention also relates to a block chain technology, and the project configuration file and the project engineering file can be stored in the block chain.

Description

Front-end code access detection method, device, equipment and storage medium
Technical Field
The invention relates to the field of computer software development, in particular to a front-end code access detection method, a front-end code access detection device, a front-end code access detection equipment and a storage medium.
Background
For most programming languages, a variant program typically has some code instrumentation built into it to ensure the quality of the code. For front-end development engineering, development is basically carried out based on JavaScript, HTML and CSS. But since JavaScript, HTML, CSS have no compiler, debugging is usually required to be performed continuously in order to find JavaScript code errors. In a modern front-end system, engineering construction based on webpack is carried out, meanwhile, plug-ins such as eslint and stylelint of webpack are matched, and the code detection capability is provided for front-end engineering. When a project is started, the webpack reads a project file, transmits the project file to a lint plug-in a binary file stream or AST syntax tree mode, and detects a code in the lint plug-in, so that a developer is helped to improve the quality of the project code. In general, if a project needs to access a lint tool, the project needs to install a corresponding tool dependency package, introduce a corresponding rule and modify the configuration of webpack to complete the access work of the lint tool.
However, since the rules of the respective lint tools are relatively free, it takes a lot of time for the developer to complete the rule configuration. Meanwhile, when the lint tool is installed, the whole body can depend on a plurality of external third parties, the lint configuration of webpack is complicated, and the whole difficulty of completing the access of the lint tool by developers is high. The problems that most front-end projects of the existing production risk do not access the lint rules, or the access rules are not uniform, the development specifications of all project groups are inconsistent and the like are caused.
Disclosure of Invention
The invention mainly aims to solve the technical problem that the access overall difficulty of the existing lint tool is higher due to non-uniform access rules of the lint tool.
The first aspect of the present invention provides a front-end code access detection method, including:
acquiring a project configuration file and a project file of a current front-end project;
reading the project configuration information in the project configuration file, and generating a project configuration table of the current front-end project according to the project configuration information;
screening a code detection tool access rule of the current front-end project from a preset code detection tool rule system according to the project configuration table;
accessing a preset code detection tool according to the code detection tool access rule;
and constructing an abstract syntax tree according to the codes of the project engineering files, inputting the abstract syntax tree into the code detection tool, and completing code detection through the code detection tool.
Optionally, in a first implementation manner of the first aspect of the present invention, the constructing an abstract syntax tree according to the code of the project engineering file, and inputting the abstract syntax tree into the code detection tool, where completing the code detection by the code detection tool includes:
inputting the project engineering file into a preset grammar analyzer, carrying out lexical analysis on codes in the project engineering file through the grammar analyzer, and converting the project engineering file into an array consisting of lexical units;
generating an abstract syntax tree of the project engineering file according to the array;
and inputting the abstract syntax tree into the code detection tool, and completing code detection through the code detection tool.
Optionally, in a second implementation manner of the first aspect of the present invention, the inputting the project engineering file into a preset parser, performing lexical analysis on codes in the project engineering file through the parser, and converting the project engineering file into an array composed of lexical units includes:
inputting the project engineering file into the grammar analyzer, scanning the code of the project engineering file line by line through the grammar analyzer and decomposing the code into lexical units, wherein the lexical units are basic word symbols in a character string form in a programming language;
and combining the lexical unit sequences into an array.
Optionally, in a third implementation manner of the first aspect of the present invention, the generating an abstract syntax tree of the project engineering file according to the array includes:
analyzing the grammar of the code according to the array, and judging whether the grammar of the code is correct or not;
if so, generating a syntax analysis tree corresponding to the code according to a preset source code language specification;
and calling a node object creating method corresponding to each node in the syntax analysis tree, creating a node object, and generating an abstract syntax tree according to the node object.
Optionally, in a fourth implementation manner of the first aspect of the present invention, after constructing an abstract syntax tree according to a code of the project engineering file, inputting the abstract syntax tree into the code detection tool, and completing code detection by the code detection tool, the method further includes:
starting multiple threads, calling the code detection tool by each thread through a command line, and detecting the project engineering file through the code detection tool;
waiting for all threads in the multiple threads to finish executing, and generating a detection result of the code detection tool;
analyzing the detection result, and filtering false reports and useless results in the detection result according to preset result filtering conditions to obtain a final detection result;
and saving the final detection result by taking a project as a unit.
Optionally, in a fifth implementation manner of the first aspect of the present invention, before the accessing a preset code detection tool according to the code detection tool access rule, the method further includes:
acquiring the version type of the code detection tool;
acquiring a dependency list of the code detection tool according to the version type;
and acquiring the dependency package of the code detection tool according to the dependency list and installing the dependency package.
Optionally, in a sixth implementation manner of the first aspect of the present invention, the obtaining a dependency package of the code detection tool according to the dependency list and installing the dependency package includes:
acquiring a dependency package of the code detection tool according to the dependency list;
carrying out validity check on the dependence packet to obtain a check result;
and if the check result is legal, installing the dependency package.
A second aspect of the present invention provides a front-end code access detection apparatus, including:
the file acquisition module is used for acquiring a project configuration file and a project file of a current front-end project;
the information reading module is used for reading the project configuration information in the project configuration file and generating a project configuration table of the current front-end project according to the project configuration information;
the rule screening module is used for screening the code detection tool access rule of the current front-end project from a preset code detection tool rule system according to the project configuration table;
the access module is used for accessing a preset code detection tool according to the code detection tool access rule;
and the detection module is used for constructing an abstract syntax tree according to the codes of the project engineering files, inputting the abstract syntax tree into the code detection tool and finishing code detection through the code detection tool.
Optionally, in a first implementation manner of the second aspect of the present invention, the detection module includes:
the lexical analysis unit is used for inputting the project engineering file into a preset grammar analyzer, carrying out lexical analysis on codes in the project engineering file through the grammar analyzer and converting the project engineering file into an array consisting of lexical units;
the syntax tree generating unit is used for generating an abstract syntax tree of the project engineering file according to the array;
and the input unit is used for inputting the abstract syntax tree into the code detection tool and finishing code detection through the code detection tool.
Optionally, in a second implementation manner of the second aspect of the present invention, the lexical analysis unit is specifically configured to:
inputting the project engineering file into the grammar analyzer, scanning the code of the project engineering file line by line through the grammar analyzer and decomposing the code into lexical units, wherein the lexical units are basic word symbols in a character string form in a programming language;
and combining the lexical unit sequences into an array.
Optionally, in a third implementation manner of the second aspect of the present invention, the syntax tree generating unit is specifically configured to:
analyzing the grammar of the code according to the array, and judging whether the grammar of the code is correct or not;
if so, generating a syntax analysis tree corresponding to the code according to a preset source code language specification;
and calling a node object creating method corresponding to each node in the syntax analysis tree, creating a node object, and generating an abstract syntax tree according to the node object.
Optionally, in a fourth implementation manner of the second aspect of the present invention, the input unit is specifically configured to:
starting multiple threads, calling the code detection tool by each thread through a command line, and detecting the abstract syntax tree through the code detection tool;
waiting for all threads in the multiple threads to finish executing, and generating a detection result of the code detection tool;
analyzing the detection result, and filtering false reports and useless results in the detection result according to preset result filtering conditions to obtain a final detection result;
and saving the final detection result by taking a project as a unit.
Optionally, in a fifth implementation manner of the second aspect of the present invention, the front-end code access detection apparatus further includes a dependency configuration module, where the dependency configuration module includes:
the version acquisition unit is used for acquiring the version type of the code detection tool;
the list acquisition unit is used for acquiring a dependency list of the code detection tool according to the version type;
and the dependent package installation unit is used for acquiring the dependent package of the code detection tool according to the dependent list and installing the dependent package.
Optionally, in a sixth implementation manner of the second aspect of the present invention, the dependent package installing unit is specifically configured to:
acquiring a dependency package of the code detection tool according to the dependency list;
carrying out validity check on the dependence packet to obtain a check result;
and if the check result is legal, installing the dependency package.
A third aspect of the present invention provides a front-end code access detection device, including: a memory having instructions stored therein and at least one processor, the memory and the at least one processor interconnected by a line; the at least one processor invokes the instructions in the memory to cause the front-end code access detection device to perform the steps of the front-end code access detection method described above.
A fourth aspect of the present invention provides a computer-readable storage medium having stored therein instructions, which, when run on a computer, cause the computer to perform the steps of the above-mentioned front-end code access detection method.
According to the technical scheme, project configuration files and project files of a current front-end project are obtained; reading the project configuration information in the project configuration file, and generating a project configuration table of the current front-end project according to the project configuration information; screening a code detection tool access rule of the current front-end project from a preset code detection tool rule system according to the project configuration table; accessing a preset code detection tool according to the code detection tool access rule; and constructing an abstract syntax tree according to the codes of the project engineering files, inputting the abstract syntax tree into the code detection tool, and completing code detection through the code detection tool. The method reads the configuration information of the front-end project to generate the project configuration table, then obtains the access rules of the lint tool according to the project configuration table, obtains the access rules of different lint tools aiming at different front-end projects, avoids the problem of high access difficulty of the lint tool caused by non-uniform access rules of the lint tool, is convenient for accessing the lint tool to the current project and detects the quality of the project file codes.
Drawings
Fig. 1 is a schematic diagram of a first embodiment of a front-end code access detection method in an embodiment of the present invention;
fig. 2 is a diagram of a second embodiment of a front-end code access detection method according to an embodiment of the present invention;
fig. 3 is a schematic diagram of a third embodiment of a front-end code access detection method in an embodiment of the present invention;
fig. 4 is a schematic diagram of a fourth embodiment of a front-end code access detection method in the embodiment of the present invention;
fig. 5 is a schematic diagram of a fifth embodiment of a front-end code access detection method in the embodiment of the present invention;
fig. 6 is a schematic diagram of an embodiment of a front-end code access detection apparatus according to an embodiment of the present invention;
fig. 7 is a schematic diagram of another embodiment of a front-end code access detection apparatus according to an embodiment of the present invention;
fig. 8 is a schematic diagram of an embodiment of a front-end code access detection device in an embodiment of the present invention.
Detailed Description
According to the technical scheme, project configuration files and project files of a current front-end project are obtained; reading the project configuration information in the project configuration file, and generating a project configuration table of the current front-end project according to the project configuration information; screening a code detection tool access rule of the current front-end project from a preset code detection tool rule system according to the project configuration table; accessing a preset code detection tool according to the code detection tool access rule; and constructing an abstract syntax tree according to the codes of the project engineering files, inputting the abstract syntax tree into the code detection tool, and completing code detection through the code detection tool. The method reads the configuration information of the front-end project to generate the project configuration table, then obtains the access rules of the lint tool according to the project configuration table, obtains the access rules of different lint tools aiming at different front-end projects, avoids the problem of high access difficulty of the lint tool caused by non-uniform access rules of the lint tool, is convenient for accessing the lint tool to the current project and detects the quality of the project file codes.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims, as well as in the drawings, 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," or "having," and any variations thereof, are intended to cover non-exclusive inclusions, 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.
For convenience of understanding, a detailed flow of the embodiment of the present invention is described below, and referring to fig. 1, a first embodiment of a front-end code access detection method in the embodiment of the present invention includes:
101. acquiring a project configuration file and a project file of a current front-end project;
it is to be understood that the execution subject of the present invention may be a front-end code access detection apparatus, and may also be a terminal or a server, which is not limited herein. The embodiment of the present invention is described by taking a server as an execution subject.
It is emphasized that the project configuration files and project engineering files described above may be stored in nodes of a blockchain in order to ensure privacy and security of the data.
In this embodiment, the project configuration file is a package.json file, and mainly includes a configuration dependency of a front end, a project engineering description and a part of project parameters, where the project engineering description includes a description of a project engineering operating environment, specifically includes a CPU, an operating system, a compiler used for selecting a project engineering compiling environment, and all modules required for project engineering construction, and the project parameters include a project address, a project package name, a project type, and project configuration information, and the project address may be a storage address of a current front-end project; the item package name may be all related package (package) names of the current front-end item; the item type may be a type of a current front-end item, specifically: when the project only comprises one module file, the type of the project can be a single module application, when the project comprises a plurality of module files, the type of the project is a multi-module application, and the project configuration information can be the configuration information related to the current front-end project.
In this embodiment, the project engineering file is a js (JavaScript) file, js is a high-level programming language with function priority, lightweight, interpretation type or just-in-time compilation type, and can be used as a scripting language of a Web page of a browser, and JavaScript is based on a prototype programming and a multi-paradigm dynamic scripting language, and supports object-oriented, command and declarative (e.g., functional programming) styles, and is commonly used to add various dynamic functions to the Web page of the browser, thereby providing a smoother and more beautiful browsing effect for a user.
102. Reading the project configuration information in the project configuration file, and generating a project configuration table of the current front-end project according to the project configuration information;
in this embodiment, matching is performed in the total library of the lint rules according to the configuration name by judging the frame and the language of the current project in the project configuration file. And generating a project configuration table according to the matched rules, wherein the purpose of generating the project configuration table is to expand and classify the lint rules. There may be hundreds of rules per class. For example, vue has a set of rules for vue and acts has a set of rules for acts. And npm plug-ins corresponding to each configuration are also different. Therefore, the set of rules is a mapping relation set from the real configuration information to the actual rules and the npm plug-ins which need to be installed actually, and the project configuration table is generated, so that the expansion is convenient and the later maintenance is also convenient.
103. Screening a code detection tool access rule of the current front-end project from a preset code detection tool rule system according to the project configuration table;
in practical application, due to the dynamic language type of JavaScript, a variety of development paradigms are generated, and problems are brought from undefined and null error reporting in operation to random addition, subtraction, line feed and blank space of codes to cause visual confusion.
In this embodiment, the code detection tool is lint, which is a static code analysis tool, and is one of the C language tools, lint can perform more extensive error analysis on the program, and it can check not only the portability problem, but also the characteristics that are portable and completely grammatical but are likely to be errors.
104. Accessing a preset code detection tool according to the code detection tool access rule;
in practical application, when the lint tool is accessed, the corresponding tool dependency package is installed, the code detection tool access rule is introduced, and the webpack configuration is modified, so that the access work of the lint tool can be completed.
105. Constructing an abstract syntax tree according to the codes of the project engineering files, inputting the abstract syntax tree into the code detection tool, and completing code detection through the code detection tool;
in this embodiment, when a project is started, the webpack reads in a project file, transmits the project file to the lint plug-in a binary file stream or AST syntax tree manner, and detects a code in the lint plug-in to help a developer improve the quality of the project code.
In this embodiment, the project engineering file is mainly converted into an abstract syntax tree through a Parser, which is mainly a Babel compiler, and the Parser (Parser) is usually present as a component of the compiler or interpreter, and is used for performing syntax checking and constructing a data structure (generally, a hierarchical data structure such as a syntax parse tree or an abstract syntax tree) composed of input words. A parser typically uses a separate lexical parser to separate individual "words" from the input character stream and uses the word stream as its input. In actual development, the parser can be written manually or (semi-) automatically generated using tools. babel is a JavaScript compiler. Macroscopically, it runs code in 3 phases: parsing (parsing) -converting the code string into an AST abstract syntax tree, translating (transforming) -transforming the abstract syntax tree, generating (generating) -generating a new code string from the transformed abstract syntax tree.
In this embodiment, the process of parsing the project engineering file into the Abstract Syntax Tree by the Syntax analyzer includes lexical analysis and Syntax analysis, where the lexical analysis mainly reads a character stream of a source code of the input project engineering file and then identifies tokens (also called word symbols or symbols) according to word formation rules, and the Syntax analysis mainly combines word sequences into various types of Syntax phrases such as "program", "sentence", "expression", and the like on the basis of the lexical analysis to form AST (Abstract Syntax Tree).
In the embodiment, a project configuration file and a project engineering file of a current front-end project are obtained; reading the project configuration information in the project configuration file, and generating a project configuration table of the current front-end project according to the project configuration information; screening a code detection tool access rule of the current front-end project from a preset code detection tool rule system according to the project configuration table; accessing a preset code detection tool according to the code detection tool access rule; and constructing an abstract syntax tree according to the codes of the project engineering files, inputting the abstract syntax tree into the code detection tool, and completing code detection through the code detection tool. The method reads the configuration information of the front-end project to generate the project configuration table, then obtains the access rules of the lint tool according to the project configuration table, obtains the access rules of different lint tools aiming at different front-end projects, avoids the problem of high access difficulty of the lint tool caused by non-uniform access rules of the lint tool, is convenient for accessing the lint tool to the current project and detects the quality of the project file codes. In addition, the invention also relates to a block chain technology, and the project configuration file and the project engineering file can be stored in the block chain.
Referring to fig. 2, a second embodiment of a front-end code access detection method according to the embodiment of the present invention includes:
201. acquiring a project configuration file and a project file of a current front-end project;
202. reading project configuration information in the project configuration file, and generating a project configuration table of a current front-end project according to the project configuration information;
203. screening a code detection tool access rule of a current front-end project from a preset code detection tool rule system according to a project configuration table;
the steps 201-203 in the present embodiment are similar to the steps 101-103 in the first embodiment, and are not described herein again.
204. Acquiring the version type of a code detection tool;
205. acquiring a dependency list of a code detection tool according to the version type;
206. acquiring a dependency package of a code detection tool according to the dependency list;
in this embodiment, the code detection tool has multiple version categories, for example, each version of multiple streaming lint tools such as eslint, sytleint, commitlint, and the like, and when the lint rule configuration is initialized, the dependency packages required to be used are concurrently installed, and the version is detected according to the maintenance tool version list, so that the availability of the lint tool and the related dependencies of the item is ensured.
In practical application, because operating systems are all designed in a modularized manner, that is, functions are mutually dependent, and some functions need some other functions to be supported, reusability of codes can be improved, that is, realization of some functions needs corresponding other function supports, that is, dependency packages, most of the dependency packages are some library files, a dynamic library and a static library are provided, if a dependency package of a program is not installed, only the program itself cannot be used, for example, a certain software is installed, the software depends on a certain development package, and the development package contains environment files in which the software needs to run, that is, dependency relationships.
207. Carrying out validity check on the dependence packet to obtain a check result;
208. if the checking result is legal, installing the dependency package;
in this embodiment, the validity check on the dependent packet includes a basic application framework, a stability test on the dependent packet, a security test on the dependent packet, a dependency management check on the dependent packet, an on-shelf specification check on the dependent packet, a dependency size check on the dependent packet, and the like.
209. Accessing a preset code detection tool according to a code detection tool access rule;
210. and constructing an abstract syntax tree according to the codes of the project engineering files, inputting the abstract syntax tree into a code detection tool, and completing code detection through the code detection tool.
Step 209-210 in the present embodiment is similar to step 104-105 in the first embodiment, and is not described herein again.
On the basis of the previous embodiment, the method adds a process of adding the dependency package, and detects the version type of the tool by acquiring the code; acquiring a dependency list of a code detection tool according to the version type; acquiring a dependency package of a code detection tool according to the dependency list; carrying out validity check on the dependence packet to obtain a check result; and if the verification result is legal, installing the dependent package. The method ensures the availability of the code detection tool of the project and the related dependence. The problem of acquired dependency packet failure is avoided by detecting the validity of the dependency packet.
Referring to fig. 3, a third embodiment of a front-end code access detection method according to the embodiment of the present invention includes:
301. acquiring a project configuration file and a project file of a current front-end project;
302. reading project configuration information in the project configuration file, and generating a project configuration table of a current front-end project according to the project configuration information;
303. screening a code detection tool access rule of a current front-end project from a preset code detection tool rule system according to a project configuration table;
304. accessing a preset code detection tool according to a code detection tool access rule;
the steps 301-304 in the present embodiment are similar to the steps 101-104 in the first embodiment, and are not described herein again.
305. Inputting the project engineering file into a syntax analyzer, scanning the codes of the project engineering file line by line through the syntax analyzer and decomposing the codes into lexical units;
306. combining the lexical unit sequences into an array;
in this embodiment, in the lexical analysis process, each statement of the source code is scanned, and word segmentation is performed while scanning, so as to obtain a lexical unit of each statement of the source code. The lexical unit is a basic constituent unit of a sentence, and may be a keyword, a variable name, an operator, a constant, or the like, for example, the obtained source code is "const a +1, const b + 1; "scan the first sentence" const a ═ 1, "scan" const "first, produce a lexical unit and represent" const "as the key word; scanning to 'a', and generating a lexical unit which indicates that 'a' is a variable name; then scanning to generate a lexical unit which represents that the word is an operator; then scanning to a constant value of 1, and generating a lexical unit to indicate that 1 is a constant value; finally, the punctuation mark is scanned to generate a lexical unit representation and the punctuation mark is generated. In the lexical analysis process, each lexical unit of a sentence "const a is 1" is formed into an array { const a is 1. Similarly, the lexical subsystem sets the statement "const b ═ a + 1; "convert to an array consisting of lexical units { const b ═ a + 1; }.
307. Generating an abstract syntax tree of the project engineering file according to the array;
308. and inputting the abstract syntax tree into a code detection tool, and finishing code detection through the code detection tool.
In this embodiment, an Abstract Syntax Tree is mainly constructed through two processes of lexical analysis and syntactic analysis, wherein the lexical analysis mainly identifies tokens (also called word symbols or symbols) according to word formation rules after reading character streams of source codes of input project engineering files, and the syntactic analysis mainly combines word sequences into various types of syntactic phrases such as "programs", "sentences", "expressions", and the like on the basis of the lexical analysis to form AST (Abstract Syntax Tree).
On the basis of the foregoing embodiment, the present embodiment describes in detail a process of constructing an abstract syntax tree according to the codes of the project engineering files, inputting the abstract syntax tree into the code detection tool, and completing code detection by the code detection tool. Inputting the project engineering file into a preset grammar analyzer, and carrying out lexical analysis on codes in the project engineering file through the grammar analyzer to convert the project engineering file into an array consisting of lexical units; generating an abstract syntax tree of the project engineering file according to the array; and inputting the abstract syntax tree into the code detection tool, and completing code detection through the code detection tool. The method reads the configuration information of the front-end project to generate the project configuration table, then obtains the access rules of the lint tool according to the project configuration table, obtains the access rules of different lint tools aiming at different front-end projects, avoids the problem of high access difficulty of the lint tool caused by non-uniform access rules of the lint tool, is convenient for accessing the lint tool to the current project and detects the quality of the project file codes.
Referring to fig. 4, a fourth embodiment of the front-end code access detection method according to the embodiment of the present invention includes:
401. acquiring a project configuration file and a project file of a current front-end project;
402. reading project configuration information in the project configuration file, and generating a project configuration table of a current front-end project according to the project configuration information;
403. screening a code detection tool access rule of a current front-end project from a preset code detection tool rule system according to a project configuration table;
404. accessing a preset code detection tool according to a code detection tool access rule;
the steps 401 and 404 in this embodiment are similar to the steps 101 and 104 in the first embodiment, and are not described herein again.
405. Inputting the project engineering file into a preset grammar analyzer, carrying out lexical analysis on codes in the project engineering file through the grammar analyzer, and converting the project engineering file into an array consisting of lexical units;
406. carrying out syntactic analysis on the code according to the array, and judging whether the grammar of the code is correct or not;
407. if so, generating a syntax analysis tree corresponding to the code according to a preset source code language specification;
408. calling a node object creating method corresponding to each node in the syntax analysis tree, creating a node object, and generating an abstract syntax tree according to the node object;
in this embodiment, if the syntax of the source code is incorrect, the error information may be fed back to the user, the modified source code returned by the user is received, lexical analysis is performed on the modified source code, the modified source code is converted into an array composed of lexical units, and the abstract syntax tree is generated according to the array composed of lexical units of the modified source code. For example, the parser pairs the source code "const a ═ 1, const b ═ a + 1; "analyze, determine the syntax error of the first sentence" const a ═ 1 "of the source code, and the end of the sentence should be a semicolon instead of a comma. And the parser feeds the error information back to the user and receives the modified source code fed back by the user. For example, receiving a modified source code "const a ═ 1 returned by the user; const b is a + 1; ". The lexical analyzer performs lexical analysis on the modified source code to obtain an array of lexical units of the modified source code, for example, { const a ═ 1; { const b ═ a + 1; and the syntax analyzer generates the abstract syntax tree according to the array of the modified source codes, which is composed of lexical units.
In the present embodiment, the abstract syntax tree is built on the basis of the parse tree. The working process is that according to the grammar of the self-defined abstract syntax tree, the character strings in the syntax tree are analyzed and analyzed, the Token information is extracted, meanwhile, according to different nodes of all levels, such as root nodes, class node classes and method node classes, the corresponding methods are respectively called, node objects are created, and then the program abstract syntax tree is generated.
409. And inputting the abstract syntax tree into a code detection tool, and finishing code detection through the code detection tool.
On the basis of the previous embodiment, the process of generating the abstract syntax tree of the project engineering file according to the array is described in detail, and the code is analyzed according to the array to judge whether the syntax of the code is correct or not; if so, generating a syntax analysis tree corresponding to the code according to a preset source code language specification; and calling a node object creating method corresponding to each node in the syntax analysis tree, creating the node object, and generating the abstract syntax tree according to the node object. The method reads the configuration information of the front-end project to generate the project configuration table, then obtains the access rules of the lint tool according to the project configuration table, obtains the access rules of different lint tools aiming at different front-end projects, avoids the problem of high access difficulty of the lint tool caused by non-uniform access rules of the lint tool, is convenient for accessing the lint tool to the current project and detects the quality of the project file codes.
Referring to fig. 5, a fifth embodiment of a front-end code access detection method according to the present invention includes:
501. acquiring a project configuration file and a project file of a current front-end project;
502. reading project configuration information in the project configuration file, and generating a project configuration table of a current front-end project according to the project configuration information;
503. screening a code detection tool access rule of a current front-end project from a preset code detection tool rule system according to a project configuration table;
504. accessing a preset code detection tool according to a code detection tool access rule;
the steps 501-504 in the present embodiment are similar to the steps 101-104 in the first embodiment, and are not described herein again.
505. Inputting the project engineering file into a preset grammar analyzer, carrying out lexical analysis on codes in the project engineering file through the grammar analyzer, and converting the project engineering file into an array consisting of lexical units;
506. generating an abstract syntax tree of the project engineering file according to the array;
507. starting multiple threads, calling a code detection tool by each thread through a command line, and detecting the abstract syntax tree through the code detection tool;
508. waiting for all threads in the multiple threads to finish executing, and generating a detection result of the code detection tool;
509. analyzing the detection result, and filtering false alarm and useless results in the detection result according to a preset result filtering condition to obtain a final detection result;
510. and storing the final detection result by taking the project as a unit.
In the embodiment, the multi-thread concurrent processing is carried out on a plurality of projects, so that the inspection efficiency is improved; by further carrying out multi-thread concurrent inspection on a plurality of source code files of a single project, the inspection efficiency is further improved, the inspection time of one project is shortened, and the total inspection time is also greatly shortened.
In this embodiment, the process of inputting the abstract syntax tree into the code detection tool, completing code detection by the code detection tool, starting multiple threads, calling the code detection tool by each thread through a command line, and detecting the abstract syntax tree by the code detection tool is described in detail; waiting for all threads in the multiple threads to finish executing, and generating a detection result of the code detection tool; analyzing the detection result, and filtering false reports and useless results in the detection result according to preset result filtering conditions to obtain a final detection result; and saving the final detection result by taking a project as a unit. By the method, the multi-thread concurrent processing is carried out on a plurality of projects, so that the inspection efficiency is improved; by further carrying out multi-thread concurrent inspection on a plurality of source code files of a single project, the inspection efficiency is further improved, the inspection time of one project is shortened, and the total inspection time is also greatly shortened.
The above describes the front-end code access detection method in the embodiment of the present invention, and the following describes the front-end code access detection device in the embodiment of the present invention, with reference to fig. 6, an embodiment of the front-end code access detection device in the embodiment of the present invention includes:
the file acquisition module 601 is configured to acquire a project configuration file and a project file of a current front-end project;
an information reading module 602, configured to read item configuration information in the item configuration file, and generate an item configuration table of a current front-end item according to the item configuration information;
a rule screening module 603, configured to screen a code detection tool access rule of the current front-end item from a preset code detection tool rule system according to the item configuration table;
an access module 604, configured to access a preset code detection tool according to the code detection tool access rule;
and the detection module 605 is configured to construct an abstract syntax tree according to the codes of the project engineering files, input the abstract syntax tree into the code detection tool, and complete code detection through the code detection tool.
It is emphasized that, in order to ensure the privacy and security of the data, the data to be pushed may be stored in a node of a blockchain.
In the embodiment of the present invention, the front-end code access detection apparatus operates the front-end code access detection method, and the front-end code access detection method includes: acquiring a project configuration file and a project file of a current front-end project; reading the project configuration information in the project configuration file, and generating a project configuration table of the current front-end project according to the project configuration information; screening a code detection tool access rule of the current front-end project from a preset code detection tool rule system according to the project configuration table; accessing a preset code detection tool according to the code detection tool access rule; and constructing an abstract syntax tree according to the codes of the project engineering files, inputting the abstract syntax tree into the code detection tool, and completing code detection through the code detection tool. The method reads the configuration information of the front-end project to generate the project configuration table, then obtains the access rules of the lint tool according to the project configuration table, obtains the access rules of different lint tools aiming at different front-end projects, avoids the problem of high access difficulty of the lint tool caused by non-uniform access rules of the lint tool, is convenient for accessing the lint tool to the current project and detects the quality of the project file codes. In addition, the invention also relates to a block chain technology, and the project configuration file and the project engineering file can be stored in the block chain.
Referring to fig. 7, a second embodiment of the apparatus for detecting front-end code access according to the present invention includes:
the file acquisition module 601 is configured to acquire a project configuration file and a project file of a current front-end project;
an information reading module 602, configured to read item configuration information in the item configuration file, and generate an item configuration table of a current front-end item according to the item configuration information;
a rule screening module 603, configured to screen a code detection tool access rule of the current front-end item from a preset code detection tool rule system according to the item configuration table;
an access module 604, configured to access a preset code detection tool according to the code detection tool access rule;
and the detection module 605 is configured to construct an abstract syntax tree according to the codes of the project engineering files, input the abstract syntax tree into the code detection tool, and complete code detection through the code detection tool.
Wherein the detection module 605 comprises:
a lexical analysis unit 6051, configured to input the project engineering file into a preset parser, perform lexical analysis on codes in the project engineering file through the parser, and convert the project engineering file into an array composed of lexical units;
a syntax tree generating unit 6052, configured to generate an abstract syntax tree of the project engineering file according to the array;
an input unit 6053, configured to input the abstract syntax tree into the code detection tool, where code detection is completed by the code detection tool.
Optionally, the lexical analysis unit is specifically configured to:
inputting the project engineering file into the grammar analyzer, scanning the code of the project engineering file line by line through the grammar analyzer and decomposing the code into lexical units, wherein the lexical units are basic word symbols in a character string form in a programming language;
and combining the lexical unit sequences into an array.
Optionally, the syntax tree generating unit 6052 is specifically configured to:
the syntax tree generating unit is specifically configured to:
analyzing the grammar of the code according to the array, and judging whether the grammar of the code is correct or not;
if so, generating a syntax analysis tree corresponding to the code according to a preset source code language specification;
and calling a node object creating method corresponding to each node in the syntax analysis tree, creating a node object, and generating an abstract syntax tree according to the node object.
Optionally, the input unit 6053 is specifically configured to:
starting multiple threads, calling the code detection tool by each thread through a command line, and detecting the abstract syntax tree through the code detection tool;
waiting for all threads in the multiple threads to finish executing, and generating a detection result of the code detection tool;
analyzing the detection result, and filtering false reports and useless results in the detection result according to preset result filtering conditions to obtain a final detection result;
and saving the final detection result by taking a project as a unit.
Wherein, the front-end code access detection apparatus further includes a dependency configuration module 606, and the dependency configuration module 606 includes:
a version acquisition unit 6061 configured to acquire a version type of the code detection tool;
a list acquisition unit 6062 configured to acquire a dependency list of the code detection tool according to the version type;
a dependent package installation unit 6063, configured to obtain the dependent package of the code detection tool according to the dependency list and install the dependent package.
Optionally, the dependent package installation unit 6063 is specifically configured to:
acquiring a dependency package of the code detection tool according to the dependency list;
carrying out validity check on the dependence packet to obtain a check result;
and if the check result is legal, installing the dependency package.
On the basis of the previous embodiment, the specific functions of each module and the unit composition of part of the modules are described in detail, through the device, the configuration information of front-end projects can be read to generate a project configuration table, the access rules of the lint tool are acquired according to the project configuration table, the access rules of different lint tools are acquired aiming at different front-end projects, the problem that the access difficulty of the lint tool is large due to the fact that the access rules of the lint tool are not uniform is solved, and the current project can be conveniently accessed into the lint tool to detect the quality of project file codes.
Fig. 6 and fig. 7 describe the apparatus for detecting mid-front-end code access in the embodiment of the present invention in detail from the perspective of a modular functional entity, and the apparatus for detecting front-end code access in the embodiment of the present invention in detail from the perspective of hardware processing.
Fig. 8 is a schematic structural diagram of a front-end code access detection device according to an embodiment of the present invention, where the front-end code access detection device 800 may generate a relatively large difference due to different configurations or performances, and may include one or more processors (CPUs) 810 (e.g., one or more processors) and a memory 820, and one or more storage media 830 (e.g., one or more mass storage devices) storing an application 833 or data 832. Memory 820 and storage medium 830 may be, among other things, transient or persistent storage. The program stored in the storage medium 830 may include one or more modules (not shown), each of which may include a series of instruction operations for the front-end code access detection device 800. Further, the processor 810 may be configured to communicate with the storage medium 830, and execute a series of instruction operations in the storage medium 830 on the front-end code access detection device 800 to implement the steps of the front-end code access detection method described above.
The front-end code access detection device 800 may also include one or more power supplies 840, one or more wired or wireless network interfaces 850, one or more input-output interfaces 860, and/or one or more operating systems 831, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, and the like. Those skilled in the art will appreciate that the front-end code access detection device configuration shown in fig. 8 does not constitute a limitation of the front-end code access detection devices provided herein, and may include more or fewer components than shown, or some components in combination, or a different arrangement of components.
The block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
The present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium, and which may also be a volatile computer-readable storage medium, having stored therein instructions, which, when run on a computer, cause the computer to perform the steps of the front-end code access detection method.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses, and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
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 invention may be embodied in the form of 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 according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a read-only memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. A front-end code access detection method, the front-end code access detection method comprising:
acquiring a project configuration file and a project file of a current front-end project;
reading the project configuration information in the project configuration file, and generating a project configuration table of the current front-end project according to the project configuration information;
screening a code detection tool access rule of the current front-end project from a preset code detection tool rule system according to the project configuration table;
accessing a preset code detection tool according to the code detection tool access rule;
and constructing an abstract syntax tree according to the codes of the project engineering files, inputting the abstract syntax tree into the code detection tool, and completing code detection through the code detection tool.
2. The front-end code access detection method of claim 1, wherein the constructing an abstract syntax tree according to the codes of the project engineering files and inputting the abstract syntax tree into the code detection tool, and the completing the code detection by the code detection tool comprises:
inputting the project engineering file into a preset grammar analyzer, carrying out lexical analysis on codes in the project engineering file through the grammar analyzer, and converting the project engineering file into an array consisting of lexical units;
generating an abstract syntax tree of the project engineering file according to the array;
and inputting the abstract syntax tree into the code detection tool, and completing code detection through the code detection tool.
3. The front-end code access detection method of claim 2, wherein the entering of the project engineering file into a preset parser, the lexical analysis of the codes in the project engineering file by the parser, and the conversion of the project engineering file into an array consisting of lexical units comprises:
inputting the project engineering file into the grammar analyzer, scanning the code of the project engineering file line by line through the grammar analyzer and decomposing the code into lexical units, wherein the lexical units are basic word symbols in a character string form in a programming language;
and combining the lexical unit sequences into an array.
4. The front-end code access detection method of claim 3, wherein the generating an abstract syntax tree for the project engineering file from the array comprises:
analyzing the grammar of the code according to the array, and judging whether the grammar of the code is correct or not;
if so, generating a syntax analysis tree corresponding to the code according to a preset source code language specification;
and calling a node object creating method corresponding to each node in the syntax analysis tree, creating a node object, and generating an abstract syntax tree according to the node object.
5. The front-end code access detection method according to any one of claims 1 to 4, wherein the inputting the abstract syntax tree into the code detection tool, the performing code detection by the code detection tool comprises:
starting multiple threads, calling the code detection tool by each thread through a command line, and detecting the abstract syntax tree through the code detection tool;
waiting for all threads in the multiple threads to finish executing, and generating a detection result of the code detection tool;
analyzing the detection result, and filtering false reports and useless results in the detection result according to preset result filtering conditions to obtain a final detection result;
and saving the final detection result by taking a project as a unit.
6. The front-end code access detection method according to claim 5, wherein before accessing a preset code detection tool according to the code detection tool access rule, the method further comprises:
acquiring the version type of the code detection tool;
acquiring a dependency list of the code detection tool according to the version type;
and acquiring the dependency package of the code detection tool according to the dependency list and installing the dependency package.
7. The front-end code access detection method of claim 6, wherein the obtaining the dependency package of the code detection tool according to the dependency list and installing the dependency comprises:
acquiring a dependency package of the code detection tool according to the dependency list;
carrying out validity check on the dependence packet to obtain a check result;
and if the check result is legal, installing the dependency package.
8. A front-end code access detection apparatus, the front-end code access detection apparatus comprising:
the file acquisition module is used for acquiring a project configuration file and a project file of a current front-end project;
the information reading module is used for reading the project configuration information in the project configuration file and generating a project configuration table of the current front-end project according to the project configuration information;
the rule screening module is used for screening the code detection tool access rule of the current front-end project from a preset code detection tool rule system according to the project configuration table;
the access module is used for accessing a preset code detection tool according to the code detection tool access rule;
and the detection module is used for constructing an abstract syntax tree according to the codes of the project engineering files, inputting the abstract syntax tree into the code detection tool and finishing code detection through the code detection tool.
9. A front-end code access detection device, the front-end code access detection device comprising: a memory having instructions stored therein and at least one processor, the memory and the at least one processor interconnected by a line;
the at least one processor invokes the instructions in the memory to cause the front-end code access detection device to perform the steps of the front-end code access detection method of any of claims 1-7.
10. A computer-readable storage medium, having stored thereon a computer program, wherein the computer program, when being executed by a processor, is adapted to carry out the steps of the front-end code access detection method according to any of the claims 1-7.
CN202110270341.0A 2021-03-12 2021-03-12 Front-end code access detection method, device, equipment and storage medium Pending CN112965695A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110270341.0A CN112965695A (en) 2021-03-12 2021-03-12 Front-end code access detection method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110270341.0A CN112965695A (en) 2021-03-12 2021-03-12 Front-end code access detection method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN112965695A true CN112965695A (en) 2021-06-15

Family

ID=76277572

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110270341.0A Pending CN112965695A (en) 2021-03-12 2021-03-12 Front-end code access detection method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112965695A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113553064A (en) * 2021-07-07 2021-10-26 北京计算机技术及应用研究所 Web front-end code conversion method
CN113821213A (en) * 2021-09-29 2021-12-21 平安普惠企业管理有限公司 Front-end code detection and restoration method, device and equipment based on artificial intelligence
CN114116517A (en) * 2021-12-06 2022-03-01 北京字节跳动网络技术有限公司 Front-end item analysis method, device, medium and electronic equipment
CN118642717A (en) * 2024-08-12 2024-09-13 深圳市智慧城市科技发展集团有限公司 Method, device and storage medium for cleaning front-end engineering code

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140282444A1 (en) * 2013-03-15 2014-09-18 ArtinSoft Corporation Programming language transformations with abstract syntax tree extensions
CN105320591A (en) * 2014-07-25 2016-02-10 腾讯科技(深圳)有限公司 Code detection method and device
CN109032949A (en) * 2018-08-02 2018-12-18 郑州悉知信息科技股份有限公司 A kind of front-end code quality determining method and device
CN110688121A (en) * 2019-08-22 2020-01-14 深圳壹账通智能科技有限公司 Code completion method, device, computer device and storage medium
CN111078568A (en) * 2019-12-20 2020-04-28 广州华多网络科技有限公司 Code specification method and device, computer equipment and storage medium
CN112379917A (en) * 2020-11-19 2021-02-19 康键信息技术(深圳)有限公司 Browser compatibility improving method, device, equipment and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140282444A1 (en) * 2013-03-15 2014-09-18 ArtinSoft Corporation Programming language transformations with abstract syntax tree extensions
CN105320591A (en) * 2014-07-25 2016-02-10 腾讯科技(深圳)有限公司 Code detection method and device
CN109032949A (en) * 2018-08-02 2018-12-18 郑州悉知信息科技股份有限公司 A kind of front-end code quality determining method and device
CN110688121A (en) * 2019-08-22 2020-01-14 深圳壹账通智能科技有限公司 Code completion method, device, computer device and storage medium
CN111078568A (en) * 2019-12-20 2020-04-28 广州华多网络科技有限公司 Code specification method and device, computer equipment and storage medium
CN112379917A (en) * 2020-11-19 2021-02-19 康键信息技术(深圳)有限公司 Browser compatibility improving method, device, equipment and storage medium

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
BOWEN-WU: "前端代码风格统一方案", 《HTTPS:https://GITHUB.COM/BOWEN-WU/LINT-HUSKY-PRETTIER》, 6 February 2021 (2021-02-06), pages 1 - 9 *
埃德·耶伯格: "《Vue.js应用测试》", 北京:机械工业出版社, pages: 21 - 24 *
魏苗等: "基于静态分析的JavaScript类型失配缺陷查找", 《计算机科学》 *
魏苗等: "基于静态分析的JavaScript类型失配缺陷查找", 《计算机科学》, no. 04, 15 April 2017 (2017-04-15) *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113553064A (en) * 2021-07-07 2021-10-26 北京计算机技术及应用研究所 Web front-end code conversion method
CN113821213A (en) * 2021-09-29 2021-12-21 平安普惠企业管理有限公司 Front-end code detection and restoration method, device and equipment based on artificial intelligence
CN114116517A (en) * 2021-12-06 2022-03-01 北京字节跳动网络技术有限公司 Front-end item analysis method, device, medium and electronic equipment
CN114116517B (en) * 2021-12-06 2024-08-09 北京字节跳动网络技术有限公司 Front-end item analysis method and device, medium and electronic equipment
CN118642717A (en) * 2024-08-12 2024-09-13 深圳市智慧城市科技发展集团有限公司 Method, device and storage medium for cleaning front-end engineering code

Similar Documents

Publication Publication Date Title
CN112965695A (en) Front-end code access detection method, device, equipment and storage medium
Louridas Static code analysis
Binkley et al. ORBS: Language-independent program slicing
Baldi et al. A theory of aspects as latent topics
Hoschele et al. Mining input grammars with AUTOGRAM
CN112379917B (en) Browser compatibility improving method, device, equipment and storage medium
CN103577168A (en) Test case creation system and method
US20070157183A1 (en) Computer program code comparison using lexemes
CN112328226A (en) Embedded system automatic test code generation method and device
Sargsyan et al. ISP-Fuzzer: Extendable fuzzing framework
Sarcar et al. A new Eclipse-based JML compiler built using AST merging
Fischer et al. Abstract syntax trees-and their role in model driven software development
Cristiá et al. A language for test case refinement in the Test Template Framework
Agarwal et al. Copilot Evaluation Harness: Evaluating LLM-Guided Software Programming
Abuín et al. Perldoop: Efficient execution of Perl scripts on Hadoop clusters
Wang et al. Identification and elimination of platform-specific code smells in high performance computing applications
CN107977304B (en) System debugging method and device
Long et al. Automatic inference of code transforms and search spaces for automatic patch generation systems
CN115033489A (en) Code resource detection method and device, electronic equipment and storage medium
CN114691197A (en) Code analysis method and device, electronic equipment and storage medium
de Sousa Preventing atomicity violations with contracts
Grigorev et al. String-embedded language support in integrated development environment
van de Laar et al. Custom static analysis to enhance insight into the usage of in-house libraries
Hu et al. Bugfox: A Trace-Based Analyzer for Localizing the Cause of Software Regression in JavaScript
Saeidi et al. Gelato: GEneric LAnguage TOols for model-driven analysis of legacy software systems

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20210615

RJ01 Rejection of invention patent application after publication