Automated review of source code for style issues
AssigneeRubrik, Inc.
InventorsZhicong Wang, Pranava Adduri, Abhinav Adduri
Life of this patent
Estimating the term…
Abstract
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.
Claims20
A method implemented on a computer system, the computer system executing instructions to effect a method for automatically identifying style issues in a source code base, the method comprising:
- accessing a reference set for a known style issue, the reference set including source code examples that exhibit the style issue, the style issue including an extra newline error;
- comparing the source code examples in the reference set to the source code base, the source code examples including a first source code example comprising a source code line immediately before a location of the extra newline error and a source code line immediately after the location of the extra newline error;
- automatically extracting source code examples from the prior source code bases, based on the locations identified in the prior style reviews;
- calculating individual scores for comparison of each source code example with the source code base, the individual scores being machine-readable binary variables;
- and
- based on the comparison, identifying locations in the source code base that are likely to exhibit the style issue.
Anon-transitory computer-readable storage medium storing executable computer program instructions for automatically identifying style issues in a source code base, the instructions executable by a computer system and causing the computer system to perform a method comprising:
- accessing a reference set for a known style issue, the reference set including source code examples that exhibit the style issue, the style issue including an extra newline error:
- comparing the source code examples in the reference set to the source code base, the source code examples including a first source code example comprising a source code line immediately before a location of the extra newline error and a source code line immediately after the location of the extra newline error;
- automatically extracting source code examples from the prior source code bases, based on the locations identified in the prior style reviews;
- calculating individual scores for comparison of each source code example with the source code base, the individual scores being machine-readable binary variables;
- and
- based on the comparison, identifying locations in the source code base that are likely to exhibit the style issue.
Dependencies are inferred from the claim text.