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

Function scanNotes

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

Source from the content-addressed store, hash-verified

542}
543
544function scanNotes(context: ScanContext): void {
545 const paths = getNotesPaths(getVaultPath())
546 const records: EntityScanRecord[] = []
547
548 listFolders(paths.notesRoot).forEach((folderPath) => {
549 const metaPath = path.join(paths.notesRoot, folderPath, META_FILE_NAME)
550 if (!fs.pathExistsSync(metaPath)) {
551 addItem(
552 context,
553 createFileItem({
554 action: 'create-folder-metadata',
555 absolutePath: path.join(paths.notesRoot, folderPath),
556 kind: 'folder',
557 relativePath: folderPath,
558 space: 'notes',
559 status: 'pending',
560 }),
561 )
562 }
563 })
564
565 listMarkdownFiles(paths.notesRoot).forEach((filePath) => {
566 const record = inspectMarkdownEntity({
567 context,
568 filePath,
569 kind: 'note',
570 rootPath: paths.notesRoot,
571 space: 'notes',
572 })
573 if (record) {
574 records.push(record)
575 }
576 })
577
578 collectDuplicateIds(context, records)
579}
580
581function scanHttp(context: ScanContext): void {
582 const paths = getHttpPaths(getVaultPath())

Callers 1

previewVaultDoctorFunction · 0.85

Calls 8

getNotesPathsFunction · 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