Code Clone Detection Based on Program Dependence Graph and Graph Attention Networks
With the escalating prevalence of software plagiarism and code cloning incidents,the efficient detection of similar code segments has become increasingly vital,particularly in the context of semantic similarity-based code clone detection,which holds significant implications for advancing research and safeguarding intellectual property rights.Semantic similarity clones,characterized by their shared functionality and semantic underpinnings,pose a greater challenge to detection than syntactic similarities.To address this issue,this paper proposes an innovative detection approach that employs Program Dependency Graph(PDG)instead of Abstract Syntax Tree,thereby offering a more effective means of representing code's semantic information.By integrating Graph Attention Networks(GAT)into our method,it can extract salient semantic features from PDG and subsequently calculate the functional similarity between two pieces of codes.Experimental results demonstrate that the proposed method based on PDG and GAT significantly outperforms existing methods in detecting semantic similarity clones.