# US 10,481,880 B2 · Code lineage tool

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

- Number: US 10,481,880 B2
- Document ID: US10481880B2
- Status: Granted
- Kind: B2
- Application number: 15/646,448
- Filed: 2017-07-11
- Published: 2019-01-17
- Granted: 2019-11-19
- Earliest claimed: 2017-07-11
- Assignees: Bank of America Corporation
- Applicants: Bank of America Corporation
- Inventors: Prashant Wason; Vijaya Rudraraju
- Web page: https://patentgrep.com/patent/US10481880B2

## CPC

- G06F 8/427: {Parsing}
- G06F 8/75: Structural analysis for program understanding
- G06F 8/43: {Checking; Contextual analysis}
- G06F 8/433: {Dependency analysis; Data or control flow analysis}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A code lineage tool includes a scanner, a parser, and an integrator. The scanner identifies a plurality of elements in software code. The parser determines that a value of a first element is affected by a second element and a third element. The parser adds the first element to a parse tree and adds the second and third elements to the parse tree as sub-nodes of the first element. The parser determines that a value of the second element is affected by a fourth element and adds the fourth element to the parse tree as a sub-node of the second element. The integrator determines that a change to the fourth element will change the value of the first element and the value of the second element and generates a lineage for the first element.

## Claims

### Claim 1

A code lineage tool comprising:
a scanner configured to identify a plurality of elements in software code by scanning the software code;
a hardware processor configured to implement:
a parser configured to:
determine, based on a stored grammar file, that a first element of the plurality of elements is a function whose value is affected by a second element of the plurality of elements and a third element of the plurality of elements;
determine, based on the grammar file, that the second and third elements are variables and are used when calling the first element;
add the first element to a parse tree;
add the second and third elements to the parse tree as sub-nodes of the first element in response to the determination that the second and third elements are used when calling the first element;
determine, based on the stored grammar file, that a value of the second element is affected by a fourth element of the plurality of elements; and
add the fourth element to the parse tree as a sub-node of the second element in response to the determination that the value of the second element is affected by the fourth element; and
an integrator configured to:
determine that the third element is not needed when calling the first element when the second element is provided to the first element;
determine, based on the parse tree, that a change to the fourth element will change the value of the first element and the value of the second element;
generate a lineage for the first element, the lineage comprising an identification of the first element, the second element, and the fourth element and an indication that the first element is based on the second element and that the second element is based on the fourth element;
exclude the third element from the lineage in response to the determination that the third element is not needed when calling the first element when the second element is provided to the first element;
determine, based on the parse tree, that when a change to a fifth element of the software code occurs, no corresponding change occurs in the first, second, and third elements;
exclude the fifth element from the lineage in response to the determination that no corresponding change occurs when the change to the fifth element occurs;
determine, based on the parse tree, that a sixth element of the software code will not execute as a result of a switch statement;
exclude the sixth element from the lineage in response to the determination that the sixth element will not execute; and
a delivery engine configured to email the lineage for presentation to a user who requested that the software code be scanned.

### Claim 2 (depends on 1)

The code lineage tool of claim 1, wherein the integrator is further configured to add the third element to the lineage as a sub-node of the first element before excluding the third element from the lineage.

### Claim 3 (depends on 1)

The code lineage tool of claim 1, wherein the software code is written in any of Structured Query Language, Java, C, and Python.

### Claim 4 (depends on 1)

The code lineage tool of claim 1, wherein the user requested that the lineage be communicated via email.

### Claim 5 (depends on 1)

The code lineage tool of claim 1, wherein the fourth element is a database table column.

### Claim 6 (depends on 1)

The code linage tool of claim 1, wherein the lineage is used to identify a bug in the software code.

### Claim 7 (depends on 1)

The code lineage tool of claim 1, wherein the integrator is further configured to generate a graph based on the lineage, the graph indicating that the first element is based on the second element.

### Claim 8

A method comprising:
identifying a plurality of elements in software code by scanning the software code;
determining, based on a stored grammar file, that a first element of the plurality of elements is a function whose value is affected by a second element of the plurality of elements and a third element of the plurality of elements;
determining, based on the grammar file, that the second and third elements are variables and are used when calling the first element;
adding the first element to a parse tree;
adding the second and third elements to the parse tree as sub-nodes of the first element in response to the determination that the second and third elements are used when calling the first element;
determining, based on the stored grammar file, that a value of the second element is affected by a fourth element of the plurality of elements;
adding the fourth element to the parse tree as a sub-node of the second element in response to the determination that the value of the second element is affected by the fourth element;
determining that the third element is not needed when calling the first element when the second element is provided to the first element;
determining, based on the parse tree, that a change to the fourth element will change the value of the first element and the value of the second element;
generating a lineage for the first element, the lineage comprising an identification of the first element, the second element, and the fourth element and an indication that the first element is based on the second element and that the second element is based on the fourth element;
excluding the third element from the lineage in response to the determination that the third element is not needed when calling the first element when the second element is provided to the first element;
determining, based on the parse tree, that when a change to a fifth element of the software code occurs, no corresponding change occurs in the first, second, and third elements;
excluding the fifth element from the lineage in response to the determination that no corresponding change occurs when the change to the fifth element occurs;
determining, based on the parse tree, that a sixth element of the software code will not execute as a result of a switch statement;
excluding the sixth element from the lineage in response to the determination that the sixth element will not execute; and
emailing the lineage for presentation to a user who requested that the software code be scanned.

### Claim 9 (depends on 8)

The method of claim 8, further comprising adding the third element to the lineage as a sub-node of the first element before excluding the third element from the lineage.

### Claim 10 (depends on 8)

The method of claim 8, wherein the software code is written in any of Structured Query Language, Java, C, and Python.

### Claim 11 (depends on 8)

The method of claim 8, wherein the user requested that the lineage be communicated via email.

### Claim 12 (depends on 8)

The method of claim 8, wherein the fourth element is a database table column.

### Claim 13 (depends on 8)

The method of claim 8, wherein the lineage is used to identify a bug in the software code.

### Claim 14 (depends on 8)

The method of claim 8, further comprising generating a graph based on the lineage, the graph indicating that the first element is based on the second element.

### Claim 15

A system comprising:
a database configured to store software code; and
a code lineage tool comprising a hardware processor configured to:
identify a plurality of elements in the software code by scanning the software code;
determine, based on a stored grammar file, that a first element of the plurality of elements is a function whose value is affected by a second element of the plurality of elements and a third element of the plurality of elements;
determine, based on the grammar file, that the second and third elements are variables and are used when calling the first element;
add the first element to a parse tree;
add the second and third elements to the parse tree as sub-nodes of the first element in response to the determination that the second and third elements are used when calling the first element;
determine, based on the stored grammar file, that a value of the second element is affected by a fourth element of the plurality of elements;
add the fourth element to the parse tree as a sub-node of the second element in response to the determination that the value of the second element is affected by the fourth element;
determine that the third element is not needed when calling the first element when the second element is provided to the first element;
determine, based on the parse tree, that a change to the fourth element will change the value of the first element and the value of the second element;
generate a lineage for the first element, the lineage comprising an identification of the first element, the second element, and the fourth element and an indication that the first element is based on the second element and that the second element is based on the fourth element;
exclude the third element from the lineage in response to the determination that the third element is not needed when calling the first element when the second element is provided to the first element;
determine, based on the parse tree, that when a change to a fifth element of the software code occurs, no corresponding change occurs in the first, second, and third elements;
exclude the fifth element from the lineage in response to the determination that no corresponding change occurs when the change to the fifth element occurs;
determine, based on the parse tree, that a sixth element of the software code will not execute as a result of a switch statement;
exclude the sixth element from the lineage in response to the determination that the sixth element will not execute; and
email the lineage for presentation to a user who requested that the software code be scanned.

### Claim 16 (depends on 15)

The system of claim 15, wherein the hardware processor is further configured to add the third element to the lineage as a sub-node of the first element before excluding the third element from the lineage.

### Claim 17 (depends on 15)

The system of claim 15, wherein the software code is written in any of Structured Query Language, Java, C, and Python.

### Claim 18 (depends on 15)

The system of claim 15, wherein the user requested that the lineage be communicated via email.

### Claim 19 (depends on 15)

The system of claim 15, wherein the fourth element is a database table column.

### Claim 20 (depends on 15)

The system of claim 15, wherein the hardware processor is further configured to generate a graph based on the lineage, the graph indicating that the first element is based on the second element.

### Claim 21 (depends on 15)

The system of claim 15, wherein the lineage is used to identify a bug in the software code.
