SpecDetect4ML: Detecting Non-Local ML Code Smells with Code Property Graphs
Not on the map. Why?
Abstract (arXiv)
Machine Learning (ML) pipelines encode quality-relevant decisions across data preparation, training, evaluation, and configuration code. Some recurring source-level quality problems in these pipelines, known as ML code smells, may not cause immediate failures but can harm reproducibility, robustness, efficiency, or maintainability. Detecting ML code smell occurrences is challenging because the decisive evidence is often non-local, spanning helper functions, wrappers, imports, control-flow, and data-flow relations. We present SpecDetect4ML, a static analyser that operationalises 22 ML code smells using CPG views with project-level resolution. We evaluate it on 890 Python ML-based systems comprising more than 20M LOC and a system-level recall benchmark over the complete ML-relevant source subset of 10 selected systems. Under identical ML code smell specifications, CPG-based reasoning raises recall from 68.62% to 88.14% compared with AST-only analysis, while keeping CPG precision comparable at 90.32%. These results show that project-level static reasoning expands the detectable portion of non-local ML code smell occurrences, while configuration-dependent and runtime-only occurrences remain outside our source-only static claims.
Key facts. Cited by 1 paper in the map (data through 14 Oct 2026). Builds on 4 of its 24 references that are in the map. First posted on arXiv 24 Sep 2025.
Builds on
4 of 24 references.
References · 4
- 2023A Synthesis of Green Architectural Tactics for ML-Enabled Systemscited by 17
- 2022Code Smells for Machine Learning Applicationscited by 8
- 2018Ariadne: Analysis for Machine Learning Programcited by 4
- 2024When Code Smells Meet ML: On the Lifecycle of ML-specific Code Smells in ML-enabled Systemscited by 2
Built on by
Citing papers per year: 2026: 1.
1 paper.
- 2026LLM Code Smells: A Taxonomy and Detection Approachcited by 0
- 2026LLM Code Smells: A Taxonomy and Detection Approach21 May 2026