# US 12,007,877 B1 · Visual query language for code review rules

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 12,007,877 B1
- Document ID: US12007877B1
- Status: Granted
- Kind: B1
- Application number: 17/708,269
- Filed: 2022-03-30
- Granted: 2024-06-11
- Earliest claimed: 2022-03-30
- Assignees: Amazon Technologies, Inc.
- Applicants: Amazon Technologies, Inc.
- Inventors: Pranav Garg; Sengamedu Hanumantha Rao Srinivasan; Omer Tripp; Abhin Sharma
- Web page: https://patentgrep.com/patent/US12007877B1

## CPC

- G06F 11/3698: Environments for analysis, debugging or testing of software
- G06F 11/3688: {for test execution, e.g. scheduling of test suites}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Techniques for providing a visual code review editor are described. An electronic device is caused to display a graphical user interface including an editor portion to edit code review rules used by a code review service of a cloud provider network. The editor portion of the graphical user interface is caused to display a first graph associated with a first code review rule, the first graph including a first node, a second node, and a first edge connecting the first node and the second node. An indication that a third node has been added to the graph via the editor portion of the graphical user interface is received. The first code review rule is updated by the code review service to reflect the addition of the third node, the first code review rule is in a text format.

## Claims

### Claim 1

A computer-implemented method comprising:
causing an electronic device to display a graphical user interface including an editor portion to edit code review rules used by a code review service of a cloud provider network;
causing the editor portion of the graphical user interface to display a first graph associated with a first code review rule, wherein the first graph includes a first node, a second node, and a first edge connecting the first node and the second node;
receiving an indication that a third node has been added to the first graph via the editor portion of the graphical user interface;
updating, by the code review service, the first code review rule to reflect the addition of the third node, wherein the first code review rule is in a text format;
receiving, from the electronic device, an indication to review at least a portion of source code;
identifying, by the code review service, a first sequence of operations in the portion of source code that match a second sequence of operations specified by the first code review rule; and
providing an indication of a location of the first sequence of operations in the portion of source code to the electronic device.

### Claim 2 (depends on 1)

The computer-implemented method of claim 1, wherein edges in the first graph correspond to data-flow or control dependencies between nodes, wherein nodes in the first graph correspond to data or action nodes, and wherein the first graph represents a sequence of operations to match buggy code by the code review service.

### Claim 3 (depends on 1)

The computer-implemented method of claim 1, wherein the graphical user interface further includes a test case editor portion, the test case editor portion providing for entry of code against which the first code review rule can be evaluated.

### Claim 4

A computer-implemented method comprising:
causing an electronic device to display a graphical user interface including an editor portion to edit code review rules used by a code review service of a cloud provider network;
causing the editor portion of the graphical user interface to display a first graph associated with a first code review rule, wherein the first graph includes a first node, a second node, and a first edge connecting the first node and the second node;
receiving an indication that a third node has been added to the first graph via the editor portion of the graphical user interface; and
updating, by the code review service, the first code review rule to reflect the addition of the third node, wherein the first code review rule is in a text format.

### Claim 5 (depends on 4)

The computer-implemented method of claim 4, wherein edges in the first graph correspond to data-flow or control dependencies between nodes, wherein nodes in the first graph correspond to data or action nodes, and wherein the first graph represents a sequence of operations to match buggy code by the code review service.

### Claim 6 (depends on 4)

The computer-implemented method of claim 4, further comprising: upon selection of a particular node in the first graph in the editor portion of the graphical user interface, causing a display of one or more operations that can be performed on the particular node, wherein the one or more operations include at least one of an edit operation and a delete operation.

### Claim 7 (depends on 6)

The computer-implemented method of claim 6, further comprising:
receiving an indication of a selection of the delete operation for the particular node; and
updating, by the code review service, the first code review rule to reflect the deletion of the particular node.

### Claim 8 (depends on 4)

The computer-implemented method of claim 4, further comprising: upon selection of a particular edge in the first graph in the editor portion of the graphical user interface, causing a display of one or more operations that can be performed on the particular edge, wherein the one or more operations include at least one of a delete operation and an insert node option.

### Claim 9 (depends on 8)

The computer-implemented method of claim 8, further comprising:
receiving an indication of a selection of the delete operation for the particular edge; and
updating, by the code review service, the first code review rule to reflect the deletion of the particular edge.

### Claim 10 (depends on 4)

The computer-implemented method of claim 4, wherein the graphical user interface further includes a test case editor portion, the test case editor portion providing for entry of code against which the first code review rule can be evaluated.

### Claim 11 (depends on 10)

The computer-implemented method of claim 10, further comprising:
receiving an indication to run a first test case via the test case editor portion of the graphical user interface;
determine, by the code review service, whether a first sequence of operations in the first test case matches a second sequence of operations specified by the first code review rule; and
causing the graphical user interface to display an indication of whether the first sequence of operations in the first test case matched a second sequence of operations specified by the first code review rule.

### Claim 12 (depends on 4)

The computer-implemented method of claim 4, further comprising:
receiving, from the electronic device, an indication to review at least a portion of source code;
identifying a first sequence of operations in the portion of source code that match a second sequence of operations specified by the first code review rule; and
providing an indication of a location of the first sequence of operations in the portion of source code to the electronic device.

### Claim 13 (depends on 4)

The computer-implemented method of claim 4, wherein updating the first code review rule to reflect the addition of the third node includes modifying a plurality of lines of code in the first code review rule.

### Claim 14

A system comprising:
a first one or more electronic devices to implement a data store in a multi-tenant provider network, the data store to store a plurality of code review rules; and
a second one or more electronic devices to implement a code reviewer service in the multi-tenant provider network, the code reviewer service including instructions that upon execution cause the code reviewer service to:
cause an electronic device to display a graphical user interface including an editor portion to edit code review rules;
retrieve a first code review rule from the data store;
cause the editor portion of the graphical user interface to display a first graph associated with the first code review rule, wherein the first graph includes a first node, a second node, and a first edge connecting the first node and the second node;
receive an indication that a third node has been added to the first graph via the editor portion of the graphical user interface;
update the first code review rule to reflect the addition of the third node, wherein the first code review rule is in a text format; and
store the updated first code review rule in the data store.

### Claim 15 (depends on 14)

The system of claim 14, wherein edges in the first graph correspond to data-flow or control dependencies between nodes, wherein nodes in the first graph correspond to data or action nodes, and wherein the first graph represents a sequence of operations to match buggy code by the code review service.

### Claim 16 (depends on 14)

The system of claim 14, wherein the code reviewer service includes further instructions that upon execution cause the code reviewer service to cause a display of one or more operations that can be performed on a particular node upon selection of the particular node in the first graph in the editor portion of the graphical user interface, wherein the one or more operations include at least one of an edit operation and a delete operation.

### Claim 17 (depends on 16)

The system of claim 16, wherein the code reviewer service includes further instructions that upon execution cause the code reviewer service to:
receive an indication of a selection of the delete operation for the particular node; and
update the first code review rule to reflect the deletion of the particular node.

### Claim 18 (depends on 14)

The system of claim 14, wherein the code reviewer service includes further instructions that upon execution cause the code reviewer service to cause a display of one or more operations that can be performed on a particular edge upon selection of the particular edge in the first graph in the editor portion of the graphical user interface, wherein the one or more operations include at least one of a delete operation and an insert node option.

### Claim 19 (depends on 14)

The system of claim 14, wherein the graphical user interface further includes a test case editor portion, the test case editor portion providing for entry of code against which the first code review rule can be evaluated.

### Claim 20 (depends on 19)

The system of claim 19, wherein the code reviewer service includes further instructions that upon execution cause the code reviewer service to:
receive an indication to run a first test case via the test case editor portion of the graphical user interface;
determine whether a first sequence of operations in the first test case matches a second sequence of operations specified by the first code review rule; and
causing the graphical user interface to display an indication of whether the first sequence of operations in the first test case matched a second sequence of operations specified by the first code review rule.
