Detecting and preventing noncompliant use of source code
First Claim
1. A system comprising:
- one or more processors; and
a memory storing instructions that, when executed by the one or more processors, perform operations comprising;
receiving a location for a first source code file,determining that the received location is a restricted location,creating, in response to the determining, a temporary index of normalized statements for the first source code file,comparing the temporary index of normalized statements for the first source code file having the restricted location and a pre-calculated index of normalized statements for second source code files stored in a protected code location to identify a number of code clones in the first source code file,determining whether the number of identified code clones in the first source code file meets a threshold, andgenerating data used to alert a user that the restricted location contains code clones when it is determined that the number of identified code clones meets the threshold.
2 Assignments
0 Petitions
Accused Products
Abstract
A system is disclosed for identifying and preventing non-compliant uses of any portion of source code or other protected content. The system includes at least one processor and a memory storing instructions that cause the system to scan files located at a source location for excerpts of protected source code. The instructions may cause the system to create a temporary clone detection structure for the files at the source location. The instructions may cause the system to use the temporary clone structure and a pre-calculated clone structure for source code files in a protected code location, to identify code clones, and to generate data used to alert a user that the source location includes portions of source code from the protected code location. When clones are found, the instructions may optionally cause the system to prevent the copying of the files containing the code clones.
-
Citations
26 Claims
-
1. A system comprising:
-
one or more processors; and a memory storing instructions that, when executed by the one or more processors, perform operations comprising; receiving a location for a first source code file, determining that the received location is a restricted location, creating, in response to the determining, a temporary index of normalized statements for the first source code file, comparing the temporary index of normalized statements for the first source code file having the restricted location and a pre-calculated index of normalized statements for second source code files stored in a protected code location to identify a number of code clones in the first source code file, determining whether the number of identified code clones in the first source code file meets a threshold, and generating data used to alert a user that the restricted location contains code clones when it is determined that the number of identified code clones meets the threshold. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15)
-
-
16. A computer-readable storage device for detecting non-compliant use of portions of source code, the storage device having recorded and embodied thereon instructions that, when executed by one or more processors of a computer system, cause the computer system to:
-
receive a location of one more source code files; determine that the location is a restricted location; create, in response to the receiving, a temporary index of tokenized statements for each of the one or more source code files; compare the temporary index for one or more source code files having the restricted location and a pre-calculated index of tokenized statements from source code files stored in a protected code location to identify a number of code clones in the one or more source code files; determine whether the number of identified code clones meets a threshold; and generate data used to alert a user that the restricted location contains code clones when it is determined that the number of identified code clones meets the threshold. - View Dependent Claims (17, 18, 19, 20, 21, 22)
-
-
23. A computer-implemented method comprising:
-
receiving, by one or more processors, a request to copy portions of one or more source code files from a source location to a destination location; identifying a number of code clones between the one or more source code files and source code from a protected code location; determining whether the number of identified code clones meets a threshold; determining whether the destination location is authorized to contain source code from the protected code location; and preventing one or more portions of the source code files from being copied from the source location to the destination location when it is determined that the number of identified clones meets the threshold and that the destination location is not authorized to contain source code from the protected code location. - View Dependent Claims (24, 25, 26)
-
Specification