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

Method initSync

src/index.ts:309–326  ·  view source on GitHub ↗

* Initialize synchronously (without indexing)

(projectRoot: string)

Source from the content-addressed store, hash-verified

307 * Initialize synchronously (without indexing)
308 */
309 static initSync(projectRoot: string): CodeGraph {
310 const resolvedRoot = path.resolve(projectRoot);
311
312 // Check if already initialized
313 if (isInitialized(resolvedRoot)) {
314 throw new Error(`CodeGraph already initialized in ${resolvedRoot}`);
315 }
316
317 // Create directory structure
318 createDirectory(resolvedRoot);
319
320 // Initialize database
321 const dbPath = getDatabasePath(resolvedRoot);
322 const db = DatabaseConnection.initialize(dbPath);
323 const queries = new QueryBuilder(db.getDb());
324
325 return new CodeGraph(db, queries, resolvedRoot);
326 }
327
328 /**
329 * Open an existing CodeGraph project

Calls 6

isInitializedFunction · 0.90
createDirectoryFunction · 0.90
getDatabasePathFunction · 0.90
getDbMethod · 0.80
resolveMethod · 0.65
initializeMethod · 0.45

Tested by 5

buildProjectFunction · 0.64
indexFunction · 0.64
buildProjectFunction · 0.64
runFixtureFunction · 0.64
setupFunction · 0.64