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

Function callsFrom

__tests__/commonjs-require-calls.test.ts:84–94  ·  view source on GitHub ↗

`file: qualified name` of every call edge out of a file.

(file: string)

Source from the content-addressed store, hash-verified

82
83/** `file: qualified name` of every call edge out of a file. */
84function callsFrom(file: string): string[] {
85 const ids = cg.getNodesInFile(file).map((n) => n.id);
86 return cg
87 .getOutgoingEdgesFrom(ids)
88 .filter((e) => e.kind === 'calls')
89 .map((e) => {
90 const t = cg.getNode(e.target)!;
91 return `${t.filePath}: ${t.qualifiedName}`;
92 })
93 .sort();
94}
95
96describe('calls through CommonJS require bindings', () => {
97 it('follow `module.exports` through the root index to the exported function; an outside package is no edge', () => {

Callers 1

Calls 4

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

Tested by

no test coverage detected