A function level Java code clone detection method

Jun Yang, Yu Xiong, Jinxin Ma · 2019

In this article, we mainly propose a method of function level code clone detection for Java language. The method includes a source code preprocessing strategy which unifies some Java grammatical features such as lambda expressions, anonymous classes and generics through code preprocessing. After the source code is preprocessed, the function extraction is performed to get all functions from source code, and then a filtering mechanism is carried out to filter out the useless comparing pairs with large difference in sequence length. Finally, we combine the longest common subsequence algorithm and the suffix array algorithm to perform the similarity calculation according to the size of the function. The experimental results in twenty open source software show that our method improves both accuracy and efficiency.

Read the paper · More papers on PaperTik