MCPcopy Index your code
hub / github.com/massCodeIO/massCode / scanCode

Function scanCode

src/main/storage/providers/markdown/doctor.ts:506–542  ·  view source on GitHub ↗
(context: ScanContext)

Source from the content-addressed store, hash-verified

504}
505
506function scanCode(context: ScanContext): void {
507 const paths = getPaths(getVaultPath())
508 const records: EntityScanRecord[] = []
509 const skipRootNames = new Set([META_DIR_NAME, 'inbox', TRASH_DIR_NAME])
510
511 listFolders(paths.vaultPath, skipRootNames).forEach((folderPath) => {
512 const metaPath = path.join(paths.vaultPath, folderPath, META_FILE_NAME)
513 if (!fs.pathExistsSync(metaPath)) {
514 addItem(
515 context,
516 createFileItem({
517 action: 'create-folder-metadata',
518 absolutePath: path.join(paths.vaultPath, folderPath),
519 kind: 'folder',
520 relativePath: folderPath,
521 space: 'code',
522 status: 'pending',
523 }),
524 )
525 }
526 })
527
528 listMarkdownFiles(paths.vaultPath).forEach((filePath) => {
529 const record = inspectMarkdownEntity({
530 context,
531 filePath,
532 kind: 'snippet',
533 rootPath: paths.vaultPath,
534 space: 'code',
535 })
536 if (record) {
537 records.push(record)
538 }
539 })
540
541 collectDuplicateIds(context, records)
542}
543
544function scanNotes(context: ScanContext): void {
545 const paths = getNotesPaths(getVaultPath())

Callers 1

previewVaultDoctorFunction · 0.85

Calls 8

getPathsFunction · 0.90
getVaultPathFunction · 0.90
listFoldersFunction · 0.85
addItemFunction · 0.85
createFileItemFunction · 0.85
inspectMarkdownEntityFunction · 0.85
collectDuplicateIdsFunction · 0.85
listMarkdownFilesFunction · 0.70

Tested by

no test coverage detected