Repository Analysis

TriliumNext/Trilium

Build your personal knowledge base with Trilium Notes

0.9 Likely human-written View on GitHub
0.9
Adjusted Score
0.9
Raw Score
100%
Time Factor
2026-05-30
Last Push
36,259
Stars
TypeScript
Language
600,902
Lines of Code
3180
Files
373
Pattern Hits
2026-05-31
Scan Date

Score History

Severity Breakdown

CRITICAL 12HIGH 0MEDIUM 39LOW 322

Pattern Findings

373 matches across 10 categories. Click a row to expand file-level details.

Hyper-Verbose Identifiers267 hits · 272 pts
SeverityFileLineSnippet
LOWpackages/codemirror/src/extensions/custom_tab.ts54function handleSingleLineSelection(state: EditorState, dispatch: (transaction: Transaction) => void) {
LOWpackages/pdfjs-viewer/src/annotations.ts64export function setupAnnotationLiveUpdates() {
LOWpackages/pdfjs-viewer/src/annotations.ts90async function extractAndSendAnnotations() {
LOWpackages/pdfjs-viewer/src/attachments.ts17async function extractAndSendAttachments() {
LOWpackages/pdfjs-viewer/src/custom.ts55function configurePdfViewerOptions() {
LOWpackages/pdfjs-viewer/src/toc.ts121export function setupActiveHeadingTracking() {
LOW…ckeditor5-footnotes/src/footnote-editing/converters.ts234function createFootnoteBackLinkViewElement(
LOW…ckeditor5-footnotes/src/footnote-editing/converters.ts266function createFootnoteReferenceViewElement(
LOW…ckeditor5-footnotes/src/footnote-editing/converters.ts303function createFootnoteItemViewElement(
LOW…ckeditor5-footnotes/src/footnote-editing/converters.ts331function updateFootnoteReferenceView(
LOWpackages/commons/src/lib/markdown_renderer.ts12function stripTaskMarkerFromTokens(tokens: Token[] | undefined, stripPattern: RegExp): void {
LOWpackages/commons/src/lib/markdown_renderer.ts175function getNormalizedMimeFromMarkdownLanguage(language: string | undefined): string {
LOWpackages/commons/src/lib/marked_extensions.ts74export function createTransclusionExtension(options: TransclusionOptions = {}): TokenizerAndRendererExtension {
LOWpackages/commons/src/lib/mime_type.ts29export function normalizeMimeTypeForCKEditor(mimeType: string) {
LOWpackages/commons/src/lib/mime_type.ts221export function getMimeTypeFromMarkdownName(mdLanguageCode: string) {
LOWpackages/ckeditor5-mermaid/tests/manual/markdown.ts48function setupMarkdownOutputPreview( editor ) {
LOWpackages/trilium-core/src/routes/api/login.ts36function logoutFromProtectedSession() {
LOWpackages/trilium-core/src/routes/api/notes.ts279function eraseUnusedAttachmentsNow() {
LOWpackages/trilium-core/src/routes/api/revisions.ts110function updateRevisionDescription(req: Request<{ revisionId: string }>) {
LOWpackages/trilium-core/src/routes/api/attributes.ts11function getEffectiveNoteAttributes(req: Request<{ noteId: string }>) {
LOWpackages/trilium-core/src/routes/api/special_notes.ts106function createOrUpdateScriptLauncherFromApi(req: Request) {
LOWpackages/trilium-core/src/routes/api/note_map.ts230function updateDescendantCountMapForSearch(noteIdToDescendantCountMap: Record<string, number>, relationships: { parentNo
LOWpackages/trilium-core/src/routes/api/tree.ts9function getNotesAndBranchesAndAttributes(_noteIds: string[] | Set<string>) {
LOWpackages/trilium-core/src/services/image.ts17function getImageMimeFromExtension(ext: string): string {
LOWpackages/trilium-core/src/services/script.ts139function getScriptBundleForFrontend(note: BNote, script?: string, params?: ScriptParams) {
LOWpackages/trilium-core/src/services/erase.ts170function eraseUnusedAttachmentsNow() {
LOWpackages/trilium-core/src/services/erase.ts174function eraseScheduledAttachments(eraseUnusedAttachmentsAfterSeconds: number | null = null) {
LOWpackages/trilium-core/src/services/scheduler.ts74function checkProtectedSessionExpiration() {
LOWpackages/trilium-core/src/services/keyboard_actions.ts9function getDefaultKeyboardActions() {
LOW…/trilium-core/src/services/hidden_subtree_templates.ts4export default function buildHiddenSubtreeTemplates() {
LOWpackages/trilium-core/src/services/context.ts89export function getAndClearEntityChangeIds() {
LOWpackages/trilium-core/src/services/context.ts89export function getAndClearEntityChangeIds() {
LOWpackages/trilium-core/src/services/setup.ts13async function hasSyncServerSchemaAndSeed() {
LOWpackages/trilium-core/src/services/ws.ts41function fillInAdditionalProperties(entityChange: EntityChange) {
LOWpackages/trilium-core/src/services/ws.ts133function buildFrontendUpdateMessage(entityChangeIds: number[]): WebSocketMessage | null {
LOWpackages/trilium-core/src/services/ws.ts165function sendTransactionEntityChangesToAllClients() {
LOWpackages/trilium-core/src/services/notes.ts177function getAndValidateParent(params: GetValidateParams) {
LOWpackages/trilium-core/src/services/notes.ts591function findMarkdownInternalLinks(content: string, foundLinks: FoundLink[]) {
LOWpackages/trilium-core/src/services/notes.ts1096function getUndeletedParentBranchIds(noteId: string, deleteId: string) {
LOWpackages/trilium-core/src/services/notes.ts1181function duplicateSubtreeWithoutRoot(origNoteId: string, newNoteId: string) {
LOWpackages/trilium-core/src/services/entity_changes.ts15function putEntityChangeWithInstanceId(origEntityChange: EntityChange, instanceId: string) {
LOWpackages/trilium-core/src/services/entity_changes.ts21function putEntityChangeWithForcedChange(origEntityChange: EntityChange) {
LOWpackages/trilium-core/src/services/entity_changes.ts49function putNoteReorderingEntityChange(parentNoteId: string, componentId?: string) {
LOWpackages/trilium-core/src/services/entity_changes.ts67function putEntityChangeForOtherInstances(ec: EntityChange) {
LOWpackages/trilium-core/src/services/entity_changes.ts75function addEntityChangesForSector(entityName: string, sector: string) {
LOWpackages/trilium-core/src/services/entity_changes.ts96function addEntityChangesForDependingEntity(sector: string, tableName: string, primaryKeyColumn: string) {
LOWpackages/trilium-core/src/services/entity_changes.ts115function cleanupEntityChangesForMissingEntities(entityName: string, entityPrimaryKey: string) {
LOWpackages/trilium-core/src/services/entity_changes.ts197function recalculateMaxEntityChangeId() {
LOWpackages/trilium-core/src/services/cloning.ts65function ensureNoteIsPresentInParent(noteId: string, parentNoteId: string, prefix?: string) {
LOWpackages/trilium-core/src/services/cloning.ts99function ensureNoteIsAbsentFromParent(noteId: string, parentNoteId: string) {
LOWpackages/trilium-core/src/services/hidden_subtree.ts35function buildHiddenSubtreeDefinition(helpSubtree: HiddenSubtreeItem[]): HiddenSubtreeItem {
LOWpackages/trilium-core/src/services/hidden_subtree.ts407function checkHiddenSubtreeRecursively(parentNoteId: string, item: HiddenSubtreeItem, extraOpts: CheckHiddenExtraOpts =
LOWpackages/trilium-core/src/services/note_types.ts22function getDefaultMimeForNoteType(typeName: string) {
LOWpackages/trilium-core/src/services/icon_packs.ts140export function determineBestFontAttachment(iconPackNote: BNote) {
LOWpackages/trilium-core/src/services/special_notes.ts245function createOrUpdateScriptLauncherFromApi(opts: { id: string; title: string; action: string; icon?: string; shortcut?
LOW…kages/trilium-core/src/services/hidden_subtree.spec.ts23function materialiseDeprecatedNote(noteId: string) {
LOWpackages/trilium-core/src/services/tree.ts61function wouldAddingBranchCreateCycle(parentNoteId: string, childNoteId: string) {
LOWpackages/trilium-core/src/services/options_init.ts82export function migrateSyncTimeoutFromMilliseconds(milliseconds: number): { value: number; scale: number } | null {
LOWpackages/trilium-core/src/services/options_init.ts313function getKeyboardDefaultOptions() {
LOWpackages/trilium-core/src/services/protected_session.ts19export function isProtectedSessionAvailable() {
207 more matches not shown…
Hallucination Indicators12 hits · 120 pts
SeverityFileLineSnippet
CRITICALpackages/ckeditor5-collapsible/src/block-drag-handle.ts141 const view = this.opts.editor.editing.view.domConverter.mapDomToView(el);
CRITICALpackages/ckeditor5-collapsible/src/block-drag-handle.ts142 let model = view ? this.opts.editor.editing.mapper.toModelElement(view as any) : null;
CRITICALpackages/ckeditor5-collapsible/src/block-drag-handle.ts164 const view = this.opts.editor.editing.view.domConverter.mapDomToView(child);
CRITICALpackages/ckeditor5-collapsible/src/block-drag-handle.ts165 const model = view ? this.opts.editor.editing.mapper.toModelElement(view as any) : null;
CRITICALpackages/ckeditor5-collapsible/src/block-drag-handle.ts177 const view = this.opts.editor.editing.mapper.toViewElement(model);
CRITICALpackages/ckeditor5-collapsible/src/block-drag-handle.ts178 const dom = view ? this.opts.editor.editing.view.domConverter.viewToDom(view) : null;
CRITICAL…kages/ckeditor5-collapsible/src/collapsible-editing.ts264 const dom = view ? this.editor.editing.view.domConverter.viewToDom(view) : null;
CRITICAL…kages/ckeditor5-collapsible/src/collapsible-editing.ts927 const changes = this.editor.model.document.differ.getChanges();
CRITICAL…kages/ckeditor5-collapsible/src/collapsible-editing.ts958 const changes = this.editor.model.document.differ.getChanges();
CRITICAL…kages/ckeditor5-collapsible/src/collapsible-editing.ts1006 const changes = this.editor.model.document.differ.getChanges();
CRITICALpackages/ckeditor5/src/plugins/indent_block_shortcut.ts30 let el: ModelPosition | ModelElement | ModelDocumentFragment | null = this.editor.model.document.selection.getFi
CRITICAL…s/todo_list_multistate/todo_list_multistate_editing.ts225 const position = this.editor.model.document.selection.getFirstPosition();
Decorative Section Separators34 hits · 102 pts
SeverityFileLineSnippet
MEDIUMscripts/translation/create-po-file.sh3# --------------------------------------------------------------------------------------------------
MEDIUMscripts/translation/create-po-file.sh18# --------------------------------------------------------------------------------------------------
MEDIUMapps/script-deployer/scripts/auto-import-xopp.ts13// ── Color mapping ────────────────────────────────────────────────────────────
MEDIUMapps/script-deployer/scripts/auto-import-xopp.ts48// ── Excalidraw element helpers ───────────────────────────────────────────────
MEDIUMapps/script-deployer/scripts/auto-import-xopp.ts90// ── xml2js element accessors ─────────────────────────────────────────────────
MEDIUMapps/script-deployer/scripts/auto-import-xopp.ts110// ── Converters ───────────────────────────────────────────────────────────────
MEDIUMapps/script-deployer/scripts/auto-import-xopp.ts231// ── Main conversion ──────────────────────────────────────────────────────────
MEDIUMapps/script-deployer/scripts/auto-import-xopp.ts287// ── Entry point (manually run) ───────────────────────────────────────────────
MEDIUMapps/script-deployer/scripts/auto-import-rnote.ts13// ── Types (rnote v0.9+ / v0.13 JSON format) ────────────────────────────────
MEDIUMapps/script-deployer/scripts/auto-import-rnote.ts101// ── Raw RGBA → PNG encoding ─────────────────────────────────────────────────
MEDIUMapps/script-deployer/scripts/auto-import-rnote.ts167// ── Color conversion ────────────────────────────────────────────────────────
MEDIUMapps/script-deployer/scripts/auto-import-rnote.ts180// ── Excalidraw element helpers ──────────────────────────────────────────────
MEDIUMapps/script-deployer/scripts/auto-import-rnote.ts222// ── Bezier flattening ───────────────────────────────────────────────────────
MEDIUMapps/script-deployer/scripts/auto-import-rnote.ts260// ── Converters ──────────────────────────────────────────────────────────────
MEDIUMapps/script-deployer/scripts/auto-import-rnote.ts432// ── Main conversion ─────────────────────────────────────────────────────────
MEDIUMapps/script-deployer/scripts/auto-import-rnote.ts468// ── Entry point ─────────────────────────────────────────────────────────────
MEDIUMapps/script-deployer/src/dev.ts14// ── Environment — must be set before any server module is imported ──────────
MEDIUMapps/script-deployer/src/dev.ts27// ── Constants ───────────────────────────────────────────────────────────────
MEDIUMapps/script-deployer/src/deploy.spec.ts17// ── Mocks — only SQL and entity_changes, becca is real ───────────────────────
MEDIUMapps/script-deployer/src/deploy.spec.ts39// ── parseScriptMeta ──────────────────────────────────────────────────────────
MEDIUMapps/script-deployer/src/deploy.spec.ts118// ── transpile ────────────────────────────────────────────────────────────────
MEDIUMapps/script-deployer/src/deploy.spec.ts146// ── deployScript ─────────────────────────────────────────────────────────────
MEDIUMapps/script-deployer/src/deploy.ts9// ── Public constants ─────────────────────────────────────────────────────────
MEDIUMapps/script-deployer/src/deploy.ts22// ── Front-matter parsing ─────────────────────────────────────────────────────
MEDIUMapps/script-deployer/src/deploy.ts75// ── Transpilation ────────────────────────────────────────────────────────────
MEDIUMapps/script-deployer/src/deploy.ts98// ── Note ID helpers ──────────────────────────────────────────────────────────
MEDIUMapps/script-deployer/src/deploy.ts108// ── Deployment ───────────────────────────────────────────────────────────────
MEDIUM…/src/services/search/services/search_profiling.spec.ts22// ── helpers ──────────────────────────────────────────────────────────
MEDIUM…/src/services/search/services/search_profiling.spec.ts76// ── dataset builder ──────────────────────────────────────────────────
MEDIUM…/src/services/search/services/search_profiling.spec.ts180// ── profiling tests ──────────────────────────────────────────────────
MEDIUM…/src/services/search/services/search_benchmark.spec.ts20// ── helpers ──────────────────────────────────────────────────────────
MEDIUM…/src/services/search/services/search_benchmark.spec.ts69// ── dataset builder ──────────────────────────────────────────────────
MEDIUM…/src/services/search/services/search_benchmark.spec.ts180// ── benchmark runner ─────────────────────────────────────────────────
MEDIUM…/src/services/search/services/search_benchmark.spec.ts279// ── tests ────────────────────────────────────────────────────────────
Over-Commented Block27 hits · 27 pts
SeverityFileLineSnippet
LOWdocker-compose.yml1# Running `docker-compose up` will create/use the "trilium-data" directory in the user home
LOWscripts/translation/create-po-file.sh1#!/usr/bin/env bash
LOW…kages/ckeditor5-collapsible/src/collapsible-editing.ts721 *
LOWpackages/commons/src/lib/shared_constants.ts21 'logseq', 'mid', 'obsidian', 'bookends', 'highlights'
LOWpackages/ckeditor5-mermaid/tests/manual/markdown.md1## Mermaid widget
LOWpackages/ckeditor5-mermaid/tests/manual/mermaid.md1## Mermaid widget
LOWpackages/share-theme/src/scripts/test.ts61// else if (previousEntry.level === cLvl - 1) {
LOWpackages/share-theme/src/scripts/modules/expanders.ts1// In case a linked article lead to a new tree
LOW…ckages/trilium-core/src/services/consistency_checks.ts901 // When sync is configured but hasn't fully completed yet (e.g. the app
LOW…re/src/services/encryption/password_encryption.spec.ts1import { describe, expect, it, vi } from "vitest";
LOW…es/trilium-core/src/services/encryption/crypto.spec.ts1import { afterEach, beforeAll, describe, expect, it, vi } from "vitest";
LOW…ilium-core/src/services/search/services/search.spec.ts781 // .child(note("Canada")
LOWpackages/splitjs/src/split.js101
LOWpackages/splitjs/src/split.js201 clientSize = 'clientHeight'
LOWpackages/splitjs/src/split.js261
LOWpackages/splitjs/src/split.js321 adjust.call(this, offset)
LOWpackages/splitjs/src/split.js561 }
LOW…ges/ckeditor5/src/plugins/syntax_highlighting/index.ts181 // Don't highlight if the code is too big, as the typing performance will be highly degraded.
LOW.github/workflows/codeql.yml1# For most projects, this workflow file will not need changing; you simply need
LOW.github/workflows/codeql.yml61
LOWapps/desktop/spec/setup.ts1// Reuse the server's full core initialization for desktop spec files that
LOWapps/desktop/scripts/build-appimage.sh1#!/usr/bin/env bash
LOWapps/desktop/src/services/printing.ts1import { getLog, utils as coreUtils } from "@triliumnext/core";
LOWapps/server/spec/db/config.ini21# path to certificate (run "bash bin/generate-cert.sh" to generate self-signed certificate). Relevant only if https=true
LOWapps/server/src/assets/config-sample.ini21# setting to give trust to reverse proxies, a comma-separated list of trusted rev. proxy IPs can be specified (CIDR nota
LOWapps/server/src/assets/config-sample.ini41[Sync]
LOWapps/client/src/services/link.ts501/* v8 ignore next -- the `print` device branch is evaluated once at module load; under test glob.device is undefined, so
Slop Phrases13 hits · 22 pts
SeverityFileLineSnippet
MEDIUMdocs/Script API/index.html67<h3 id="mobile" class="tsd-anchor-link">Mobile<a href="#mobile" aria-label="Permalink" class="tsd-anchor-icon"><svg view
LOWpackages/codemirror/vite.config.ts21 // Don't forget to update your package.json as well.
LOWpackages/highlightjs/vite.config.ts21 // Don't forget to update your package.json as well.
LOWpackages/ckeditor5/vite.config.ts22 // Don't forget to update your package.json as well.
MEDIUM.github/workflows/codeql.yml56 # If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
MEDIUM.vscode/i18n-ally-custom-framework.yml11# To help with this, you can use https://www.freeformatter.com/json-escape.html
MEDIUM.vscode/i18n-ally-custom-framework.yml23# To help with this, you can use https://www.freeformatter.com/json-escape.html
LOW…s/en/User Guide/User Guide/Advanced Usage/Sharing.html403 in format <code>username:password</code>. Don't forget to make this inheritable
LOW… Guide/User Guide/Advanced Usage/ETAPI (REST API).html49<p>Make sure to replace the values of:</p>
LOW… Installing the server/Packaged version for Linux.html168<p>Don't forget to <a href="#root/_help_l2VkvOwUNfZj">configure TLS</a>, which is
LOW…er Installation/1. Installing the server/Manually.html44<p>Don't forget to <a href="#root/_help_l2VkvOwUNfZj">configure TLS</a> which is
LOW…otes/en/User Guide/User Guide/Collections/Geo Map.html203 of a child note of the map (don't forget to surround the value with a
LOWapps/client/src/translations/en/translation.json481 "share_credentials": "require credentials to access this shared note. Value is expected to be in format 'username:pa
Fake / Example Data13 hits · 14 pts
SeverityFileLineSnippet
LOW… Basics/Preact/Built-in components/Widget showcase.jsx15 const lorem = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam accumsan eu odio non gravida. Pellen
LOW… Basics/Preact/Built-in components/Widget showcase.jsx15 const lorem = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam accumsan eu odio non gravida. Pellen
LOWpackages/pdfjs-viewer/src/annotations.spec.ts47 const withAuthor = { ...SAMPLE_HIGHLIGHT, titleObj: { str: "John Doe", dir: "ltr" } };
LOWpackages/pdfjs-viewer/src/annotations.spec.ts48 expect(processAnnotation(withAuthor, 1)!.author).toBe("John Doe");
LOWpackages/turndown-plugin-gfm/test/gfm.spec.ts15 expect(turndown.turndown("<strike>Lorem ipsum</strike>")).toBe("~~Lorem ipsum~~");
LOWpackages/turndown-plugin-gfm/test/gfm.spec.ts19 expect(turndown.turndown("<s>Lorem ipsum</s>")).toBe("~~Lorem ipsum~~");
LOWpackages/turndown-plugin-gfm/test/gfm.spec.ts23 expect(turndown.turndown("<del>Lorem ipsum</del>")).toBe("~~Lorem ipsum~~");
LOWpackages/trilium-core/src/becca/similarity.spec.ts13 <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer eget purus et eros faucibus dignissi
LOWpackages/trilium-core/src/becca/similarity.spec.ts13 <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer eget purus et eros faucibus dignissi
LOW… Basics/Preact/Built-in components/Widget showcase.jsx15 const lorem = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam accumsan eu odio non gravida. Pellen
LOW… Basics/Preact/Built-in components/Widget showcase.jsx15 const lorem = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam accumsan eu odio non gravida. Pellen
LOW…m Demo/Scripting examples/Render note with JSX/JSX.jsx13 const lorem = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam accumsan eu odio non gravida. Pellen
LOW…m Demo/Scripting examples/Render note with JSX/JSX.jsx13 const lorem = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam accumsan eu odio non gravida. Pellen
Verbosity Indicators3 hits · 4 pts
SeverityFileLineSnippet
LOWpackages/codemirror/src/extensions/custom_tab.ts24 // Step 1: Handle non-empty selections → replace with tab
LOWpackages/codemirror/src/extensions/custom_tab.ts46 // Step 2: Handle empty selections
LOWapps/client/src/services/note_tooltip.ts100 // we need to check if we're still hovering over the element
Self-Referential Comments1 hit · 3 pts
SeverityFileLineSnippet
MEDIUMapps/desktop/scripts/build-appimage.sh50# Create the AppRun entry point
Overly Generic Function Names2 hits · 2 pts
SeverityFileLineSnippet
LOWapps/server/src/routes/custom.ts7function handleRequest(req: Request, res: Response) {
LOW…/client/src/widgets/type_widgets/canvas/persistence.ts199async function getData(api: ExcalidrawImperativeAPI, appStateToCompare: RefObject<Partial<ImportantAppState>>) {
Redundant / Tautological Comments1 hit · 2 pts
SeverityFileLineSnippet
LOWapps/server/rootless-entrypoint.sh5# Check if runtime UID/GID match the expected values