Automated Source Code Style Issue Detection via String Convolution

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Current methods for reviewing source code for formatting issues are inefficient, as they require significant manual effort and vary by organization, language, and project, making it difficult to develop a single review tool that can apply uniformly across different code bases, and styles often evolve over time without formal documentation.

Innovation Solution

A computer system that automatically identifies style issues in source code by using a reference set of examples, comparing them to the code base through string convolution and machine learning models, and suggesting or auto-correcting issues, allowing for real-time or batch processing.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If manual code review is performed, then style issues can be identified, but it requires significant time and effort from software engineers

Engineering Contradiction:
Improvestyle issue detection accuracyVSAvoidtime spent on code review
Core Design Contradiction:
Measurement precisionVSLoss of time

Solution Approach 1:

The system enables self-service by allowing the codebase to review itself through automated style checking. The reference set of code examples with known style issues is compared against the target codebase using string convolution, enabling the system to automatically identify style problems without requiring manual engineer review for each issue.

Inventive Principle:
Principle #25Self-service

Solution Approach 2:

The patent replaces the mechanical manual review process with an automated computational system. Instead of engineers manually reading and evaluating code, the system uses string convolution algorithms and machine learning models to automatically detect style issues, substituting human cognitive labor with automated computational mechanisms.

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

2Adaptability or versatility

If a single review tool is developed to cover all code bases, then versatility is improved, but the complexity of the tool increases due to varying styles across organizations and languages

Engineering Contradiction:
Improveapplicability across different code basesVSAvoidreview software complexity
Core Design Contradiction:
Adaptability or versatilityVSDevice complexity

Solution Approach 1:

The system achieves universality by creating a single review tool that can handle multiple code bases with different styles. The reference set approach allows the same tool to be applied across different organizations, languages, and projects by comparing against stored examples, eliminating the need for separate review tools for each codebase.

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

Solution Approach 2:

The patent employs parameter changes by allowing the review system to adapt to different coding styles through the reference set. Instead of hardcoding specific style rules, the system changes its comparison parameters by selecting appropriate reference examples from the stored set, enabling it to detect style issues in diverse code bases without changing the core algorithm.

Inventive Principle:
Principle #35Parameter changes

3Stability of the object's composition

If style guides are formally documented, then style consistency is improved, but the effort required to document and maintain the guide increases

Engineering Contradiction:
Improvestyle consistencyVSAvoidtime to document and maintain style guide
Core Design Contradiction:
Stability of the object's compositionVSLoss of time

Solution Approach 1:

The system performs preliminary action by pre-storing reference sets of code examples with known style issues before actual review is needed. These reference sets are created in advance and can be directly compared against target codebases, eliminating the need for ongoing manual documentation and maintenance of style guides while ensuring consistent style detection.

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentUS11294792B2Automated review of source code for style issues
Publication Date: 2022.04.05 RUBRIK INC
  • US11294792B2 patent drawing
  • US11294792B2 patent drawing
  • US11294792B2 patent drawing

AI summary

In one aspect, a computer system automatically identifies style issues in a source code base. A reference set for a known style issue includes source code examples that exhibit the style issue. The source code examples in the reference set are compared to the source code base, for example using string convolution. Based on the comparison, locations in the source code base that are likely to exhibit the style issue are identified. Various steps in the processing may be implemented using machine learning models, clustering or other automated data science techniques.