Scalable and Accurate Clones Detection Based on Metrics for Dependence Graph
Sevak Sargsyan, Shamil Faimovich Kurmangaleev, Artiom Baloian, Hayk K. Aslanyan · Mathematical Problems of Computer Science · 2014
The article describes a new method of code clones detection for C/C++ programming languages. The method is based on metrics for program dependence graph. For every node of program dependence graph a characteristic vector is constructed, which contains information about neighbors. These characteristic vectors are represented as sixty four bit integer numbers, which allows determining similarity between two nodes in amortized constant time. Due to this it is possible to analyze effectively projects with million lines of source code. The high accuracy of the determined clones was achieved by checking locations of source code for corresponding nodes. The paper also describes new approach for dependency graphs generation, which allows building them much faster than any of the existing methods. This method was compared with several widely used tools. It performs better both execution time and accuracy.