# US 2021/0232387 A1 · Linking copied code

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

- Number: US 2021/0232387 A1
- Document ID: US20210232387A1
- Status: Published application
- Kind: A1
- Application number: 16/750,093
- Filed: 2020-01-23
- Published: 2021-07-29
- Earliest claimed: 2020-01-23
- Assignees: International Business Machines Corporation
- Applicants: International Business Machines Corporation
- Inventors: ANDREW C. M. HICKS; MICHAEL TERRENCE COHOON; RYAN THOMAS RAWLINS; MICHAEL E. GILDEIN
- Web page: https://patentgrep.com/patent/US20210232387A1

## CPC

- G06F 8/36: Software reuse
- G06F 8/71: Version control (security arrangements therefor G06F21/57); Configuration management
- G06F 16/23: Updating
- G06F 8/65: Updates (security arrangements therefor G06F21/57)
- G06F 16/178: Techniques for file synchronisation in file systems
- G06F 16/2255: {Hash tables}
- G06F 16/44: Browsing; Visualisation therefor
- G06F 40/166: Editing, e.g. inserting or deleting
- G06F 40/174: Form filling; Merging
- G06F 40/197: Version control (for software G06F8/71)
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Aspects of the invention include receiving, by a processor, a request to copy a code from a source file and receiving, by the processor, a request to paste the code into a destination file. Aspects also include creating, by the processor based at least in part on the request to paste the code, an entry in a database, the entry having an identification of the source file, an identification of the destination file, a location of the code in the source file, and a location of the code in the destination file.

## Claims

### Claim 1

A method for linking copied code, the method comprising:
receiving, by a processor, a request to copy code from a source file;
receiving, by the processor, a request to paste the code into a destination file;
creating, by the processor based at least in part on the request to paste the code, an entry in a database, the entry comprising an identification of the source file, an identification of the destination file, a location of the code in the source file, and a location of the code in the destination
monitoring, by the processor, the destination file for changes to the code;
calculating, by the processor based at least in part on detecting changes to the code in the destination file, a similarity score between the code in the source file and the changed code in the destination file; and
based upon a determination that the similarity score is less than a threshold, deleting, by the processor, the entry in the database.

### Claim 2 (depends on 1)

The method of claim 1, further comprising monitoring, by the processor, the source file for changes to the code.

### Claim 3 (depends on 2)

The method of claim 2, wherein the entry in the database includes an action to be taken upon detecting changes in the source file.

### Claim 4 (depends on 3)

The method of claim 3, wherein the action includes automatically applying changes detected to the code in the source file to the code in the destination file.

### Claim 5 (depends on 3)

The method of claim 3, wherein the action includes creating a notification of the changes detected to the code in the source file.

### Claim 6 (depends on 1)

The method of claim 1, wherein the entry in the database further includes a copy of the code.

### Claim 7 (depends on 1)

The method of claim 1, wherein the entry in the database further includes a primary key value that is created by applying a hashing algorithm to the code.

### Claim 8

(canceled)

### Claim 9

(canceled)

### Claim 10

A system comprising:
one or more processors for executing computer-readable instructions, the computer-readable instructions controlling the one or more processors to perform operations comprising:
receiving, by a processor, a request to copy code from a source file;
receiving, by the processor, a request to paste the code into a destination file;
creating, by the processor based at least in part on the request to paste the code, an entry in a database, the entry comprising an identification of the source file, an identification of the destination file, a location of the code in the source file, and a location of the code in the destination file;
monitoring, by the processor, the destination file for changes to the code;
calculating, by the processor based at least in part on detecting changes to the code in the destination file, a similarity score between the code in the source file and the changed code in the destination file; and
based upon a determination that the similarity score is less than a threshold, deleting, by the processor, the entry in the database.

### Claim 11 (depends on 10)

The system of claim 10, wherein the operations further comprise monitoring, by the processor, the source file for changes to the code.

### Claim 12 (depends on 11)

The system of claim 11, wherein the entry in the database includes an action to be taken upon detecting changes in the source file.

### Claim 13 (depends on 12)

The system of claim 12, wherein the action includes automatically applying changes detected to the code in the source file to the code in the destination file.

### Claim 14 (depends on 12)

The system of claim 12, wherein the action includes creating a notification of the changes detected to the code in the source file.

### Claim 15 (depends on 10)

The system of claim 10, wherein the entry in the database further includes a copy of the code.

### Claim 16 (depends on 10)

The system of claim 10, wherein the entry in the database further includes a primary key value that is created by applying a hashing algorithm to the code.

### Claim 17

(canceled)

### Claim 18

(canceled)

### Claim 19

A computer program product comprising a computer-readable storage medium having program instructions embodied therewith, the program instructions executable by a processor to cause the processor to perform operations comprising:
receiving, by a processor, a request to copy a code from a source file;
receiving, by the processor, a request to paste the code into a destination file;
creating, by the processor based at least in part on the request to paste the code, an entry in a database, the entry comprising an identification of the source file, an identification of the destination file, a location of the code in the source file, and a location of the code in the destination
calculating, by the processor based at least in part on detecting changes to the code in the destination file, a similarity score between the code in the source file and the changed code in the destination file; and
based upon a determination that the similarity score is less than a threshold, deleting, by the processor, the entry in the database.

### Claim 20

(canceled)
