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

Function targets

__tests__/r-test-file-scope.test.ts:46–50  ·  view source on GitHub ↗
(file: string)

Source from the content-addressed store, hash-verified

44 const cg = await CodeGraph.init(root, { index: true });
45 try {
46 const targets = (file: string) =>
47 cg
48 .getOutgoingEdgesFrom(cg.getNodesInFile(file).map((n) => n.id), ['calls'])
49 .map((e) => `${cg.getNode(e.target)!.name}@${cg.getNode(e.target)!.filePath}`)
50 .sort();
51 expect(targets('R/geom-point.R')).toEqual([]);
52 expect(targets('tests/testthat/test-scales.R')).toEqual(['geom_point@R/geom-point.R', 'quux@tests/testthat/helper-s3.R']);
53 } finally {

Callers 1

Calls 4

mapMethod · 0.80
getNodeMethod · 0.80
getNodesInFileMethod · 0.65
getOutgoingEdgesFromMethod · 0.45

Tested by

no test coverage detected