Evolving Trends in Cleanliness of Open Source Projects
Open Access
- 18 November 2026
- journal article
- Published by Association for Computing Machinery (ACM) in ACM Transactions on Software Engineering and Methodology
- Vol. 35 (12) , 1-36
Abstract
In the rapidly evolving landscape of open source software, code cleanliness has become a critical metric for assessing project quality and maintainability. However, understanding its evolution is essential for identifying long-term sustainability and best practices. This study investigates trends in code cleanliness across representative projects from three major open source communities: Apache, Google, and Spring. These were selected based on popularity and active commit frequencies. We focus on indicators such as cyclomatic complexity, lines of code per function and file, line length, and naming practices, drawn from project-specific coding guidelines and relevant for evaluating AI-generated code. Using abstract syntax trees and thresholds from best practice to parse positive and negative modifications and integrating differential information from commit logs, we establish precise mappings between functions and code lines before and after modifications. Our analysis shows complexity and lines of code growth as projects mature, largely due to feature growth and fault-tolerance logic in distributed systems. Continuous refactoring by key contributors can curb this rise overall. Projects also differ in standards and statement use: conditional and exception-handling statements correlate with higher complexity, while variable declarations and expressions track method size and line length, suggesting disciplined statement choices support cleaner code in practice.Keywords
Funding Information
- General program of the National Natural Science Foundation of China (62371256 and 62472326)
- Natural Science Research Start-up Foundation of Recruiting Talents of Nanjing University of Posts and Telecommunications (NY22502)
- Self-developed Project of Nanjing University of Posts and Telecommunications Nantong Research Institute Co., Ltd. (ZY-001)
This publication has 80 references indexed in Scilit:
- An eye tracking study assessing source code readability rules for program comprehensionEmpirical Software Engineering, 2024
- An empirical study on software understandability and its dependence on code characteristicsEmpirical Software Engineering, 2023
- Security‐based code smell definition, detection, and impact quantification in AndroidSoftware: Practice and Experience, 2023
- What really changes when developers intend to improve their source code: a commit-level study of static metric value and static analysis warning changesEmpirical Software Engineering, 2023
- Revisiting the debate: Are code metrics useful for measuring maintenance effort?Empirical Software Engineering, 2022
- On the challenges of open-sourcing proprietary software projectsEmpirical Software Engineering, 2018
- Code smells for Model-View-Controller architecturesEmpirical Software Engineering, 2017
- Evaluating code complexity triggers, use of complexity measures and the influence of code complexity on maintenance timeEmpirical Software Engineering, 2017
- Characterizing logging practices in Java-based open source software projects – a replication study in Apache Software FoundationEmpirical Software Engineering, 2016
- Impact of experience on maintenance skillsJournal of Software Maintenance and Evolution: Research and Practice, 2002