Cross-language Source Code Clone Detection Based On Graph Neural Network

Zhang Yuguo, Jia Yang, Ou Ruan · 2024

Code clone detection has important applications in the security field, including vulnerability mining and recovery, malware detection, and copyright protection. Currently, clone detection in a single programming language has been widely researched. However, the research on cross-language clone detection is limited, and the syntax and structure of different programming languages are not the same, which makes cross-language clone detection more difficult. In this paper, we compute the embeddings by training the graph neural network, which is a numerical vector that is based on the AST graph of each function, and then perform similarity detection by measuring the embedding distance between two functions. We implement a model called CrossLCE. To train our network, we used the CLCDSA dataset, which contains multiple programming languages (C/C++, Python, and Java.). We evaluated our approach to this dataset and gave promising results in detecting similarities between code snippets.

Read the paper · More papers on PaperTik