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

Method getModuleStructure

src/graph/queries.ts:205–220  ·  view source on GitHub ↗

* Get the module/package structure * * Returns a tree structure of files organized by directory. * * @returns Map of directory paths to contained files

()

Source from the content-addressed store, hash-verified

203 * @returns Map of directory paths to contained files
204 */
205 getModuleStructure(): Map<string, string[]> {
206 const files = this.queries.getAllFiles();
207 const structure = new Map<string, string[]>();
208
209 for (const file of files) {
210 const parts = file.path.split('/');
211 const dir = parts.slice(0, -1).join('/') || '.';
212
213 if (!structure.has(dir)) {
214 structure.set(dir, []);
215 }
216 structure.get(dir)!.push(file.path);
217 }
218
219 return structure;
220 }
221
222 /**
223 * Find circular imports between files

Callers

nothing calls this directly

Calls 6

hasMethod · 0.80
pushMethod · 0.80
getAllFilesMethod · 0.65
getMethod · 0.65
joinMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected