Manuscript Offprint

arXiv:2610.19167

Beyond Functional Correctness: Static Code Quality Profiling of LLM-Generated Code

Jue Huang, Tarek Mahmud, Meiru Che, Guowei Yang

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Jue Huang 1^{1}, Tarek Mahmud 2^{2}, Meiru Che 3^{3}, and Guowei Yang 1^{1}

1^{1} The University of Queensland, Brisbane, QLD, Australia

jue.huang, guowei.yang@uq.edu.au

2^{2} Texas A&M University–Kingsville, Kingsville, TX, USA

Tarek.Mahmud@tamuk.edu

3^{3} Central Queensland University, Brisbane, QLD, Australia

m.che@cqu.edu.au

Abstract. Large language models (LLMs) are increasingly used for code generation, yet most evaluations still focus on whether generated code passes benchmark test suites. Functional correctness alone, however, provides only a limited view of quality: benchmark tests are often incomplete, and passing them does not guarantee that code is maintainable, reliable, or well-structured. This paper presents a large-scale static quality profiling of LLM-generated Python code, with a focus on maintainability and reliability. Using 65,663 programs from 73 models in LiveCodeBench, we evaluate generated code with established static analysis tools, including Pylint, Radon, and SonarQube. Our results show systematic differences across models that are not captured by correctness alone, with maintainability emerging as the clearest source of variation. We further find that correctness often comes with structural trade-offs rather than uniformly simpler solutions. Overall, our findings motivate evaluation frameworks that assess LLM-generated code beyond pass rates alone.

Keywords: Large Language Models · Code Generation · Static Analysis · Code Quality Profiling · Maintainability

1 Introduction

LLMs are increasingly used in software development to assist with programming tasks, generate candidate solutions, and support rapid prototyping. As instruction-tuned and code-specialized models become more common, automated code generation is becoming routine in both industry and academia. This makes it increasingly important to understand not only whether generated code works, but also its structural and non-functional properties.

To the best of our knowledge, recent evaluations focus on functional correctness, typically measured by whether generated programs pass benchmark test suites such as HumanEval [9] and MBPP [4]. While this has been useful for establishing common baselines, correctness alone provides only a limited view of code quality. A program may pass benchmark tests yet still be unnecessarily complex, hard to read, or difficult to maintain.

J. Huang et al.

Prior work suggests that LLM-generated code can exhibit maintainability and structural quality issues, including unnecessary complexity, naming problems, and other code-quality concerns [20, 1].

Software engineering research has long emphasized the importance of non-functional attributes such as maintainability, reliability, and security. As LLM-generated code becomes part of real development workflows, these non-functional dimensions deserve systematic evaluation.

Despite growing interest in LLM-based code generation, the structural properties of generated code remain underexplored at scale. Existing benchmarks provide limited visibility into non-functional quality, and relatively few studies [42, 1] evaluate generated code using static analysis tools commonly employed in practice. Afrin et al. [1] examine how quantization affects the functional performance and static code-quality properties of large code-generation models. However, it remains unclear what static code-quality profiles different LLMs exhibit, which quality dimensions most clearly distinguish them, and how these profiles vary across task difficulty levels.

To address this gap, we present a large-scale static code-quality profiling study of LLM-generated Python programs using a broad set of static quality metrics. We combine widely used software engineering tools—Pylint [40], Radon [26], and SonarQube [39]—to analyze code style, refactoring signals, structural complexity, maintainability, reliability, and security-related warnings. Our study covers 65,663 programs generated by 73 LLMs from the LiveCodeBench [21] dataset, spanning diverse model families and task difficulty levels. We use these complementary metrics to characterize and compare multidimensional static quality profiles across models and across Easy, Medium, and Hard tasks.

To support the interpretation of these profiles, we additionally analyze functionally correct programs separately and report length-normalized metrics for the correct-only subset. These analyses help determine whether the observed patterns are influenced by incomplete failed implementations or differences in code volume. We treat them as supporting analyses rather than separate research objectives.

Our analysis reveals systematic differences in how LLMs structure code, identifying patterns that are not captured by correctness-based evaluation alone. In particular, maintainability emerges as a key dimension for distinguishing model behavior. As task difficulty increases, generated programs generally become longer and more structurally involved, while the corresponding changes in static-analysis findings depend on whether raw counts or length-normalized measures are considered.

This work makes the following contributions toward profiling the static quality of LLM-generated code beyond functional correctness:

– A large-scale static code-quality profiling study of LLM-generated code. Using established analysis tools—Pylint, Radon, and SonarQube—we profile maintainability, reliability, security-related findings, structural complexity, and code size in 65,663 Python programs generated by 73 LLMs in the LiveCodeBench dataset.

– Characterization of cross-model and cross-difficulty code-quality profiles. We identify consistent stylistic and structural tendencies across LLMs and show how multiple static quality dimensions vary across Easy, Medium, and Hard programming tasks.

– Reproducibility through artifact availability. We release all code, analysis scripts, and aggregated experimental results to support reproducibility and enable further investigation 4^{4}.

References (47)