Code quality detection method and system based on combination of artificial intelligence and rule engine
By parsing code into an abstract syntax tree and configuration files into a key-value pair mapping structure, and combining a rule engine and a deep learning model for detection, the problem of balancing accuracy and recall in existing tools is solved, achieving efficient and reliable code quality detection and repair suggestion generation.
Patent Information
- Application Number
- CN202511715786.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-21
- Publication Date
- 2026-02-17
AI Technical Summary
Existing code quality inspection tools struggle to balance accuracy and recall, lack multi-dimensional detection mechanisms involving AI and rule engines, have poor adaptability in remediation suggestions and lack manual confirmation processes, and have insufficient coverage of automatically generated test cases, resulting in low efficiency and reliability of code quality inspection.
By combining artificial intelligence and a rule engine, the system parses the source code into an abstract syntax tree and the configuration file into a key-value pair mapping structure. It then uses the rule engine module for rapid detection and deep learning models for in-depth analysis to generate repair suggestions.
It improves the accuracy and reliability of code quality inspection, identifies potential problems, generates targeted remediation suggestions, enhances the comprehensiveness and operability of inspection results, and significantly reduces defect rates and improves delivery stability.
Smart Images

Figure CN121541885A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of software development, in particular to a code quality detection method and system based on the combination of artificial intelligence and rule engine. BACKGROUND
[0002] Current code quality detection tools mainly use static rule scanning, such as ESLint, Check style, SonarQube, etc., and their detection capabilities are highly dependent on the maintenance of the rule library, which cannot deeply understand business semantics and is difficult to realize cross-module dependency analysis, and has the limitation of single detection dimension. In recent years, AI code generation tools have effectively improved development efficiency, but there are obvious shortcomings in the quality control and running stability of generated code, and they cannot provide continuous quality optimization suggestions for existing projects, making it difficult to meet the code quality control needs throughout the project life cycle.
[0003] In some scenarios, the existing detection tools still have significant shortcomings in core functions, which are manifested in three aspects: first, the lack of a multi-dimensional detection mechanism combining AI and rule engine makes it difficult to balance the accuracy and recall rate of detection; second, the repair suggestions are mostly generated by manually editing rules, which have poor adaptability and no manual confirmation process, and there is a risk of false repair; third, the automatically generated test cases have insufficient coverage and cannot support high-quality code delivery requirements. These problems result in low efficiency and reliability of code quality detection. SUMMARY
[0004] In order to solve the technical problem of low efficiency and reliability of code quality detection, the purpose of the present application is to provide a code quality detection method and system based on the combination of artificial intelligence and rule engine, and the technical solution adopted is as follows:
[0005] In a first aspect, the present application discloses a code quality detection method based on the combination of artificial intelligence and rule engine, comprising: obtaining the source code and configuration file of a target project; parsing the source code into an abstract syntax tree and the configuration file into a key-value pair mapping structure; using a rule set to detect the abstract syntax tree and the key-value pair mapping structure through a rule engine module to perform a first quality detection on the source code, and using a deep learning model to perform a second quality detection on the abstract syntax tree and the key-value pair mapping structure; aggregating the detection results of the first quality detection and the second quality detection, and generating repair suggestions for the source code based on the aggregation results.
[0006] In a second aspect, the embodiments of the present application disclose a code quality detection system based on the combination of artificial intelligence and a rule engine, comprising: a processor and a memory; wherein the memory is used to store a computer program that can run on the processor; and the processor is used to execute the program stored on the memory to realize the steps of the code quality detection method based on the combination of artificial intelligence and a rule engine mentioned in the first aspect.
[0007] Through the technical solutions disclosed by the embodiments of the present application, the internal structure of the code can be clearly presented by parsing the source code into an abstract syntax tree, which helps to find potential syntax errors and logical problems. The configuration information can be managed and analyzed conveniently by parsing the configuration file into a key-value pair mapping structure, and the configuration-related errors and risks can be quickly located. The rule engine module can quickly scan the abstract syntax tree and the key-value pair mapping structure according to the rule set, accurately locate the potential problems in the code, and save detection time and labor cost. The deep learning model has strong automatic feature learning ability, can extract key features from complex data, and can perform deep analysis on the code, effectively improving the detection accuracy, finding hidden dangers that are difficult to detect by traditional methods, and the deep learning model has good adaptability and generalization ability when facing different types and sizes of code, can cope with various complex detection scenarios, and improve the reliability of the detection result. Further, the results of the first quality detection and the second quality detection are summarized, which can comprehensively present the quality status of the code, provide a complete code quality view for the developers, and facilitate the overall grasp of the code problems. Finally, the repair suggestions generated based on the summary results have pertinence and operability, which can provide specific improvement direction and method for the developers, help to quickly repair the problems in the code, and optimize the code quality. BRIEF DESCRIPTION OF DRAWINGS
[0008] Figure 1 A flowchart of a code quality detection method based on the combination of artificial intelligence and a rule engine provided by the embodiments of the present application.
[0009] Figure 2 A structure diagram of a code quality detection system based on the combination of artificial intelligence and a rule engine provided by the embodiments of the present application. DETAILED DESCRIPTION
[0010] In order to further illustrate the technical means and effects taken by the present application to achieve the predetermined invention purpose, the specific implementation, structure, features and effects of the code quality detection method and system based on the combination of artificial intelligence and a rule engine according to the present application are described in detail as follows. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. In addition, the specific features, structures or characteristics in one or more embodiments can be combined in any suitable form.
[0011] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The specific schemes of a code quality detection method based on artificial intelligence and rule engine combination provided by the present application are specifically described below with reference to the drawings.
[0012] The practical application scenario of the present application is as follows: the present application relates to the technical field of software development quality assurance, and in particular to a code quality detection method and system based on artificial intelligence and rule engine combination. The system supports Java language, collects code through Git repository and integrated development environment (Integrated Development Environment Plugin, IDE) plug-in, and combines rule engine and deep learning model trained in public code library to detect configuration file abnormalities (such as path error, key value missing, type mismatch) and structural problems (such as missing field, unclosed logic, abnormal call chain), and generate repair prompt information for artificial confirmation. At the same time, the system can automatically generate basic test cases containing unit testing and interface testing, support parameterization and automatic generation of assertion rules. It has been verified that the defect detection rate of the present application can reach 80%, the repair suggestion adoption rate is about 50%, the test coverage rate is improved by 30%, and the defect rate is significantly reduced and the delivery stability is improved.
[0013] As shown in the flowchart of a code quality detection method based on artificial intelligence and rule engine combination provided by the embodiments of the present application, the method comprises the following steps: Figure 1 Figure 1 Step S101, acquiring source code and configuration files of a target project.
[0014] Step S101, acquiring source code and configuration files of a target project.
[0015] Specifically, the embodiment of the present application acquires the source code and configuration files of the target project in real time through a Git repository or an IDE plug-in. The source code covers all program files used to implement business logic, algorithm processing, and data interaction, including but not limited to various programming language files (such as.java for Java,.py for Python,.js for JavaScript, etc.), code units containing main program entry, function modules, tool classes, interface definitions, etc. Markup language files (such as.html for HTML,.xml for XML) are used for page structure description or data format definition. Script files (such as.sh for Shell,.bash for Bash) are used for automated deployment, environment configuration, and other auxiliary operations. Configuration files include various configuration item carriers that control software running parameters, environment dependencies, and resource allocation, such as system configuration files (such as.properties,.yaml,.json) that store database connection information, service ports, log levels, etc. Build configuration files (such as pom.xml for Maven, build.gradle for Gradle) that define project dependency libraries, compilation rules, and packaging methods. Environment-specific configurations (such as dev.properties, prod.yaml) that distinguish between development, testing, and production environments. Toolchain configurations (such as the.idea directory of an IDE,.eslintrc of a code inspection tool) that are used to unify development specifications and tool behaviors.
[0016] Further, the source code and configuration files form an organic whole through the project directory structure, for example, the source code is divided into src / main directory according to function modules, the configuration files are concentrated in config or resources directory, and logical association is established through package path, reference path, etc. to jointly determine the actual running behavior of the software.
[0017] Step S102, parsing the source code into an abstract syntax tree and the configuration files into a key-value pair mapping structure.
[0018] Specifically, the Abstract Syntax Tree (AST) is an abstract representation of the syntax structure of the source code. It presents the syntax of the code in a tree structure, and each node represents a structure in the source code. AST does not depend on the specific language syntax details, so it has wide application in the fields of compilers, editors, code analysis tools, etc. Key-value pair mapping is a common data structure used to store the association between keys and values. Each key must be unique, while values can be repeated. Key-value pair mapping is widely used in programming, especially in scenarios that require fast data lookup, insertion, or deletion.
[0019] Further, as an optional embodiment of the present application, the parsing the source code into an abstract syntax tree comprises: preprocessing and normalizing the source code to obtain standard source code; using a lexical analyzer to segment the standard source code to obtain lexical units; and organizing the lexical units into an abstract syntax tree according to the grammar rules of the programming language by using a syntax analyzer, the abstract syntax tree representing the syntax structure of the source code.
[0020] Specifically, the embodiment of the present application first preprocesses and normalizes the source code, specifically removes meaningless line breaks, white spaces, comments, etc. Encoding unification and syntax standardization: uniformly converts the source code into UTF-8 encoding to prevent garbled code. At the same time, some syntactic sugar is standardized. Then the preprocessed code string is segmented into a series of meaningful lexical units using a lexical analyzer. Then the syntax analyzer organizes the lexical unit stream into an AST according to the grammar rules of the programming language. This AST tree accurately reflects the syntax structure of the program, where each node represents a syntax structure (such as expression, statement, function declaration, etc.). Cross-file context parsing: for object-oriented languages, the inheritance relationship between classes, interface implementation, etc. need to be parsed; at the same time, the function call graph within the project needs to be constructed to clearly show the calling relationship between functions and methods, providing a basis for subsequent data flow and control flow analysis.
[0021] Further, after the abstract syntax tree is organized by the syntax analyzer according to the grammar rules of the programming language, the method further comprises: associating the identifier nodes of the abstract syntax tree with corresponding data types, and recording the positions of each identifier node in the source code; marking the control flow structure in the abstract syntax tree and annotating the use chain for the identifier nodes to obtain an enhanced abstract syntax tree; and detecting the abstract syntax tree and the key-value pair mapping structure by using the rule set through the rule engine module to perform the first quality detection on the source code.
[0022] Specifically, the embodiment of the present application enhances and converts the AST, specifically associates the identifier nodes with their corresponding data types (such as variable types, function return value types). This is very important for finding type mismatch errors. Source code position binding: record the exact position (file path, starting line number, column number) of each AST node in the original source code. In this way, after the defect is found, the problem code can be accurately located. Control flow and data flow information embedding: although not directly modifying the AST, the enhancement process can mark the control flow structures such as loops and conditional branches, and annotate the definition and use chain for the identifier nodes, preparing for advanced analysis (such as taint analysis).
[0023] Further, the embodiment of the present application maps and parses the key-value pairs of the configuration file. Standardized key-value extraction: regardless of the original format of the configuration file, the content thereof is parsed into a uniform "key-value" pair set. The embodiment of the present application supports multi-layer nested structure: for formats such as JSON and YAML that support complex nested structures, conversion is performed through a flat strategy. Environment variable and placeholder parsing: placeholders (such as ${PROFILE} of Spring Boot) in the configuration file are identified and parsed, and an attempt is made to associate them with system environment variables or other configuration sources to obtain the final actual value. Secondly, environment variable and placeholder parsing: placeholders (such as ${PROFILE} of Spring Boot) in the configuration file are identified and parsed, and an attempt is made to associate them with system environment variables or other configuration sources to obtain the final actual value.
[0024] In step S103, the rule engine module detects the abstract syntax tree and the key-value pair mapping structure by using the rule set to perform first quality detection on the source code, and a deep learning model performs second quality detection on the abstract syntax tree and the key-value pair mapping structure.
[0025] Specifically, the abstract syntax tree and the key-value pair mapping structure of the embodiment of the present application are sent into two core analysis engines in parallel, the rule engine module performs fast pattern matching on the abstract syntax tree and the key-value pair mapping structure based on an explicit rule set, and the deep learning model performs deeper semantic understanding. Further, as an optional embodiment of the present application, the rule engine module detects the abstract syntax tree and the key-value pair mapping structure by using the rule set to perform first quality detection on the source code, including: the rule engine module detects the abstract syntax tree by using the rule set to perform syntax and structure detection, to obtain a structural quality detection result; the rule engine module detects the key-value pair mapping structure by using the rule set to perform semantic and logical detection, to obtain a configuration file anomaly detection result; and the rule engine module detects the abstract syntax tree and the key-value pair mapping structure by using a predefined security rule library in the rule set to perform security and compliance detection, to obtain a security compliance detection result.
[0026] Specifically, this embodiment of the invention performs syntax and structure checks on the abstract syntax tree (AST), and the structural quality check results include, but are not limited to, issues such as missing fields, unclosed logic, and abnormal call chains. The rule engine module uses a rule set to perform semantic and logical checks on the key-value pair mapping structure, and the configuration file anomaly check results include, but are not limited to, issues such as incorrect paths, missing keys, and data type mismatches. Specifically, when performing syntax and structure checks on the AST, pattern matching is performed based on the AST to verify the closure of brackets and quotation marks, and the integrity of logical blocks, such as unclosed brackets, missing quotation marks, and mismatched logical tags. When performing semantic and logical checks on the key-value pair mapping structure, type validation, enumeration value checks, and dependency verification are performed based on key-value pairs, such as port numbers being out of range or referencing non-existent paths. When performing security and compliance checks on the AST and key-value pair mapping structure, a predefined security rule base (such as hard-coded passwords and excessive permissions) and compliance template matching are used, such as checking for plaintext passwords in the configuration file. Thus, syntax and structure checks on abstract syntax trees can be systematically performed based on predefined rules (such as code indentation standards, function naming formats, and class inheritance hierarchy restrictions) to identify syntax errors, structural redundancy, and excessively deep logical nesting. This ensures that the code conforms to the team's or industry's common coding standards, improves code readability and maintainability, and reduces subsequent development collaboration costs caused by structural chaos. Semantic and logical checks on key-value pair mapping structures can validate the legality of configuration items through rules (such as data type matching, completeness of required fields, and parameter value range constraints). This promptly identifies configuration conflicts (such as contradictory definitions of the same parameter in different environment configurations) and invalid configurations (such as referencing non-existent resource paths), preventing risks such as system deployment failures and operational anomalies due to configuration errors and ensuring the stability of the software operating environment.
[0027] Furthermore, as an optional embodiment of the present invention, the second quality inspection of the abstract syntax tree and key-value pair mapping structure by using a deep learning model includes: performing semantic understanding and cross-file dependency analysis on the abstract syntax tree and key-value pair mapping structure by using a deep learning model to obtain implicit defect detection results, which include logical errors, architectural smells, and deep security vulnerabilities.
[0028] Specifically, the deep learning model in this embodiment of the invention is a deep learning model trained using code from a massive public codebase, such as the Transformer model, to perform deeper semantic understanding and cross-file dependency analysis. It can identify hidden defects that are difficult to describe using hard-coded rules, such as complex logical errors, architectural smells, and deep security vulnerabilities. Thus, by leveraging deep learning of code semantics and cross-file associations, this embodiment of the invention can identify hidden problems that rules struggle to cover, such as logical contradictions (e.g., oversights in conditional statements) and architectural smells (e.g., unclear module responsibilities), filling the blind spots of traditional detection methods. Furthermore, by jointly modeling the structural features of the abstract syntax tree and the key-value logic of configuration files, it can uncover deep security vulnerabilities (e.g., privilege circumvention caused by indirect call chains). These vulnerabilities are often difficult to detect by conventional methods due to their hidden cross-file dependencies, significantly improving the forward-looking nature of security protection.
[0029] Furthermore, this embodiment of the invention establishes a link between source code and configuration: this is a crucial step in demonstrating module intelligence. For example, by analyzing the dependencies parsed from the AST (such as Java's import statements) and cross-validating them with the dependencies declared in configuration files (such as pom.xml), it is possible to identify non-standard or security-risk situations such as using libraries but not declaring them in the configuration, or declaring libraries but not using them in the code. Unified data output: The final output of the module is a unified data model containing the following two parts: Enhanced AST forest: representing structured data of all source code in the entire project. Global key-value pair mapping: representing all parsed configuration information.
[0030] Step S104: Summarize the detection results of the first quality inspection and the second quality inspection, and generate a repair suggestion for the source code based on the summary results.
[0031] Specifically, this embodiment of the invention summarizes the detection results of the first quality inspection and the second quality inspection. Then, it generates targeted remediation suggestions for the problems found in the summarized results. As an optional embodiment of the invention, generating remediation suggestions for the source code based on the summarized results includes: searching for remediation suggestions corresponding to the summarized results from historical defects and corresponding remediation libraries.
[0032] Furthermore, as an optional embodiment of the present invention, after searching for and summarizing the repair suggestions from historical defects and corresponding repair libraries, the method further includes: repairing the source code based on the repair suggestions to obtain repaired source code; generating unit test and interface test files for the repaired source code and attaching assertion rules; and repairing the code based on the unit test and interface test files.
[0033] Specifically, in this embodiment of the invention, based on repair suggestions (such as syntax correction, logic optimization, and configuration adjustment schemes), the source code is modified in a targeted manner within the IDE. For example, for the repair suggestion of "null pointer exception," null value judgment logic is added; for the configuration issue of "database connection timeout," the connection timeout parameter in the key-value pair mapping structure is adjusted. During the repair process, Git repository branch management can be used to operate in an independent repair branch to avoid affecting the stability of the main branch code. Based on the repaired source code, unit test and interface test files are automatically generated using tools (such as JUnit and Postman automated script generators). The unit test files need to cover the core logic of the repaired code (such as function input / output and exception handling scenarios), and the interface test files need to simulate real request scenarios (such as parameter passing and return result verification), and attach explicit assertion rules (such as "the return status code should be 200" and "the calculation result should be consistent with the expected value"). The generated unit tests and interface test files are run. If a test case fails (e.g., assertion fails, exception is thrown), the unresolved issues in the code are located and fixed (e.g., missing logic fixes, newly introduced syntax errors), and secondary fixes are performed based on the test feedback. If all test cases pass, the fix is verified to meet expectations, ensuring that the fixed code has no new hidden dangers. Thus, in this embodiment of the invention, the fixed source code needs to be verified by automated testing, avoiding the situation of "fixing old problems and introducing new problems" (e.g., accidentally deleting critical code, logic conflicts), and ensuring that the fix covers core scenarios (e.g., boundary values, abnormal scenarios). For example, for the fix of "array out of bounds", unit tests can verify through multiple sets of input parameters to ensure that the fix logic is effective in different scenarios, significantly improving the reliability of the fixed code. Moreover, the automated generation of test files replaces manual writing, reducing the time cost of test development (e.g., it takes 1 hour to manually write 10 interface test cases, while it only takes 5 minutes to generate them automatically). At the same time, the additional assertion rules clarify the test standards, avoid the subjective errors of human judgment, make the test results more accurate, and help developers quickly verify the fix effect. From "fixing code" to "generating tests" and then to "secondary fixing," a complete quality control loop is formed, deeply collaborating with Git repositories and IDE plugins (e.g., Git prevents branch merging when tests fail; IDE plugins provide real-time prompts for test failure reasons). This closed-loop mechanism ensures that fixed code undergoes rigorous verification before entering subsequent stages, meeting the quality requirements of the software development lifecycle and reducing the risk of problematic code entering the production environment.
[0034] Corresponding to the code quality detection method based on the combination of artificial intelligence and rule engine provided in the above embodiments, based on the same technical concept, this invention also provides a code quality detection system based on the combination of artificial intelligence and rule engine. This code quality detection system is used to execute the above-described code quality detection method based on the combination of artificial intelligence and rule engine. Figure 2 This is a schematic diagram of the structure of a code quality inspection system based on the combination of artificial intelligence and rule engine, as provided in one embodiment of the present invention. Figure 2 As shown. A code quality inspection system based on the combination of artificial intelligence and a rule engine can vary significantly due to differences in configuration or performance. It may include one or more processors 201 and memory 202. The memory 202 stores computer programs that can run on the processor 201, and the processor 201 executes the programs stored in the memory 202 to achieve the above. Figure 1 The various steps in the method embodiment are described. The memory 202 can be temporary or persistent storage. The application stored in the memory 202 may include one or more modules (not shown in the figure), each module may include a series of computer-executable instructions for a code quality inspection system based on a combination of artificial intelligence and a rule engine.
[0035] Furthermore, the processor 201 can be configured to communicate with the memory 202 and execute a series of computer-executable instructions in the memory 202 on the code quality inspection system based on the combination of artificial intelligence and rule engine. The code quality inspection system based on the combination of artificial intelligence and rule engine may also include one or more power supplies 203, one or more wired or wireless network interfaces 204, one or more input / output interfaces 205, and one or more keyboards 206.
[0036] Specifically, in this embodiment, the code quality inspection system based on the combination of artificial intelligence and a rule engine includes a processor, a communication interface, a memory, and a communication bus; wherein, the processor, communication interface, and memory communicate with each other through the bus; the memory is used to store computer programs; and the processor is used to execute the programs stored in the memory to achieve the above. Figure 1 The various steps in the method embodiments are the same as those in the above method embodiments, and have the same beneficial effects. To avoid repetition, the embodiments of the present invention will not be described again here.
[0037] It should be noted that the code quality detection system based on the combination of artificial intelligence and rule engine provided in this embodiment of the invention and the code quality detection method based on the combination of artificial intelligence and rule engine provided in this embodiment of the invention are based on the same application concept. Therefore, the specific implementation of this embodiment can refer to the implementation of the aforementioned code quality detection method based on the combination of artificial intelligence and rule engine, and has the same or similar beneficial effects. Repeated parts will not be described again.
[0038] It should be noted that the order of the above embodiments of the present invention is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. The processes depicted in the accompanying drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0039] The various embodiments in this specification are described in a progressive manner. The same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on describing the differences from other embodiments.
Claims
1. A code quality inspection method based on the combination of artificial intelligence and rule engine, characterized in that, The code quality detection method based on the combination of artificial intelligence and rule engine includes: Obtain the source code and configuration files of the target project; The source code is parsed into an abstract syntax tree, and the configuration file is parsed into a key-value pair mapping structure; The abstract syntax tree and the key-value pair mapping structure are detected by the rule engine module using the rule set to perform a first quality check on the source code, and a second quality check is performed on the abstract syntax tree and the key-value pair mapping structure using a deep learning model. The detection results of the first quality inspection and the second quality inspection are summarized, and a repair suggestion for the source code is generated based on the summarized results.
2. The code quality detection method based on the combination of artificial intelligence and rule engine according to claim 1, characterized in that, The step of parsing the source code into an abstract syntax tree includes: The source code is preprocessed and normalized to obtain standard source code; The standard source code is segmented using a lexical analyzer to obtain lexical units; The parser organizes the lexical units into the abstract syntax tree according to the grammar rules of the programming language. The abstract syntax tree represents the grammatical structure of the source code.
3. The code quality detection method based on the combination of artificial intelligence and rule engine according to claim 2, characterized in that, After the lexical units are organized into the abstract syntax tree by the parser according to the grammar rules of the programming language, the method further includes: Associating the identifier nodes of the abstract syntax tree with their corresponding data types, and recording the position of each identifier node in the source code; By marking the control flow structure and labeling the identifier nodes with chains in the abstract syntax tree, an enhanced abstract syntax tree is obtained. The step of using a rule engine module to perform a first quality check on the source code by utilizing a rule set to examine the abstract syntax tree and the key-value pair mapping structure includes: The rule engine module uses a rule set to examine the enhanced abstract syntax tree and the key-value pair mapping structure to perform a first quality check on the source code.
4. The code quality detection method based on the combination of artificial intelligence and rule engine according to claim 1, characterized in that, The step of using a rule engine module to perform a first quality check on the source code by utilizing a rule set to examine the abstract syntax tree and the key-value pair mapping structure includes: The abstract syntax tree is subjected to syntax and structure checks using the rule set by the rule engine module to obtain structural quality check results. The rule engine module uses rule sets to perform semantic and logical detection on the key-value pairs and key-value pair mapping structure to obtain configuration file anomaly detection results. The rule engine module uses a predefined security rule library in the rule set to perform security and compliance checks on the abstract syntax tree and the key-value pair mapping structure, and obtains the security and compliance check results.
5. The code quality detection method based on the combination of artificial intelligence and rule engine according to claim 1, characterized in that, The second quality check of the abstract syntax tree and the key-value pair mapping structure using a deep learning model includes: By using a deep learning model to perform semantic understanding and cross-file dependency analysis on the abstract syntax tree and the key-value pair mapping structure, latent defect detection results are obtained, including logical errors, architectural smells, and deep security vulnerabilities.
6. The code quality detection method based on the combination of artificial intelligence and rule engine according to claim 1, characterized in that, The repair suggestions generated based on the summarized results for the source code include: Search for repair suggestions that correspond to the summarized results from historical defects and corresponding repair libraries.
7. The code quality detection method based on the combination of artificial intelligence and rule engine according to claim 1, characterized in that, After searching for remediation suggestions corresponding to the summarized results from historical defects and corresponding remediation libraries, the method further includes: Based on the repair suggestions, the source code is repaired to obtain the repaired source code; Generate unit test and interface test files for the repaired source code and attach assertion rules; The code is repaired based on the unit tests and interface test files.
8. A code quality inspection system based on the combination of artificial intelligence and rule engine, characterized in that, include: Processor and memory; wherein the memory is used to store computer programs that can run on the processor; A processor is used to execute a program stored in memory to implement the steps of the code quality detection method based on the combination of artificial intelligence and rule engine as described in any one of claims 1-7.