LLM-Based Code Quality Evaluation and Iterative Improvement

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing methods for evaluating and improving code quality are subjective, time-consuming, and inflexible, lacking comprehensive assessment across multiple dimensions and being specific to programming languages.

Innovation Solution

Utilizing a large language model (LLM) to evaluate and improve code quality by assessing multiple dimensions such as readability, maintainability, testability, efficiency, robustness, security, documentation, modularity, and scalability, with a framework that provides quantitative and qualitative feedback for iterative improvement.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Adaptability or versatility

If manual code reviews are used to evaluate code quality, then the evaluation can be subjective and flexible, but it becomes time-consuming and requires programming language specific expertise

Engineering Contradiction:
Improveflexibility in evaluationVSAvoidtime-consuming
Core Design Contradiction:
Adaptability or versatilityVSLoss of time

Solution Approach 1:

The patent replaces manual code review processes with an automated LLM-based evaluation system. The LLM processes code through API calls, automatically assessing multiple quality dimensions without human intervention, thereby eliminating the time-consuming nature of manual reviews while maintaining comprehensive evaluation capabilities

Inventive Principle:
Principle #28Mechanics substitution (Replace mechanical system)

Solution Approach 2:

The LLM-based system provides universal evaluation across multiple programming languages and diverse code quality dimensions simultaneously. The same evaluation framework can assess readability, maintainability, testability, efficiency, robustness, security, documentation, modularity, and scalability across different programming languages without requiring language-specific expertise

Inventive Principle:
Principle #6Universality (Multi-functionality)

2Productivity

If algorithmic assessments are used to evaluate code quality, then the evaluation becomes objective and efficient, but it becomes narrow focused, inflexible, and non-exhaustive

Engineering Contradiction:
Improveevaluation efficiencyVSAvoidflexibility in assessment
Core Design Contradiction:
ProductivityVSAdaptability or versatility

Solution Approach 1:

The system implements iterative feedback loops where the LLM evaluates code quality dimensions, provides detailed feedback reports, and enables code generation based on the evaluation results. This feedback mechanism allows the system to maintain objectivity while adapting to different code structures and providing comprehensive assessments across multiple quality dimensions

Inventive Principle:
Principle #23Feedback

Solution Approach 2:

The patent changes the evaluation parameters from fixed algorithmic metrics to dynamic LLM-based assessments that can adapt to different programming languages and code styles. The system evaluates multiple quality dimensions including readability, maintainability, testability, efficiency, robustness, security, documentation, modularity, and scalability, providing flexible and comprehensive feedback

Inventive Principle:
Principle #35Parameter changes

3Device complexity

If existing code quality evaluation methods are used, then the process is straightforward, but it lacks comprehensive assessment across multiple dimensions

Engineering Contradiction:
Improvesimplicity of processVSAvoidcomprehensive assessment
Core Design Contradiction:
Device complexityVSMeasurement precision

Solution Approach 1:

The patent segments the code quality evaluation into multiple distinct dimensions including readability, maintainability, testability, efficiency, robustness, security, documentation, modularity, and scalability. Each dimension is evaluated separately by the LLM, allowing comprehensive assessment while maintaining an organized and manageable evaluation process through structured feedback reports

Inventive Principle:
Principle #1Segmentation

Data Source

PatentUS20250272218A1Systems and methods for automated evaluation and improvement of code quality
Publication Date: 2025.08.28 JPMORGAN CHASE BANK NA
  • US20250272218A1 patent drawing
  • US20250272218A1 patent drawing
  • US20250272218A1 patent drawing

AI summary

Automated evaluation and improvement of code quality is disclosed. A method may include: receiving code to optimize; evaluating the code for a plurality of code quality dimensions using a LLM, wherein the LLM returns a code quality score and a qualitative summary for each code quality dimension; generating an overall code quality score based on the code quality score and the qualitative summary; improving the code using the LLM based on the code quality score and the qualitative summary for each code quality dimension; evaluating the improved code for the plurality of code quality dimensions using the wherein the LLM returns an updated code quality score and an updated qualitative summary; generating an overall code quality score based on the updated code quality score and the updated qualitative summary; and outputting the improved code in response to the updated code quality score being higher than the overall code quality score.