Code odor detection method and system based on large language model
By constructing a prompt word and hierarchical adjustment strategy for large language models, the misjudgment and information loss of code odor detection in the existing technology is solved, and accurate detection and efficient analysis of complex code structures are achieved.
Patent Information
- Application Number
- CN202510338368.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-21
- Publication Date
- 2025-08-01
AI Technical Summary
In the prior art, Feature Envy detection method has misjudgment or misjudgment when facing complex code structures, making it difficult to accurately model the dynamic behavior of the code. In addition, large language models rely on ordinary prompt words in code odor detection, resulting in information loss or incomplete analysis.
By extracting the context information of the code to be detected, building a collection of methods and class information, combining the thinking chain and thinking tree to build a prompt word for a large language model, and using a hierarchical code replacement strategy, dynamically adjusting the context code information and inputting it to the large language model for code odor detection.
Improves the accuracy and efficiency of code odor detection, reduces misjudgment and misjudgment, ensures that long code snippets are not limited by context window size, and provides comprehensive analysis results.