MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / made

Function made

__tests__/cpp-gtest-fixture-scope.test.ts:36–40  ·  view source on GitHub ↗

The `instantiates` edges of every function named `name`, by its first line, as `startLine -> qualifiedName @confidence`.

(cg: CodeGraph, name: string)

Source from the content-addressed store, hash-verified

34
35/** The `instantiates` edges of every function named `name`, by its first line, as `startLine -> qualifiedName @confidence`. */
36function made(cg: CodeGraph, name: string): string[] {
37 return cg.getNodesByKind('function').filter((n: Node) => n.name === name).sort((a, b) => a.startLine - b.startLine)
38 .flatMap((fn) => cg.getOutgoingEdgesFrom([fn.id], ['instantiates'])
39 .map((e) => `${fn.startLine} -> ${cg.getNode(e.target)?.qualifiedName} @${(e.metadata as { confidence?: number } | undefined)?.confidence}`));
40}
41
42describe('C++ names in a gtest TEST_F or TEST_P body', () => {
43 it("find the fixture's nested types, its bases' included", async () => {

Callers 1

Calls 4

mapMethod · 0.80
getNodeMethod · 0.80
getNodesByKindMethod · 0.65
getOutgoingEdgesFromMethod · 0.45

Tested by

no test coverage detected