The Prevalence of Code Smells in Machine Learning projects
Not on the map. Why?
Abstract (arXiv)
Artificial Intelligence (AI) and Machine Learning (ML) are pervasive in the current computer science landscape. Yet, there still exists a lack of software engineering experience and best practices in this field. One such best practice, static code analysis, can be used to find code smells, i.e., (potential) defects in the source code, refactoring opportunities, and violations of common coding standards. Our research set out to discover the most prevalent code smells in ML projects. We gathered a dataset of 74 open-source ML projects, installed their dependencies and ran Pylint on them. This resulted in a top 20 of all detected code smells, per category. Manual analysis of these smells mainly showed that code duplication is widespread and that the PEP8 convention for identifier naming style may not always be applicable to ML code due to its resemblance with mathematical notation. More interestingly, however, we found several major obstructions to the maintainability and reproducibility of ML projects, primarily related to the dependency management of Python projects. We also found that Pylint cannot reliably check for correct usage of imported dependencies, including prominent ML libraries such as PyTorch.
Key facts. Cited by 16 papers in the map (data through 7 Oct 2026). Builds on 3 of its 18 references that are in the map. First posted on arXiv 6 Mar 2021.
Builds on
3 of 18 references.
References · 3
- 2020AI Lifecycle Models Need To Be Revised. An Exploratory Study in Fintechcited by 33
- 2020Code Smells and Refactoring: A Tertiary Systematic Review of Challenges and Observationscited by 18
- 2020A large-scale comparative analysis of Coding Standard conformance in Open-Source Data Science projectscited by 9
Built on by
Citing papers per year: 2022: 5; 2023: 4; 2024: 2; 2025: 3; 2026: 2.
16 papers.
Sort:
By area:
- 2023A Static Evaluation of Code Completion by Large Language Modelscited by 14
- 2024PeaTMOSS: A Dataset and Initial Analysis of Pre-Trained Models in Open-Source Softwarecited by 9
- 2022Code Smells for Machine Learning Applicationscited by 7
- 2022Quality issues in Machine Learning Software Systemscited by 7
- 2022"Project smells" -- Experiences in Analysing the Software Quality of ML Projects with mllintcited by 2
- 2024ZS4C: Zero-Shot Synthesis of Compilable Code for Incomplete Code Snippets using LLMscited by 2
- 2025MLScent A tool for Anti-pattern detection in ML projectscited by 2
- 2022MLSmellHound: A Context-Aware Code Analysis Toolcited by 1
- 2022Assessing the Quality of Computational Notebooks for a Frictionless Transition from Exploration to Productioncited by 1
- 2023PeaTMOSS: Mining Pre-Trained Models in Open-Source Softwarecited by 1
- 2023Quality Issues in Machine Learning Software Systemscited by 0
- 2023Good Tools are Half the Work: Tool Usage in Deep Learning Projectscited by 0
4 more
- 2025Automatic Identification of Machine Learning-Specific Code Smellscited by 0
- 2025Analysing Python Machine Learning Notebooks with Moosecited by 0
- 2026Quality and Security Signals in AI-Generated Python Refactoring Pull Requestscited by 0
- 2026From AI Technical Debt to Agentic Technical Debt: A Systematic Mapping of Root Causes and Manifestations in Agentic AI Systemscited by 0
- 2026From AI Technical Debt to Agentic Technical Debt: A Systematic Mapping of Root Causes and Manifestations in Agentic AI Systems2 Aug 2026
- 2026Quality and Security Signals in AI-Generated Python Refactoring Pull Requests20 May 2026
- 2025Analysing Python Machine Learning Notebooks with Moose15 Sep 2025
- 2025Automatic Identification of Machine Learning-Specific Code Smells4 Aug 2025
- 2025MLScent A tool for Anti-pattern detection in ML projects30 Jan 2025
- 2024PeaTMOSS: A Dataset and Initial Analysis of Pre-Trained Models in Open-Source Software1 Feb 2024
- 2024ZS4C: Zero-Shot Synthesis of Compilable Code for Incomplete Code Snippets using LLMs25 Jan 2024
- 2023Good Tools are Half the Work: Tool Usage in Deep Learning Projects29 Oct 2023
- 2023PeaTMOSS: Mining Pre-Trained Models in Open-Source Software5 Oct 2023
- 2023Quality Issues in Machine Learning Software Systems26 Jun 2023
- 2023A Static Evaluation of Code Completion by Large Language Models5 Jun 2023
- 2022Quality issues in Machine Learning Software Systems18 Aug 2022
4 more
- 2022Assessing the Quality of Computational Notebooks for a Frictionless Transition from Exploration to Production24 May 2022
- 2022MLSmellHound: A Context-Aware Code Analysis Tool8 May 2022
- 2022Code Smells for Machine Learning Applications25 Mar 2022
- 2022"Project smells" -- Experiences in Analysing the Software Quality of ML Projects with mllint20 Jan 2022
- 2023A Static Evaluation of Code Completion by Large Language Modelscited by 14
- 2024PeaTMOSS: A Dataset and Initial Analysis of Pre-Trained Models in Open-Source Softwarecited by 9
- 2022Code Smells for Machine Learning Applicationscited by 7
- 2022Quality issues in Machine Learning Software Systemscited by 7
- 2022"Project smells" -- Experiences in Analysing the Software Quality of ML Projects with mllintcited by 2
- 2024ZS4C: Zero-Shot Synthesis of Compilable Code for Incomplete Code Snippets using LLMscited by 2
- 2025MLScent A tool for Anti-pattern detection in ML projectscited by 2
- 2022MLSmellHound: A Context-Aware Code Analysis Toolcited by 1
- 2022Assessing the Quality of Computational Notebooks for a Frictionless Transition from Exploration to Productioncited by 1
- 2023PeaTMOSS: Mining Pre-Trained Models in Open-Source Softwarecited by 1
- 2023Quality Issues in Machine Learning Software Systemscited by 0
- 2023Good Tools are Half the Work: Tool Usage in Deep Learning Projectscited by 0
12 most cited of 14 All 14 (JSON)
- 2025Analysing Python Machine Learning Notebooks with Moose15 Sep 2025
- 2025Automatic Identification of Machine Learning-Specific Code Smells4 Aug 2025
- 2025MLScent A tool for Anti-pattern detection in ML projects30 Jan 2025
- 2024PeaTMOSS: A Dataset and Initial Analysis of Pre-Trained Models in Open-Source Software1 Feb 2024
- 2024ZS4C: Zero-Shot Synthesis of Compilable Code for Incomplete Code Snippets using LLMs25 Jan 2024
- 2023Good Tools are Half the Work: Tool Usage in Deep Learning Projects29 Oct 2023
- 2023PeaTMOSS: Mining Pre-Trained Models in Open-Source Software5 Oct 2023
- 2023Quality Issues in Machine Learning Software Systems26 Jun 2023
- 2023A Static Evaluation of Code Completion by Large Language Models5 Jun 2023
- 2022Quality issues in Machine Learning Software Systems18 Aug 2022
- 2022Assessing the Quality of Computational Notebooks for a Frictionless Transition from Exploration to Production24 May 2022
- 2022MLSmellHound: A Context-Aware Code Analysis Tool8 May 2022
12 newest of 14 All 14 (JSON)