Code-Clone Detection and Analysis
First Claim
1. A method implemented by one or more computing devices configured to detect and analyze code clone in one or more source code bases, the method comprising:
- receiving a selection of a subject code snippet based at least in part upon user input;
at least partly in response to the receiving of the selection, obtaining the subject code snippet;
identifying a group of clone code snippets in the one or more source code bases, each of the identified clone code snippets of the group including a true clone and a near clone of the subject code snippet;
estimating code-improvement-potential properties of one or more of the clone code snippets of the group of found clone code snippets;
ranking at least some of the clone code snippets of the group based at least in part upon one or more of the estimated code-improvement-potential properties; and
causing presentation of the ranked clone code snippets of the group.
2 Assignments
0 Petitions
Accused Products
Abstract
Techniques for detecting, analyzing, and/or reporting code clone are described herein. In one or more implementations, clone-code detection is performed on one or more source code bases to find true and near clones of a subject code snippet that a user (e.g., a software developer) expressly or implicitly selected. In one or more other implementations, code clone is analyzed to estimate the code-improvement-potential (such as bug-potential and code-refactoring-potential) properties of clones. One or more other implementations present the results of code clone analysis with indications (e.g., rankings) of the estimated properties of the respective the clones.
57 Citations
20 Claims
-
1. A method implemented by one or more computing devices configured to detect and analyze code clone in one or more source code bases, the method comprising:
-
receiving a selection of a subject code snippet based at least in part upon user input; at least partly in response to the receiving of the selection, obtaining the subject code snippet; identifying a group of clone code snippets in the one or more source code bases, each of the identified clone code snippets of the group including a true clone and a near clone of the subject code snippet; estimating code-improvement-potential properties of one or more of the clone code snippets of the group of found clone code snippets; ranking at least some of the clone code snippets of the group based at least in part upon one or more of the estimated code-improvement-potential properties; and causing presentation of the ranked clone code snippets of the group. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11)
-
-
12. One or more computer-readable media storing processor-executable instructions that, when executed, cause one or more processors to perform a method comprising:
-
receiving a selection of a subject code snippet based at least in part upon user input; at least partly in response to the receiving of the selection, obtaining the subject code snippet; identifying a group of clone code snippets in one or more source code bases, each of the identified clone code snippets of the group having a similarity metric that meets or exceeds a similarity threshold, the similarity metric of an identified clone code snippet being indicative of a similarity between the identified clone code snippet and the subject code snippet. - View Dependent Claims (13, 14, 15)
-
-
16. One or more computer-readable media storing processor-executable instructions that, when executed, cause one or more processors to perform a method of analyzing code clone in one or more source code bases, the method comprising:
-
obtaining a group of clone code snippets, each clone code snippet being a true clone or near clone of a subject code snippet; estimating code-improvement-potential properties of each of the clone code snippets of the group of clone code snippets; and causing presentation of at least some of the clone code snippets of the group of the clone code snippets with an indication of the estimated code-improvement-potential properties of the presented clone code snippets. - View Dependent Claims (17, 18, 19, 20)
-
Specification