On the Nature of Code Cloning in Open-Source Java Projects
Yaroslav Golubev, Timofey Bryksin

TL;DR
This study analyzes code cloning in over 23,000 open-source Java projects, revealing that method-level copying is common and persists over time, with various anomalies identified that could aid future research.
Contribution
It provides a large-scale empirical analysis of code clones in Java projects, highlighting clone prevalence, characteristics, and anomalies at file and method levels.
Findings
35.4% of methods have no clones
Method-level cloning is more prevalent than file-level
Cloning persists throughout Java's history
Abstract
Code cloning plays a very important role in open-source software engineering. The presence of clones within a project may indicate a need for refactoring, and clones between projects are even more interesting, since code migration takes place and violations are possible. But how is code being copied? How prevalent is the process and on what level does it happen? In this general study, we attempt to shed some light on these questions by searching for clones in a large dataset of over 23 thousand Java projects on the level of both files and methods, and by studying the code fragments themselves and their clone pairs. We study the size and the age of code fragments, the prevalence of their clones, relationships between exact and non-exact clones, as well as between method-level and file-level clones. We also discover and describe various anomalies in the code clones that were detected in…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
