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

Method getModuleStructure

src/graph/queries.ts:206–221  ·  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

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