Code cloning detection method and system
The invention discloses a code clone detection method and system. The method comprises the following specific steps: S1, preprocessing a source code of a PDG; s2, adopting joern-cli capable of processing a language to generate a PDG (Portable Document Gateway); s3, optimizing the PDG by deleting the...
Gespeichert in:
Hauptverfasser: | , , , , , , , , , |
---|---|
Format: | Patent |
Sprache: | chi ; eng |
Schlagworte: | |
Online-Zugang: | Volltext bestellen |
Tags: |
Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
|
Zusammenfassung: | The invention discloses a code clone detection method and system. The method comprises the following specific steps: S1, preprocessing a source code of a PDG; s2, adopting joern-cli capable of processing a language to generate a PDG (Portable Document Gateway); s3, optimizing the PDG by deleting the meaningless nodes or combining the nodes; s4, performing feature extraction on the PDG; and S5, adopting the GAT as a model architecture, and taking the PDG as input data to complete detection and identification tasks of the clone codes. According to the method, the expression effect of the semantic information of the source code is improved by utilizing the PDG, the feature information of the source code is abstracted into the PDG to serve as the input of the GAT, and meanwhile, the attention degree of the model on the code semantic features is increased by utilizing the attention mechanism of the GAT model, so that the code clone detection accuracy can be improved.
本发明公开了一种代码克隆检测方法及系统,方法具体步骤如下:S1、对PDG的源代码进行预处理;S |
---|