Multi-Threshold Token-Based Code Clone Detection
Yaroslav Golubev, Viktor Poletansky, Nikita Povarov, and Timofey Bryksin
March, 2021. Published in the proceedings of SANER'21 (A).
Abstract. Clone detection plays an important role in software engineering. Finding clones within a single project introduces possible refactoring opportunities, and between different projects it could be used for detecting code reuse or possible licensing violations.
In this paper, we propose a modification to bag-of-tokens based clone detection that allows detecting more clone pairs of greater diversity without losing precision by implementing a multi-threshold search, i.e. conducting the search several times, aimed at different groups of clones. To combat the increase in operation time that this approach brings about, we propose an optimization that allows to significantly decrease the overlap in detected clones between the searches.
We evaluate the method for two different popular clone detection tools on two datasets of different sizes. The implementation of the technique allows to increase the number of detected clones by 40.5-56.6% for different datasets. BigCloneBench evaluation also shows that the recall of detecting Strongly Type-3 clones increases from 37.5% to 59.6%.
Paper Pre-print Data VideoCiting publications
- A comprehensive review on code clone detection techniques
G Chatley, A Kaur · AIP Conference Proceedings · 2026 - Find My Code Twin: Improving SNIPPET SEARCH Performance Using LLMs in Practice
S Ko, E Jang, D Choi, D Ryu, J Park · Proceedings of the IEEE … · 2026 - Prompt-Driven Large Language Models for Automated Code Clone Detection: An Empirical Study
S Dou, C Li, J Shan, H Jia, Y Hu, Y Wu · IEEE Transactions on … · 2026 - Eler: Ensemble Learning-Based Automated Verification of Code Clones
S Dou, Y Hu, S Feng, Y Wu · IEEE Transactions on … · 2026 - Optimizing Knowledge Utilization for Multi-Intent Comment Generation with Large Language Models
S Li, Z Wang, X Du, Z Wu, J Yu · IEEE Transactions on … · 2026 - Evaluating the effectiveness of deep learning models for foundational program analysis tasks
Q Chen, R Chen, C Yu, R Liu, C Zhang · ACM Transactions on … · 2026 - Permissive-washing in the open AI supply chain: A large-scale audit of license integrity
J Jewitt, GK Rajbahadur, H Li, B Adams · Proceedings of the 32nd … · 2026 - A Novel Approach to Eliminate the Dead Code and Change the Looping Structure for Optimizing the Code
Tulshihar Patil, Shashank Joshi, Sagar Ganapati Mohite, Rahul Desai, P. V. Londhe, Pramod Jadhav, Milind Gayakwad · Advances in Nonlinear Variational Inequalities · 2025 - Beyond Rule-Based Testing: LLM-Driven Prompt Engineering for Automated Generative Software Validation
X Bao · Science Open · 2025 - A Comparative Study of Threshold Determination Algorithms for Code Similarity Detection
A Bhattacharyya, J Singh · 2025 International Conference on … · 2025 - Cues, Clones, and Cars: Access Control Issues in Customized Android
P Vyas · 2025 - Bridging Clone Detection and Industrial Compliance: A Practical Pipeline for Enterprise Codebases
X Zhang, S Liu, J Zhang, Y Xiang · Australasian Conference on … · 2025 - Comprehensively understanding of software project code reuse for Java
L Zhao · 2025 - Program clones detection as natural language texts fragments based on constructive-synthesizing modeling
VI Shynkarenko, OS Kuropiatnyk, IM Demidovich · 2025 - Distilling Benign Knowledge with Fine-Grained AST Fragments for Precise Real-World Web Shell Detection
M Gao, L Chen, Y He, Y Chen, L Ying · 2025 IEEE/ACM 33rd … · 2025 - Detecting essence code clones via information theoretic analysis
L Zhao, S Dou, Y Hu, Y Wu, J Wu, C Liu · arXiv preprint arXiv … · 2025 - Scalable Large-Scale Multi-Granularity Code Clone Detection via Clustering Search and Pre-Trained Models
Y An, Y Ma, X Gao, H Sun · IEEE Transactions on Software … · 2025 - Fine-grained code clone detection by keywords-based connection of program dependency graph
Y Wu, W Suo, S Feng, C Wu, D Zou · IEEE Transactions on … · 2025 - Secure smart contracts: Enhancing vulnerability detection with graph and tokenization analysis
AK BR, BN Lakshmi, M Prasad · … on Computing for … · 2025 - JC-Finder: Detecting Java Clone-based Third-Party Library by Class-level Tree Analysis
L Zhao, C Li, Y Wu, L Zhang, J Wu, C Liu · arXiv preprint arXiv … · 2025 - A privacy-preserving standardized model for large-scale source code fingerprint extraction and clone detection
M Yang, Y Tan, N Shi, Y Wang, Z Wang · Computer Standards & … · 2025 - MAGNET: A Multi-Graph Attentional Network for Code Clone Detection
Z Zhang, T Saber · arXiv preprint arXiv:2510.24241 · 2025 - I Know Who Clones Your Code: Interpretable Smart Contract Similarity Detection
Z Liu, L Ma, Z Mu, C Wei, X Xu, Y Jiao · IEEE Transactions on … · 2025 - CCDive: A deep dive into code clone detection using local sequence alignment
Y Glani, L Ping, SA Shah, L Ke · Tsinghua Science and … · 2025 - LLM-BL: Large language models are zero-shot rankers for bug localization
Z Li, Z Jiang, Q Huang, Q Gu · 2025 IEEE/ACM 33rd … · 2025 - Software security analysis in 2030 and beyond: A research roadmap
M Böhme, E Bodden, T Bultan, C Cadar, Y Liu · ACM Transactions on … · 2025 - An empirical study on commit message generation using llms via in-context learning
Y Wu, Y Wang, Y Li, W Tao, S Yu · 2025 IEEE/ACM 47th … · 2025 - МЕТОДЫ И ИНСТРУМЕНТЫ АВТОМАТИЗИРОВАННОГО ВЫЯВЛЕНИЯ ПЛАГИАТА В ПРОГРАММНОМ КОДЕ СТУДЕНТОВ
O Bousquet, Q Le, E Chi · arXiv preprint arXiv:2406.13232 · 2024 - Extractive Multi-Software Product Line Engineering
K Rosiak · 2024 - A Longitudinal Analysis Of Replicas in the Wild Wild Android
SM Abbas Zaidi · 2024 - A Longitudinal Analysis Of Replicas in the Wild Wild Android
SMA Zaidi, S Khan, P Vyas, Y Aafer · Proceedings of the 39th IEEE/ACM … · 2024 - Machine learning is all you need: A simple token-based approach for effective code clone detection
S Feng, W Suo, Y Wu, D Zou, Y Liu, H Jin · Proceedings of the IEEE … · 2024 - Large language models are few-shot summarizers: Multi-intent comment generation via in-context learning
M Geng, S Wang, D Dong, H Wang, G Li, Z Jin · Proceedings of the 46th … · 2024 - Commit message generation via chatgpt: How far are we?
Y Wu, Y Li, S Yu · Proceedings of the 2024 IEEE/ACM First International … · 2024 - Sur l'élaboration de meilleures techniques pour l'apprentissage auto-supervisé des représentations du code
L Maes · 2023 - Towards a Dataset of Programming Contest Plagiarism in Java
E Slobodkin, A Sadovnikov · arXiv preprint arXiv:2303.10763 · 2023 - Damerau-Levenshtein Distance Algorithm Based on Abstract Syntax Tree to Detect Code Plagiarism
A Nuraminah, A Ammar · Scientific Journal of Informatics · 2023 - Tritor: Detecting semantic code clones by building social network-based triads model
D Zou, S Feng, Y Wu, W Suo, H Jin · Proceedings of the 31st ACM Joint … · 2023 - Goner: Building tree-based n-gram-like model for semantic code clone detection
Y Wu, S Feng, W Suo, D Zou · IEEE Transactions on … · 2023 - Codeformer: A gnn-nested transformer model for binary code similarity detection
G Liu, X Zhou, J Pang, Y Feng, W Liu · Electronics · 2023 - Fine-grained code clone detection with block-based splitting of abstract syntax tree
T Hu, Z Xu, Y Fang, Y Wu, B Yuan, D Zou · Proceedings of the 32nd … · 2023 - Graph-based code semantics learning for efficient semantic code clone detection
D Yu, Q Yang, X Chen, J Chen, Y Xu · Information and Software … · 2023 - Towards understanding the capability of large language models on code clone detection: A survey
S Dou, J Shan, H Jia, W Deng, Z Xi, W He, Y Wu · arXiv preprint arXiv … · 2023 - Optimizing duplicate size thresholds in ides
K Grotov, S Titov, A Suhinin, Y Golubev · 2023 IEEE/ACM 20th … · 2023 - Enhancement of Generic Code Clone Detection Model for Python Application
INA Asmad, AFM Ali, NISI Jailani · International Journal of … · 2022 - A collaborative method for code clone detection using a deep learning model
S Karthik, B Rajdeepa · Advances in Engineering Software · 2022 - Detecting semantic code clones by building AST-based Markov chains model
Y Wu, S Feng, D Zou, H Jin · Proceedings of the 37th IEEE/ACM … · 2022 - On the nature of code cloning in open-source java projects
Y Golubev, T Bryksin · 2021 IEEE 15th International Workshop … · 2021 - Lsiccds: Large Scale Incremental Code Clone Detection System
X Zhang, T Wang, Y Yu, Y Zhong, H Wang · Available at SSRN 4210940 · 2011 - The Opticode: A User-Centric Tool for Enhancing Software Efficiency and Minimizing Errors Through Dead Code Elimination and Loop Invariant Code Motion Techniques
T Patil, S Joshi, YC Kulkarni, SD Jadhav
