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

Function selfLoops

__tests__/resolution.test.ts:6523–6528  ·  view source on GitHub ↗
(g: CodeGraph, file: string)

Source from the content-addressed store, hash-verified

6521
6522 describe('Name-only method match never binds a delegating call to its own caller', () => {
6523 const selfLoops = (g: CodeGraph, file: string): string[] =>
6524 g.getNodesInFile(file)
6525 .filter((n) => n.kind === 'method' || n.kind === 'function')
6526 .flatMap((n) => g.getOutgoingEdges(n.id)
6527 .filter((e) => e.kind === 'calls' && e.target === n.id)
6528 .map(() => n.name));
6529
6530 it('drops the self-loop for a Scala delegating wrapper', async () => {
6531 fs.writeFileSync(path.join(tempDir, 'Form.scala'), `

Callers 1

resolution.test.tsFile · 0.85

Calls 3

mapMethod · 0.80
getNodesInFileMethod · 0.65
getOutgoingEdgesMethod · 0.45

Tested by

no test coverage detected