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

Function bases

__tests__/python-outside-bases.test.ts:221–228  ·  view source on GitHub ↗
(file: string, name: string)

Source from the content-addressed store, hash-verified

219
220/** `file:class` of what the class `name` in `file` extends. */
221const bases = (file: string, name: string): string[] => {
222 const node = cg.getNodesInFile(file).find((n) => n.name === name && n.kind === 'class')!;
223 expect(node, name).toBeDefined();
224 return cg.getOutgoingEdges(node.id).filter((e) => e.kind === 'extends').map((e) => {
225 const target = cg.getNode(e.target)!;
226 return `${target.filePath}:${target.name}`;
227 });
228};
229
230describe('a Python base imported from outside the project', () => {
231 it('links no project class of that name, plain or parameterized', () => {

Callers 1

Calls 4

mapMethod · 0.80
getNodeMethod · 0.80
getNodesInFileMethod · 0.65
getOutgoingEdgesMethod · 0.45

Tested by

no test coverage detected