IP Library Granted Patent US 10,261,883
Granted Patent B2
US 10,261,883 · App. 15/682,041 · Granted Apr 16, 2019

Aggregating source code metric values

Inventors: Julian Tibble (Oxford, GB); Pavel Avgustinov (Oxford, GB); Yorck Huenke (Oxford, GB); Arthur Baars (Oxford, GB); Anders Starcke Henriksen (Oxford, GB)
Assignee: Semmle Limited
G06F11/3616G06F8/70G06F8/75G06F8/77G06F11/3688G06F17/30958
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 10,261,883
App. No.
15/682,041
Granted
Apr 16, 2019
Kind
B2
Abstract

Methods, systems, and apparatus, including computer programs encoded on computer storage media, for aggregating source code metric values. One of the methods includes obtaining data representing a directed graph, wherein one or more nodes of the graph are associated with a respective set of one or more metric instances, wherein each set of metric instances for each node includes all metric instances occurring in sets of any node descendant from the node in the graph, wherein each metric instance identifies a location in a source code base, and wherein each metric instance has a respective metric value, a respective identifier, and a respective attribute type. An attribute value is computed for a first node in the graph from the respective metric value of each metric instance in a first set of metric instances associated with the first node.

Claims (31)

1. A computer-implemented method comprising:

obtaining data representing a directed graph having multiple nodes, wherein the nodes of the graph represent respective source code file locations in a source code base, and wherein each node representing a respective source code file location is associated with a respective source code metric instance having a respective metric value representing a property of the one or more source code files at the respective source code file location associated with the node

generating, for a parent node in the graph having a descendant node that is reachable from the parent node by multiple paths in the graph, a first set of source code metric instances comprising a set union of all source code metric instances associated with the parent node and all source code metric instances associated with any node descendant from the parent node in the graph, including adding to the first set of source code metric instances a single instance of a source code metric instance for the descendant node that is reachable from the parent node by multiple paths in the graph;

generating an aggregated attribute value for the parent node in the graph, including aggregating respective metric values of each source code metric instance in the first set of source code metric instances associated with the parent node; and

associating the generated aggregated attribute value with the parent node in the graph as an aggregated source code metric value for source code files having source code file locations represented by nodes descendant from the parent node in the graph.

2. The method of claim 1 , wherein generating the first set of source code metric instances associated with the parent node comprises generating a set union of the source code metric instances associated with the parent node and only metric instances associated with any node directly descendant from the parent node in the graph.

3. The method of claim 1 , wherein the graph includes multiple source code location nodes and multiple edges between the source code location nodes, each source code location node representing a portion of the source code base, each edge between source code location nodes representing inclusion of a first portion of the source code base in a second portion of the source code base.

4. The method of claim 1 , wherein each node represents a location in a file system.

5. The method of claim 1 , wherein a first source code metric instance of the first set of source code metric instances is associated with multiple locations in the source code base, and wherein the first source code metric instances represents an instance of duplicate source code elements in the source code base.

6. The method of claim 5 , wherein the first source code metric instance associated with the multiple locations in the source code base represents a declaration of a source code element in a first location in the source code base and a definition of the source code element in a second location in the source code base.

7. A system comprising:

one or more computers and one or more storage devices storing instructions that are operable, when executed by the one or more computers, to cause the one or more computers to perform operations comprising:

obtaining data representing a directed graph having multiple nodes, wherein the nodes of the graph represent respective source code file locations in a source code base, and wherein each node representing a respective source code file location is associated with a respective source code metric instance having a respective metric value representing a property of the one or more source code files at the respective source code file location associated with the node;

generating, for a parent node in the graph having a descendant node that is reachable from the parent node by multiple paths in the graph, a first set of source code metric instances comprising a set union of all source code metric instances associated with the parent node and all source code metric instances associated with any node descendant from the parent node in the graph, including adding to the first set of source code metric instances a single instance of a source code metric instance for the descendant node that is reachable from the parent node by multiple paths in the graph;

generating an aggregated attribute value for the parent node in the graph, including aggregating respective metric values of each source code metric instance in the first set of source code metric instances associated with the parent node; and

associating the generated aggregated attribute value with the parent node in the graph as an aggregated source code metric value for source code files having source code file locations represented by nodes descendant from the parent node in the graph.

8. The system of claim 7 , wherein generating the first set of source code metric instances associated with the parent node comprises generating a set union of the source code metric instances associated with the parent node and only metric instances associated with any node directly descendant from the parent node in the graph.

9. The system of claim 7 , wherein the graph includes multiple source code location nodes and multiple edges between the source code location nodes, each node representing a portion of the source code base, each edge between source code location nodes representing inclusion of a first portion of the source code base in a second portion of the source code base.

10. The system of claim 7 , wherein each node represents a location in a file system.

11. The system of claim 7 , wherein a first source code metric instance of the first set of source code metric instances is associated with multiple locations in the source code base, and wherein the first source code metric instances represents an instance of duplicate source code elements in the source code base.

12. The system of claim 10 , wherein the first source code metric instance associated with the multiple locations in the source code base represents a declaration of a source code element in a first location in the source code base and a definition of the source code element in a second location in the source code base.

13. A computer program product, encoded on one or more non-transitory computer storage media, comprising instructions that when executed by one or more computers cause the one or more computers to perform operations comprising:

obtaining data representing a directed graph having multiple nodes, wherein the nodes of the graph represent respective source code file locations in a source code base, and wherein each node representing a respective source code file location is associated with a respective source code metric instance having a respective metric value representing a property of the one or more source code files at the respective source code file location associated with the node;

generating, for a parent node in the graph having a descendant node that is reachable from the parent node by multiple paths in the graph, a first set of source code metric instances comprising a set union of all source code metric instances associated with the parent node and all source code metric instances associated with any node descendant from the parent node in the graph, including adding to the first set of source code metric instances a single instance of a source code metric instance for the descendant node that is reachable from the parent node by multiple paths in the graph;

generating an aggregated attribute value for the parent node in the graph, including aggregating respective metric values of each source code metric instance in the first set of source code metric instances associated with the parent node; and

associating the generated aggregated attribute value with the parent node in the graph as an aggregated source code metric value for source code files having source code file locations represented by nodes descendant from the parent node in the graph.

14. The computer program product of claim 13 , wherein generating the first set of source code metric instances associated with the parent node comprises generating a set union of the source code metric instances associated with the parent node and only metric instances associated with any node directly descendant from the parent node in the graph.

15. The computer program product of claim 13 , wherein the graph includes multiple source code location nodes and multiple edges between the source code location nodes, each node representing a portion of the source code base, each edge between source code location nodes representing inclusion of a first portion of the source code base in a second portion of the source code base.

16. The computer program product of claim 13 , wherein each node represents a location in a file system.

17. The computer program product of claim 13 , wherein a first source code metric instance of the first set of source code metric instances is associated with multiple locations in the source code base, and wherein the first source code metric instances represents an instance of duplicate source code elements in the source code base.

18. The computer program product of claim 17 , wherein the first source code metric instance associated with the multiple locations in the source code base represents a declaration of a source code element in a first location in the source code base and a definition of the source code element in a second location in the source code base.

Assignments (3)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jan 27, 2020
From: GITHUB SOFTWARE UK LTD.
To: MICROSOFT TECHNOLOGY LICENSING, LLC
Reel/Frame 051710/0252 →
CHANGE OF NAME Recorded Dec 10, 2019
From: SEMMLE LIMITED
To: GITHUB SOFTWARE UK LTD.
Reel/Frame 051244/0305 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Mar 1, 2018
From: TIBBLE, JULIAN; AVGUSTINOV, PAVEL; HUENKE, YORCK; BAARS, ARTHUR; HENRIKSEN, ANDERS STARCKE
To: SEMMLE LIMITED
Reel/Frame 045080/0008 →
Continuity (4)
Continuation 15346596 · Nov 8, 2016
Continuation 14794227 · Jul 8, 2015
Continuation 14292697 · May 30, 2014
Related Publication 20180032422A1 · Feb 1, 2018
Cited By (1)
US 12,355,795