Assessing the Quality and Security of AI-Generated Code: A Quantitative Analysis
Not on the map. Why?
Abstract (arXiv)
This study presents a quantitative evaluation of the code quality and security of five prominent Large Language Models (LLMs): Claude Sonnet 4, Claude 3.7 Sonnet, GPT-4o, Llama 3.2 90B, and OpenCoder 8B. While prior research has assessed the functional performance of LLM-generated code, this research tested LLM output from 4,442 Java coding assignments through comprehensive static analysis using SonarQube. The findings suggest that although LLMs can generate functional code, they also introduce a range of software defects, including bugs, security vulnerabilities, and code smells. These defects do not appear to be isolated; rather, they may represent shared weaknesses stemming from systemic limitations within current LLM code generation methods. In particular, critically severe issues, such as hard-coded passwords and path traversal vulnerabilities, were observed across multiple models. These results indicate that LLM-generated code requires verification in order to be considered production-ready. This study found no direct correlation between a model's functional performance (measured by Pass@1 rate of unit tests) and the overall quality and security of its generated code, measured by the number of SonarQube issues in benchmark solutions that passed the functional tests. This suggests that functional benchmark performance score is not a good indicator of overall code quality and security. The goal of this study is not to rank LLM performance but to highlight that all evaluated models appear to share certain weaknesses. Consequently, these findings support the view that static analysis can be a valuable instrument for detecting latent defects and an important safeguard for organizations that deploy AI in software development.
Key facts. Cited by 7 papers in the map (data through 14 Oct 2026). Builds on 7 of its 26 references that are in the map. First posted on arXiv 20 Aug 2025.
Builds on
7 of 26 references.
References · 7
- 2021Evaluating Large Language Models Trained on Codecited by 8,320
- 2024GPT-4o System Cardcited by 4,588
- 2023Large Language Models for Software Engineering: Survey and Open Problemscited by 181
- 2024OpenCoder: The Open Cookbook for Top-Tier Code Large Language Modelscited by 130
- 2024ComplexCodeEval: A Benchmark for Evaluating Large Code Models on More Complex Codecited by 19
- 2025The Hidden Risks of LLM-Generated Web Application Code: A Security-Centric Evaluation of Code Generation Capabilities in Large Language Modelscited by 7
- 2024Analyzing the concept of technical debt in the context of agile software development: A systematic literature reviewcited by 1
Built on by
Citing papers per year: 2025: 1; 2026: 6.
7 papers.
- 2025AI Code in the Wild: Measuring Security Risks and Ecosystem Shifts of AI-Generated Code in Modern Softwarecited by 4
- 2026A Guide to Large Language Models in Modeling and Simulation: From Core Techniques to Critical Challengescited by 3
- 2026Can Large Language Models Implement Agent-Based Models? An ODD-based Replication Studycited by 1
- 2026Beyond Functional Correctness: Design Issues in AI IDE-Generated Large-Scale Projectscited by 1
- 2026VibeJam: A User Study Platform for Web Development with Agentscited by 0
- 2026What is the Difference Between Me and You? Benchmarking the Quality Gap Between Human-Written and AI-Generated Codecited by 0
- 2026QTestBench: A Test Framework for Evaluating LLM-Generated Quantum Codecited by 0
- 2026QTestBench: A Test Framework for Evaluating LLM-Generated Quantum Code9 Oct 2026
- 2026What is the Difference Between Me and You? Benchmarking the Quality Gap Between Human-Written and AI-Generated Code11 Sep 2026
- 2026VibeJam: A User Study Platform for Web Development with Agents30 Aug 2026
- 2026Beyond Functional Correctness: Design Issues in AI IDE-Generated Large-Scale Projects7 Apr 2026
- 2026Can Large Language Models Implement Agent-Based Models? An ODD-based Replication Study8 Feb 2026
- 2026A Guide to Large Language Models in Modeling and Simulation: From Core Techniques to Critical Challenges5 Feb 2026
- 2025AI Code in the Wild: Measuring Security Risks and Ecosystem Shifts of AI-Generated Code in Modern Software21 Dec 2025