Code Review System Using Graph-Based Context and Multi-Model Validation

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Ensuring code quality and identifying issues in software development is a challenging task due to the presence of bugs, errors, and inefficiencies, which can lead to unexpected behavior, application crashes, and poor user experience.

Innovation Solution

A computer-based system comprising a processor that performs operations including obtaining code, parsing it to generate a structural representation, processing the code and structural representation to generate a context, and using language models to generate and validate issue reports, prioritize them, and provide them to users.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If multiple language models are used to generate and validate issue reports, then the reliability of issue detection is improved, but the device complexity increases

Engineering Contradiction:
Improveissue detection reliabilityVSAvoidsystem complexity
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The system segments the code review task into multiple independent language models, each specializing in detecting specific categories of issues (e.g., security vulnerabilities, performance problems, code quality). This segmentation allows each model to focus on particular aspects, improving overall detection reliability while maintaining manageable complexity through modular architecture

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

Multiple language models are merged into a unified system that processes code together. The models work in parallel to generate issue reports, which are then aggregated and validated by additional models. This merging leverages the strengths of each individual model while achieving comprehensive code analysis through collective validation

Inventive Principle:
Principle #5Merging (Combining)

2Manufacturing precision

If comprehensive code analysis is performed to identify all issues, then the manufacturing precision of code quality assessment is improved, but the loss of time increases

Engineering Contradiction:
Improvecode quality assessment precisionVSAvoidcode review time
Core Design Contradiction:
Manufacturing precisionVSLoss of time

Solution Approach 1:

The system performs preliminary actions by generating structural representations of code (such as abstract syntax trees and dependency graphs) before detailed issue detection. This preliminary structuring organizes the code into manageable components, enabling faster and more precise issue identification during the subsequent analysis phase by multiple language models

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The system employs multiple language models that may generate more issue reports than actually exist (excessive action), including some false positives. However, additional validation models then filter these reports to identify genuine issues. This approach ensures comprehensive coverage and high precision by over-analyzing and then validating, rather than attempting to be perfectly efficient from the start

Inventive Principle:
Principle #16Partial or excessive action

3Measurement precision

If contextual information is generated and processed for code review, then the measurement precision of issue identification is improved, but the use of energy increases

Engineering Contradiction:
Improveissue identification precisionVSAvoidprocessing energy
Core Design Contradiction:
Measurement precisionVSUse of energy by moving object

Solution Approach 1:

The system extracts only the most relevant contextual information from the codebase, such as structural representations, dependency relationships, and key code segments. By taking out and focusing on essential context rather than processing all code uniformly, the system achieves high measurement precision for issue identification while reducing the overall energy required for analysis

Inventive Principle:
Principle #2Taking out (Extraction)

Data Source

PatentUS12340191B1Systems and methods for reviewing code
Publication Date: 2025.06.24 BOOSTSECURITY IO INC
  • US12340191B1 patent drawing
  • US12340191B1 patent drawing
  • US12340191B1 patent drawing

AI summary

Provided herein is a method for reviewing code. The method can comprise parsing the code to generate a structural representation of the code, wherein the structural representation comprises a graph representative of the code. The method can comprise processing the code and the structural representation to generate a context for the code based at least in part on the graph. The method can comprise processing the context and a set of prompts to generate a set of contextualized prompts, wherein at least two prompts in the set of prompts are specific for different categories of issues. The method can comprise prompting a first set of language models with the set of contextualized prompts to generate a set of issue reports. The method can comprise prompting a second set of language models to generate a set of validated issue reports comprising a set of non-hallucinated issue report.