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

Method buildFileRecord

src/extraction/index.ts:2413–2431  ·  view source on GitHub ↗

The FileRecord for a fresh-index store (nodeCount is the PRE-filter count).

(
    filePath: string,
    content: string,
    language: Language,
    stats: fs.Stats,
    nodeCount: number,
    resultErrors: ExtractionResult['errors']
  )

Source from the content-addressed store, hash-verified

2411 */
2412 /** The FileRecord for a fresh-index store (nodeCount is the PRE-filter count). */
2413 private buildFileRecord(
2414 filePath: string,
2415 content: string,
2416 language: Language,
2417 stats: fs.Stats,
2418 nodeCount: number,
2419 resultErrors: ExtractionResult['errors']
2420 ): FileRecord {
2421 return {
2422 path: filePath,
2423 contentHash: hashContent(content),
2424 language,
2425 size: stats.size,
2426 modifiedAt: stats.mtimeMs,
2427 indexedAt: Date.now(),
2428 nodeCount,
2429 errors: resultErrors.length > 0 ? resultErrors : undefined,
2430 };
2431 }
2432
2433 private buildFreshStoreBundle(
2434 filePath: string,

Callers 2

storeResultMethod · 0.95
buildFreshStoreBundleMethod · 0.95

Calls 1

hashContentFunction · 0.85

Tested by

no test coverage detected