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

Method initSync

src/index.ts:450–467  ·  view source on GitHub ↗

* Initialize synchronously (without indexing)

(projectRoot: string)

Source from the content-addressed store, hash-verified

448 * Initialize synchronously (without indexing)
449 */
450 static initSync(projectRoot: string): CodeGraph {
451 const resolvedRoot = path.resolve(projectRoot);
452
453 // Check if already initialized
454 if (isInitialized(resolvedRoot)) {
455 throw new Error(`CodeGraph already initialized in ${resolvedRoot}`);
456 }
457
458 // Create directory structure
459 createDirectory(resolvedRoot);
460
461 // Initialize database
462 const dbPath = getDatabasePath(resolvedRoot);
463 const db = DatabaseConnection.initialize(dbPath);
464 const queries = new QueryBuilder(db.getDb());
465
466 return new CodeGraph(db, queries, resolvedRoot);
467 }
468
469 /**
470 * 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 15

buildProjectFunction · 0.64
buildProjectFunction · 0.64
indexFunction · 0.64
indexProjectFunction · 0.64
makeProjectFunction · 0.64
indexProjectFunction · 0.64
makeIndexedFunction · 0.64
mkIndexedFunction · 0.64
indexProjectFunction · 0.64
buildProjectFunction · 0.64
indexFunction · 0.64
buildProjectFunction · 0.64