Public report of HKUDS/DeepTutor, published 3 November 2026. It has the same score, grades and number of findings as the full report. The details of security findings (where they are in the code, which known vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive report Measured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.11.1). Assert signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey → Signed and filed in the standard's public register, 3 November 2026, 18:03 UTC · Survey ID cd_3d1accf0cf974c19a6db9ba9c452f04b

HKUDS/DeepTutor

Measured 3 November 2026, 18:00 UTC, at code version f7aed07

CAI score 44out of 100 At risk Up 1 since the last survey

The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.

A large codebase: 495,252 lines of product code in 6 projects, tests not counted · Estimated rebuild effort: about 4.9 person-years · Weakest lens: Production Readiness, 34

Findings by how serious they are

179 critical 3840 serious 179 minor

10 dimensions are left out of the score. For each one, we either couldn't measure it in this code, or found no evidence of the safeguard we look for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.

This survey was produced by

Assert small markCanine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
3 November 2026, 18:00 UTC

A measurement, not a certificate. The Code Assurance Index records a number together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee the code. The standard was written by Canine Development, which also builds the Canine Code Analyzer. It is open to any tool that implements it, and today the Canine Code Analyzer is the only one that does.

A critical security finding is open, such as a library with a known critical vulnerability or a password or key found in the code. The score itself is unchanged, but its band shows At risk until the finding is fixed. See the Security and Compliance lens.

The score is deterministic, which means the same code always gets the same score. We work it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸

88of 88 dimensions measured by tools.
4172of 4198 findings point to an exact file and line, so you can open each one in the code. The other 26 concern the repository as a whole, such as missing documentation.
88dimensions across 7 lenses, read from 495,252 lines of product code in 6 projects.
Chapters

Executive summary

HKUDS/DeepTutor is rated At risk because critical security findings are open. Its score is held back because we found no automated security scanning of the code, its secrets or its dependencies, and it has uses of packages that aren't listed. It scores 44 out of 100, which the At risk rating leaves unchanged.

Production Readiness, at 34, is the weakest lens and counts most in the score. The best first step is fixing the package under a licence on your banned list, worth about 5 points. Adding automated security scanning would lift Production Readiness itself, also worth about 5. Raising Production Readiness to 70 would lift the score to about 53.

Forty-two pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Thirty-five passwords or keys are open to anyone who can read the repository, and nineteen known security holes in the packages the code depends on can be used by attackers. Pinning each tool to an exact version, replacing each exposed password or key and updating the vulnerable packages would close these risks. Correcting the flagged pipeline settings would fix the six weaknesses in the build pipeline's configuration, and the six unsafe settings in infrastructure or container files need changing to safe values. The 27 form fields without a label need a label.

The product code is 495,252 lines, about €720,000 to rebuild.

A lens is capped at Adequate while one of its dimensions scores below 4 out of 10, however well the rest of the lens does. That way a serious problem in one place always shows in the lens's rating.

How the score is built: what each lens counts for The lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
Production Readiness 34 · counts for 46%Accessibility 45 · counts for 25%Code Health 57 · counts for 14%Architecture 57 · counts for 8%Performance 60 · counts for 4%Security and Compliance 71 · counts for 2%Maturity 74 · counts for 1%

If Production Readiness rose from 34 to 70, the lowest score rated Strong, the score would rise from 44 to about 53.

Code composition: what the lines of code are
Product code 67%Tests 33%
New since the last survey: 653 findings

These 653 critical or serious findings weren't in the previous survey, on 20 October 2026. The first 100 are listed here, and the findings file in the download package lists them all.

  • Cyclomatic Complexity · ChatStateAdapter.reduce (cyclomatic 187) web/features/chat/ChatStateAdapter.tsx
  • Cyclomatic Complexity · NoteWorkspace.NoteWorkspace (cyclomatic 155) web/features/notes/components/NoteWorkspace.tsx
  • Cyclomatic Complexity · TimeGrid.TimeGrid (cyclomatic 107) web/features/calendar/components/TimeGrid.tsx
  • Cyclomatic Complexity · CalendarPage.CalendarPage (cyclomatic 107) web/features/calendar/components/CalendarPage.tsx
  • Cyclomatic Complexity · NoteEditor.NoteEditor (cyclomatic 97) web/features/notes/components/NoteEditor.tsx
  • Cyclomatic Complexity · NoteLearningContent.NoteLearningContent (cyclomatic 66) web/features/notes/components/NoteLearningContent.tsx
  • Cyclomatic Complexity · NativeSession.operate (cyclomatic 61) packages/chat-engine/src/native/session.ts
  • Cyclomatic Complexity · NoteBlockPreview.NoteBlockPreview (cyclomatic 59) web/features/notes/components/NoteBlockPreview.tsx
  • Cyclomatic Complexity · useNoteThreads.useNoteThreads (cyclomatic 58) web/features/notes/components/useNoteThreads.ts
  • Cyclomatic Complexity · NoteFavoritesPicker.NoteFavoritesPicker (cyclomatic 54) web/features/notes/components/NoteFavoritesPicker.tsx
  • Cyclomatic Complexity · KanbanBoard.KanbanBoard (cyclomatic 53) web/features/tasks/components/KanbanBoard.tsx
  • Cyclomatic Complexity · NotebookConsole.NotebookDetail (cyclomatic 48) web/components/notebook/NotebookConsole.tsx
  • Cyclomatic Complexity · NoteEditor.Handles (cyclomatic 45) web/features/notes/components/NoteEditor.tsx
  • Cyclomatic Complexity · blocks.blockPreview (cyclomatic 44) web/features/notes/model/blocks.ts
  • Cyclomatic Complexity · blocks.blocks_to_markdown (cyclomatic 43) deeptutor/notes/blocks.py
  • Cyclomatic Complexity · NoteTopBar.NoteTopBar (cyclomatic 42) web/features/notes/components/NoteTopBar.tsx
  • Cyclomatic Complexity · chat-completions.request (cyclomatic 39) packages/chat-engine/src/providers/chat-completions.ts
  • Cyclomatic Complexity · EventEditor.EventEditor (cyclomatic 39) web/features/calendar/components/EventEditor.tsx
  • Cyclomatic Complexity · NoteCompanion.ThreadPanel (cyclomatic 39) web/features/notes/components/NoteCompanion.tsx
  • Cyclomatic Complexity · CreationDraftCard.CreationDraftCard (cyclomatic 37) web/components/chat/home/CreationDraftCard.tsx
  • Cyclomatic Complexity · OutputFileActions.OutputFileActions (cyclomatic 37) web/components/files/OutputFileActions.tsx
  • Cyclomatic Complexity · PracticePage.PracticeCollectionPage (cyclomatic 37) web/components/learning/practice/PracticePage.tsx
  • Cyclomatic Complexity · LocationCrumbs.InstanceCrumb (cyclomatic 36) web/components/layout/LocationCrumbs.tsx
  • Cyclomatic Complexity · CalendarStore.update (cyclomatic 35) deeptutor/services/calendar/store.py
  • Cyclomatic Complexity · useDragSort.useDragSort.handlePointerDown.<returned closure> (cyclomatic 35) web/hooks/useDragSort.ts
  • Cyclomatic Complexity · OrganizedSessionList.OrganizedSessionList::renderRow (cyclomatic 34) web/components/sessions/OrganizedSessionList.tsx
  • Cyclomatic Complexity · NoteCompanion.ThreadComposer (cyclomatic 34) web/features/notes/components/NoteCompanion.tsx
  • Cyclomatic Complexity · evaluation.load_cases (cyclomatic 33) deeptutor/services/memory/evaluation.py
  • Cyclomatic Complexity · AnswerModeMenu.PartnerLinkList (cyclomatic 32) web/components/chat/home/AnswerModeMenu.tsx
  • Cyclomatic Complexity · types.validateNativeInput (cyclomatic 31) packages/chat-engine/src/native/types.ts
  • Cyclomatic Complexity · ReviewTrail.ReviewTrail (cyclomatic 30) web/components/space/learning/ReviewTrail.tsx
  • Cyclomatic Complexity · MessageThreadMarker.MessageThreadMarker (cyclomatic 30) web/features/chat/messages/MessageThreadMarker.tsx
  • Cyclomatic Complexity · NoteFavoriteBlock.NoteFavoriteBlock (cyclomatic 30) web/features/notes/components/NoteFavoriteBlock.tsx
  • Cyclomatic Complexity · CoWriterStorage.update_document (cyclomatic 29) deeptutor/co_writer/storage.py
  • Cyclomatic Complexity · _turn_runtime_shared._resolve_selection_tutor_context (cyclomatic 29) deeptutor/services/session/_turn_runtime_shared.py
  • Cyclomatic Complexity · ChatSessionMenu.ChatSessionMenu (cyclomatic 29) web/features/chat/components/ChatSessionMenu.tsx
  • Cyclomatic Complexity · ClassicLearningDashboard.ClassicLearningDashboard (cyclomatic 29) web/features/ui-layout/classic/ClassicLearningDashboard.tsx
  • Cyclomatic Complexity · run-loop.runLoop (cyclomatic 28) packages/chat-engine/src/core/run-loop.ts
  • Cyclomatic Complexity · ComposerTrayMenu.TrayMenu (cyclomatic 28) web/components/chat/home/ComposerTrayMenu.tsx
  • Cyclomatic Complexity · python_scheduler.run_loop (cyclomatic 27) deeptutor/agents/loop/python_scheduler.py
  • Cyclomatic Complexity · model-round.modelRound (cyclomatic 27) packages/chat-engine/src/native/model-round.ts
  • Cyclomatic Complexity · CategoryNavigation.CategoryTabs (cyclomatic 27) web/components/sidebar/CategoryNavigation.tsx
  • Cyclomatic Complexity · CalendarRuntime.CalendarRuntime (cyclomatic 27) web/features/calendar/components/CalendarRuntime.tsx
  • Cyclomatic Complexity · ClassicSidebarShell.ClassicSidebarShell (cyclomatic 27) web/features/ui-layout/classic/ClassicSidebarShell.tsx
  • Cyclomatic Complexity · VideoLessonCapability.run (cyclomatic 26) deeptutor/agents/video_lesson/capability.py
  • Cyclomatic Complexity · lifecycle.change (cyclomatic 26) deeptutor/modules/lifecycle.py
  • Cyclomatic Complexity · MonthView.MonthWeek (cyclomatic 26) web/features/calendar/components/MonthView.tsx
  • Cyclomatic Complexity · HandoffCapability._partner (cyclomatic 25) deeptutor/capabilities/handoff/capability.py
  • Cyclomatic Complexity · document_images._render_omml (cyclomatic 25) deeptutor/utils/document_images.py
  • Cyclomatic Complexity · build_modules.build (cyclomatic 25) scripts/build_modules.py
  • Cyclomatic Complexity · PartnerRoster.PartnerRoster (cyclomatic 25) web/components/sidebar/PartnerRoster.tsx
  • Cyclomatic Complexity · CommandPalette.CommandPalette (cyclomatic 25) web/components/sidebar/CommandPalette.tsx
  • Cyclomatic Complexity · NativeAdapter.invoke (cyclomatic 24) deeptutor/agents/loop/native_adapter.py
  • Cyclomatic Complexity · folders.browse_folders (cyclomatic 24) deeptutor/services/workspace/folders.py
  • Cyclomatic Complexity · workspace.workspaceTool (cyclomatic 24) packages/chat-engine/src/tools/workspace.ts
  • Cyclomatic Complexity · AnswerModeMenu.AnswerList (cyclomatic 24) web/components/chat/home/AnswerModeMenu.tsx
  • Cyclomatic Complexity · PageCustomizeDialog.PageCustomizeDialog (cyclomatic 24) web/components/customization/PageCustomizeDialog.tsx
  • Cyclomatic Complexity · ServerFolderPicker.ServerFolderPicker (cyclomatic 24) web/components/workspaces/ServerFolderPicker.tsx
  • Cyclomatic Complexity · launcher._terminate_all (cyclomatic 23) deeptutor/runtime/launcher.py
  • Cyclomatic Complexity · PartnerArchives.conversationPreview (cyclomatic 23) web/components/partners/PartnerArchives.tsx
  • Cyclomatic Complexity · NoteInlineReviews.NoteInlineReviews (cyclomatic 23) web/features/notes/components/NoteInlineReviews.tsx
  • Cyclomatic Complexity · NoteInsertMenu.NoteInsertMenu (cyclomatic 23) web/features/notes/components/NoteInsertMenu.tsx
  • Cyclomatic Complexity · NoteThreadMarkers.NoteThreadMarkers (cyclomatic 23) web/features/notes/components/NoteThreadMarkers.tsx
  • Cyclomatic Complexity · history.reference_history_reads (cyclomatic 22) deeptutor/capabilities/mastery/history.py
  • Cyclomatic Complexity · generation.propose_generated_block (cyclomatic 22) deeptutor/capabilities/notes/generation.py
  • Cyclomatic Complexity · proposals.propose (cyclomatic 22) deeptutor/notes/proposals.py
  • Cyclomatic Complexity · proposals.review (cyclomatic 22) deeptutor/notes/proposals.py
  • Cyclomatic Complexity · recurrence.parse_rule (cyclomatic 22) deeptutor/services/calendar/recurrence.py
  • Cyclomatic Complexity · launch_settings._normalize_language (cyclomatic 22) deeptutor/services/config/launch_settings.py
  • Cyclomatic Complexity · Conversation.project (cyclomatic 22) packages/chat-engine/src/context/conversation.ts
  • Cyclomatic Complexity · history.planHistory (cyclomatic 22) packages/chat-engine/src/context/history.ts
  • Cyclomatic Complexity · MonthView.MonthView (cyclomatic 22) web/features/calendar/components/MonthView.tsx
  • Cyclomatic Complexity · markdown.parseNoteMarkdown (cyclomatic 22) REDACTED
  • Cyclomatic Complexity · start (cyclomatic 22) apps/desktop/src/runtime.mjs
  • Cyclomatic Complexity · catalog.manifests (cyclomatic 21) deeptutor/modules/catalog.py
  • Cyclomatic Complexity · layers.read_layers (cyclomatic 21) deeptutor/services/calendar/layers.py
  • Cyclomatic Complexity · GoogleBrowserScraperProvider.search (cyclomatic 21) deeptutor/services/search/providers/google_browser_scraper.py
  • Cyclomatic Complexity · chat-completions.request::ingest (cyclomatic 21) packages/chat-engine/src/providers/chat-completions.ts
  • Cyclomatic Complexity · ask-user.askPayload.questions (cyclomatic 21) packages/chat-engine/src/tools/ask-user.ts
  • Cyclomatic Complexity · HandoffCapability._subagent (cyclomatic 20) deeptutor/capabilities/handoff/capability.py
  • Cyclomatic Complexity · generation.result_learning_block (cyclomatic 20) deeptutor/capabilities/notes/generation.py
  • Cyclomatic Complexity · catalog.module_statuses (cyclomatic 20) deeptutor/modules/catalog.py
  • Cyclomatic Complexity · LlamaIndexPipeline.search (cyclomatic 20) deeptutor/services/rag/pipelines/llamaindex/pipeline.py
  • Cyclomatic Complexity · contracts.validateOutput (cyclomatic 20) packages/chat-engine/src/core/contracts.ts
  • Cyclomatic Complexity · http.post (cyclomatic 20) packages/chat-engine/src/providers/http.ts
  • Cyclomatic Complexity · ToolDispatcher.run::execute (cyclomatic 20) packages/chat-engine/src/tools/dispatcher.ts
  • Cyclomatic Complexity · stdio.lines.on("line") (cyclomatic 20) packages/chat-engine/src/transport/stdio.ts
  • Cyclomatic Complexity · page.PageCard (cyclomatic 20) web/app/(workspace)/co-writer/page.tsx
  • Cyclomatic Complexity · NoteTaskBlock.NoteTaskBlock (cyclomatic 20) web/features/notes/components/NoteTaskBlock.tsx
  • Cyclomatic Complexity · AudioOverviewCapability.run (cyclomatic 19) deeptutor/capabilities/audio_overview/capability.py
  • Cyclomatic Complexity · lifecycle.plan (cyclomatic 19) deeptutor/modules/lifecycle.py
  • Cyclomatic Complexity · claude_code_provider._prompt_input (cyclomatic 19) deeptutor/services/llm/provider_core/claude_code_provider.py
  • Cyclomatic Complexity · storage.resolve_resumable_rebuild_dir (cyclomatic 19) deeptutor/services/rag/pipelines/llamaindex/storage.py
  • Cyclomatic Complexity · thread_attribution.backfill_thread_sources (cyclomatic 19) deeptutor/services/session/thread_attribution.py
  • Cyclomatic Complexity · speech_text._replace_limits_once (cyclomatic 19) deeptutor/services/voice/speech_text.py
  • Cyclomatic Complexity · kit.Timeline (cyclomatic 19) deeptutor/agents/video_lesson/remotion/kit.tsx
  • Cyclomatic Complexity · page.PartnerGroupPage (cyclomatic 19) web/app/(workspace)/partners/groups/[groupId]/page.tsx
  • Cyclomatic Complexity · OrganizedSessionList.OrganizedSessionList::renderGroup (cyclomatic 19) web/components/sessions/OrganizedSessionList.tsx
  • Cyclomatic Complexity · TracePresentation.StreamingStatus (cyclomatic 19) web/features/chat/trace/TracePresentation.tsx
  • Cyclomatic Complexity · NoteOutline.NoteOutline (cyclomatic 19) web/features/notes/components/NoteOutline.tsx

We compare every finding with the previous survey's. A finding that has only moved to another line in the same file counts as the same finding, so only new findings appear here. Advisory notes from the AI model are left out, because the model words them afresh in every survey.

Fixed since the last survey: 1488 findings

These 1488 critical or serious findings were in the previous survey, on 20 October 2026, and are gone from this one. The first 100 are listed here.

  • Cyclomatic Complexity · ChatStateAdapter.reducer (cyclomatic 176) web/features/chat/ChatStateAdapter.tsx
  • Cyclomatic Complexity · NotebookConsole.NotebookConsole (cyclomatic 68) web/components/notebook/NotebookConsole.tsx
  • Cyclomatic Complexity · tools._render_course_overview (cyclomatic 56) deeptutor/capabilities/course_study/tools.py
  • Cyclomatic Complexity · AgentLoop._run_loop (cyclomatic 54) deeptutor/agents/loop/agent_loop.py
  • Cyclomatic Complexity · InlineFileCard.makeFileLinkRemarkPlugin (cyclomatic 50) web/components/common/InlineFileCard.tsx
  • Cyclomatic Complexity · page.KanbanPage (cyclomatic 46) web/app/(workspace)/kanban/page.tsx
  • Cyclomatic Complexity · PracticePage.ScopedPracticePage (cyclomatic 40) web/components/learning/practice/PracticePage.tsx
  • Cyclomatic Complexity · OrganizedSessionList.OrganizedSessionList::renderRow (cyclomatic 39) web/components/courses/OrganizedSessionList.tsx
  • Cyclomatic Complexity · PersonaSelector.PersonaSelector (cyclomatic 37) web/components/chat/home/PersonaSelector.tsx
  • Cyclomatic Complexity · ResourceSelector.ResourceSelector (cyclomatic 36) web/components/chat/home/ResourceSelector.tsx
  • Cyclomatic Complexity · useDragSort.useDragSort.handlePointerDown (cyclomatic 35) web/hooks/useDragSort.ts
  • Cyclomatic Complexity · tools.course_edit (cyclomatic 31) deeptutor/capabilities/course_study/tools.py
  • Cyclomatic Complexity · CoursesShelf.CoursesShelf (cyclomatic 25) web/components/courses/CoursesShelf.tsx
  • Cyclomatic Complexity · OrganizedSessionList.OrganizedSessionList::renderGroup (cyclomatic 24) web/components/courses/OrganizedSessionList.tsx
  • Cyclomatic Complexity · CourseService._load (cyclomatic 22) deeptutor/services/courses.py
  • Cyclomatic Complexity · _turn_runtime_shared._apply_course_defaults (cyclomatic 21) deeptutor/services/session/_turn_runtime_shared.py
  • Cyclomatic Complexity · AgentSelector.AgentSelector (cyclomatic 20) web/components/chat/home/AgentSelector.tsx
  • Cyclomatic Complexity · document_images.extract_docx_rich (cyclomatic 19) deeptutor/utils/document_images.py
  • Cyclomatic Complexity · page.CourseDetailPage (cyclomatic 18) web/app/(utility)/courses/[courseId]/page.tsx
  • Cyclomatic Complexity · ActivityLibrary.ActivityLibrary (cyclomatic 18) web/components/learning/ActivityLibrary.tsx
  • Cyclomatic Complexity · FolderDialog.FolderDialog (cyclomatic 18) web/components/reading/library/FolderDialog.tsx
  • Cyclomatic Complexity · codebuddy_provider._assistant_tool_calls (cyclomatic 17) deeptutor/services/llm/provider_core/codebuddy_provider.py
  • Cyclomatic Complexity · CourseSyllabus.CourseSyllabus (cyclomatic 17) web/components/courses/CourseSyllabus.tsx
  • Cyclomatic Complexity · navigation.resolve_module (cyclomatic 16) deeptutor/learning/navigation.py
  • Cyclomatic Complexity · TopicWizardSteps.SourceRow (cyclomatic 16) web/components/space/learning/TopicWizardSteps.tsx
  • Cyclomatic Complexity · TaskPanelSection.TaskPanelSection (cyclomatic 16) web/components/tasks/TaskPanelSection.tsx
  • Cognitive Complexity · ChatStateAdapter.reducer (cognitive 222) web/features/chat/ChatStateAdapter.tsx
  • Cognitive Complexity · AgentLoop._run_loop (cognitive 138) deeptutor/agents/loop/agent_loop.py
  • Cognitive Complexity · NotebookConsole.NotebookConsole (cognitive 91) web/components/notebook/NotebookConsole.tsx
  • Cognitive Complexity · tools._render_course_overview (cognitive 62) deeptutor/capabilities/course_study/tools.py
  • Cognitive Complexity · OrganizedSessionList.OrganizedSessionList::renderRow (cognitive 54) web/components/courses/OrganizedSessionList.tsx
  • Cognitive Complexity · PracticePage.ScopedPracticePage (cognitive 49) web/components/learning/practice/PracticePage.tsx
  • Cognitive Complexity · page.KanbanPage (cognitive 45) web/app/(workspace)/kanban/page.tsx
  • Cognitive Complexity · CoursesShelf.CoursesShelf (cognitive 42) web/components/courses/CoursesShelf.tsx
  • Cognitive Complexity · tools.course_edit (cognitive 39) deeptutor/capabilities/course_study/tools.py
  • Cognitive Complexity · useDragSort.useDragSort.handlePointerDown (cognitive 34) web/hooks/useDragSort.ts
  • Cognitive Complexity · CourseSyllabus.CourseSyllabus (cognitive 31) web/components/courses/CourseSyllabus.tsx
  • Cognitive Complexity · courses_state._question_bank_state (cognitive 26) deeptutor/services/courses_state.py
  • Cognitive Complexity · ResourceSelector.ResourceSelector (cognitive 25) web/components/chat/home/ResourceSelector.tsx
  • Cognitive Complexity · SessionViewerPanel.TabBar (cognitive 25) web/components/chat/home/SessionViewerPanel.tsx
  • Cognitive Complexity · CourseService._load (cognitive 24) deeptutor/services/courses.py
  • Cognitive Complexity · codebuddy_provider._consume_messages (cognitive 23) deeptutor/services/llm/provider_core/codebuddy_provider.py
  • Cognitive Complexity · _turn_runtime_shared._apply_course_defaults (cognitive 23) deeptutor/services/session/_turn_runtime_shared.py
  • Cognitive Complexity · MasterySourcePresentation.presentedPages (cognitive 23) web/components/chat/home/MasterySourcePresentation.tsx
  • Cognitive Complexity · DocumentAdder.process_new_documents (cognitive 22) deeptutor/knowledge/add_documents.py
  • Cognitive Complexity · codebuddy_provider._assistant_tool_calls (cognitive 22) deeptutor/services/llm/provider_core/codebuddy_provider.py
  • Cognitive Complexity · PersonaSelector.PersonaSelector (cognitive 22) web/components/chat/home/PersonaSelector.tsx
  • Cognitive Complexity · OrganizedSessionList.OrganizedSessionList::renderGroup (cognitive 22) web/components/courses/OrganizedSessionList.tsx
  • Cognitive Complexity · DashScopeVideogenAdapter._poll (cognitive 21) deeptutor/services/videogen/adapters/dashscope.py
  • Cognitive Complexity · practice.practice_analytics (cognitive 20) deeptutor/api/routers/practice.py
  • Cognitive Complexity · page.CourseDetailPage (cognitive 20) web/app/(utility)/courses/[courseId]/page.tsx
  • Cognitive Complexity · tools.course_handoff (cognitive 18) deeptutor/capabilities/course_study/tools.py
  • Cognitive Complexity · CourseResources.CourseResources (cognitive 18) web/components/courses/CourseResources.tsx
  • Cognitive Complexity · ActivityLibrary.ActivityLibrary (cognitive 17) web/components/learning/ActivityLibrary.tsx
  • Cognitive Complexity · capability._durable_reading_position (cognitive 16) deeptutor/capabilities/course_study/capability.py
  • Cognitive Complexity · executor._execute_chat_job (cognitive 16) deeptutor/services/cron/executor.py
  • Cognitive Complexity · CourseProgress.CourseProgress (cognitive 16) web/components/courses/CourseProgress.tsx
  • God Classes · FunctionTooLong: ChatWorkspace.ChatWorkspace web/features/chat/components/ChatWorkspace.tsx
  • God Classes · FunctionTooLong: ChatStateAdapter.reducer web/features/chat/ChatStateAdapter.tsx
  • God Classes · FunctionTooLong: page.MasteryTopicPage web/app/(workspace)/learning/mastery/[pathId]/page.tsx
  • God Classes · FunctionTooLong: OrganizedSessionList.OrganizedSessionList web/components/courses/OrganizedSessionList.tsx
  • God Classes · ClassTooLong: ChatWorkspace web/features/chat/components/ChatWorkspace.tsx
  • God Classes · FunctionTooLong: page.KanbanPage web/app/(workspace)/kanban/page.tsx
  • God Classes · FunctionTooLong: page.CourseDetailPage web/app/(utility)/courses/[courseId]/page.tsx
  • God Classes · FunctionTooLong: PersonaSelector.PersonaSelector web/components/chat/home/PersonaSelector.tsx
  • God Classes · FunctionTooLong: PracticePage.ScopedPracticePage web/components/learning/practice/PracticePage.tsx
  • God Classes · FunctionTooLong: CoursesShelf.CoursesShelf web/components/courses/CoursesShelf.tsx
  • God Classes · FunctionTooLong: CourseResources.CourseResources web/components/courses/CourseResources.tsx
  • God Classes · FunctionTooLong: ResourceSelector.ResourceSelector web/components/chat/home/ResourceSelector.tsx
  • God Classes · FunctionTooLong: CourseDialog.CourseDialog web/components/courses/CourseDialog.tsx
  • God Classes · FunctionTooLong: AgentSelector.AgentSelector web/components/chat/home/AgentSelector.tsx
  • God Classes · FunctionTooLong: CourseSyllabus.CourseSyllabus web/components/courses/CourseSyllabus.tsx
  • God Classes · FunctionTooLong: ChatMarkdownNoteTab.ChatMarkdownNoteTab web/components/chat/home/ChatMarkdownNoteTab.tsx
  • God Classes · FunctionTooLong: WorkspaceChatGroups.WorkspaceGroup web/components/workspaces/WorkspaceChatGroups.tsx
  • God Classes · FileTooLong: courses/OrganizedSessionList.tsx web/components/courses/OrganizedSessionList.tsx
  • God Classes · FunctionTooLong: ThemePreviewCard.MiniPreview web/components/settings/ThemePreviewCard.tsx
  • God Classes · ClassTooLong: OrganizedSessionList web/components/courses/OrganizedSessionList.tsx
  • God Classes · FunctionTooLong: CoursePill.CoursePill web/components/chat/home/CoursePill.tsx
  • God Classes · FileTooLong: api/main.py deeptutor/api/main.py
  • God Classes · FileTooLong: course_study/tools.py deeptutor/capabilities/course_study/tools.py
  • God Classes · FunctionTooLong: ModuleOutline.ModuleOutline web/components/space/learning/ModuleOutline.tsx
  • God Classes · FunctionTooLong: useDragSort.useDragSort.handlePointerDown web/hooks/useDragSort.ts
  • God Classes · FileTooLong: mastery/loop.py deeptutor/capabilities/mastery/loop.py
  • God Classes · FunctionTooLong: TopicAtlas.TopicAtlas web/components/space/learning/TopicAtlas.tsx
  • God Classes · FileTooLong: library/ReadingLibrary.tsx web/components/reading/library/ReadingLibrary.tsx
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) deeptutor/api/routers/book.py
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) deeptutor/book/blocks/animation.py
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) deeptutor/services/courses.py
  • Code Duplication · Duplicated block (19 lines × 2) deeptutor/utils/document_images.py
  • Code Duplication · Duplicated block (17 lines × 3) deeptutor/capabilities/course_study/capability.py
  • Code Duplication · Duplicated block (16–17 lines × 2) deeptutor/api/routers/knowledge.py
  • Code Duplication · Duplicated block (13 lines × 2) deeptutor/services/config/launch_settings.py
  • Code Duplication · Duplicated block (10–12 lines × 2) deeptutor/api/routers/knowledge.py
  • Code Duplication · Duplicated block (11–12 lines × 2) deeptutor/services/llm/provider_core/openai_compat_provider.py
  • Code Duplication · Duplicated block (11–12 lines × 2) deeptutor/utils/document_extractor.py
  • Code Duplication · Duplicated block (10 lines × 2) deeptutor/capabilities/course_study/tools.py
  • Code Duplication · Duplicated block (9 lines × 2) deeptutor/api/routers/notebook.py
  • Code Duplication · Duplicated block (9 lines × 2) deeptutor/capabilities/course_study/capability.py
  • Code Duplication · Duplicated block (7–9 lines × 2) deeptutor/capabilities/course_study/tools.py
  • Code Duplication · Duplicated block (6–9 lines × 2) deeptutor/services/courses.py
Rebuild cost: about €720,000 · Estimate
Cost to rebuild€240,000 to €1,200,000, for 3,962 to 12,569 hours of work, about 4.9 person-years for 2 to 10 engineers
Difficulty of the problemStandard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor×0.7 at a score of 44. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
SizeLarge: 495,252 lines of product code
What it is notNot a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.

How the estimate is made: We price the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. For this code, every line is priced as straight logic, which keeps the estimate on the low side.

Top priorities

The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.

1
Resolve the 1 Banned license finding(s) in License Compliance.
Raises the score by about 5 points · Low effort · License Compliance
2
Resolve the 1 Test suite cannot be installed from its own lockfile finding(s) in Test Reliability.
Raises the score by about 3 points · Low effort · Test Reliability
3
Add a SAST step to CI running what this repository's stack ships: bandit, `semgrep --config=p/python`, or CodeQL's python pack — so a security regression fails the build instead of landing.
Raises the score by about 5 points · Medium effort · Security & performance tooling

Diagnosis: what the measurements show together

Each conclusion below combines several dimensions into one point that no single dimension shows, and lists the measurements it rests on.

Where the investment is most exposed · Value at risk
This code would cost about €720,000 to build again, about 4.9 person-years of work. Its weakest lens is Production Readiness, at 34 (Weak). Production Readiness is about whether the product is ready to run in production and to change without breaking. Because the weakest lens counts most in the score, work on Production Readiness also moves the score most.
Based on: the rebuild estimate · the Production Readiness grade · how much each lens counts
What to do: Start with the Production Readiness actions in Top priorities.
If you do one thing first · First action
Resolve the 1 Banned license finding(s) in License Compliance. Of all the actions in this report, it raises the score most for the work it takes: about 5 points for low effort, because it clears the 1 License Compliance findings. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 5.9 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 5% to 12% on every change. The history of the code shows how much it changes: about 795,212 lines over the last 90 days, which is about 3,225,026 lines a year. At that pace, the extra work comes to an estimated 425.6 to 2553.6 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.

Architecture: which parts of the code depend on which

The code is divided into modules, groups of code that each handle one part of the product, and a module depends on another when it uses code from it. The table lists the modules both down the side and across the top, in an order where each module should only use modules listed above it. A number in a cell means the module on that row uses the module in that column, and it counts the pairs of building blocks (types) that connect them. The one thing to look for is a mark above the diagonal line. It means two or more modules use each other in a loop (a dependency cycle), so none of them can be changed, tested or released on its own.

1451 modules, with 1554 dependencies between them. One loop runs through 2 of the modules, marked above the diagonal.

The table shows the 40 modules with the most connections; 1411 more are left out to keep it readable.

Which modules use which. The module on each row uses the module in each column, and the number counts the pairs of types that connect them. A cell above the diagonal is part of a loop.
uses →1 deeptutor.agents.base_agent2 deeptutor.book.models3 deeptutor.core.context4 deeptutor.core.tool_protocol5 deeptutor.partners.bus.events6 deeptutor.partners.config.schema7 deeptutor.reading8 deeptutor.runtime.stream_bus9 deeptutor.services.llm.provider_core.base10 deeptutor.services.parsing.base11 deeptutor.services.path_service12 deeptutor.services.search.types13 deeptutor.services.subagent.config14 deeptutor.services.subagent.types15 deeptutor.services.voice.config16 deeptutor_cli17 packages.chat-engine.src.native.types18 web.components.knowledge19 web.components.reading20 web.features.chat.ChatStateAdapter21 web.hooks22 web.lib.book-types23 deeptutor.api.routers24 deeptutor.book.blocks.base25 deeptutor.core.capability_protocol26 deeptutor.partners.bus.queue27 deeptutor.services28 deeptutor.services.config29 deeptutor.services.partners30 deeptutor.services.search.base31 deeptutor.services.subagent.base32 deeptutor.services.voice.base33 web.app.(workspace).learning.books.components34 web.app.(workspace).learning.books.components.blocks35 web.contracts.generated.turn-protocol36 deeptutor.partners.channels.base37 deeptutor.plugins38 web.components.chat39 web.components.chat.home40 web.lib
1 deeptutor.agents.base_agent
2 deeptutor.book.models
3 deeptutor.core.context
4 deeptutor.core.tool_protocol
5 deeptutor.partners.bus.events
6 deeptutor.partners.config.schema
7 deeptutor.reading
8 deeptutor.runtime.stream_bus
9 deeptutor.services.llm.provider_core.base
10 deeptutor.services.parsing.base
11 deeptutor.services.path_service
12 deeptutor.services.search.types
13 deeptutor.services.subagent.config
14 deeptutor.services.subagent.types
15 deeptutor.services.voice.config
16 deeptutor_cli
17 packages.chat-engine.src.native.types
18 web.components.knowledge
19 web.components.reading
20 web.features.chat.ChatStateAdapter
21 web.hooks
22 web.lib.book-types
23 deeptutor.api.routers431
24 deeptutor.book.blocks.base6
25 deeptutor.core.capability_protocol1
26 deeptutor.partners.bus.queue2
27 deeptutor.services1
28 deeptutor.services.config2
29 deeptutor.services.partners12
30 deeptutor.services.search.base1
31 deeptutor.services.subagent.base2
32 deeptutor.services.voice.base2
33 web.app.(workspace).learning.books.components12
34 web.app.(workspace).learning.books.components.blocks1
35 web.contracts.generated.turn-protocol1
36 deeptutor.partners.channels.base11
37 deeptutor.plugins11
38 web.components.chat1
39 web.components.chat.home11
40 web.lib11141
Uses a module listed above itPart of a loopThe module itself
1 deeptutor.agents.base_agent2 deeptutor.book.models3 deeptutor.core.context4 deeptutor.core.tool_protocol5 deeptutor.partners.bus.events6 deeptutor.partners.config.schema7 deeptutor.reading8 deeptutor.runtime.stream_bus9 deeptutor.services.llm.provider_core.base10 deeptutor.services.parsing.base11 deeptutor.services.path_service12 deeptutor.services.search.types13 deeptutor.services.subagent.config14 deeptutor.services.subagent.types15 deeptutor.services.voice.config16 deeptutor_cli17 packages.chat-engine.src.native.types18 web.components.knowledge19 web.components.reading20 web.features.chat.ChatStateAdapter21 web.hooks22 web.lib.book-types23 deeptutor.api.routers24 deeptutor.book.blocks.base25 deeptutor.core.capability_protocol26 deeptutor.partners.bus.queue27 deeptutor.services28 deeptutor.services.config29 deeptutor.services.partners30 deeptutor.services.search.base31 deeptutor.services.subagent.base32 deeptutor.services.voice.base33 web.app.(workspace).learning.books.components34 web.app.(workspace).learning.books.components.blocks35 web.contracts.generated.turn-protocol36 deeptutor.partners.channels.base37 deeptutor.plugins38 web.components.chat39 web.components.chat.home40 web.libdeeptutor.agents.base_agent1deeptutor.book.models2deeptutor.core.context3deeptutor.core.tool_protocol4deeptutor.partners.bus.events5deeptutor.partners.config.schema6deeptutor.reading7deeptutor.runtime.stream_bus8deeptutor.services.llm.provider_core.base9deeptutor.services.parsing.base10deeptutor.services.path_service11deeptutor.services.search.types12deeptutor.services.subagent.config13deeptutor.services.subagent.types14deeptutor.services.voice.config15deeptutor_cli16packages.chat-engine.src.native.types17web.components.knowledge18web.components.reading19web.features.chat.ChatStateAdapter20web.hooks21web.lib.book-types22deeptutor.api.routers23deeptutor.book.blocks.base24deeptutor.core.capability_protocol25deeptutor.partners.bus.queue26deeptutor.services27deeptutor.services.config28deeptutor.services.partners29deeptutor.services.search.base30deeptutor.services.subagent.base31deeptutor.services.voice.base32web.app.(workspace).learning.books.components33web.app.(workspace).learning.books.components.blocks34web.contracts.generated.turn-protocol35deeptutor.partners.channels.base36deeptutor.plugins37web.components.chat38web.components.chat.home39web.lib4043161212121221211111111111141+1411 more modules (most-connected shown)

At a glance — Code Health · 57% · Adequate · gated by D1, D2 ·

At a glance — Architecture · 57% · Adequate · gated by D26, AX7 ·

At a glance — Maturity · 74% · Strong ·

At a glance — Readiness · 34% · Weak · gated by R8, P3, P7 ·

At a glance — Security · 71% · Adequate · gated by D28, D29, D30 ·

At a glance — Accessibility · 45% · Weak · gated by AC4 ·

At a glance — Performance · 60% · Adequate ·

Security & Compliance — OWASP Top-10 mapping

Findings mapped to OWASP categories; the specific CVEs/secrets are in the Security dimension cards below and findings.md (redacted only on the public version of this report).

OWASP categoryFindingsSeverity
A05:2025 — Injection76High / Critical
A03:2025 — Software Supply Chain Failures44High / Critical
A07:2025 — Authentication Failures36High / Critical
A02:2025 — Security Misconfiguration19High / Critical

Roadmap

Top priorities: Add a SAST step to CI running what this repository's stack ships: bandit, `semgrep --config=p/python`, or CodeQL's python pack — so a security regression fails the build instead of landing; Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies; Resolve the 1 Banned license finding(s) in License Compliance.

Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.

Do thisHelpsEffortDimension
Resolve the 1 Banned license finding(s) in License Compliance.+4.6 ptsLowLicense Compliance
Resolve the 1 Test suite cannot be installed from its own lockfile finding(s) in Test Reliability.+3.0 ptsLowTest Reliability
Add a SAST step to CI running what this repository's stack ships: bandit, `semgrep --config=p/python`, or CodeQL's python pack — so a security regression fails the build instead of landing.+5.3 ptsMediumSecurity & performance tooling
Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.+5.3 ptsMediumDependency Hygiene
Pass `timeout=` on every `requests`/`httpx` call (requests has no default and will wait forever), mount an `HTTPAdapter(max_retries=Retry(...))` on shared sessions, and wrap calls to flaky dependencies in `tenacity` retries or a `pybreaker` circuit breaker.+2.9 ptsMediumOutbound HTTP resilience
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.+2.2 ptsMediumKeyboard semantics
Keep a changelog (e.g. Keep-a-Changelog) recording what shipped in each release.+1.5 ptsMediumRelease Hygiene
Enforce accessibility in the toolchain: add eslint-plugin-jsx-a11y, then assert with vitest-axe in tests, then gate axe/pa11y/Lighthouse in CI.+1.4 ptsMediumA11y enforcement

File quality

Per-file score 0–10 — a quality signature. Of 935 files carrying findings, judged against the Production bar: 1% slop · 76% mixed · 23% near-clean.

FileScoreBandWorst signal
REDACTED0.0SlopDependency Vulnerabilities: Critical vulnerability: REDACTED
REDACTED1.2SlopStatic Analysis (SAST): High: REDACTED
REDACTED1.3SlopStatic Analysis (SAST): High: REDACTED
REDACTED1.4SlopStatic Analysis (SAST): High: REDACTED
REDACTED1.6SlopIaC & Container Security: High IaC: REDACTED
REDACTED2.7SlopDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED3.0SlopStatic Analysis (SAST): High: REDACTED
REDACTED3.5SlopDependency Vulnerabilities: High vulnerability: REDACTED
REDACTED3.7SlopIaC & Container Security: High IaC: REDACTED
REDACTED4.4MixedSecrets (history): REDACTED: REDACTED
REDACTED4.4MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.6MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.6MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.9MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED5.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED5.1MixedStatic Analysis (SAST): High: REDACTED
REDACTED5.1MixedIaC & Container Security: High IaC: REDACTED
REDACTED5.1MixedIaC & Container Security: High IaC: REDACTED
REDACTED5.3MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED5.4MixedStatic Analysis (SAST): Medium: REDACTED

How the grades work

Every finding carries one of four grades. Three say how serious it is. The fourth says this survey could not settle it — and it is a grade, not a gap.

Critical — 179

A definite problem that already costs you something and drags the score down: a missing authorisation check, a dependency with a known exploit, a build that does not reproduce. Failure here tends to cause failures elsewhere.

Serious — 3840

Likely wrong, but not failing yet. It degrades the codebase over a longer horizon and can cause failures elsewhere — not urgent this week, not something to carry for two years either.

Minor — 179

Recorded, with no effect on how the codebase functions. Present so the survey is complete, not because it needs doing.

Could not be resolved — 10

Something this survey could not settle from the outside, and which could be critical or serious. Either a control was required and no positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean result. These are excluded from the score rather than awarded a pass, so the number on the cover neither rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each one is named under Limitations.

Methodology & how to trust this report

This survey is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. All 88 evaluated dimensions are computed by tools and static analysis; no language model sets or judges any of them. Overall confidence is 0.9, the weighted average across measured dimensions.

Every figure here is one of two kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10.

What we checked — 88 dimensions across the health lenses
D1D2D3D4D5D6D9D10D11D13D14D15D16D17D19D20D24D26D27D28D29D30D31D34D35D36D43D44AC1AC2AC3AC4AC5AC6AC7AX10AX2AX3AX5AX6AX7C2M1M2M3M4P1P10P2P3P4P6P7PF3R1R10R11R2R3R4R5R6R7R8R9X1X12X13X14X15X16X17X18X19X2X21X22X23X24X25X26X27X28X29X3X30X4X5

Each chip is a dimension scored from real signals across architecture, testing, dependencies, security & compliance, documentation, git-history and code quality — in one coherent pass. A surface report typically covers a handful.

How to trust any code-health report — three questions
  1. Can you open the finding? Real findings cite a repo-relative file and line you can open at the cited line — never an absolute scratch path. Here, 4172 of 4198 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
  2. Is there a tool behind the number? Every score below names the method that produced it: Roslyn, git or a scanner, not a narrative.
  3. Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.

This report answers yes to all three. That's the bar to hold any assessment to.

Tools & methods

The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.

MethodBacksVersionEvaluator
Roslyn static analysisComplexity, cohesion, coupling, dead code, API surface, layering5.3.0✓ deterministic
Native secret scannerHardcoded secrets / credentials1.0.0✓ deterministic
Canine Code Analyzer duplication detector (in-process)Code duplication1.0.0✓ deterministic
Coverage (coverlet / dotnet-coverage)Line & branch coverage10.0.400✓ deterministic
NuGet / dotnetOutdated, vulnerable & deprecated dependencies10.0.400✓ deterministic
git / LibGit2SharpChurn hotspots, knowledge concentration, history2.43.0 · 0.31.0✓ deterministic
gitleaks · semgrep · trivy · checkovSecrets in history, SAST, CVEs, IaC & container, PII / GDPR1.86.0 · 0.69.3 · 3.2.533✓ deterministic

Every finding is locatable in findings.md. Run 01a1a292-069e-7040-833b-78486a617dff.

The exact command behind every deep-scan dimension — tool, version, invocation and retained raw output — is in Appendix B — Reproduction & audit trail.

Run transparency — what happened this run

What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.

  • D8 Code Coverage — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT MEASURED: this repository's production source spans .mts, .ts, .tsx, .py, and our analyzer cannot run the .py test suite(s) — so no coverage was collected for the repository as a whole. The JavaScript/TypeScript half did build and run, and its own line coverage came back at 91.3% — but that is a figure for one half of the product, and we do not publish a partial one as if it were complete. This is OUR limitation, not a defect in the repo — coverage is excluded from the score rather than counted as a near-zero. In the meantime, produce a coverage report in a standard format (lcov — `vitest --coverage`, `jest --coverage`, `bun test --coverage --coverage-reporter=lcov`, or `nyc`, or `coverage run -m pytest` then `coverage xml`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures and real coverage will be read. You can widen what we reach: optional: produce a coverage report in a standard format (`coverage run -m pytest` then `coverage xml`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures — then both halves are read on the next scan.
  • D10 Test Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The 2,486 test(s) behind this row are the ones the JavaScript/TypeScript census could read, and this repository also carries at least 985 test source file(s) (.py) that it cannot: it reads JavaScript/TypeScript test declarations off disk, so a JUnit/pytest-style suite is invisible to it. Skipped tests, zero-assertion tests and the other quality signals on this row are UNMEASURED in that suite — their absence from the counts above is a gap in this analyzer's language coverage, not a finding that those tests are sound.
  • D12 Dependency Hygiene — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Not scored — 27 shipped Python distribution(s) were read, but the outdated signal needs pypi.org, and no declaration here carries an exact pin to ask about — a floor or a range installs the newest release it admits and cannot be behind one, so this dimension's own question is only partly answered. NOT a finding that these dependencies are current or healthy.
  • D14 License Compliance — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares REDACTED, but the licence verdict published here was taken over its Python distribution dependencies. Nothing was read about its npm dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
  • D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each ecosystem's manifests (what makes a folder runnable or a published package) need their own proof before D19 judges its units. Until then those folders' READMEs are judged only as documents (boilerplate, structure), never counted as complete.
  • D21 Naming Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D21's deterministic naming rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. Until then its declarations carry no naming verdict this run — this says nothing about whether its names are consistent.
  • D21 Naming Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
  • D22 Internal API Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22 identifies the intentionally-exposed surface from `IsPackable` and `.Contracts` project names, MSBuild conventions read off the loaded project set. This target exposed no such projects, so the probe never ran; this says nothing about whether the repository has a public API. This repository commits no C#/VB source at all, so there was never an MSBuild project set to read these conventions off. That is OUR side and it is an ADMISSION gap, not an environment fault: it declares a published package (setup.py), but no published-package marker D22 reads admitted any project here. D22 DOES collect the public API of every language in this tree, and admits a project only when its manifest makes that ecosystem's publication act in a form the marker recognises — so what is missing is not a collector but an admission rule for the publication act this repository makes, if it makes one. The remedy is a better discriminator for that marker — not a collector, and no change to the scan image can close it. The marker's rules are measured to refuse applications, so one refused repository is the rule working as calibrated; several are the evidence that it is too strict. For npm the surface is what a published REDACTED's entry points (exports, main, module, types) export, followed through the source; an entry that names build output the tree does not commit (dist/, build/) is not followed back to source, because only a tsconfig outDir/rootDir pair states that mapping and a bundler's input lives in executable configuration this engine does not evaluate.
  • D24 Comment Value — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each source language's comment syntax, and the code a comment annotates in it, needs its own proof before D24 judges it. Until then those comments are left unread, not counted as clean.
  • D27 Navigability — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Tracing effort is measured over resolved call sites, and all 1165 sampled here came from .py files. This repository's .tsx source is a material share of its production lines and contributed none, so the score above is a verdict about the part that was read. Not a finding that the unread half navigates well — it is unmeasured.
  • D32 Data Compliance (PII/GDPR) — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `web/app/(workspace)/learning/books/components/BookChatPanel.tsx`, `web/components/chat/MyAgentsPicker.tsx`, `web/components/chat/ReadingReferencePicker.tsx`, `web/components/chat/home/ChatComposer.tsx`, `web/components/chat/home/StandaloneComposer.tsx`, … (+8 more) produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
  • AC2 Forms & labels — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 150 further occurrence(s) are not listed individually; the score already reflects all 190.
  • AC4 Keyboard semantics — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 6 further occurrence(s) are not listed individually; the score already reflects all 46.
  • AC6 Visual & motion safety — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 99 further occurrence(s) are not listed individually; the score already reflects all 139.
  • AX1 Captive dependencies — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads Microsoft.Extensions.DependencyInjection registrations in C# and Spring beans in Java/Kotlin only, and this repository defines its own container in deeptutor_cli/skill.py, whose lifetimes are not modelled yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • AXR1 Runtime accessibility — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Render strategy: boot via DockerCompose (REDACTED). compose up failed (exit 1 — a container did not start, exited, or never became healthy) — deeptutor Pulling pocketbase Pulling deeptutor Pulled pocketbase Pulled Container deeptutor-pocketbase Error dependency failed to start: container deeptutor-pocketbase is unhealthy; runtime evidence skipped.
  • C1 Data Protection — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These personal data controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks personal data controls.
  • GD1 Unfinished & placeholder code — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby and Scala source only, and this repository's Python, Swift is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • IC1 Incompleteness & stubs — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby and Scala source only, and this repository's Python, Swift is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • M4 Documentation accuracy — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 reads a prose claim (a path, a setting, a variable, a route, a version, a project, an install, a bare project name in a command) only in text identified as English: the cues that tell a claim from an absence, the past, a plan or an example are an English lexicon, and on other text they would let a false claim through. Links, image targets, fenced commands with an explicit path or a package-manager script, and env-fence variables are checked in every language. 'und' is text the identifier could not name (too short, mixed script, no function words).
  • M4 Documentation accuracy — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
  • R10 Code Duplication — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 490 further occurrence(s) are not listed individually; the score already reflects all 530.
  • R11 Import Boundaries — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 6 further occurrence(s) are not listed individually; the score already reflects all 46.
  • R3 Large Files — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 107 further occurrence(s) are not listed individually; the score already reflects all 147.
  • R4 Test Coverage — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 91 further occurrence(s) are not listed individually; the score already reflects all 131.
  • R7 Dead Code — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 78 further occurrence(s) are not listed individually; the score already reflects all 118.
  • S1 Web-Security Posture — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These web-security controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks web-security controls.
  • X3 Exception handling — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 428 further occurrence(s) are not listed individually; the score already reflects all 468.
  • X4 Structured logging — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 299 further occurrence(s) are not listed individually; the score already reflects all 339.
  • X7 Silent fallback defaults — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 96 further occurrence(s) are not listed individually; the score already reflects all 136.

Repo exclusion declarations: 29 pattern(s) declared (.gitattributes linguist-generated/vendored, .editorconfig generated_code) excluded 0 source file(s) from code-quality scoring. Declarations are the repo's own visible statement that a tree is machine-written or vendored — auditable in any diff, honored by GitHub the same way.

Limitations & what we did not check

We assess the repository exactly as committed, and only the repository. By design we do not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.

Per-dimension blind spots

For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
  • D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
  • D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
  • D9 Test Distribution: The test-pyramid shape is inferred from project/folder naming and references, with a single test host bucketed per-file by its path tier and content signals — a suite that names tiers unconventionally and gives no per-file signal can still be mis-bucketed.
  • D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
  • D11 Test Reliability: Flakiness is inferred from history/markers — we run the suite once (for coverage), not the repeated runs under varied conditions that reveal nondeterminism, so a flaky test never recorded as failing is invisible here.
  • D13 REDACTED Scanning: REDACTED detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
  • D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
  • D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
  • D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
  • D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
  • D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
  • D20 ADR Quality: ADR quality checks the structure of the decision records present: it cannot know about decisions made and never recorded, and it does not judge how well a record argues its case. Records in a language the section lexicon does not cover are not evaluated.
  • D24 Comment Value: Comment value is measured as redundancy only: a comment that repeats its code's words is found, but a paraphrase in other words, a vague comment, or one the code contradicts is not, and whether a comment is valuable is not claimed. Comments in other scripts or languages, and outside C#, are not judged.
  • D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
  • D27 Navigability: Indirection/navigability is structural — it measures hops to follow a call, not whether that indirection buys real flexibility or just ceremony.
  • D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
  • D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
  • D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
  • D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
  • D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
  • D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a REDACTED (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
  • AC1 Text alternatives: Alt-text is detected structurally — the scan sees that an alternative EXISTS, not whether it meaningfully describes the image, and decorative-vs-missing is judged by attribute shape; runtime-injected images and a non-role=img decorative svg are out of scope. This is accessibility readiness, never a WCAG conformance claim.
  • AC2 Forms & labels: Label association is read from static markup — a label wired up at runtime (JS-set aria-labelledby, framework-injected ids) reads as missing, a present label says nothing about whether its text is correct. A known UI-library field component (e.g. a JSX <TextField>) is now checked conservatively — flagged only when it carries NO label/aria-label/aria-labelledby/id/name — but wrapper/context-labelled libraries (Chakra/Radix FormControl+FormLabel) aren't statically visible (possible false positive) and non-JSX lowercased components are still skipped. A click handler on a plain element is now asked for a name too (it is a control the author declared), but the subtree test that answers it is deliberately generous: any DYNAMIC text expression in the subtree counts as a name, so an icon chosen by a ternary ({cond ? <IconA/> : <IconB/>}) reads as named, and a glyph component from a library the icon-import list does not know still names its parent. A clean result is "no unlabelled control found", not a labelling proof.
  • AC3 Page structure: Page structure is read from the static markup tree — landmarks, headings and lang injected at runtime aren't seen, heading ORDER is checked structurally (not against the rendered visual hierarchy), and lang/title/main fire only on full documents, never partials, and the data-table check sees header-cell presence (a <th> exists), not whether each header correctly associates with its cells. Static readiness, not conformance.
  • AC4 Keyboard semantics: Keyboard semantics are inferred from markup attributes — interactivity wired purely in script, focus managed at runtime, and component-level handlers are invisible. A clean result means "no static keyboard-trap shape", not a keyboard-operability proof.
  • AC5 ARIA correctness: ARIA correctness is checked against the static role/attribute shape — roles/attributes set dynamically aren't seen, a valid role says nothing about whether it matches the element's real behaviour, and required-state checks are suppressed when a JSX spread could supply them. The two-branch toggle check (a control whose state is conveyed only by which of two mutually exclusive branches renders) reads CONDITIONALS THAT ARE ATTRIBUTES — Vue v-if/v-else/v-show and Alpine x-if/x-show — so the same toggle written as a Svelte {#if} block or a JSX ternary is control flow the markup model never projects as a branch and is not seen at all.
  • AC6 Visual & motion safety: Contrast and motion safety are PARTIAL by construction — literal colours (hex/rgb/hsl/named) in inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS top-level declarations are read (same-rule/same-element colour+background pairs only); computed/runtime/theme colour, external-CDN stylesheets, CSS-in-JS dynamic (${…}) and nested-selector colours, cross-element pairs and image contrast stay out of reach, so a clean result is bounded by what the static CSS itself shows.
  • AC7 A11y enforcement: Enforcement is scored from in-repo config/CI evidence only — an a11y gate enforced in external tooling with no in-repo trace can't be credited, and a configured linter is presence, not proof the rules actually run or block a merge.
  • AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
  • M4 Documentation accuracy: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.
  • P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
  • P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.

Dimensions

D1 · Cyclomatic Complexity2.0 / 10Critical✓ Tool-verified

What it measures: How tangled the control flow is — methods with many branches are hard to test and change.

Method: Cyclomatic complexity per method (1 + decision points), computed exhaustively across production source; test projects separated by convention. Deterministic.

Maturity: Documented → Verified → Prevented · effective 2.0 / 10 · rule-coverage 100% · ceiling Prevented

931 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was ChatStateAdapter.ChatStateAdapterProvider at 457. A further 3 method(s) were over the threshold but excluded as flat dispatchers (a long switch/match over independent cases: many branches, almost no nesting), the largest being GeneratedOutputFileActions.supportsGeneratedOutputActions at 21 — they are counted neither in the figure above nor in this dimension's score. 2 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold methods was excluded, so the exclusion is disclosed nowhere in the file itself: web/components/chat/GeneratedOutputFileActions.tsx (GeneratedOutputFileActions.supportsGeneratedOutputActions at 21), web/hooks/useVoiceRecorder.ts (useVoiceRecorder.useVoiceRecorder.start at 17). They are named here because the per-file figures other dimensions report are taken BEFORE this exclusion, so such a file can show a high maximum complexity elsewhere in this report and nothing here, with nothing to reconcile the two.

OrganizedSessionList.OrganizedSessionList::renderRow (cyclomatic 34) · ×2web/components/sessions/OrganizedSessionList.tsx:303
ChatStateAdapter.ChatStateAdapterProvider (cyclomatic 457)web/features/chat/ChatStateAdapter.tsx:2031
ChatWorkspace.ChatWorkspace (cyclomatic 341)web/features/chat/components/ChatWorkspace.tsx:274
CoWriterWorkspace.CoWriterWorkspace (cyclomatic 297)web/features/co-writer/components/CoWriterWorkspace.tsx:182
SettingsStore.SettingsProvider (cyclomatic 285)web/features/settings/store/SettingsStore.tsx:644

+ 923 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Bring the 65 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with ChatStateAdapter.ChatStateAdapterProvider (cyclomatic 457), ChatWorkspace.ChatWorkspace (cyclomatic 341), CoWriterWorkspace.CoWriterWorkspace (cyclomatic 297). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 65 together lifts Cyclomatic Complexity from 2.0 to about 4.3/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
  2. Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.

D2 · Cognitive Complexity2.0 / 10Critical✓ Tool-verified

What it measures: How hard the code is for a person to follow, beyond raw branching.

Method: Cognitive complexity per method (Sonar-style nesting-penalized score), computed exhaustively over production code, excluding test projects. Deterministic.

Maturity: Documented → Verified → Prevented · effective 2.0 / 10 · rule-coverage 100% · ceiling Prevented

1242 method(s) exceeded the cognitive complexity threshold of 15; the worst was ChatStateAdapter.ChatStateAdapterProvider at 522.

OrganizedSessionList.OrganizedSessionList::renderRow (cognitive 48) · ×2web/components/sessions/OrganizedSessionList.tsx:303
InlineFileCard.makeFileLinkRemarkPlugin::visit (cognitive 27) · ×2web/components/common/InlineFileCard.tsx:313
ChatStateAdapter.ChatStateAdapterProvider (cognitive 522)web/features/chat/ChatStateAdapter.tsx:2031
SettingsStore.SettingsProvider (cognitive 352)web/features/settings/store/SettingsStore.tsx:644
ChatWorkspace.ChatWorkspace (cognitive 336)web/features/chat/components/ChatWorkspace.tsx:274

+ 1234 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Bring the 113 bodies over 60 down to 60 or less in Cognitive Complexity — start with ChatStateAdapter.ChatStateAdapterProvider (cognitive 522), SettingsStore.SettingsProvider (cognitive 352), ChatWorkspace.ChatWorkspace (cognitive 336). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 113 together lifts Cognitive Complexity from 2.0 to about 3.2/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
  2. Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.

D3 · God Classes6.2 / 10Adequate✓ Tool-verified

What it measures: Over-large classes that try to do too much ("god classes").

Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.

Maturity: Documented → Verified → Prevented · effective 6.2 / 10 · rule-coverage 100% · ceiling Prevented

521 god class(es) detected.

FunctionTooLong: CoWriterWorkspace.CoWriterWorkspace · ×322web/features/co-writer/components/CoWriterWorkspace.tsx:182
FileTooLong: chat/ChatStateAdapter.tsx · ×143web/features/chat/ChatStateAdapter.tsx
ClassTooLong: CoWriterWorkspace · ×30web/features/co-writer/components/CoWriterWorkspace.tsx:1
TooManyMethods: SQLiteSessionStore · ×24deeptutor/services/session/sqlite_store.py:255
MethodTooLong: ToolDispatcher.run · ×2packages/chat-engine/src/tools/dispatcher.ts:40

What to do

  1. Resolve the 322 FunctionTooLong finding(s) in God Classes — start with page.tsx (13), ChatMessageList.tsx (4), CreateKbModal.tsx (3). — One of this dimension's main actionable groups (322 warning-level).
  2. Resolve the 143 FileTooLong finding(s) in God Classes — start with REDACTED (6), pipeline.py (4), manager.py (4). — One of this dimension's main actionable groups (143 warning-level).
  3. Resolve the 30 ClassTooLong finding(s) in God Classes — start with CoWriterWorkspace.tsx, ServiceConfigEditor.tsx, QuizViewer.tsx. — One of this dimension's main actionable groups (30 warning-level).
  4. Enforce God Classes in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.

D4 · Code Duplication9.7 / 10Stronggated by 315 serious findings✓ Tool-verified

What it measures: Copy-pasted code that should be shared instead.

Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), density-scored per KLoC of production code. Deterministic.

Maturity: Documented → Verified → Prevented · effective 9.7 / 10 · rule-coverage 100% · ceiling Verified

302 duplicated block group(s) detected. A further 13 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted. Measured on part of this repository only: .tsx (33% of production source) was not exposed to THIS dimension's token comparison and is not in this count; duplication there is measured by R10 Code Duplication, the frontend lens's card running the same clone algorithm over the JS/TS token stream.

Duplicated block (8 lines × 2) · ×25deeptutor/agents/loop/pipeline.py:1651
Duplicated block (10 lines × 2) · ×19deeptutor/agents/_shared/tool_composition.py:136
Duplicated block (5 lines × 2) · ×19deeptutor/agents/loop/pipeline.py:133
Duplicated block (12 lines × 2) · ×18deeptutor/agents/question/pipeline.py:2067
Duplicated block (9 lines × 2) · ×16deeptutor/api/routers/notebook.py:319

+ 107 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Resolve the 25 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with pipeline.py (4), storage.py (3), question_notebook.py (2). — One of this dimension's main actionable groups (25 warning-level).
  2. Resolve the 19 Duplicated block (10 lines × 2) finding(s) in Code Duplication — start with pipeline.py (6), manager.py (2), tool_composition.py. — One of this dimension's main actionable groups (19 warning-level).
  3. Resolve the 19 Duplicated block (5 lines × 2) finding(s) in Code Duplication — start with provider_runtime.py (2), sqlite_store.py (2), pipeline.py. — One of this dimension's main actionable groups (19 warning-level).
  4. Enforce Code Duplication in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.

Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.

D5 · Coupling10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether volatile projects sit underneath others that depend on them (so their churn ripples upward), and whether project dependencies form cycles. A widely-depended-on but stable shared/kernel project is healthy, not penalised.

Method: Dependency cycles via elementary-DFS over real .csproj references, plus Martin instability (afferent/efferent) per project. Exhaustive over the reference graph, deterministic.

Coverage: Exhaustive · type-level: afferent/efferent coupling + cycles computed over every production type — the population is all types, not a name convention.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Prevented

4 production modules (npm+Python), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; 0 module(s) off the main sequence.

✓ On the Gold path — maintain.

Detailed fixes: d5_recommendation.md.

D6 · Cohesion (LCOM4)9.9 / 10Stronggated by 3 serious findings✓ Tool-verified

What it measures: Whether a class's methods are focused on a single responsibility.

Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.

Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.

Maturity: Documented → Verified → Prevented · effective 9.9 / 10 · rule-coverage 100% · ceiling Verified

3 of 253 classes have LCOM4 above 3.

Low cohesion: AgenticLoopPipeline (LCOM4 8) · ×3deeptutor/agents/loop/pipeline.py:200

What to do

  1. Resolve the 3 Low cohesion finding(s) in Cohesion (LCOM4) — start with pipeline.py, pocketbase_store.py, store.py. — One of this dimension's main actionable groups (3 warning-level).
  2. Enforce Cohesion (LCOM4) in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.

Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.

D9 · Test Distribution10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether the test suite has a healthy mix of unit / integration / end-to-end tests.

Method: Test projects classified (Unit/Integration/BDD/E2E) from compiled metadata; test methods counted exhaustively across projects with placement-agnostic disk fallback. Deterministic.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

12290 test methods: 12206 unit, 38 integration, 0 BDD, 46 e2e. The JavaScript/TypeScript suite contributes 2486 `it`/`test` case(s) across 464 test file(s) declaring at least one; its tier split is read from package names and paths only. The Python suite contributes 9804 test function(s) across 931 file(s) declaring at least one — every `def test…` in a file pytest or unittest would collect, which is those frameworks' own definition of a case; a parametrize table counts once, so this is a floor. Its tier split is read from file names and paths only.

✓ On the Gold path — maintain.

Detailed fixes: d9_recommendation.md.

D10 · Test Quality10.0 / 10Stronggated by 6 serious findings✓ Tool-verified

What it measures: Whether the tests truly assert behaviour rather than just running the code.

Method: Per-test assertions, skips, and mock references analyzed via Roslyn; structured skip-reason tags (BUG:/ENV:) separate documented deferrals from debt. Deterministic.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Prevented

2 skipped, 4 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 2486 tests. Measured on the JavaScript/TypeScript suite only — at least 985 test source file(s) (.py) went unread, so its test quality is unmeasured and is not in these counts.

No assertions: displays unreadable or missing source states rather than permanent loading · ×4web/tests/kb-visual-coverage.spec.tsx:26
Skipped test: (unnamed test) · ×2web/tests/e2e/multi-worker-turns.audit.ts:10
Mock-dominated test: reports CFI progress inside the final chapter, including one-chapter books (#1673) · ×10web/tests/epub-display-preferences.spec.tsx:242

What to do

  1. Resolve the 10 Mock-dominated test finding(s) in Test Quality — start with watching-browser.spec.tsx (2), epub-display-preferences.spec.tsx, favorites-flow.spec.tsx. — One of this dimension's main actionable groups (10 recommendation-level).
  2. Resolve the 4 No assertions finding(s) in Test Quality — start with kb-visual-coverage.spec.tsx, settings-service-preview.spec.tsx, watching-browser.spec.tsx. — One of this dimension's main actionable groups (4 warning-level).
  3. Resolve the 2 Skipped test finding(s) in Test Quality — start with multi-worker-turns.audit.ts, turn-lifecycle.audit.ts. — One of this dimension's main actionable groups (2 warning-level).
  4. Enforce Test Quality in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

Detailed fixes: d10_recommendation.md · top locations in Appendix A, every location in findings.md.

D11 · Test Reliability10.0 / 10Adequategated by 1 critical finding✓ Tool-verified

What it measures: Whether the tests pass reliably, with no flakiness.

Method: Suite re-run N times within tiered wall-clock budgets (unit to e2e); tests failing non-deterministically across runs flagged; guarded tests retried when #if guards detected.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Verified

0 flaky across 2 measured tier(s). JavaScript/TypeScript (node:test via `npm ci --ignore-scripts` in apps/desktop/ (22 tests); node:test via `npm ci --ignore-scripts` in packages/chat-engine/ (60 tests); vitest via `npm ci --ignore-scripts` in web/): measured (0 flaky); Python (repository root, 933 test files): measured (0 flaky).

Test suite cannot be installed from its own lockfile: web/

What to do

  1. Resolve the 1 Test suite cannot be installed from its own lockfile finding(s) in Test Reliability. — One of this dimension's main actionable groups (1 issue-level).

Detailed fixes: d11_recommendation.md · top locations in Appendix A, every location in findings.md.

D13 · REDACTED Scanning10.0 / 10Exemplary○ Nothing flagged

What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.

Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Prevented

REDACTED scan ran and found no leaked secrets.

✓ On the Gold path — maintain.

Detailed fixes: d13_recommendation.md.

D14 · License Compliance8.0 / 10Adequategated by 1 critical finding✓ Tool-verified

What it measures: Whether the licenses of third-party packages are compatible with your policy.

Method: Third-party package licenses resolved from declared package metadata and checked against the configured policy (allow/deny/copyleft). Deterministic; clean = no incompatible license found at metadata depth.

Maturity: Documented → Verified → Prevented · effective 8.0 / 10 · rule-coverage 100% · ceiling Verified

1 of 80 shipped Python distribution(s) use a banned license. Licences were resolved from PyPI over the distributions a consumer installs — this repository's 27 declared runtime requirement(s) closed transitively over each distribution's published `requires_dist` (53 reached that way). Requirements it states ONLY under an extra, a PEP 735 dependency group, a Poetry dev group or a dev-named requirements file are excluded: pip does not install any of them for a consumer. ★ This repository commits no dependency lockfile that this pass reads, so each licence is the one PyPI publishes for the distribution's CURRENT release rather than for a pinned version. 6 of them publish no licence on PyPI this pass can read; that is missing data, not a violation, and none of them is charged. This repository publishes itself under Apache-2.0, which is its own choice and is not judged here. ★ COVERAGE OF THIS VERDICT: it grades this repository's Python distribution dependencies and nothing else. The repository also declares REDACTED, and the licences of those dependencies were NOT read by this pass — a gap in this engine's coverage, not a statement about them. So this result says the graded closure carries no banned licence; it does NOT say this repository's licensing is clear.

Banned license: pyte

What to do

  1. Resolve the 1 Banned license finding(s) in License Compliance. — One of this dimension's main actionable groups (1 issue-level).
  2. Enforce License Compliance in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.

Detailed fixes: d14_recommendation.md · top locations in Appendix A, every location in findings.md.

D15 · Churn × Complexity Hotspots8.8 / 10Strong✓ Tool-verified

What it measures: Files that change often and are also complex — the riskiest hotspots.

Method: Per production file churn times cyclomatic complexity over a rolling window, computed from git and Roslyn/JS/Razor analysis. Exhaustive, deterministic per commit date.

Maturity: Documented → Verified → Prevented · effective 8.8 / 10 · rule-coverage 100% · ceiling Documented

Top hotspots: web/features/chat/ChatStateAdapter.tsx (46×457=21022); web/features/chat/components/ChatWorkspace.tsx (53×341=18073); web/features/settings/store/SettingsStore.tsx (37×285=10545) Repeated repair below the complexity floor: deeptutor/knowledge/add_documents.py (12 of 20 changes were fixes); deeptutor/core/turn_request.py (9 of 17 changes were fixes); deeptutor/runtime/orchestrator.py (8 of 15 changes were fixes)

Hotspot: web/features/chat/ChatStateAdapter.tsx · ×329web/features/chat/ChatStateAdapter.tsx:2031
Repeated repair: deeptutor/knowledge/add_documents.py · ×43deeptutor/knowledge/add_documents.py:165

What to do

  1. Resolve the 329 Hotspot finding(s) in Churn × Complexity Hotspots — start with page.tsx (10), REDACTED (5), pipeline.py (5). — One of this dimension's main actionable groups (329 warning-level).
  2. Resolve the 43 Repeated repair finding(s) in Churn × Complexity Hotspots — start with config.py (2), add_documents.py, turn_request.py. — One of this dimension's main actionable groups (43 warning-level).

Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.

D16 · Bus Factor8.4 / 10Strong✓ Tool-verified

What it measures: Whether knowledge is concentrated in too few people (the "bus factor").

Method: Living knowledge per author via time-decayed commit attribution (6-month half-life, focus weighting) across largest source files. Deterministic, avoids blame's mechanical-refactor false positives.

Maturity: Documented → Verified → Prevented · effective 8.4 / 10 · rule-coverage 100% · ceiling Documented

257 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is web/components/memory/MemorySection.tsx. Counted over 1544 of the 2213 production source files in this repository: 668 are under the ~2,400-byte size floor this dimension measures over, and the remaining 1 have no attributable history left to measure.

Off-boarding risk: anonymized user #1 · ×5
Further sole-owners (lower concentration)

What to do

  1. Resolve the 5 Off-boarding risk finding(s) in Bus Factor. — One of this dimension's main actionable groups (5 recommendation-level).
  2. Resolve the 1 Further sole-owners (lower concentration) finding(s) in Bus Factor. — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d16_recommendation.md · top locations in Appendix A, every location in findings.md.

D17 · Explicit Debt10.0 / 10Exemplary○ Nothing flagged

What it measures: Acknowledged debt left in the code — TODOs, dead code, suppressed warnings.

Method: Roslyn syntactic debt markers (suppressions/TODO/FIXME/HACK/empty-catch/commented-code/Obsolete) plus SymbolFinder dead-code analysis; weighted-debt-per-KLoC density deducted 2.0x per unit. Deterministic, exhaustive.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Prevented

0 deducted task-comment markers across 495252 LoC (0.0/KLoC) → score 10.0. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.

✓ On the Gold path — maintain.

Detailed fixes: d17_recommendation.md.

D19 · Documentation Quality10.0 / 10Exemplary○ Nothing flagged

What it measures: Whether the project's documentation is clear, complete, and useful.

Method: Every README, docs/ document and root guide parsed by its markup and measured in Unicode letters. Published: a runnable or packaged .NET project whose README (or a document it links, or a root guide) shows no example, and a root README naming none of three or more projects. Overview, licence, boilerplate, wall-of-text, empty-section and XML-doc rows are measured and withheld (counted in gaps) after adjudication. Deterministic, exhaustive, advisory.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

2 of 2 documentation facets pass in full. 23 document(s) read across 5 unit(s).

✓ On the Gold path — maintain.

Detailed fixes: d19_recommendation.md.

D20 · ADR Quality0.0 / 10Critical✓ Tool-verified

What it measures: Whether architecture decisions are recorded well (context, decision, consequences).

Method: Every ADR read by its section structure: nine located rules (a missing Decision, Context or Consequences section, a stale status, two records deciding the same question, a dangling supersede link, a number-only title, a single option, no named cost, no status where the log uses one, no enforcement field where the log adopted one), each a fixed deduction from 10; the score is the mean over evaluated records. Deterministic, no model. Advisory.

Maturity: Documented → Verified → Prevented · effective 0.0 / 10 · rule-coverage 100% · ceiling Documented

No architecture decision records were found.

No ADRs found

What to do

  1. Resolve the 1 No ADRs found finding(s) in ADR Quality. — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d20_recommendation.md · top locations in Appendix A, every location in findings.md.

D24 · Comment Value9.9 9.8 / 10Exemplary✓ Tool-verified

What it measures: Whether comments are worth it — explaining WHY (valuable) rather than WHAT (redundant).

Method: Every inline C# comment compared word by word with the identifiers, literals and constructs of the code it annotates (taken from the syntax); a comment whose words that code already contains is redundant, as are closing-brace labels and generator template text. Comments giving a reason or a reference are kept; other scripts and languages are not judged. Deterministic, exhaustive, advisory.

Maturity: Documented → Verified → Prevented · effective 9.8 / 10 · rule-coverage 99% · ceiling Documented

2 of 2526 judged comments only repeat the code they sit on (0.1 %). 48 comment(s) in another language or script were not judged.

redundant comment · ×2web/components/chat/home/SessionViewerPanel.tsx:1716

✓ On the Gold path — maintain.

Detailed fixes: d24_recommendation.md · top locations in Appendix A, every location in findings.md.

D26 · Project Cohesion3.3 / 10Weak✓ Tool-verified

What it measures: Whether each project is a focused, coherent unit rather than an oversized grab-bag.

Method: Project size overshoot penalties (LoC / public-type count / namespace count, 2-of-3 flag) weighted by log magnitude. Exhaustive across projects, deterministic.

Maturity: Documented → Verified → Prevented · effective 3.3 / 10 · rule-coverage 100% · ceiling Documented

2 of 6 build units (Python, npm) flagged as possibly oversized/incoherent.

Projects may be oversized for their cohesion

What to do

  1. Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion. — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d26_recommendation.md · top locations in Appendix A, every location in findings.md.

D27 · Navigability8.6 / 10Strong✓ Tool-verified

What it measures: How far you must trace to follow a call — low indirection and co-located slices read easier.

Method: Call indirection (interface hops, cross-namespace calls, slice-locality scaled) over a sampled set of method invocations, size-aware baseline. Sampled; confidence discounted by symbol-resolution gaps. C# also names each pass-through layer (a class whose every public method only forwards its own parameters to one collaborator) as a located finding; the score is not affected.

Coverage: Slice locality from the first namespace segments, SAMPLED (≤400 methods) — not exhaustive.

Maturity: Documented → Verified → Prevented · effective 8.6 / 10 · rule-coverage 100% · ceiling Documented

66 % of calls cross a namespace and 0 % go through an interface, but 58 % of collaborators are co-located — so following a call takes several hops. Baseline: small — navigation cost is tolerated. Measured over the .py source only — this repository's .tsx was not sampled for call sites, so this score covers part of the tree, not all of it.

Scattered collaborators

What to do

  1. Resolve the 1 Scattered collaborators finding(s) in Navigability. — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d27_recommendation.md · top locations in Appendix A, every location in findings.md.

D28 · Secrets (history)0.0 / 10Critical✓ Tool-verified

What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.

Method: REDACTED scan via TWO gitleaks detect passes in an isolated checkout — the full git history, then a second --no-git pass over the working tree as it stands — merged and de-duplicated by (rule, file, line); each match flagged High. Both invocations are recorded in the audit trail. Exhaustive; when the tool is absent, or when its output cannot be parsed into the expected shape, the dimension is WITHHELD as an explicit measurement gap on our side — unscored and excluded from the lens, never a hedged middling score.

Maturity: Documented → Verified → Prevented · effective 0.0 / 10 · rule-coverage 100% · ceiling Documented

35 finding(s): 0 critical, 35 high, 0 medium, 0 low. Remediation for historically-committed secrets is credential rotation — they remain in history regardless of later deletion.

REDACTED
REDACTED

What to do

  1. Resolve the 35 REDACTED finding(s) in Secrets (history) — start with REDACTED (30), REDACTED (4), REDACTED. — One of this dimension's main actionable groups (35 issue-level).
  2. Resolve the 1 Rotate the exposed credentials finding(s) in Secrets (history). — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d28_recommendation.md · top locations in Appendix A, every location in findings.md.

D29 · Static Analysis (SAST)0.5 / 10Critical✓ Tool-verified

What it measures: Real static-analysis (SAST) findings — likely security bugs in the code, any language.

Method: Polyglot static analysis via semgrep across the repo using the pinned, image-baked p/security-audit + p/owasp-top-ten rulesets (no scan-time registry fetch); severity rules (ERROR/WARNING/INFO) map to a full-band severity-weighted score. Exhaustive, deterministic; degrades on parse failure.

Coverage: semgrep pattern rules over all files — exhaustive for the rule set, blind to classes of bug without a rule (clean = no rule matched).

Maturity: Documented → Verified → Prevented · effective 0.5 / 10 · rule-coverage 100% · ceiling Documented

76 finding(s): 0 critical, 53 high, 22 medium, 1 low. 42 unpinned-GitHub-Actions row(s) are reported here but scored by D36 (supply-chain provenance), which measures that posture as `pinned_actions` — one pinning decision is charged once, not once per lens. semgrep hit a parse error in 61 file(s) — `deeptutor/agents/chat/prompts/zh/agentic_chat.yaml`, `deeptutor/agents/question/prompts/zh/deep_question.yaml`, `deeptutor/agents/question/prompts/zh/idea_agent.yaml`, `deeptutor/agents/question/prompts/zh/pipeline.yaml`, `deeptutor/agents/research/prompts/zh/pipeline.yaml`, … (+56 more) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. Separately, one or more rules could not re-parse an embedded snippet in 5 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

+ 12 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Resolve the 6 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (4), REDACTED, REDACTED. — One of this dimension's main actionable groups (6 issue-level).
  2. Resolve the 2 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 issue-level).
  3. No action in Static Analysis (SAST) — all 42 REDACTED finding(s) are reported here at file:line but scored by D36 (supply-chain provenance), so none is charged to this dimension. — One of this dimension's main actionable groups (42 issue-level, 0 of them charged here).

Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.

D30 · Dependency Vulnerabilities0.0 / 10Critical✓ Tool-verified

What it measures: Whether any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir and Erlang via Hex, Go modules, Java and Kotlin via Maven/Gradle, JavaScript/npm, .NET/NuGet, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift.

Method: Dependency-CVE scan across every ecosystem the repository declares, scored ONCE. Three sources are unioned and deduplicated by advisory identity (rule id + alias closure, CVE<->GHSA) scoped to package+version, keeping the worst severity: `osv-scanner --recursive` over osv.dev for Dart pub, Elixir/Hex (and Erlang, whose `rebar.lock` syft first converts to a CycloneDX SBOM the scanner reads, with rows attributed back to the lock), Go, Java and Kotlin via Maven/Gradle (and Scala, whose sbt build's pinned direct declarations are written into a CycloneDX SBOM the scanner reads, with rows attributed back to the build file), npm, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift; `trivy fs --scanners vuln` for npm lockfiles; and `dotnet list package --vulnerable --include-transitive` for NuGet (with per-advisory collapse of the project x target-framework fan-out), plus a DECLARED-dependency arm that resolves a published gem's gemspec against rubygems.org where no Gemfile.lock is committed. `SeverityScore(c,h,m,l, normalizer 8.0)`. NotApplicable only when NO ecosystem is readable; if any applicable ecosystem could not be scanned the findings are REPORTED and the score is withheld. Supersedes the npm and OSV arms, retired 2026-09-05.

Maturity: Documented → Verified → Prevented · effective 0.0 / 10 · rule-coverage 100% · ceiling Documented

37 finding(s): 3 critical, 16 high, 16 medium, 2 low.

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

+ 2 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Resolve the 15 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (13), REDACTED (2). — One of this dimension's main actionable groups (15 issue-level).
  2. Resolve the 2 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (2). — One of this dimension's main actionable groups (2 issue-level).
  3. Resolve the 1 Critical vulnerability finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).

Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.

D31 · IaC & Container Security6.8 / 10Adequate✓ Tool-verified

What it measures: Whether Dockerfiles / Terraform / Kubernetes config follow security best practices.

Method: IaC/container misconfiguration scan via trivy config (REDACTED/Terraform/K8s/Helm/CloudFormation); severity rules to 0-10 moderate normalizer. NotApplicable without manifests. Exhaustive, deterministic.

Maturity: Documented → Verified → Prevented · effective 6.8 / 10 · rule-coverage 100% · ceiling Documented

19 finding(s): 0 critical, 6 high, 12 medium, 1 low.

REDACTED
REDACTED
REDACTED

What to do

  1. Resolve the 12 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (7), REDACTED (2), REDACTED. — One of this dimension's main actionable groups (12 warning-level).
  2. Resolve the 6 High IaC finding(s) in IaC & Container Security — start with REDACTED (2), REDACTED (2), REDACTED. — One of this dimension's main actionable groups (6 issue-level).
  3. Resolve the 1 Low IaC finding(s) in IaC & Container Security — start with REDACTED. — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d31_recommendation.md · top locations in Appendix A, every location in findings.md.

D34 · Knowledge Freshness9.9 / 10Exemplary✓ Tool-verified

What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.

Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.

Maturity: Documented → Verified → Prevented · effective 9.9 / 10 · rule-coverage 100% · ceiling Documented

10 of 1545 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is deeptutor/tools/vision/coord_transform.py. Counted over 1545 of the 2213 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Orphaned file · ×10deeptutor/tools/vision/coord_transform.py:1
Orphaned files with no living knowledge

✓ On the Gold path — maintain.

Detailed fixes: d34_recommendation.md · top locations in Appendix A, every location in findings.md.

D35 · Change Coupling10.0 / 10Stronggated by 4 serious findings✓ Tool-verified

What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.

Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.

Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

Strongest change-coupling: sessions.py↔protocol.py 60%; add_documents.py↔initializer.py 53%; protocol.py↔session-api.ts 50%

Change coupling: sessions.py ↔ protocol.py · ×4deeptutor/api/routers/sessions.py:1

What to do

  1. Resolve the 4 Change coupling finding(s) in Change Coupling — start with sessions.py, add_documents.py, protocol.py. — One of this dimension's main actionable groups (4 warning-level).

Detailed fixes: d35_recommendation.md · top locations in Appendix A, every location in findings.md.

D36 · Supply-chain Provenance & Signing7.5 / 10Strong✓ Tool-verified

What it measures: Whether the build pipeline provides supply-chain integrity — generated provenance/attestation, signed artifacts (cosign/sigstore), an SBOM, and pinned build actions. Presence of the configuration, not a runtime guarantee.

Method: Supply-chain provenance/signing read deterministically from CI/build config (.github/workflows, .gitlab-ci.yml, azure-pipelines, Jenkinsfile, .circleci) + the release surface: four signals — generated provenance/attestation (SLSA/in-toto/actions-attest), artifact signing (cosign/sigstore/gitsign), an SBOM (syft/sbom-action/*.spdx.json/*.cdx.json), and SHA-pinned build actions — scored 10·present/denom. NotApplicable without a build pipeline. Detects configuration presence, not runtime enforcement.

Maturity: Documented → Verified → Prevented · effective 7.5 / 10 · rule-coverage 100% · ceiling Documented

3/4 supply-chain integrity signals present (provenance, signing, SBOM, pinned actions).

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

What to do

  1. Resolve the 3 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED, REDACTED, REDACTED. — One of this dimension's main actionable groups (3 warning-level).
  2. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).

Detailed fixes: d36_recommendation.md · top locations in Appendix A, every location in findings.md.

D43 · Malicious Dependencies10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. Scored apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.

Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. SCORED, not informational.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

No dependency in any ecosystem this repository declares is published as malicious.

✓ On the Gold path — maintain.

Detailed fixes: d43_recommendation.md.

D44 · Platform End-of-Life10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether anyone still ships security patches for the platform this repository RUNS ON — the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.

Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates — no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged — `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on — and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads — never scores it clean.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 1 platform declaration(s) and 27 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.

✓ On the Gold path — maintain.

Detailed fixes: d44_recommendation.md.

Frontend & cross-cutting dimensions

R = React/JS · M = Maturity · P = Readiness.

AC1 · Text alternatives4.8 / 10Weak✓ Tool-verified

Other · Accessibility — Whether non-text content carries a text alternative — img/area/input[type=image] have alt, a meaningful svg has a title or aria-label, video has a captions track, and object/embed/canvas have a name or fallback content. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: every img/area/input[type=image] checked for alt, svg[role=img] for a title/aria-label, video for a captions <track>. Components skipped, spreads suppressed. Deterministic, hard fact per element.

Coverage: Population: image/media elements — img, area, input[type=image], svg, video, object, embed, canvas — across the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and dynamic-attribute elements are skipped. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is NOT read by any producer, so it contributes no element to this population; where such a frontend is present the card discloses it as an analyzer gap rather than scoring around it.

  • Video with no captions <track> offers no captions. This player's source is set at runtime, so there is no caption file to author here: give the player a way to carry captions — accept a track/captions URL alongside the media and render a <track kind="captions"> when one is supplied — and capture that asset wherever the media enters the product (upload, import or generation). (×8) — web/app/(workspace)/learning/books/components/blocks/AnimationBlock.tsx:58, web/components/chat/preview/previewers/VideoPreview.tsx:30, web/components/math-animator/MathAnimatorViewer.tsx:99, …
  • A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content. (×2) — web/components/reading/PdfPage.tsx:215, REDACTED:113

What to do

  • Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video.
AC2 · Forms & labels5.7 / 10Adequate✓ Tool-verified

Other · Accessibility — Whether form controls have a programmatic label (an associated label, aria-label or aria-labelledby), buttons have text, links have an accessible name, a click handler on a plain element names the control it declares, fieldsets have a non-empty legend, known UI-library field components carry a label prop, and a placeholder isn't used as the only label. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: inputs/selects/textareas checked for an associated label[for]/wrapping label/aria-label/aria-labelledby (per document), buttons for accessible text, fieldsets for a legend; placeholder-only labelling flagged. Deterministic, hard fact per control.

Coverage: Population: form controls, buttons, links, fieldsets and known UI-library field components in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and spread/dynamic-attribute elements are skipped, so a control whose label arrives through a spread or a runtime expression is deliberately not judged. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

  • A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one). (×4) — web/app/(workspace)/learning/books/components/BookChatPanel.tsx:478, web/app/(workspace)/learning/books/components/BookChatPanel.tsx:578, web/app/(workspace)/learning/books/components/BookHealthBanner.tsx:359, …
  • This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label. (×19) — web/app/(workspace)/learning/books/components/BookChatPanel.tsx:605, web/app/(workspace)/learning/books/components/blocks/UserNoteBlock.tsx:93, web/app/(workspace)/partners/groups/new/page.tsx:149, …
  • This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it. (×8) — web/app/(workspace)/learning/books/components/SpineEditor.tsx:491, web/app/(workspace)/learning/books/components/blocks/BlockBodyEditor.tsx:52, web/app/(workspace)/partners/groups/[groupId]/page.tsx:336, …
  • This <label> has no htmlFor and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label htmlFor="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id. (×9) — web/app/(workspace)/partners/groups/[groupId]/page.tsx:333, web/app/(workspace)/partners/groups/[groupId]/page.tsx:342, web/app/(workspace)/partners/new/page.tsx:306, …

What to do

  • Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.
AC3 · Page structure7.9 / 10Strong✓ Tool-verified

Other · Accessibility — Whether pages declare a language (well-formed BCP-47) and a non-empty title, expose exactly one main landmark and a sane heading order with non-empty headings, keep zoom enabled, title their iframes, give data tables header cells, and avoid meta-refresh. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: html lang, document <title>, a main landmark and heading order on full documents only, plus zoom-disabling viewports, untitled iframes and meta-refresh anywhere. Deterministic, per structural checkpoint.

Coverage: Population: the PARSED MARKUP documents (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx). The page-level checks — lang, title, single main landmark — fire ONCE PER FULL DOCUMENT (an <html> root) and never on a partial or component fragment, so a repo of fragments is assessed only on the per-element checks (heading order, table headers, iframe titles, meta-refresh, zoom). Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

  • A <table> with data cells but no <th> gives assistive technology no way to associate cells with their headers. Mark the header row/column cells as <th> (with a scope). — web/components/chat/preview/previewers/XlsxPreview.tsx:116

What to do

  • Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.
AC4 · Keyboard semantics2.9 / 10Weak✓ Tool-verified

Other · Accessibility — Whether interactive behaviour is keyboard-reachable — no click handler on a non-interactive element lacking a role, tabindex and key handler, no element the repo's own CSS styles `cursor: pointer` without giving it any of the three, no unfocusable element whose only binding is a mouse enter/leave pair or a double-click, no positive tabindex, no href-less anchor, no placeholder-href (#/javascript) link acting as a button. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: click handlers on non-interactive elements lacking role+tabindex+key handler, positive tabindex values, and href-less anchors. Components skipped, spreads suppressed. Deterministic, hard fact per element.

Coverage: Population: elements that pose a keyboard-semantics question, in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx) — a non-natively-interactive element carrying a click handler, a double-click or hover enter/leave binding, a pointer-only gesture on a tabindex="0" element, or `cursor: pointer` from the repo's own CSS; an href-less or placeholder-href (#, javascript:) anchor; and any element with a positive tabindex. Natively interactive elements used correctly (<button>, <a href>, form controls) are NOT in the population — there is nothing to judge — so a page of nothing but correct controls gives AC4 nothing to measure. Keyboard reachability is judged from the markup, never from a rendered page. ★ An interactive element declared in a tagged-template (html`…`) or hyperscript frontend is NOT in this population — no producer reads either — so an empty population is reported as an analyzer gap, never as "this repository has no interactive elements".

  • This <div role="dialog"> is a modal dialog, but focus is moved into it, but nothing keeps it there: Tab walks out to the page behind, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close. (×8) — web/app/(admin)/admin/users/page.tsx:797, web/app/(admin)/admin/users/page.tsx:921, web/components/chat/preview/FilePreviewDrawer.tsx:211, …
  • This <div role="dialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close. (×11) — web/app/(workspace)/learning/books/components/BookGenerationActivity.tsx:235, web/components/chat/home/ContextBudgetChip.tsx:251, web/components/chat/home/SessionViewerPanel.tsx:1142, …
  • This <div> announces itself as a role="button" and binds a click, but nothing can put focus on it: no tabIndex={0} in any spelling, no key handler, and nothing in this file moves focus or sets aria-activedescendant. The role tells assistive tech what the control IS; it does not make the control reachable, so a keyboard user cannot operate it at all (WCAG 2.1.1). Give it tabIndex={0}="0" and an Enter/Space key handler, or make it a native <button>. If a parent widget owns the keyboard model, that parent must move focus onto the active role="button" or point aria-activedescendant at it. — web/components/activity/ActivityRow.tsx:107
  • A click handler on a plain element with no role and no tabindex: even where another element's key handler can reach it, assistive tech can neither focus it nor announce what it is. Use a <button>, or add role + tabIndex={0}. (×3) — web/components/chat/home/ComposerResources.tsx:287, web/components/knowledge/KbDocumentList.tsx:277, web/components/knowledge/KbDocumentList.tsx:424
  • This <nav> binds mouse-enter and mouse-leave and nothing else — no click, no key handler, no focus handler, and no tabIndex={0}, so it cannot even take focus. A keyboard user cannot hover, so whatever the pair reveals or highlights is reachable with a mouse only. Bind the same state to focus/blur as well, and add tabIndex={0}="0" so the element can receive that focus. — web/components/chat/home/TurnNavigator.tsx:271
  • A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler. (×9) — web/components/layout/AppShell.tsx:87, web/components/math-animator/MathAnimatorViewer.tsx:193, web/components/memory/MemoryGraph.tsx:734, …
  • This <div> binds mouse-enter and mouse-leave and nothing else — no click, no key handler, no focus handler, and no tabIndex={0}, so it cannot even take focus. A keyboard user cannot hover, so whatever the pair reveals or highlights is reachable with a mouse only. Bind the same state to focus/blur as well, and add tabIndex={0}="0" so the element can receive that focus. — web/components/partners/PartnerComposer.tsx:569
  • This <div> announces itself as a role="separator" and is operated by pointerdown, pointerup and pointermove, but nothing can put focus on it: no tabIndex={0}, no key handler, and nothing in its scripts moves focus. A keyboard cannot produce a pointer drag, so the control cannot be operated at all (WCAG 2.1.1). Give it tabIndex={0}="0" and move it with the arrow keys in a key handler (with aria-valuenow for the position it holds). — web/components/quiz/QuizConfigPanel.tsx:749
  • This <form role="dialog"> is a modal dialog, but focus is moved into it, but nothing keeps it there: Tab walks out to the page behind, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close. — web/components/reading/library/FolderDialog.tsx:74
  • This <span> binds double-click and nothing else. No click, no key handler, and no tabIndex={0}, so it cannot even take focus. Nothing synthesises a double-click from the keyboard: Enter and Space fire a single click, and only on a native <button> or <a href>. So this behaviour has no keyboard path at all. Expose the same action on a real control, or add role + tabIndex={0} + a key handler alongside the double-click. — web/components/settings/ModelCards.tsx:202
  • This <h3> binds double-click and nothing else. No click, no key handler, and no tabIndex={0}, so it cannot even take focus. Nothing synthesises a double-click from the keyboard: Enter and Space fire a single click, and only on a native <button> or <a href>. So this behaviour has no keyboard path at all. Expose the same action on a real control, or add role + tabIndex={0} + a key handler alongside the double-click. — REDACTED:53
  • This <div role="alertdialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close. — web/components/space/learning/ConfirmDialog.tsx:32
  • This <div role="alertdialog"> is a modal dialog, but focus is moved into it, but nothing keeps it there: Tab walks out to the page behind, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close. — web/components/ui/ConfirmDialog.tsx:56

What to do

  • Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
AC5 · ARIA correctness8.0 / 10Strong✓ Tool-verified

Other · Accessibility — Whether ARIA is used correctly — valid non-abstract roles, the ARIA state a role requires, valid (non-misspelled) aria-* attribute names, in-enum values for token-typed aria-* attributes, and no aria-hidden on (or wrapping) a focusable element. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: role values checked against the WAI-ARIA role set (abstract/invalid flagged), required ARIA state for a role, and aria-hidden on a focusable element. Deterministic, role/attribute level.

Coverage: Population: elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx) that carry a role or an aria-* attribute; roles and token values are checked against the ARIA enums exhaustively within that set. An expression-valued (dynamic) role or aria-* value is skipped rather than guessed, and markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

  • This is not a valid WAI-ARIA attribute, so assistive technology ignores it (usually a typo). Use the correct aria-* attribute. — web/app/(workspace)/learning/books/components/PageOutlineNav.tsx:203

What to do

  • Use valid, non-abstract roles, supply the ARIA state each role requires, and never put aria-hidden on a focusable element.
AC6 · Visual & motion safety4.3 / 10Weak✓ Tool-verified

Other · Accessibility — Whether focus outlines aren't removed without a replacement, motion respects prefers-reduced-motion, and literal CSS colour pairs meet contrast — PARTIAL: inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS literals are read (hex/rgb/hsl/named), never computed/runtime/external-CDN colour. Static markup readiness, not a WCAG conformance claim.

Method: Static markup/CSS scan: inline outline:none/0, literal inline colour/background contrast against the 4.5:1 AA floor, and <style>-block animation without a prefers-reduced-motion guard. Deterministic but PARTIAL — only inline styles and in-repo CSS literals are visible.

Coverage: Population: styled elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx), plus in-repo <style> blocks, in-repo .css files and CSS-in-JS literals. Colour contrast is computed from LITERAL colour pairs only (hex/rgb/hsl/named, including var() tokens and Tailwind neutral utilities) — computed, runtime-themed and external-CDN colour is never resolved, so this is a partial read of contrast by construction. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

  • <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2). (×22) — web/app/(admin)/admin/users/page.tsx:370, web/app/(workspace)/learning/books/components/BookCreator.tsx:374, web/app/(workspace)/learning/books/components/BookCreator.tsx:395, …
  • <textarea> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2). (×10) — web/app/(workspace)/learning/books/components/BookChatPanel.tsx:605, web/app/(workspace)/learning/books/components/BookCreator.tsx:226, web/app/(workspace)/learning/books/components/BookCreator.tsx:384, …
  • <select> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2). (×3) — web/app/(workspace)/learning/books/components/BookCreator.tsx:257, web/app/(workspace)/learning/books/components/SpineEditor.tsx:366, web/components/chat/QuestionBankPicker.tsx:248
  • This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade. (×3) — web/app/(workspace)/partners/groups/[groupId]/page.tsx:404, web/components/chat/QuestionBankPicker.tsx:322, web/components/knowledge/KbIndexVersionsSection.tsx:487
  • <button> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2). (×2) — web/components/chat/home/ResponderList.tsx:150, web/components/chat/home/TurnNavigator.tsx:299

What to do

  • Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.
AC7 · A11y enforcement4.0 / 10Weak✓ Tool-verified

Other · Accessibility — Whether accessibility is ENFORCED in the toolchain — an accessibility checker configured over the markup (an a11y lint rule set, e.g. eslint-plugin-jsx-a11y or vuejs-accessibility where the project lints JavaScript) and an automated accessibility assertion wired into tests or CI (axe/pa11y/Lighthouse or an equivalent) — on the Documented→Verified→Prevented ladder.

Method: Repo config/CI scan: an accessibility checker configured over the markup (an a11y lint rule set such as eslint-plugin-jsx-a11y / vuejs-accessibility where JavaScript is linted) and an automated accessibility assertion in tests or CI (axe/pa11y/Lighthouse or equivalent), graded on the Documented→Verified→Prevented rungs. Deterministic, presence/rung detection.

Coverage: Population: the repository's own tooling configuration — lint config, test and CI files — NOT the markup. It is read for a configured accessibility checker and an automated accessibility assertion (axe/pa11y/Lighthouse, or a native-toolkit equivalent), and it credits an INVOCATION, never a mention: a licence filename, an import comment or a doc reference earns no rung. Enforcement configured entirely outside the repository leaves no evidence here and cannot be credited.

  • No accessibility enforcement found — no a11y linter (eslint-plugin-jsx-a11y) and no axe/pa11y/Lighthouse in tests or CI. Start with the linter to catch issues at author time. What was searched, so you can tell an absence from a miss: the 594 markup file(s) this pass actually assessed, the linter configuration checked in beside them, and this repository's test and CI files — matched by name against the accessibility checkers this dimension carries. An audit run outside the repository, a hosted scanner, or a check whose name is not one of those, is not seen here. — REDACTED:74

What to do

  • Enforce accessibility in the toolchain: add eslint-plugin-jsx-a11y, then assert with vitest-axe in tests, then gate axe/pa11y/Lighthouse in CI.
AX10 · Code composition4.8 / 10Weak✓ Tool-verified

Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.

Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.

Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.

What to do

  • The domain core is a small share of production code, but most of the rest matched no layer vocabulary at all — so this is not yet an anemic-domain finding. The namespace/path convention could not place that code, which makes the composition above a statement about the naming, not about the design. Name the layers (or check that the repository's conventions differ from the ones this check knows) before reading a thin domain into it.
AX2 · Stateful singletons10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether singleton services avoid mutable shared instance state that concurrent callers would race on.

Method: Roslyn scan: singleton field mutations unguarded by lock or Interlocked, per type; syntax-based guard detection. Deterministic, traceable per field.

AX3 · Project dependency cycles10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).

Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.

AX5 · Architecture & structure10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether the codebase has a recognisable, scale-appropriate structure (a named architectural style, or modular enough for its size) rather than being an ad-hoc ball of mud.

Method: Roslyn plus csproj analysis: architecture style detection (DDD, clean, vertical-slice, CQRS) and structure fitness for repo size. Deterministic.

AX6 · Interface segregation10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether interfaces stay focused rather than fat — the Interface-Segregation principle (SOLID 'I').

Method: Roslyn scan: public interface declared-member counts (accessors fold into their property/event); fat-interface threshold (over 15 declared members) flagged per type. Each finding also reports the distinct-OPERATION count — members counted by name, so an overload group counts once — which decides whether it states the caller-side ISP harm or the implementer-side burden of an overload set. TypeScript: exported interfaces that declare behaviour, counted over their REQUIRED operations (method signatures and function-typed properties with no `?`, once per signature) — data-shape interfaces and ambient .d.ts declarations are outside the population; JavaScript declares no interfaces and is not applicable. Deterministic, type-level.

  • `QuestionBankController` declares 18 required operations: `setScope`, `setReviewFilters`, `setSort`, `setSearchInput`, `refresh`, `setPage`, `toggleSelected`, `selectAll`, `clearSelection`, `toggleBookmark`, `toggleResolved`, `removeEntry`, `fileEntries`, `unfileEntries`, `fileIntoNewCategory`, `addCategory`, `renameExistingCategory`, `removeCategory`. Counted over its REQUIRED operations — a method signature or a function-typed property with no `?`, once per signature; optional members and data properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — web/components/space/question-bank/useQuestionBank.ts:74

What to do

  • Split fat interfaces into focused role-interfaces so clients depend only on what they use.
AX7 · Slice cohesion1.0 / 10Critical✓ Tool-verified

Other · Architecture — Whether feature slices stay independent (no direct cross-slice references) — the discipline that makes vertical-slice architecture pay off.

Method: Roslyn scan (vertical-slice gated): feature slices resolved from namespaces (.Features.*, .Slices.*) or project names; cross-slice type references detected. Deterministic, traceable.

  • `CalendarPage` (slice 'calendar') depends on `HeaderActionButton` from slice 'chat'. — web/features/calendar/components/CalendarPage.tsx:351
  • `EventEditor` (slice 'calendar') depends on `HeaderActionButton` from slice 'chat'. — web/features/calendar/components/EventEditor.tsx:73
  • `EventDetails` (slice 'calendar') depends on `HeaderActionButton` from slice 'chat'. — web/features/calendar/components/ItemDetails.tsx:106
  • `ChatWorkspace` (slice 'chat') depends on `useCapabilityCatalog` from slice 'capabilities'. — web/features/chat/components/ChatWorkspace.tsx:283
  • `ChatWorkspace` (slice 'chat') depends on `getChatCapability` from slice 'capabilities'. — web/features/chat/components/ChatWorkspace.tsx:645
  • `ChatWorkspace` (slice 'chat') depends on `listKnowledgeBases` from slice 'knowledge'. — web/features/chat/components/ChatWorkspace.tsx:1396
  • `ChatWorkspace` (slice 'chat') depends on `ToolName` from slice 'capabilities'. — web/features/chat/components/ChatWorkspace.tsx:1486
  • `ChatWorkspace` (slice 'chat') depends on `ALL_TOOLS` from slice 'capabilities'. — web/features/chat/components/ChatWorkspace.tsx:1487
  • `ChatWorkspace` (slice 'chat') depends on `RESPONSE_LANGUAGE_OPTIONS` from slice 'settings'. — web/features/chat/components/ChatWorkspace.tsx:2964
  • `CoWriterWorkspace` (slice 'co-writer') depends on `LLMSelection` from slice 'chat'. — web/features/co-writer/components/CoWriterWorkspace.tsx:262
  • `CoWriterWorkspace` (slice 'co-writer') depends on `listKnowledgeBases` from slice 'knowledge'. — web/features/co-writer/components/CoWriterWorkspace.tsx:408
  • `resultBlock` (slice 'notes') depends on `MessageItem` from slice 'chat'. — web/features/notes/components/NoteCompanion.tsx:158
  • `ThreadPanel` (slice 'notes') depends on `useChatStateAdapter` from slice 'chat'. — web/features/notes/components/NoteCompanion.tsx:234
  • `ThreadPanel` (slice 'notes') depends on `RoughActionButton` from slice 'chat'. — web/features/notes/components/NoteCompanion.tsx:283
  • `ThreadPanel` (slice 'notes') depends on `COMMAND_CONFIRMATION_FAILED` from slice 'chat'. — web/features/notes/components/NoteCompanion.tsx:314
  • `ThreadPanel` (slice 'notes') depends on `ChatMessageList` from slice 'chat'. — web/features/notes/components/NoteCompanion.tsx:419
  • `ThreadPanel` (slice 'notes') depends on `MessageAttachment` from slice 'chat'. — web/features/notes/components/NoteCompanion.tsx:432
  • `ThreadComposer` (slice 'notes') depends on `LLMSelection` from slice 'chat'. — web/features/notes/components/NoteCompanion.tsx:658
  • `useNoteThreads` (slice 'notes') depends on `useChatStateAdapter` from slice 'chat'. — web/features/notes/components/useNoteThreads.ts:82
  • `useNoteThreads` (slice 'notes') depends on `MessageItem` from slice 'chat'. — web/features/notes/components/useNoteThreads.ts:450
  • `NetworkSettingsPage` (slice 'settings') depends on `useRuntimeStatus` from slice 'runtime-status'. — web/features/settings/sections/NetworkSettingsSection.tsx:97
  • `NetworkSettingsPage` (slice 'settings') depends on `RuntimeHealthCard` from slice 'runtime-status'. — web/features/settings/sections/NetworkSettingsSection.tsx:221
  • `NetworkSettingsPage` (slice 'settings') depends on `TurnCoordinationSettings` from slice 'runtime-status'. — web/features/settings/sections/NetworkSettingsSection.tsx:227
  • `KanbanBoard` (slice 'tasks') depends on `useTaskBlocks` from slice 'calendar'. — web/features/tasks/components/KanbanBoard.tsx:48
  • `KanbanBoard` (slice 'tasks') depends on `dateKey` from slice 'calendar'. — web/features/tasks/components/KanbanBoard.tsx:86
  • `KanbanBoard` (slice 'tasks') depends on `addDays` from slice 'calendar'. — web/features/tasks/components/KanbanBoard.tsx:87
  • `KanbanBoard` (slice 'tasks') depends on `startOfWeek` from slice 'calendar'. — web/features/tasks/components/KanbanBoard.tsx:87

What to do

  • Keep slices independent: share cross-slice needs via an explicit contract/shared-kernel, not direct references between slices.
C2 · Access Controls10.0 / 10Exemplary○ Nothing flagged

Other · Security — Whether access is authorized by default — a framework authorization attribute/decorator or policy, or imperative guard methods (throw-on-violation) called from handlers.

Method: Roslyn scan: [Authorize] usage and authorization policies, plus imperative throw-on-violation guard methods detected via syntax. Deterministic.

M1 · Documentation (README)8.0 / 10Strong✓ Tool-verified

Maturity · Maturity — Whether the repo and its projects have a README, and whether it's substantive and current.

Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.

What to do

  • Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
  • Add an 'Architecture' / 'How it works' section to the root README — the high-level shape.
  • Add a README to the 2 of 6 project(s) that lack one — worth up to 0.7 pts.
M2 · Architecture documentation5.0 / 10Adequate✓ Tool-verified

Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.

Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.

  • No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.

What to do

  • Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
M3 · Folder & project structure8.0 / 10Strong✓ Tool-verified

Maturity · Maturity — Whether the repo is organised deliberately — src/test separation and consistent project naming.

Method: Filesystem scan: src/test folder separation and namespace-prefix consistency (majority RootNamespace agreement). Exhaustive across projects, deterministic.

  • Production code isn't grouped under a src/ folder — it's spread across several top-level directories, so there's no one place that says 'this is the product'.

What to do

  • Group production code under src/ (or split deliberately, e.g. backend/ + frontend/) so production and tooling code aren't mixed at the root.
M4 · Documentation accuracy10.0 / 10Exemplary○ Nothing flagged

Maturity · Maturity — Whether the project's current-state documentation describes the code that exists.

Method: Every current-state document's checkable claims looked up in the tree (links, versions, and artefact counts an order of magnitude off), plus two README checks: an advertised infrastructure product with no footprint, and a module the CHANGELOG records as removed. Deterministic, no model. Advisory.

P1 · CI/CD gates10.0 / 10Exemplary○ Nothing flagged

Readiness · Readiness — Whether an automated pipeline builds and tests every change.

Method: Filesystem scan: CI workflow files (.github/workflows, .gitlab-ci.yml, etc.) for build and test stages. Exhaustive, deterministic.

P10 · Library API & versioning10.0 / 10Exemplary○ Nothing flagged

Readiness · Readiness — For a library: a deliberate (small) public API surface and explicit semantic versioning so consumers can depend on it safely.

Method: Roslyn scan: public API surface area and semantic-versioning markers (SemVer attributes, changelog entries) for libraries; off .NET, a library is the ecosystem's publication act (an npm package that is not private and names an entry point, a PyPI distribution with a build system, a Rust library crate, a Maven/Gradle module that publishes, a Go module with no package main, a gemspec, a Composer library, a SwiftPM library product, a pub.dev or Hex package), its surface is the share of types the language's code model records as public (Rust, Swift, Java, Kotlin, Go, Dart; not measured where the model records no type visibility or, as in TypeScript, only module-level export), and its version is read from the manifest, a semver CHANGELOG, release tooling or semver git tags. Exhaustive, deterministic.

P2 · Observability6.0 / 10Adequate✓ Tool-verified

Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.

Method: Filesystem/Roslyn scan: structured-logging frameworks (Serilog, NLog), OpenTelemetry, and health-check endpoint patterns. Exhaustive, deterministic.

  • Only 1/3 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `apps/desktop`, `web`.

What to do

  • Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
  • Add OpenTelemetry tracing/metrics (opentelemetry-sdk) so requests are traceable across the system, not just health-probable.
P3 · Security & performance tooling0.0 / 10Critical✓ Tool-verified

Readiness · Readiness — Whether SAST, secret/dependency scanning and performance benchmarking are wired in (presence, not runtime).

Method: Filesystem scan: SAST configuration, dependency-update automation, secret scanning, and a benchmark harness or benchmark step — in this repository's own ecosystem. Exhaustive, deterministic.

  • No static application security testing detected. For this repository's stack, add bandit, `semgrep --config=p/python`, or CodeQL's python pack as a CI step. What was searched, so you can tell an absence from a miss: the 43712 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner. — REDACTED:32
  • `apps/desktop/package.json` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`. — apps/desktop/package.json:19

What to do

  • Add a SAST step to CI running what this repository's stack ships: bandit, `semgrep --config=p/python`, or CodeQL's python pack — so a security regression fails the build instead of landing.
  • Enable Dependabot/Renovate or a dependency-review gate.
  • Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
P4 · Deployment & Rollback10.0 / 10Exemplary✓ Tool-verified

Readiness · Readiness — Whether releases are automated and safely reversible (probes, rolling updates, approval gates) — from manifests/pipeline files, not the live environment.

Method: Filesystem scan: deployment manifests/IaC (K8s YAML, Helm, Terraform) for rolling updates, probes, approval gates, migration hooks. Exhaustive, deterministic.

P6 · Release Hygiene5.0 / 10Adequate✓ Tool-verified

Readiness · Readiness — Whether releases are traceable — a maintained changelog and explicit version stamping.

Method: Filesystem scan: changelog file presence and version tags in csproj or git tags. Exhaustive, deterministic.

  • No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)

What to do

  • Keep a changelog (e.g. Keep-a-Changelog) recording what shipped in each release.
P7 · Outbound HTTP resilience3.0 / 10Weak✓ Tool-verified

Readiness · Readiness — Whether outbound HTTP calls are wrapped in resilience (retry/timeout/circuit-breaker) so a failing dependency doesn't cascade.

Method: Source scan: outbound HTTP clients and what bounds them — resilience handlers (Polly, AddStandardResilienceHandler) on .NET; on Go, the JVM, Python, JavaScript/TypeScript, Ruby, PHP, Rust, Elixir, Swift, Dart and Erlang, a timeout, deadline, retry or breaker beside each call, or a process-wide client default (a framework-wide deadline such as Drupal core's, Laravel's or actix's awc counts). Exhaustive, deterministic.

  • `httpx.AsyncClient(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. (×3) — deeptutor/partners/channels/dingtalk.py:175, deeptutor/services/llm/openai_http_client.py:102, deeptutor/services/llm/openai_http_client.py:153
  • `requests.Session(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — deeptutor/partners/channels/lark_http.py:43

What to do

  • Pass `timeout=` on every `requests`/`httpx` call (requests has no default and will wait forever), mount an `HTTPAdapter(max_retries=Retry(...))` on shared sessions, and wrap calls to flaky dependencies in `tenacity` retries or a `pybreaker` circuit breaker.
PF3 · Async & latency hygiene6.0 / 10Adequate✓ Tool-verified

Readiness · Performance — Whether asynchronous code stays responsive — it avoids sync-over-async blocking (a .NET .Wait()/.GetAwaiter().GetResult(), a time.sleep or blocking HTTP call inside a Python coroutine, a *Sync call inside an async JavaScript function, block_on inside a Rust async fn, runBlocking inside a Kotlin suspend function, block() inside a Reactor publisher) that stalls a thread or event loop and risks deadlock, and, where the code is a reusable library on .NET, awaits with ConfigureAwait(false) so it never captures and stalls its caller's context.

Method: Production-source scan: sync-over-async blocking counted everywhere — .Wait()/.GetAwaiter().GetResult() in .NET; off .NET, read from each language's code model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin, Swift, Dart) or inside a Java method returning a Reactor Mono/Flux or a Scala method returning a Future or effect — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.

  • `start` is async and calls time.sleep — a blocking call inside async code stalls the event loop — every other task on it waits for as long as it runs. — deeptutor/partners/channels/feishu.py:480
  • `execFileSync` in `packageWindows` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×2) — apps/desktop/platforms/windows-x64/package.mjs:39, apps/desktop/platforms/windows-x64/package.mjs:43
  • `execFileSync` in `packageMac` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×3) — apps/desktop/scripts/lib/macos.mjs:29, apps/desktop/scripts/lib/macos.mjs:30, apps/desktop/scripts/lib/macos.mjs:40
  • `fs.readFileSync` in `main` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — web/scripts/route_budgets.mjs:172

What to do

  • Python: await the async equivalent (asyncio.sleep, an async HTTP client such as httpx.AsyncClient or aiohttp, asyncio.create_subprocess_exec), or move the blocking call off the loop with `await asyncio.to_thread(...)`; never call asyncio.run inside a coroutine — await the coroutine.
  • TypeScript/JavaScript: use the promise APIs (fs/promises, a promisified child_process.execFile, the async zlib/crypto functions) and await them instead of the *Sync variants.
R1 · Type Safety9.7 / 10Exemplary✓ Tool-verified

React / JS · Code Health — How much of the frontend is typed TypeScript vs untyped JavaScript.

Method: Frontend file inventory: the share of typed TypeScript vs untyped JavaScript across the source tree. Deterministic, exhaustive over frontend files.

What to do

  • Migrate the remaining .js/.jsx files to TypeScript.
R10 · Code Duplication8.9 / 10Strong✓ Tool-verified

React / JS · Code Health — Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm over JS/TS tokens, D-386): a block is reported only where its copies still agree on most of their own identifiers and literals, or were renamed as they were pasted but kept most of their constants, and where the copies carry enough code to stand on their own or the copied extent reaches 30 lines — so a re-implementation sharing neither names nor values, and a small pasted declaration, are both found and deliberately not reported, and a clean R10 is not a claim that nothing was copied.

Method: Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm run over JS/TS tokens). Masking finds the candidates; a block is reported when its copies still agree on most of their own identifiers and literals, or when a renamed copy still agrees on most of its constants, AND the copies carry enough code to stand on their own — or when the copied extent reaches 30 lines. So a re-implementation sharing neither names nor values, and a small pasted declaration, are deliberately not counted. Deterministic.

  • 249 duplicated blocks under web/ have copies in at least two of the sibling directories app, components, context, contracts, features, hooks (+2 more sibling(s) not listed) — 120 of them are reported below, and 129 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 249 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 249 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 249 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — web/app/(workspace)/partners/new/page.tsx:76
  • 125 duplicated blocks under web/components/ have copies in at least two of the sibling directories activity, agents, chat, cli-apps, customization, knowledge (+19 more sibling(s) not listed) — 58 of them are reported below, and 67 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 125 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 125 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 125 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — web/components/reading/workspace/ReadingComposer.tsx:52
  • 9 duplicated blocks under web/features/ have copies in at least two of the sibling directories calendar, chat, co-writer, knowledge, multi-user, notes (+2 more sibling(s) not listed) — 2 of them are reported below, and 7 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 9 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 9 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 9 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — web/features/multi-user/components/GuardianRelationshipsEditor.tsx:41
  • web/components/space/PersonasSection.tsx:36 · web/components/space/SkillsSection.tsx:47 — the two spans are one implementation copied and then locally edited — 2084 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — web/components/space/PersonasSection.tsx:36
  • web/components/common/RichMarkdownRenderer.tsx:186 · web/components/common/SimpleMarkdownRenderer.tsx:48 — the two spans are one implementation copied and then locally edited — 2403 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — web/components/common/RichMarkdownRenderer.tsx:186
  • web/components/chat/BookReferencePicker.tsx:51 · web/components/chat/ReadingReferencePicker.tsx:53 — the two spans are one implementation copied and then locally edited — 1407 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — web/components/chat/BookReferencePicker.tsx:51
  • web/features/settings/sections/CapabilitiesSettingsSection.tsx:148 · web/features/settings/sections/MemorySettingsSection.tsx:79 — the two spans are one implementation copied and then locally edited — 1301 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — web/features/settings/sections/CapabilitiesSettingsSection.tsx:148
  • web/components/knowledge/KbGitHubSourcesSection.tsx:66 · web/components/knowledge/KbWebSourcesSection.tsx:94 — the two spans are one implementation copied and then locally edited — 955 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — web/components/knowledge/KbGitHubSourcesSection.tsx:66
  • web/app/(workspace)/partners/new/page.tsx:76 · web/components/partners/PartnerConfigure.tsx:94 — the two spans are one implementation copied and then locally edited — 712 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — web/app/(workspace)/partners/new/page.tsx:76
  • web/components/sidebar/UtilitySidebar.tsx:36 · web/components/sidebar/WorkspaceSidebar.tsx:46 — the two spans are one implementation copied and then locally edited — 733 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — web/components/sidebar/UtilitySidebar.tsx:36
  • web/components/space/ChatHistorySection.tsx:62 · web/components/space/MyAgentsSection.tsx:90 — the two spans are one implementation copied and then locally edited — 634 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — web/components/space/ChatHistorySection.tsx:62
  • web/features/settings/sections/DocumentParsingSettingsSection.tsx:389 · web/features/settings/sections/DocumentParsingSettingsSection.tsx:683 — the two spans are one implementation copied and then locally edited — 467 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — web/features/settings/sections/DocumentParsingSettingsSection.tsx:389
  • web/app/(workspace)/partners/groups/[groupId]/page.tsx:264 · web/app/(workspace)/partners/groups/new/page.tsx:29 — the two spans are one implementation copied and then locally edited — 511 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — web/app/(workspace)/partners/groups/[groupId]/page.tsx:264
  • web/components/SessionList.tsx:138 · web/components/SessionList.tsx:248 — the two spans are one implementation copied and then locally edited — 444 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — web/components/SessionList.tsx:138
  • web/components/sidebar/SidebarShell.tsx:111 · web/features/ui-layout/classic/ClassicSidebarShell.tsx:92 — the two spans are one implementation copied and then locally edited — 383 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — web/components/sidebar/SidebarShell.tsx:111
  • web/components/learning/LearningDashboard.tsx:65 · web/features/ui-layout/classic/ClassicLearningDashboard.tsx:107 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — web/components/learning/LearningDashboard.tsx:65
  • web/features/settings/sections/AttachmentsSettingsSection.tsx:53 · web/features/settings/sections/StartersSettingsSection.tsx:31 — the two spans are one implementation copied and then locally edited — 511 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — web/features/settings/sections/AttachmentsSettingsSection.tsx:53
  • web/components/chat/home/CreationDraftCard.tsx:51 · web/components/chat/home/PartnerDraftCard.tsx:26 — the two spans are one implementation copied and then locally edited — 431 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — web/components/chat/home/CreationDraftCard.tsx:51
  • web/components/chat/PersonaPicker.tsx:117 · web/components/chat/QuestionBankPicker.tsx:260 — the two spans are one implementation copied and then locally edited — 298 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — web/components/chat/PersonaPicker.tsx:117
  • web/app/(admin)/admin/users/page.tsx:796 · web/app/(admin)/admin/users/page.tsx:920 — the two spans are one implementation copied and then locally edited — 261 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — web/app/(admin)/admin/users/page.tsx:796
  • web/components/reading/workspace/ReadingComposer.tsx:52 · web/components/space/learning/MasteryComposer.tsx:51 — the two spans are one implementation copied and then locally edited — 395 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — web/components/reading/workspace/ReadingComposer.tsx:52
  • web/components/sidebar/SidebarShell.tsx:365 · web/features/ui-layout/classic/ClassicSidebarShell.tsx:258 — the two spans are one implementation copied and then locally edited — 295 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — web/components/sidebar/SidebarShell.tsx:365
  • web/components/common/Modal.tsx:61 · web/components/common/PickerShell.tsx:179 — the two spans are one implementation copied and then locally edited — 349 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — web/components/common/Modal.tsx:61
  • web/hooks/useVoiceAutoplay.ts:17 · web/hooks/useVoiceMathSpeak.ts:7 — the two spans are one implementation copied and then locally edited — 316 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — web/hooks/useVoiceAutoplay.ts:17
  • web/components/chat/home/SessionViewerPanel.tsx:1542 · web/components/chat/preview/FilePreviewDrawer.tsx:374 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — web/components/chat/home/SessionViewerPanel.tsx:1542
  • web/components/partners/PartnerModelPicker.tsx:94 · web/components/partners/PartnerModelSelect.tsx:63 — the two spans are one implementation copied and then locally edited — 257 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — web/components/partners/PartnerModelPicker.tsx:94
  • web/hooks/useLearningIndex.ts:21 · web/hooks/usePartnerNavigation.ts:39 — the two spans are one implementation copied and then locally edited — 270 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — web/hooks/useLearningIndex.ts:21
  • web/components/reading/ReadingActionsProvider.tsx:81 · web/components/reading/ReadingExtensionBar.tsx:128 — the two spans are one implementation copied and then locally edited — 273 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — web/components/reading/ReadingActionsProvider.tsx:81
  • web/components/space/question-bank/useQuestionBank.ts:441 · web/features/settings/store/SettingsStore.tsx:2510 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — web/components/space/question-bank/useQuestionBank.ts:441
  • web/app/(auth)/login/page.tsx:120 · web/app/(auth)/register/page.tsx:137 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — web/app/(auth)/login/page.tsx:120
  • web/components/reading/library/MaterialLibrary.tsx:697 · web/components/reading/library/ReadingLibrary.tsx:504 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — web/components/reading/library/MaterialLibrary.tsx:697
  • web/components/memory/MemoryL1Workbench.tsx:221 · web/components/memory/MemoryWorkbench.tsx:523 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — web/components/memory/MemoryL1Workbench.tsx:221
  • web/components/cli-apps/CliAppsSection.tsx:959 · web/components/mcp/McpCatalogBrowser.tsx:723 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — web/components/cli-apps/CliAppsSection.tsx:959
  • web/components/knowledge/KbGitHubSourcesSection.tsx:17 · web/components/knowledge/KbWebSourcesSection.tsx:29 — the two spans are one implementation copied and then locally edited — 266 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — web/components/knowledge/KbGitHubSourcesSection.tsx:17
  • web/components/partners/PartnerModelPicker.tsx:21 · web/components/partners/PartnerModelSelect.tsx:164 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — web/components/partners/PartnerModelPicker.tsx:21
  • web/components/reading/library/ReadingFolder.tsx:192 · web/components/reading/library/ReadingLibrary.tsx:331 — the two spans are one implementation copied and then locally edited — 138 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — web/components/reading/library/ReadingFolder.tsx:192
  • web/lib/admin-api.ts:36 · web/lib/profile-api.ts:14 — the two spans are one implementation copied and then locally edited — 238 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — web/lib/admin-api.ts:36
  • web/lib/partner-groups-api.ts:84 · web/lib/partners-api.ts:172 — the two spans are one implementation copied and then locally edited — 202 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — web/lib/partner-groups-api.ts:84
  • web/components/chat/home/StandaloneComposer.tsx:471 · web/features/chat/components/ChatWorkspace.tsx:1564 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — web/components/chat/home/StandaloneComposer.tsx:471
  • web/components/notebook/useNotebookLibrary.ts:271 · web/context/AppShellContext.tsx:400 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — web/components/notebook/useNotebookLibrary.ts:271

What to do

  • Act on each finding's own remediation rather than one rule: the move depends on what recurs. Where the copies are executable blocks, give the shared part one home and call it from each site; where they are declarations, a listing, a specialisation already delegating to its base, or one shape repeated per entity, there is no call site and the move is a shared type, a generated set or a factory — sometimes there is nothing to extract.
R11 · Import Boundaries6.5 / 10Adequate✓ Tool-verified

React / JS · Architecture — Conformance to the detected frontend architecture layout (feature-sliced / layered src) plus cross-package deep-import rules (D-386).

Method: Conformance to the detected frontend layout (feature-sliced / layered src) plus cross-package deep-import rules, over the module graph. Deterministic.

  • web/components/common/code-block-themes.ts:10 imports react-syntax-highlighter/dist/esm/styles/prism/one-dark, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — web/components/common/code-block-themes.ts:10
  • web/components/common/code-block-themes.ts:11 imports react-syntax-highlighter/dist/esm/styles/prism/a11y-dark, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — web/components/common/code-block-themes.ts:11
  • web/components/common/code-block-themes.ts:12 imports react-syntax-highlighter/dist/esm/styles/prism/a11y-one-light, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — web/components/common/code-block-themes.ts:12
  • web/components/common/code-block-themes.ts:13 imports react-syntax-highlighter/dist/esm/styles/prism/atom-dark, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — web/components/common/code-block-themes.ts:13
  • web/components/common/code-block-themes.ts:14 imports react-syntax-highlighter/dist/esm/styles/prism/base16-ateliersulphurpool.light, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — web/components/common/code-block-themes.ts:14
  • web/components/common/code-block-themes.ts:15 imports react-syntax-highlighter/dist/esm/styles/prism/cb, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — web/components/common/code-block-themes.ts:15
  • web/components/common/code-block-themes.ts:16 imports react-syntax-highlighter/dist/esm/styles/prism/coldark-cold, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — web/components/common/code-block-themes.ts:16
  • web/components/common/code-block-themes.ts:17 imports react-syntax-highlighter/dist/esm/styles/prism/coldark-dark, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — web/components/common/code-block-themes.ts:17
  • web/components/common/code-block-themes.ts:18 imports react-syntax-highlighter/dist/esm/styles/prism/coy-without-shadows, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — web/components/common/code-block-themes.ts:18
  • web/components/common/code-block-themes.ts:19 imports react-syntax-highlighter/dist/esm/styles/prism/coy, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — web/components/common/code-block-themes.ts:19
  • web/components/common/code-block-themes.ts:20 imports react-syntax-highlighter/dist/esm/styles/prism/darcula, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — web/components/common/code-block-themes.ts:20
  • web/components/common/code-block-themes.ts:21 imports react-syntax-highlighter/dist/esm/styles/prism/dark, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — web/components/common/code-block-themes.ts:21
  • web/components/common/code-block-themes.ts:22 imports react-syntax-highlighter/dist/esm/styles/prism/dracula, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — web/components/common/code-block-themes.ts:22
  • web/components/common/code-block-themes.ts:23 imports react-syntax-highlighter/dist/esm/styles/prism/duotone-dark, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — web/components/common/code-block-themes.ts:23
  • web/components/common/code-block-themes.ts:24 imports react-syntax-highlighter/dist/esm/styles/prism/duotone-earth, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — web/components/common/code-block-themes.ts:24
  • web/components/common/code-block-themes.ts:25 imports react-syntax-highlighter/dist/esm/styles/prism/duotone-forest, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — web/components/common/code-block-themes.ts:25
  • web/components/common/code-block-themes.ts:26 imports react-syntax-highlighter/dist/esm/styles/prism/duotone-light, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — web/components/common/code-block-themes.ts:26
  • web/components/common/code-block-themes.ts:27 imports react-syntax-highlighter/dist/esm/styles/prism/duotone-sea, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — web/components/common/code-block-themes.ts:27
  • web/components/common/code-block-themes.ts:28 imports react-syntax-highlighter/dist/esm/styles/prism/duotone-space, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — web/components/common/code-block-themes.ts:28
  • web/components/common/code-block-themes.ts:29 imports react-syntax-highlighter/dist/esm/styles/prism/funky, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — web/components/common/code-block-themes.ts:29
  • web/components/common/code-block-themes.ts:30 imports react-syntax-highlighter/dist/esm/styles/prism/ghcolors, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — web/components/common/code-block-themes.ts:30
  • web/components/common/code-block-themes.ts:31 imports react-syntax-highlighter/dist/esm/styles/prism/gruvbox-dark, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — web/components/common/code-block-themes.ts:31
  • web/components/common/code-block-themes.ts:32 imports react-syntax-highlighter/dist/esm/styles/prism/gruvbox-light, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — web/components/common/code-block-themes.ts:32
  • web/components/common/code-block-themes.ts:33 imports react-syntax-highlighter/dist/esm/styles/prism/holi-theme, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — web/components/common/code-block-themes.ts:33
  • web/components/common/code-block-themes.ts:34 imports react-syntax-highlighter/dist/esm/styles/prism/hopscotch, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — web/components/common/code-block-themes.ts:34
  • web/components/common/code-block-themes.ts:35 imports react-syntax-highlighter/dist/esm/styles/prism/lucario, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — web/components/common/code-block-themes.ts:35
  • web/components/common/code-block-themes.ts:36 imports react-syntax-highlighter/dist/esm/styles/prism/material-dark, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — web/components/common/code-block-themes.ts:36
  • web/components/common/code-block-themes.ts:37 imports react-syntax-highlighter/dist/esm/styles/prism/material-light, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — web/components/common/code-block-themes.ts:37
  • web/components/common/code-block-themes.ts:38 imports react-syntax-highlighter/dist/esm/styles/prism/material-oceanic, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — web/components/common/code-block-themes.ts:38
  • web/components/common/code-block-themes.ts:39 imports react-syntax-highlighter/dist/esm/styles/prism/night-owl, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — web/components/common/code-block-themes.ts:39
  • web/components/common/code-block-themes.ts:40 imports react-syntax-highlighter/dist/esm/styles/prism/nord, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — web/components/common/code-block-themes.ts:40
  • web/components/common/code-block-themes.ts:41 imports react-syntax-highlighter/dist/esm/styles/prism/okaidia, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — web/components/common/code-block-themes.ts:41
  • web/components/common/code-block-themes.ts:42 imports react-syntax-highlighter/dist/esm/styles/prism/one-light, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — web/components/common/code-block-themes.ts:42
  • web/components/common/code-block-themes.ts:43 imports react-syntax-highlighter/dist/esm/styles/prism/pojoaque, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — web/components/common/code-block-themes.ts:43
  • web/components/common/code-block-themes.ts:44 imports react-syntax-highlighter/dist/esm/styles/prism/prism, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — web/components/common/code-block-themes.ts:44
  • web/components/common/code-block-themes.ts:45 imports react-syntax-highlighter/dist/esm/styles/prism/shades-of-purple, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — web/components/common/code-block-themes.ts:45
  • web/components/common/code-block-themes.ts:46 imports react-syntax-highlighter/dist/esm/styles/prism/solarized-dark-atom, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — web/components/common/code-block-themes.ts:46
  • web/components/common/code-block-themes.ts:47 imports react-syntax-highlighter/dist/esm/styles/prism/solarizedlight, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — web/components/common/code-block-themes.ts:47
  • web/components/common/code-block-themes.ts:48 imports react-syntax-highlighter/dist/esm/styles/prism/synthwave84, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — web/components/common/code-block-themes.ts:48
  • web/components/common/code-block-themes.ts:49 imports react-syntax-highlighter/dist/esm/styles/prism/tomorrow, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — web/components/common/code-block-themes.ts:49

What to do

  • Fix the listed violations: import through public entries (package exports / slice index), never reach into another layer or package's internals.
R2 · Cyclomatic Complexity6.0 / 10Adequate✓ Tool-verified

React / JS · Code Health — Per-function cyclomatic/cognitive complexity from the token-level function scanner (D-386) — real branching, not a regex heuristic.

Method: Per-function cyclomatic/cognitive complexity from a token-level function scanner (real branching, not a regex heuristic), computed over every frontend function. Deterministic.

  • reduce has cyclomatic complexity 192 and cognitive complexity 232; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/features/chat/ChatStateAdapter.tsx:802
  • (anonymous) has cyclomatic complexity 178 and cognitive complexity 170; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/features/chat/ChatStateAdapter.tsx:3014
  • ChatComposer has cyclomatic complexity 119 and cognitive complexity 102; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/components/chat/home/ChatComposer.tsx:200
  • ModelEditor has cyclomatic complexity 87 and cognitive complexity 62; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/components/settings/ModelsWorkspace.tsx:703
  • (anonymous) has cyclomatic complexity 80 and cognitive complexity 55; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/features/chat/components/ChatWorkspace.tsx:2005
  • QuestionCard has cyclomatic complexity 77 and cognitive complexity 62; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/components/space/question-bank/QuestionCard.tsx:136
  • extractMessageSegments has cyclomatic complexity 76 and cognitive complexity 188; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/components/chat/home/AskUserOptions.tsx:348
  • (anonymous) has cyclomatic complexity 67 and cognitive complexity 58; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/features/chat/messages/ChatMessageList.tsx:2457
  • ProfileFields has cyclomatic complexity 64 and cognitive complexity 56; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/components/settings/ServiceConfigEditor.tsx:1426
  • BookPageInner has cyclomatic complexity 63 and cognitive complexity 52; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/app/(workspace)/learning/books/BooksRoute.tsx:104
  • KbIndexVersionsSection has cyclomatic complexity 62 and cognitive complexity 51; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/components/knowledge/KbIndexVersionsSection.tsx:50
  • operate has cyclomatic complexity 60 and cognitive complexity 76; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/chat-engine/src/native/session.ts:169
  • SubagentSettingsEditor has cyclomatic complexity 59 and cognitive complexity 55; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/components/settings/SubagentSettingsEditor.tsx:324
  • SingleMasteryQuestionCard has cyclomatic complexity 59 and cognitive complexity 51; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/components/chat/home/MasteryQuestionCard.tsx:125
  • buildStartTurnInput has cyclomatic complexity 58 and cognitive complexity 57; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/features/chat/controllers/buildStartTurnInput.ts:51
  • PageReader has cyclomatic complexity 58 and cognitive complexity 44; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/app/(workspace)/learning/books/components/PageReader.tsx:122
  • CoWriterWorkspace has cyclomatic complexity 56 and cognitive complexity 52; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/features/co-writer/components/CoWriterWorkspace.tsx:182
  • UserMessage has cyclomatic complexity 55 and cognitive complexity 46; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/features/chat/messages/ChatMessageList.tsx:1709
  • (anonymous) has cyclomatic complexity 54 and cognitive complexity 77; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/features/chat/ChatStateAdapter.tsx:2215
  • (anonymous) has cyclomatic complexity 54 and cognitive complexity 54; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — web/features/chat/ChatStateAdapter.tsx:2714

What to do

  • Break down the listed branch-heavy functions; aim P95 cyclomatic ≤ 5.
R3 · Large Files4.6 / 10Weak✓ Tool-verified

React / JS · Code Health — How many source files exceed the large-file threshold.

Method: Components/modules exceeding the large-file threshold, counted exhaustively across the frontend source tree. Deterministic.

  • web/features/chat/ChatStateAdapter.tsx has 4236 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/features/chat/ChatStateAdapter.tsx:1
  • web/features/chat/components/ChatWorkspace.tsx has 3111 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/features/chat/components/ChatWorkspace.tsx:1
  • web/features/chat/messages/ChatMessageList.tsx has 2676 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/features/chat/messages/ChatMessageList.tsx:1
  • web/features/settings/store/SettingsStore.tsx has 2488 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/features/settings/store/SettingsStore.tsx:1
  • web/features/co-writer/components/CoWriterWorkspace.tsx has 2407 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/features/co-writer/components/CoWriterWorkspace.tsx:1
  • web/features/knowledge/components/engines/EngineDetail.tsx has 1919 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/features/knowledge/components/engines/EngineDetail.tsx:1
  • web/features/chat/trace/TracePresentation.tsx has 1899 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/features/chat/trace/TracePresentation.tsx:1
  • web/components/settings/ServiceConfigEditor.tsx has 1860 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/components/settings/ServiceConfigEditor.tsx:1
  • web/features/knowledge/api/client.ts has 1769 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/features/knowledge/api/client.ts:1
  • web/components/chat/home/SessionViewerPanel.tsx has 1673 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/components/chat/home/SessionViewerPanel.tsx:1
  • web/components/chat/home/ChatComposer.tsx has 1619 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/components/chat/home/ChatComposer.tsx:1
  • web/features/notes/components/NoteEditor.tsx has 1618 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/features/notes/components/NoteEditor.tsx:1
  • web/components/chat/home/AskUserOptions.tsx has 1604 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/components/chat/home/AskUserOptions.tsx:1
  • web/components/knowledge/CreateKbModal.tsx has 1584 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/components/knowledge/CreateKbModal.tsx:1
  • web/components/memory/MemorySection.tsx has 1443 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/components/memory/MemorySection.tsx:1
  • web/components/reading/ReaderPane.tsx has 1400 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/components/reading/ReaderPane.tsx:1
  • web/components/quiz/QuizViewer.tsx has 1351 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/components/quiz/QuizViewer.tsx:1
  • web/components/partners/PartnerChat.tsx has 1329 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/components/partners/PartnerChat.tsx:1
  • web/features/settings/sections/DocumentParsingSettingsSection.tsx has 1287 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/features/settings/sections/DocumentParsingSettingsSection.tsx:1
  • web/components/settings/ModelsWorkspace.tsx has 1206 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/components/settings/ModelsWorkspace.tsx:1
  • web/app/(workspace)/learning/books/BooksRoute.tsx has 1166 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/app/(workspace)/learning/books/BooksRoute.tsx:1
  • web/components/chat/home/StandaloneComposer.tsx has 1034 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/components/chat/home/StandaloneComposer.tsx:1
  • web/components/reading/workspace/MediaReadingStage.tsx has 1001 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/components/reading/workspace/MediaReadingStage.tsx:1
  • web/components/space/SkillsSection.tsx has 990 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/components/space/SkillsSection.tsx:1
  • web/app/(admin)/admin/users/page.tsx has 989 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/app/(admin)/admin/users/page.tsx:1
  • web/components/cli-apps/CliAppsSection.tsx has 969 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/components/cli-apps/CliAppsSection.tsx:1
  • web/components/notebook/NotebookConsole.tsx has 967 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/components/notebook/NotebookConsole.tsx:1
  • web/components/memory/MemoryGraph.tsx has 937 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/components/memory/MemoryGraph.tsx:1
  • web/components/settings/SubagentSettingsEditor.tsx has 932 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/components/settings/SubagentSettingsEditor.tsx:1
  • REDACTED has 930 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
  • web/components/memory/MemoryRunPanel.tsx has 914 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/components/memory/MemoryRunPanel.tsx:1
  • web/components/space/learning/MasteryStudy.tsx has 880 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/components/space/learning/MasteryStudy.tsx:1
  • web/features/notes/components/NoteCompanion.tsx has 831 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/features/notes/components/NoteCompanion.tsx:1
  • web/features/multi-user/components/GrantEditor.tsx has 825 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/features/multi-user/components/GrantEditor.tsx:1
  • web/app/(workspace)/partners/[partnerId]/page.tsx has 816 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/app/(workspace)/partners/[partnerId]/page.tsx:1
  • web/features/notes/components/NoteWorkspace.tsx has 803 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/features/notes/components/NoteWorkspace.tsx:1
  • web/lib/learning-api.ts has 799 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/lib/learning-api.ts:1
  • web/app/(workspace)/learning/books/components/PageReader.tsx has 787 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/app/(workspace)/learning/books/components/PageReader.tsx:1
  • web/components/chat/home/ComposerInput.tsx has 785 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/components/chat/home/ComposerInput.tsx:1
  • web/app/(workspace)/learning/mastery/[pathId]/page.tsx has 774 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — web/app/(workspace)/learning/mastery/[pathId]/page.tsx:1

What to do

  • Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
R4 · Test Coverage8.8 / 10Strong✓ Tool-verified

React / JS · Readiness — Static test reachability (D-386): the share of production files reachable from any test via the import graph — measured without running anything.

Method: Static test reachability: the share of production files reachable from any test via the import graph — measured without running anything. Deterministic.

  • No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one. (×40) — web/components/memory/MemorySection.tsx:1, web/components/space/SkillsSection.tsx:1, web/components/cli-apps/CliAppsSection.tsx:1, …

What to do

  • Add tests that import the unreached modules (directly or through their public entry).
R5 · Dependency Freshness6.9 / 10Adequate✓ Tool-verified

React / JS · Readiness — How outdated the npm dependencies are (a maturity signal). JS/npm CVEs are scored separately in D30 (JS/npm Dependency Vulnerabilities).

Method: npm dependency staleness from manifest/registry metadata (a maturity signal; JS/npm CVEs are scored separately in D30, which answers dependency vulnerabilities for every ecosystem). Deterministic.

  • 31 outdated package(s); JS/npm CVEs scored in D30

What to do

  • Bump outdated dependencies to current versions to limit upgrade debt.
R6 · Tooling10.0 / 10Exemplary✓ Tool-verified

React / JS · Readiness — Whether the project wires up test, lint and typecheck — detected from each REDACTED script's COMMAND (eslint / tsc / vitest / jest / playwright), not just its name, and corroborated against CI-workflow invocations so a tool run only in CI still counts.

Method: REDACTED scanned for test/lint/typecheck script wiring. Deterministic presence check.

R7 · Dead Code7.4 / 10Strong✓ Tool-verified

React / JS · Code Health — Files unreachable from every application/tooling/test entry point, and exports nothing imports (module-graph reachability, D-386).

Method: Dead code: files unreachable from every application/tooling/test entry point plus exports nothing imports, via module-graph reachability. Deterministic, exhaustive over the import graph.

  • 2 file(s) (~121 LoC) were excluded from dead-code analysis — declare main/module/exports or a conventional entry (src/index.*, an index.html script) so reachability can see this package.
  • Unreachable from the 133 application, 15 tooling and 470 test entry point(s) detected in this repo. Gate removals on `npm run build` — an undetected custom entry would make these reachable.
  • no import path from any entry point (133 application, 15 tooling, 470 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (web/components/settings/TaskModelsEditor.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it — web/components/settings/ServiceConfigEditor.tsx
  • no import path from any entry point (133 application, 15 tooling, 470 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make (×12) — web/components/settings/ConnectionsEditor.tsx, web/components/watching/WatchingMarksPanel.tsx, web/components/settings/SettingsPresetsPanel.tsx, …
  • no import path from any entry point (133 application, 15 tooling, 470 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (web/components/settings/ServiceConfigEditor.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it (×3) — web/components/settings/ModelCards.tsx, web/components/settings/DimensionField.tsx, web/components/settings/ModelCapabilityFields.tsx
  • no import path from any entry point (133 application, 15 tooling, 470 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (web/components/settings/SettingsPresetsPanel.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it — web/lib/settings-presets.ts
  • no import path from any entry point (133 application, 15 tooling, 470 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (deeptutor/agents/video_lesson/remotion/build.mjs) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it — deeptutor/agents/video_lesson/remotion/render-platform.ts
  • Nothing imports this binding — it is safe to review for removal. (×19) — apps/desktop/src/config.mjs:47, apps/desktop/src/config.mjs:52, web/components/chat/home/ComposerInput.tsx:152, …
  • Nothing ultimately consumes this binding: its only referrer is the re-export in web/app/(utility)/notebooks/[notebookId]/page.tsx, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in web/app/(utility)/notebooks/[notebookId]/page.tsx in the same commit, or the barrel will import a name that no longer exists. — web/app/(utility)/notebooks/NotebooksRoute.tsx:27

What to do

  • Delete the dead files and unused exports — every line is maintenance cost and rebuild-estimate inflation with zero runtime value.
R8 · Dependency Hygiene0.0 / 10Critical✓ Tool-verified

React / JS · Readiness — npm dependency truthfulness (D-386): unused dependencies, imports not declared anywhere, and type-/test-only packages shipped as production deps.

Method: npm dependency truthfulness: unused dependencies, imports declared nowhere, and type-/test-only packages shipped as production deps — from the manifest + import graph. Deterministic.

  • Imported but not declared in any reachable REDACTED — installs work only by hoisting accident. (×5) — tests/services/sandbox/javascript.test.mjs:7, web/features/notes/components/NoteEditor.tsx:90, web/tests/epub-reader.audit.ts:2, …
  • Declared in REDACTED but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it. (×3)
  • Only test files import it (first: web/tests/e2e/pdf-reading-resize.audit.ts:4) — move it to devDependencies. — REDACTED:50

What to do

  • Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.
R9 · Circular Imports10.0 / 10Exemplary✓ Tool-verified

React / JS · Architecture — Import cycles in the module graph (D-386) — files that can only be understood and changed together.

Method: Import cycles in the module graph, detected exhaustively over JS/TS imports (the same cycle detection as the .NET coupling dimension). Deterministic.

X1 · Async correctness8.0 / 10Strong✓ Tool-verified

Other · Code Health — Whether the code avoids sync-over-async (deadlock-prone blocking on tasks) and async void.

Method: Roslyn syntax scan: async methods scanned for .Wait()/.GetAwaiter().GetResult() and async-void outside event handlers. Deterministic, hard fact per invocation.

  • The task this creates is not kept anywhere. The event loop holds only a weak reference to its tasks, so a task nobody references can be garbage-collected before it finishes (Python's documentation for `asyncio.create_task`: save a reference to the result); and nothing ever awaits it, so an exception it raises is never handled — it surfaces, if at all, as "Task exception was never retrieved" in a log. Keep the task: `await` it, gather it, start it in an `asyncio.TaskGroup` (`async with asyncio.TaskGroup() as tg: tg.create_task(…)`), or, for genuine fire-and-forget, add it to a set and `task.add_done_callback(tasks.discard)` with a callback that also reads its exception. (×5) — deeptutor/services/rag/pipelines/lightrag/worker.py:206, deeptutor/services/llm/provider_factory.py:171, deeptutor/runtime/agentic/client.py:244, …

What to do

  • Task from `worker_loop.create_task` is not kept
X12 · Unreachable branch10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether any branch is dead by construction — a switch arm whose label can never equal a case-normalised subject, or an `else if` whose predicate the arm above has already swallowed.

Method: Roslyn syntax + semantics: switch labels compared against the subject's own case normaliser, and if/else-if chains checked for a literal an earlier arm's containment test already swallows. Deterministic, provable per finding. Advisory.

X13 · Undrained process stream10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a child process that has BOTH standard streams redirected drains both — reading one to the end while the other is never read deadlocks once the child fills the unread pipe.

Method: Roslyn syntax + semantics: ProcessStartInfo launches with both streams redirected, checked for a drain of each stream across the enclosing type. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `spawn` imported from `child_process` whose stdout and stderr are both pipes (no options, no `stdio`, or `stdio` of `'pipe'`), bound to a local that never leaves its scope, where exactly one of the two streams is read, the other never, and the child’s `close`/`exit` (or the read stream’s end) is awaited; a shell redirect in the call’s arguments or a `kill` of the child suppresses it. The same rule reads Python’s `subprocess.Popen`, Dart’s `Process.start`, Ruby’s `Open3.popen3`, and Scala’s JDK process starts (`new ProcessBuilder(…).start()` with no `redirectErrorStream`/`redirectError`/`redirectOutput`/`inheritIO`, `Runtime.getRuntime.exec`) where one of `getInputStream`/`getErrorStream` is read and the other never while `waitFor()` is called or the read stream is read to its end. Deterministic, provable per finding. Advisory.

X14 · Bypassable address classification10.0 / 10Exemplary○ Nothing flagged

Other · Security — Whether a hand-rolled public/private IP check can be walked past — a method that unwraps IPv4-mapped IPv6 but returns the opposite verdict for the same host written as IPv4-compatible, 6to4 or NAT64.

Method: Roslyn syntax + semantics: methods that unwrap IPv4-mapped IPv6 and hand-roll IPv4 range carve-outs, checked for whether the IPv6 branch also accounts for the IPv4-compatible, 6to4 and NAT64 embeddings. Deterministic, provable per finding. Advisory.

X15 · Unvalidated length from an untrusted reader10.0 / 10Exemplary○ Nothing flagged

Other · Security — Whether a length read out of the stream being parsed is bounded before it is allocated or read — an unchecked count taken from the input lets the input choose the allocation.

Method: Roslyn syntax + semantics: integer lengths read from a BinaryReader and spent on a bulk read or an array allocation, checked for any comparison or bounding call on the value anywhere in the method. Deterministic, provable per finding. Advisory.

X16 · Unfloored truncation loop10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a loop that shortens a string until it fits a length budget has a floor — one with none grinds the value down to the empty string, or past it into a negative-length `Substring`.

Method: Roslyn syntax + semantics: while/do loops whose body's only effect on a string is to drop its last character, checked for whether anything — a direct comparison on the length, a body guard, a break — bounds that length below. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `while`/`do` loop whose body’s one assignment to a value is `x = x.slice(0, -1)` or `x = x.slice|substring|substr(0, x.length - 1)`, driven by a condition that reads `x.length` only as a term of a larger expression — never compared directly, never tested for truthiness, and with no other read of `x` — and whose body has no `break`, `return`, `throw` or `if` naming `x`. Deterministic, provable per finding. Advisory.

X17 · Uncapped recursion over a caller-supplied document1.2 / 10Critical✓ Tool-verified

Other · Security — Whether a walk that recurses through a JSON/XML tree handed in by its caller bounds how deep it will go — an uncapped walk lets the document's nesting choose the stack depth, and the resulting StackOverflowException cannot be caught.

Method: Roslyn syntax + semantics: methods that take a JSON/XML document node and call themselves with a child of it, reachable from an externally-callable member of the same type that accepts a document, checked for any depth parameter, descent counter or threaded arithmetic anywhere in the walk. On a repository with no .NET source it reads TypeScript off the engine’s own token stream (test, vendored, generated and minified paths and `.d.ts` not) with the same rule: a function or method with a parameter typed as a document value — `unknown`, `any`, `object`, `Record<string, unknown|any>`, a JSON alias (`JsonValue`, `JSONObject`, …) or a DOM node global the file does not rebind — that calls itself (bare, or through `this` for a method, or hands itself to a call over the value as in `value.map(walk)`) with something it took out of that value and never through an ancestor accessor such as `closest()` or `parentElement`, that is exported or reached from an exported function (a public method of the same exported class) taking such a value, and that names no depth, level, nesting, recursion, remaining or budget anywhere and threads no `+`/`-` arithmetic through a self-call. Plain JavaScript is not read: with no annotation nothing tells a parsed document from a tree the code built itself. Deterministic, provable per finding. Advisory.

  • `parseRuntimeStatus` is exported, takes a document from its caller (line 79) and hands it to `hasCredentialLikeKey`, which calls itself at line 50 (`hasCredentialLikeKey`) with a piece of `value` (and at line 53) — and nowhere in `hasCredentialLikeKey` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `hasCredentialLikeKey` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — web/features/runtime-status/model.ts:50
  • `blockPreview` is exported, takes a document from its caller (line 27) and hands it to `inlineText`, which calls itself at line 13 (`inlineText`) with a piece of `value` — and nowhere in `inlineText` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `inlineText` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — web/features/notes/model/blocks.ts:13
  • `blockPreview` is exported and takes `block: NoteBlock` from its caller, and it calls itself at line 100 (`blockPreview`) with a piece of `block` — and nowhere in `blockPreview` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `blockPreview` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — web/features/notes/model/blocks.ts:100
  • `inlineText` is exported and takes `content: unknown` from its caller, and it calls itself at line 76 (`inlineText`) with a piece of `content` — and nowhere in `inlineText` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `inlineText` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — web/features/notes/model/threads.ts:76
  • `estimateValue` is exported and takes `value: unknown` from its caller, and it calls itself at line 25 (`estimateValue`) with a piece of `value` (and at line 31) — and nowhere in `estimateValue` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `estimateValue` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — packages/chat-engine/src/context/conversation.ts:25
  • `save_config` is public, takes a document from its caller (line 69) and hands it to `_deep_update`, which calls itself at line 51 (`self._deep_update`) with a piece of `target` — and nowhere in `_deep_update` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_deep_update` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — deeptutor/utils/config_manager.py:51
  • `render_docx_text` is public, takes a document from its caller (line 431) and hands it to `_render_omml`, which calls itself at line 422 (`_render_omml`) with a piece of `node` — and nowhere in `_render_omml` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_render_omml` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — deeptutor/utils/document_images.py:422
  • `render_docx_text` is public and takes `node: Any` from its caller, and it calls itself at line 443 (`render_docx_text`) with a piece of `node` — and nowhere in `render_docx_text` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `render_docx_text` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — deeptutor/utils/document_images.py:443
  • `build_pdf_documents` is public, takes a document from its caller (line 145) and hands it to `_list_item_pieces`, which calls itself at line 127 (`_list_item_pieces`) with a piece of `value` — and nowhere in `_list_item_pieces` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_list_item_pieces` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — deeptutor/services/rag/source_pages.py:127
  • `public_policy` is public and takes `policy: dict[str, Any]` from its caller, and it calls itself at line 668 (`public_policy`) with a piece of `policy` (and at line 673) — and nowhere in `public_policy` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `public_policy` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — deeptutor/services/rag/pipelines/lightrag/indexing_policy.py:668
  • `mask_channel_secrets` is public, takes a document from its caller (line 150) and hands it to `_walk`, which calls itself at line 155 (`_walk`) with a piece of `value` (and at line 157, line 159) — and nowhere in `_walk` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_walk` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — deeptutor/services/partners/manager.py:155
  • `save_memory_settings` is public, takes a document from its caller (line 82) and hands it to `_from_dict`, which calls itself at line 132 (`_from_dict`) with a piece of `raw` (and at line 137) — and nowhere in `_from_dict` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_from_dict` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — deeptutor/services/memory/settings.py:132
  • `resolve_references` is public and takes `payload: Any` from its caller, and it calls itself at line 125 (`resolve_references`) with a piece of `payload` (and at line 127) — and nowhere in `resolve_references` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `resolve_references` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — REDACTED:125
  • `estimate_prompt_tokens` is public, takes a document from its caller (line 15) and hands it to `without_image_payloads`, which calls itself at line 36 (`without_image_payloads`) with a piece of `value` (and at line 40) — and nowhere in `without_image_payloads` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `without_image_payloads` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — deeptutor/services/llm/usage_estimation.py:36
  • `extract_response_content` is public and takes `message: object` from its caller, and it calls itself at line 306 (`extract_response_content`) with a piece of `message` — and nowhere in `extract_response_content` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `extract_response_content` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — deeptutor/services/llm/utils.py:306
  • `chat` is public and takes `extra_kwargs: Any` from its caller, and it calls itself at line 1115 (`self.chat`) with a piece of `extra_kwargs` — and nowhere in `chat` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `chat` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — deeptutor/services/llm/provider_core/openai_compat_provider.py:1115
  • `chat_stream` is public and takes `extra_kwargs: Any` from its caller, and it calls itself at line 1318 (`self.chat_stream`) with a piece of `extra_kwargs` — and nowhere in `chat_stream` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `chat_stream` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — deeptutor/services/llm/provider_core/openai_compat_provider.py:1318
  • `restore_catalog_secrets` is public, takes a document from its caller (line 99) and hands it to `_restore_secret_value`, which calls itself at line 83 (`_restore_secret_value`) with a piece of `proposed` (and at line 87) — and nowhere in `_restore_secret_value` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_restore_secret_value` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — deeptutor/services/config/model_catalog.py:83
  • `normalize_origins` is public, takes a document from its caller (line 47) and hands it to `_raw_origin_items`, which calls itself at line 16 (`_raw_origin_items`) with a piece of `value` — and nowhere in `_raw_origin_items` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_raw_origin_items` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — deeptutor/services/config/origins.py:16
  • `inline_markdown` is public and takes `content: Any` from its caller, and it calls itself at line 203 (`inline_markdown`) with a piece of `content` — and nowhere in `inline_markdown` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `inline_markdown` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — deeptutor/notes/blocks.py:203
  • `validate_grant` is public, takes a document from its caller (line 316) and hands it to `walk`, which calls itself at line 329 (`walk`) with a piece of `value` (and at line 332) — and nowhere in `walk` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `walk` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — deeptutor/multi_user/grants.py:329
  • `exact_diff` is public and takes `before: Any` from its caller, and it calls itself at line 47 (`exact_diff`) with a piece of `before` (and at line 63) — and nowhere in `exact_diff` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `exact_diff` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — deeptutor/learning/outline_revision.py:47
  • `append_history` is public, takes a document from its caller (line 76) and hands it to `_clip_history_value`, which calls itself at line 72 (`_clip_history_value`) with a piece of `value` — and nowhere in `_clip_history_value` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_clip_history_value` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — deeptutor/co_writer/edit_agent.py:72
  • `inline_refs` is public, takes a document from its caller (line 49) and hands it to `_walk`, which calls itself at line 68 (`_walk`) with a piece of `node` (and at line 69, line 71) — and nowhere in `_walk` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_walk` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — deeptutor/api/routers/_partners_channel_schema.py:68
  • `collect_secret_fields` is public and takes `schema: dict[str, Any]` from its caller, and it calls itself at line 116 (`collect_secret_fields`) with a piece of `schema` — and nowhere in `collect_secret_fields` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `collect_secret_fields` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — deeptutor/api/routers/_partners_channel_schema.py:116

What to do

  • Each finding names the externally-callable member that accepts the document and the self-call that descends, and states that no depth parameter or counter exists anywhere in the walk. Confirm from the two, then thread a depth argument through the walk and reject documents past a fixed maximum, or rewrite it with an explicit stack.
X18 · Disposal-pattern correctness10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a type's disposal matches what it OWNS — releasing what it created, leaving alone what it was handed, and not declaring a finalizer for state that has nothing unmanaged to finalize.

Method: Roslyn syntax + semantics: every assignment to a disposable field is read to decide whether the type CREATED the value or was handed it, and the type's disposal is checked against that answer — an injected interface it disposes, a value it constructed and never releases, a finalizer on a type holding nothing unmanaged, and a disposable local whose every reference is a plain member read. A value handed to a container that disposes its contents (a parent control's `Controls` collection, a component `IContainer`) is released by that container and is not reported; generated code is out of population. On a repository with no .NET source the same ownership questions are read in JavaScript/TypeScript off the engine’s own token stream (test, vendored, generated and minified paths not): a class declaring `dispose()`, `[Symbol.dispose]()` or `[Symbol.asyncDispose]()` that disposes a field it was handed through a constructor parameter typed as a repository interface or resolved by a dependency-injection container; that assigns a field only ever from `new X(…)` of a disposable class and neither releases it anywhere in the class nor names it in its disposal member or a method that member calls, nor hands it to anything else; and a `const`/`let` local built from literals only whose every reference opens a statement operating on a non-release member of it. A class is disposable when every repository declaration of its name declares or inherits a disposal member, or when it is a documented library disposable (`vscode` EventEmitter, CancellationTokenSource and Disposable; three.js geometries, materials, textures, render targets, renderers, controls and composers). The finalizer arm has no JavaScript counterpart: a class cannot declare one. Dart is read for the owned-and-never-released arm: a Flutter `State` (or a class declaring `dispose()`/`close()`) whose library-private field is written only with direct creations of a framework controller, `FocusNode`, `StreamController` or periodic `Timer` (or a `.listen(…)` into a field declared `StreamSubscription`), which nothing in the class or its library releases (`dispose`/`close`/`cancel`) and which is never handed on except as a named argument. Ruby is read for the owned-and-never-released arm and the abandoned-local arm: a class declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose instance variable is written only with a blockless core descriptor creation (`File.open`/`new`, `Tempfile`, `Dir.open`, `IO.popen`, the `socket` and `openssl` socket classes) that no method of the class closes and that is never handed on (passed, returned, stored, exposed by `attr_reader`, delegated) — a class whose superclass or mixin lies outside the repository is not judged — and a blockless creation read through and dropped (`File.open(path).read`) or held in a local that is never closed, returned, passed or stored (a `&:read` block-pass, an `autoclose: false` borrow and a `fileno` hand-over are not abandonment). PHP is read for the same two arms: a class (not a trait, and not one using a trait) declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose `private` property (or a `final` class's `protected` one) is written only with a direct core `fopen`, `tmpfile`, `popen`, `proc_open`, `fsockopen`, `stream_socket_client`/`server` or `opendir` that nothing in the class closes (`fclose`, `pclose`, `closedir`, `unset`, a reset to `null`) and that is never handed on, and a handle held in a function's local, or read through as the argument of a reader, that is never closed, returned, passed, captured or stored; a `php://` stream, `curl_init`, `SplFileObject`, `PDO` and a function the repository declares under the core name are not read. Deterministic, provable per finding. Advisory.

X19 · Unrestored process-global state10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a method that temporarily changes state belonging to the whole process — the working directory, an environment variable — puts it back on EVERY path: a restore reached only when nothing throws leaks the change to the rest of the process.

Method: Roslyn syntax + semantics: method bodies that write the process working directory or an environment variable and write it back in the same body, checked for whether that restore sits in a `finally`/`catch` or only on the straight-line path. On a repository with no .NET source the same rule reads production JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not): `process.chdir`, `process.env.NAME =`/`["NAME"] =` and `delete process.env.NAME`, and Deno’s `Deno.chdir`/`Deno.env.set`/`Deno.env.delete`, paired per function body (a nested function or arrow is its own body, and module top-level code is none), where the last write puts back a local the body captured from the same global or deletes a variable the first write set, with at least one statement between them; a write in a `catch`/`finally` of that body silences it. Deterministic, provable per finding. Advisory.

X2 · Cancellation propagation8.0 / 10Strong✓ Tool-verified

Other · Code Health — Whether async functions that make a cancellable request accept or pass on an AbortSignal (adoption curve).

Method: Roslyn scan: every async method (excluding framework-fixed overrides/Blazor handlers) checked for CancellationToken parameter presence. Deterministic, adoption percentage. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same question: every named async function that itself makes a request an AbortSignal can cancel (global `fetch`, axios and its file-local instances, ky, ofetch) counts, and it is compliant when its parameters or body name a signal or it hands one of its own parameters to the request as options; signatures a framework fixes (JSX event handlers, route and lifecycle exports, request-first handlers, `override`, `'use server'` modules, TanStack `mutationFn`) are exempt unless they take a signal. Deterministic, adoption percentage.

  • Only 10/15 async functions that make a cancellable request (fetch, axios, ky, ofetch, got, undici, node:http) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
  • `apiFetch` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — web/shared/api/client.ts:28
  • `waitForServer` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — web/scripts/route_budgets.mjs:56
  • `loadRouteChunks` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — web/scripts/route_budgets.mjs:112
  • `assertRootRedirect` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — web/scripts/route_budgets.mjs:120
  • `fetchNode` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — apps/desktop/scripts/build-runtime.mjs:33

What to do

  • Thread an AbortSignal through async functions that make requests, so the work stops when its caller gives up.
X21 · Side-effecting pattern guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a `when` guard is free of side effects — a guard that increments a counter or assigns while deciding whether its arm matches applies that change during PATTERN MATCHING, on an arm that may not be selected, and skips it entirely when a short-circuit to its left answers first.

Method: Roslyn syntax: `when` guards on case labels and switch-expression arms, read for a mutation (`++`/`--`/assignment) sitting in a position the guard's own `&&`/`||`/`??`/`?:`/`?.` can skip. Deterministic, provable per finding. Advisory.

X22 · Contradicted release guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a method that TAKES a lock or semaphore and gives it back from a flag-guarded `finally` returns the value that flag implies — reporting success while the guard hands the primitive back admits a second caller the exclusion was there to keep out, and reporting failure while the guard keeps it leaves nothing to ever give it back. Also whether a `finally` that gives the primitive back unconditionally can run in a state where the method does not hold it: after a timed wait whose result was discarded, after an acquire inside the `try` that can fail, after the body already released it, or never, because a `return` left between the acquire and the `try`.

Method: Roslyn syntax: `try` statements whose `finally` releases a synchronisation primitive under a bare local-bool guard, where the method also TOOK that same primitive before the `try`, checked for a `return` of a bool literal whose value disagrees with the flag state the method's own straight-line assignments put it in. Deterministic, provable per finding. Advisory.

X23 · Unguarded diagnostic materialisation10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether the work a diagnostic log line costs is paid only when that line is wanted — C# evaluates a call's arguments BEFORE the call, so a trace/debug message joined or projected out of a collection is built in full on every pass, and then discarded by a sink the shipped configuration leaves switched off.

Method: Roslyn syntax: log calls at a diagnostic level (a `Log`-prefixed method naming Trace/Debug/Verbose, or a bare `Debug`/`Trace`/`Verbose` on a receiver named for a logger), whose argument list is read for a call whose cost scales with a sequence — a LINQ operator, a materialisation, `string.Join`, a serializer — with no enclosing level check or conditional-compilation region. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `debug`/`trace`/`verbose` call on a receiver named for a logger, or a `log`-prefixed method naming the level, whose argument calls an array operator (`map`/`filter`/`reduce`/`sort`/…), `Array.from`, `Object.keys/values/entries`, `JSON.stringify`/`util.inspect` over anything but a literal, or an array `join` — outside any arrow or function passed as an argument, which the logger calls only when the level is on — with no enclosing `if`, `&&` or `?:` whose condition names a level, a level string, or the `NODE_ENV`/`__DEV__`/`DEV` build switch. Deterministic, provable per finding. Advisory.

X24 · Document value interpolated into markup unescaped5.9 / 10Adequate✓ Tool-verified

Other · Security — Whether text read out of the document being converted is escaped before it is written into generated markup — a value the document's author chose, interpolated into an attribute the surrounding literal delimits, can close that attribute and open another.

Method: Roslyn semantic model over the whole compilation: a string-typed `Value`/`InnerText`/`InnerXml`/`Text` member declared inside `DocumentFormat.OpenXml` or `System.Xml` is a taint SOURCE, propagated through assignments, returns, arguments, tuple elements and string composition to its transitive closure, then read at interpolated-string holes that sit in a markup position the surrounding literal itself delimits. Escaper/encoder calls and enclosing validator conditions cut the flow. Flow- and container-insensitive by construction. A second arm needs no provenance at all and reports a type that CONTRADICTS ITSELF — the same expression escaped at one delimited markup hole and interpolated raw at another hole in the same markup position of the same type, which the type's own escaping proves is a defect without knowing where the value came from. On a repository with no .NET source it reads JavaScript/TypeScript off the token stream with the same rule: a DOM read of raw document text (`getAttribute`, `textContent`, `innerText`, `nodeValue`) is the source, propagated through local bindings and string composition, and judged at template-literal and concatenation holes in the same two delimited markup positions; escapers and validating conditions cut it, and documentation-site, test, vendored and minified scripts are not read. Deterministic, provable per finding. Advisory.

  • `svg` is text this program did not author, and it is written into the text of an element through `dangerouslySetInnerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. (×2) — web/components/Mermaid.tsx:176, REDACTED:142
  • `themeScript` is text this program did not author, and it is written into the text of an element through `dangerouslySetInnerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — web/components/ThemeScript.tsx:59
  • `html` is text this program did not author, and it is written into the text of an element through `dangerouslySetInnerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — REDACTED:31

What to do

  • Each finding names the expression, the attribute it lands in and the line. Confirm the value's origin from the read this analyzer traced, then escape it at the sink or validate it against the shape the attribute accepts before interpolating.
X25 · Inert configuration knob10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a value the caller is invited to supply is the value the type actually uses — a constructor parameter stored in a private field that nothing ever reads while the default it was given is spelled out a second time at the site that should have read it, a keyed lookup that falls back to a different setting than the one its key names while the same type falls back to the matching one for that same key, or a culture-sensitive parse given no format provider by a type that feeds its own settable culture to the same kind of parse elsewhere, or a number an entry point writes to standard output under the host's culture while the same entry point formats with the invariant culture elsewhere. Either way, every caller who supplies a value silently gets something else.

Method: Roslyn syntax: private instance fields of a non-partial type assigned in a constructor from one of its own parameters with a `??` fallback, checked for whether anything in the type body reads the field and whether that same fallback expression is spelled out again outside the constructor; and `??` fallbacks onto a member access from a lookup call carrying exactly one string literal, grouped by that key across the type and checked for a fallback member whose folded name disagrees with the key while a sibling site for the same key agrees with it. On a repository with no .NET source the first two arms read JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `#x`, `private` or `private` parameter-property instance field filled in the constructor from a parameter (or one member of one) through `??`/`||` or a parameter default, never read anywhere in the file by name, whose constructed default is spelled again in the class body; and `lookup("key") ?? s.member` grouped by key per class, or per module outside every class. The culture arm has no JavaScript counterpart: its parses take no locale. Deterministic, provable per finding. Advisory.

X26 · Unsynchronised callback handoff10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a value handed from a callback to the body that waits on it crosses on something built to be crossed — a `Queue<T>`/`List<T>`/`Dictionary<K,V>` written inside an event handler and read back outside it is mutated by two flows at once, and the semaphore or completion source beside it orders how MANY items exist while leaving the collection's own head, tail and backing array unprotected.

Method: Roslyn syntax: method, accessor, local-function and lambda bodies that declare BOTH a non-thread-safe generic collection (`Queue`/`Stack`/`List`/`Dictionary`/`HashSet`/`Sorted*`/`LinkedList`) and a synchronisation primitive (`SemaphoreSlim`/`TaskCompletionSource`/`ManualResetEvent(Slim)`/`AutoResetEvent`/`CountdownEvent`) as locals, then read for a `+=`-registered lambda that raises that primitive while the body outside every lambda waits on it — and, in that scope, a mutating call on the collection inside the lambda paired with a mention of it outside. Any `lock` in the scope abstains it. On a repository with no .NET source the same handoff is read in Java off the engine’s own token stream (test source sets, vendored and demonstration paths not): an `ArrayList`/`LinkedList`/`ArrayDeque`/`PriorityQueue`/`Hash*`/`LinkedHash*`/`Tree*` local and a `CountDownLatch`/`Semaphore`/`CompletableFuture` local, a lambda or anonymous class that raises the primitive and mutates the collection, and a wait outside it; any `synchronized` or `lock()` abstains the body. Because each of those primitives orders what the callback wrote before raising it, only a touch that provably overlaps the callback is convicted: one after the registration and before the next wait, or one in a loop registered-before, waiting on every pass and not declaring the collection. Deterministic, provable per finding. Advisory.

X27 · Collection changed while being enumerated10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a `for` loop leaves the `dict`, `set` or `deque` it is walking alone — CPython's iterators over those check that the collection has not changed size since the loop began, so a body that removes from (or empties) the very collection the loop is walking makes the next step raise `RuntimeError: dictionary changed size during iteration` and the remaining items are never seen.

Method: Roslyn syntax + semantics: `foreach` statements whose body calls a structural mutator (`Add`/`Remove`/`Clear`/`Insert`/…) on the very expression the loop is enumerating. Two arms. ARM A — the source is a concrete fragile BCL collection, or a live `Keys`/`Values` view over one, and the mutator resolves to that same collection's own member; concurrent and immutable collections and arrays are outside the population by construction, since their enumerators survive a structural change. ARM B — the source is an argument-less accessor CALL on a receiver whose body is in source: the accessor must return a stored field VERBATIM and a sibling member must structurally change that same field, both read off the implementations rather than from the members' names. A mutation the loop provably exits immediately after (`break`/`return`/`throw`/`goto`), or one written inside a nested loop or a lambda, is counted and never reported. Deterministic, provable per finding. Advisory.

X28 · Index access outside its own emptiness guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a condition that tests a value for emptiness indexes that same value only where the test holds — an `||` written one parenthesis too far to the left leaves an index access outside the guard beside it, so the empty case the guard exists to anticipate reaches the index and throws.

Method: Roslyn syntax only, no semantic model: the OUTERMOST `&&`/`||` of every boolean condition, read for a symbol the condition tests for emptiness (`string.IsNullOrEmpty`/`IsNullOrWhiteSpace`, a `Length`/`Count` comparison against a literal, `Any()`, a `Length`/`Count` pattern, or a comparison against `""`) and ALSO indexes. Each `symbol[...]` access is placed by a boolean-reachability walk from the access up to the outermost connective: an access is COVERED when some enclosing step has it in the right operand and the left operand, under the truth value that step forces, proves the symbol non-empty — a recursion over `&&`/`||` whose true- and false-directions are asymmetric. A finding needs BOTH an uncovered access and a covered one on the same symbol in the same condition, which is the agreeing twin that separates a misplaced parenthesis from an unrelated length test. Bare index accesses with no emptiness test in the condition are neither counted nor reported; a non-identifier receiver and a lambda nested inside the condition are outside the population. Deterministic, provable per finding. Advisory.

X29 · Per-element action decided by a fixed element10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a decision taken once per element is taken ABOUT that element — a test inside a counted loop that reads a fixed subscript of the very collection its guarded statement indexes by the loop variable applies element zero's answer to all of them, so the elements that differ from it are all handled wrongly, and in the same direction.

Method: Roslyn syntax only, no semantic model: every `for` statement declaring exactly ONE loop variable, and every `if` inside its body that is not under a nested loop or a lambda. A site enters the population when the `if`’s condition never mentions the loop variable while the statement it guards indexes some collection by that variable ALONE (`c[i]`; `c[i + 1]` and `c[i, j]` are outside it). A finding additionally needs the AGREEING TWIN at the same-collection grain: the condition must read THAT SAME collection at a subscript that does not move — written into the condition, or reached through a local declared BEFORE the loop, so an alias bound inside the body is not followed. Both collection expressions must be simple identifiers. On a repository with no .NET source the same rule reads JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `for (let|var|const x = …; …; …)` with one declarator and a braced body, an alias followed only when it is declared before the loop in a block that encloses it and never assigned inside the loop. Deterministic, provable per finding. Advisory.

X3 · Exception handling5.5 / 10Adequate✓ Tool-verified

Other · Code Health — Whether exceptions are handled rather than silently swallowed or rethrown with lost stack traces.

Method: Roslyn syntax scan: every catch clause counted; empty catches and bare rethrows flagged. Population is all catch clauses, not estimated. Deterministic, hard fact.

  • An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it. (×35) — web/shared/storage/store.ts:173, web/shared/storage/store.ts:174, web/shared/api/client.ts:218, …
  • `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter. (×5) — web/lib/book-ws-operation.ts:102, web/lib/quiz-judge.ts:87, web/lib/use-book-stream.ts:75, …

What to do

  • Swallowed exception (empty catch)
X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a guard written as a NEGATED `||` says what its author meant — `!(a || b || x != k)` is `!a && !b && x == k` by De Morgan, so a bail-out that mixes capabilities the code needs with a fault it refuses turns inside out: it fires only where the capabilities are ABSENT, and lets every value the fault term names walk straight into the body that cannot handle it.

Method: Roslyn syntax only, no semantic model: every logical-not whose operand is a parenthesised `||` chain of two or more disjuncts, flattened (a left-nested `a || b || c` read once would see `(a || b)` as one disjunct). A site enters the population on that shape alone. A finding additionally needs the disjuncts to DISAGREE in polarity: at least one bare boolean read — an identifier or member access, never an invocation, which is a predicate rather than a capability flag — and at least one `x != <constant>`, the only form that negates into an exact-value pin (`== null` negates into a looser requirement and is outside the fault set). Consistently-polarised disjunctions, all-fault or all-capability, are counted and never reported; a negated `&&` is outside the population entirely. No same-receiver gate: it was measured to cost a real defect and remove no false positive. Deterministic, provable per finding. Advisory.

X4 · Structured logging4.6 / 10Weak✓ Tool-verified

Other · Code Health — Whether log calls use message templates (queryable) rather than interpolated strings.

Method: Roslyn syntax scan: every log call-site counted; interpolated-string first-argument violations flagged. Population is all log calls, not estimated. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `trace`/`debug`/`info`/`warn`/`error`/`fatal`/`verbose`/`silly`/`http`/`log` call on a receiver named for a logger, in a package whose own or an enclosing `REDACTED` declares a logger that carries values as fields (pino, pino-http, nestjs-pino, Fastify, winston, bunyan, tslog, LogTape, roarr), whose first deciding argument is a template literal with substitutions; an object-literal fields argument is stepped over, a plain string message clears the call. Python is read the same way: a `debug`/`info`/`warning`/`error`/`exception`/`critical`/`log` call on a logger in a file that imports the standard library’s `logging` or structlog (loguru, which formats at the call, is not judged), whose message is a whole f-string with a non-constant field; a `%`-formatted, `.format()`-ed or concatenated message is not convicted, as in C#. PHP is read the same way: a PSR-3 level call (`emergency`…`debug`, `log`) on a logger (`$logger`, `$this->logger`, Laravel’s `Log::`, `logger()`, `\Drupal::logger()`) in a package whose `composer.json` requires a PSR-3 logger or a framework that hands one out (psr/log, Monolog, Laravel, Symfony, Drupal, CakePHP), or a file that imports one, whose message is a double-quoted string interpolating a variable; a single-quoted message clears the call, and `sprintf` or `.` concatenation is not convicted, as in C#. Dart is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on Sentry’s structured logger (`Sentry.logger`) whose message is a whole string literal interpolating a value (`$name`, `${…}`); the `Sentry.logger.fmt` template API clears the call. Dart that logs only through loggers with one message and no fields (package:logging, package:logger, talker, dart:developer) is not applicable rather than a reach gap. Ruby is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on the console gem’s `Console` (declared by a Gemfile, gemspec or Gemfile.lock, or required) or, where SemanticLogger, Ougai or dry-logger is declared or required, on a receiver named for a logger (`logger`, `@logger`, `Rails.logger`, `log`), whose first deciding argument is, as the whole argument, a double-quoted string interpolating a non-constant value (`#{…}`, `#@ivar`); a plain literal clears the call, keyword arguments are the fields, and a block, `%`-format or `+` concatenation is not convicted. Ruby that logs only through the standard Logger (Rails.logger) is not applicable rather than a reach gap. Deterministic.

  • `debug` at line 258 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — deeptutor/utils/file_types.py:258
  • `debug` at line 108 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — deeptutor/utils/json_parser.py:108
  • `debug` at line 122 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — deeptutor/utils/json_parser.py:122
  • `debug` at line 166 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — deeptutor/utils/json_parser.py:166
  • `debug` at line 179 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — deeptutor/utils/json_parser.py:179
  • `debug` at line 180 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — deeptutor/utils/json_parser.py:180
  • `warning` at line 200 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — deeptutor/utils/json_parser.py:200
  • `info` at line 76 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — deeptutor/tools/vision/image_utils.py:76
  • `info` at line 101 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — deeptutor/tools/vision/image_utils.py:101
  • `debug` at line 150 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — deeptutor/tools/vision/image_utils.py:150
  • `debug` at line 189 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — deeptutor/tools/vision/image_utils.py:189
  • `debug` at line 206 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — deeptutor/tools/vision/image_utils.py:206
  • `info` at line 214 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — deeptutor/services/auth.py:214
  • `warning` at line 382 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — deeptutor/services/auth.py:382
  • `warning` at line 406 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — deeptutor/services/auth.py:406
  • `info` at line 91 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — deeptutor/services/pocketbase_client.py:91
  • `error` at line 93 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.error("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.error("order moved", order_id=order_id, status=status)` with structlog. — deeptutor/services/pocketbase_client.py:93
  • `debug` at line 160 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog. — deeptutor/services/pocketbase_client.py:160
  • `info` at line 183 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog. — deeptutor/services/pocketbase_client.py:183
  • `warning` at line 185 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — deeptutor/services/pocketbase_client.py:185
  • `warning` at line 191 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — deeptutor/services/pocketbase_client.py:191
  • `warning` at line 282 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — deeptutor/services/setup/init.py:282
  • `warning` at line 299 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — deeptutor/services/setup/init.py:299
  • `warning` at line 388 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — deeptutor/services/session/pocketbase_store.py:388
  • `warning` at line 495 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — deeptutor/services/session/pocketbase_store.py:495
  • `warning` at line 514 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — deeptutor/services/session/pocketbase_store.py:514
  • `warning` at line 533 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — deeptutor/services/session/pocketbase_store.py:533
  • `warning` at line 556 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — deeptutor/services/session/pocketbase_store.py:556
  • `warning` at line 585 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — deeptutor/services/session/pocketbase_store.py:585
  • `warning` at line 643 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — deeptutor/services/session/pocketbase_store.py:643
  • `warning` at line 741 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — deeptutor/services/session/pocketbase_store.py:741
  • `warning` at line 800 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — deeptutor/services/session/pocketbase_store.py:800
  • `warning` at line 835 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — deeptutor/services/session/pocketbase_store.py:835
  • `warning` at line 855 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — deeptutor/services/session/pocketbase_store.py:855
  • `warning` at line 908 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — deeptutor/services/session/pocketbase_store.py:908
  • `warning` at line 981 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — deeptutor/services/session/pocketbase_store.py:981
  • `warning` at line 1038 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — deeptutor/services/session/pocketbase_store.py:1038
  • `warning` at line 1061 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — deeptutor/services/session/pocketbase_store.py:1061
  • `warning` at line 1096 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — deeptutor/services/session/pocketbase_store.py:1096
  • `warning` at line 1327 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog. — deeptutor/services/session/pocketbase_store.py:1327

What to do

  • Interpolated log message defeats structured logging
X5 · Nullable reference types9.8 / 10Exemplary✓ Tool-verified

Other · Code Health — Whether strict null checking is enabled and not undermined by heavy `!` assertion — TypeScript's `strictNullChecks` (which `strict` turns on) is what makes `string` exclude `null` and `undefined`, and the postfix `!` is the operator that silences it.

Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.

  • ~0.4 `!` null assertions per 1k TypeScript source lines — 102 assertion(s) across the 229829 source line(s) of the 1056 TypeScript file(s) read, which is the only code the operator asserts anything in (a `!` in a `.js` file is not this operator and was not counted, and one in a file whose null checking is off silences nothing). Densest: web/lib/memory-graph.ts (6), web/features/calendar/components/MonthView.tsx (5), web/features/calendar/components/TimeGrid.tsx (5). Each one tells the compiler to trust the author about null, suppressing the very diagnostic `strictNullChecks` exists to produce.

What to do

  • The findings name the configuration each number was taken from and, for the assertions, the files that hold them. Turn null checking on where it is off — `"strict": true` in the base tsconfig that the others extend switches `strictNullChecks` on with the rest of the family — and then resolve the assertions rather than adding to them. A `!` on a value the checker could show to be null is a promise the author cannot check from where they are standing, and each one is a `TypeError: Cannot read properties of null` waiting for the path that makes it true; where the value genuinely cannot be null, say something the checker can see instead (narrow it with a test, make the property required, drop the `?`).

WCAG coverage — what static analysis assessed

Statically assessed 15 of 55 WCAG 2.2 Level A/AA success criteria (27%; ≈30% of the 50 WCAG 2.1 AA criteria for EN 301 549). The other 40 require runtime or manual evaluation. Partial signal only (a clean result is necessary, not sufficient; static analysis fully verifies none). This is accessibility readiness, not a conformance claim — a WCAG conformance claim requires manual evaluation (WCAG-EM 1.0).

DimensionWCAG 2.2 A/AA criteriaCoverage
AC1 · Text alternatives1.1.1, 1.2.2, 1.2.5Partial signal
AC2 · Forms & labels1.3.1, 3.3.2, 4.1.2Partial signal
AC3 · Page structure1.4.4, 2.2.1, 2.4.1, 2.4.2, 3.1.1, 4.1.2Partial signal
AC4 · Keyboard semantics2.1.1, 2.4.3Partial signal
AC5 · ARIA correctness4.1.2Partial signal
AC6 · Visual & motion safety1.4.3, 2.4.7Partial — literal CSS only
AC7 · A11y enforcementenforcement — no page criterionEnforcement posture (process)

Not statically assessed — these 40 Level A/AA criteria need runtime or manual evaluation (WCAG-EM): 1.2.1, 1.2.3, 1.2.4, 1.3.2, 1.3.3, 1.3.4, 1.3.5, 1.4.1, 1.4.2, 1.4.5, 1.4.10, 1.4.11, 1.4.12, 1.4.13, 2.1.2, 2.1.4, 2.2.2, 2.3.1, 2.4.4, 2.4.5, 2.4.6, 2.4.11, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.5.7, 2.5.8, 3.1.2, 3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.6, 3.3.1, 3.3.3, 3.3.4, 3.3.7, 3.3.8, 4.1.3.

Reference — by lens

The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.

LensScoreRatingImpact
Code Health57%Adequate — gated by D1, D2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture57%Adequate — gated by D26, AX7Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Maturity74%StrongStrongest area.
Readiness34%Weak — gated by R8, P3, P7Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security71%Adequate — gated by D28, D29, D30Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Accessibility45%Weak — gated by AC4Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Performance60%AdequateAcceptable, with room to improve.
Unscored — 3 check(s) recorded observations but carry no score

These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.

  • X10 Duplicated predicate — 25 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X6 Hand-rolled structured-format parsing — 6 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X7 Silent fallback defaults — 40 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 1 control(s) we could not find positive evidence for

These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.

  • P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 40 check(s) not relevant to this codebase

These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.

  • AX1 Captive dependencies — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX4 Dependency direction — not applicable to a vertical-slice architecture (the inward-dependency rule is for layered/clean styles)
  • AX8 Test isolation — no test/production split to check
  • AX9 CQS / query purity — no CQRS query handlers detected — query purity is not applicable to this codebase
  • AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • AXR1 Runtime accessibility — compose up failed (exit 1 — a container did not start, exited, or never became healthy) — deeptutor Pulling pocketbase Pulling deeptutor Pulled pocketbase Pulled Container deeptutor-pocketbase Error dependency failed to start: container deeptutor-pocketbase is unhealthy; runtime evidence skipped This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
  • C1 Data Protection — Not assessed: these personal data controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks personal data controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C3 Audit Trail — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Django, SQLAlchemy, SQLModel, Peewee, Tortoise or MongoEngine model, a migration or a SQL schema — and no database or data-store client (Django ORM, SQLAlchemy, psycopg, PyMongo, …) in the source either, so this repository keeps no sensitive data whose changes an audit trail would record. If it does (through a store configured outside this repository, for instance), the trail belongs to wherever that data is stored.
  • C4 Data Retention — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential on a Django, SQLAlchemy, SQLModel, Peewee, Tortoise or mongoengine model, in a migration or in a SQL schema — and no database or data-store client (django.db, sqlalchemy, psycopg2, pymongo, sqlite3, …) imported either, so this repository keeps no personal data whose lifetime a retention limit would bound.
  • C5 Data-Subject Rights — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential on a Django, SQLAlchemy, SQLModel, Peewee, Tortoise or mongoengine model, in a migration or in a SQL schema — and no database or data-store client (django.db, sqlalchemy, psycopg2, pymongo, sqlite3, …) imported either, so this repository keeps no personal data for a data subject to erase, export or consent over.
  • D12 Dependency Hygiene — Not scored — 27 shipped Python distribution(s) were read, but the outdated signal needs pypi.org, and no declaration here carries an exact pin to ask about — a floor or a range installs the newest release it admits and cannot be behind one, so this dimension's own question is only partly answered. NOT a finding that these dependencies are current or healthy.
  • D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
  • D21 Naming Consistency — Naming consistency is measured on C# and TypeScript only; JavaScript, Python, Swift not measured.
  • D22 Internal API Consistency — The exposed public-API surface could not be collected — no C#/VB projects loaded.
  • D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ sibling projects each declaring an entity of their own or taking another project's integration events. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D25 ADR Conformance — no ADRs to check
  • D32 Data Compliance (PII/GDPR) — 13 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
  • D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
  • D39 IL Efficiency — D39 measures the IL emitted by a .NET build; this repository has no .NET solution or project files, so the dimension does not apply.
  • D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
  • D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
  • D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
  • D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
  • D8 Code Coverage — Coverage not measured — polyglot repository, one half has no runner
  • DM1 Domain Modelling — applicable but not scored (2 of 3 signals for this style — below the bar we score at): 283 value object(s); 2 domain event(s); its domain events are published by services or handlers — no domain entity raises one
  • ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and this analysis resolves a call's owner only where the receiver's type is written down in the source. Reported as guidance rather than measured
  • ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
  • ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
  • GD1 Unfinished & placeholder code — no source files were read — this check reads C#, F#, JavaScript/TypeScript, Dart, Ruby and Scala, and none was read for this repository's product. That is a limit of the analyzer, not a finding about your code.
  • IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
  • P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
  • P9 Domain vs controller coverage — coverage data present for 44 file(s), but no domain-layer files were identified: no covered file's path contains any of the markers this check keys on (/domain/, /aggregates/, /valueobjects/, /domainmodel/, .domain/, /entities/), which are matched case-insensitively anywhere in the path. With no domain partition there is nothing to compare the web/controller layer against — if this repository keeps its business rules under a folder named none of those, that naming is what the check cannot see, not the domain logic.
  • PF1 Benchmark discipline — Not applicable: no benchmark suite was found. This check searched for a pytest-benchmark or pytest-codspeed dependency with tests taking the `benchmark` fixture, an asv.conf.json with its `time_`/`mem_`/`peakmem_` benchmarks, or a pyperf Runner, and for a `*benchmark*` script that this repository's CI runs. Benchmarks are credited as a bonus, so their absence is neither scored nor deducted.
  • PF2 Allocation hygiene — Not applicable: allocation awareness is rated where code engineers for it — at least 400 production lines that ship benchmarks or already use allocation-aware idioms (8 or more). This repository's Swift code has 70 production line(s), 0 such use(s) and no benchmarks, so there is no allocation work to rate. The card is reward-only: its absence costs nothing.
  • S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.

Appendix A — Findings (grouped)

The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.

Critical — 179 finding(s)
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • + 17 more in this group — see findings.md.
D28 · Secrets (history) · REDACTED · ×35
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • + 10 more in this group — see findings.md.
AC2 · Forms & labels · <input> without a programmatic label · ×18
  • <input> without a programmatic label web/app/(workspace)/learning/books/components/SpineEditor.tsx:491 — This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <input> without a programmatic label web/app/(workspace)/partners/groups/[groupId]/page.tsx:336 — This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <input> without a programmatic label web/app/(workspace)/partners/groups/new/page.tsx:149 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label web/app/(workspace)/partners/new/page.tsx:309 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label web/app/(workspace)/partners/new/page.tsx:324 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label web/components/SessionList.tsx:170 — This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <input> without a programmatic label web/components/SessionList.tsx:276 — This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <input> without a programmatic label web/components/agents/ConnectedAgents.tsx:302 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label web/components/agents/ConnectedAgents.tsx:324 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label web/components/chat/BookReferencePicker.tsx:242 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label web/components/chat/HistorySessionPicker.tsx:252 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label web/components/chat/MyAgentsPicker.tsx:364 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label web/components/chat/PersonaPicker.tsx:123 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label web/components/chat/QuestionBankPicker.tsx:266 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label web/components/chat/ReadingReferencePicker.tsx:341 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label web/components/cli-apps/CliAppsSection.tsx:459 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label web/components/knowledge/CreateKbModal.tsx:1169 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label web/components/knowledge/CreateKbModal.tsx:1210 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
D30 · Dependency Vulnerabilities · High CVE · ×15
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
AC4 · Keyboard semantics · Click handler on a non-interactive <div> · ×11
  • Click handler on a non-interactive <div> web/components/chat/home/ComposerResources.tsx:287 — A click handler on a plain element with no role and no tabindex: even where another element's key handler can reach it, assistive tech can neither focus it nor announce what it is. Use a <button>, or add role + tabIndex={0}.
  • Click handler on a non-interactive <div> web/components/knowledge/KbDocumentList.tsx:277 — A click handler on a plain element with no role and no tabindex: even where another element's key handler can reach it, assistive tech can neither focus it nor announce what it is. Use a <button>, or add role + tabIndex={0}.
  • Click handler on a non-interactive <div> web/components/knowledge/KbDocumentList.tsx:424 — A click handler on a plain element with no role and no tabindex: even where another element's key handler can reach it, assistive tech can neither focus it nor announce what it is. Use a <button>, or add role + tabIndex={0}.
  • Click handler on a non-interactive <div> web/components/layout/AppShell.tsx:87 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
  • Click handler on a non-interactive <div> web/components/math-animator/MathAnimatorViewer.tsx:193 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
  • Click handler on a non-interactive <div> web/components/memory/MemorySection.tsx:1437 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
  • Click handler on a non-interactive <div> web/components/notebook/NotebookSelector.tsx:169 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
  • Click handler on a non-interactive <div> web/components/reading/library/ReadingLibrary.tsx:343 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
  • Click handler on a non-interactive <div> web/components/reading/workspace/ReadingCompanion.tsx:376 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
  • Click handler on a non-interactive <div> web/components/reading/workspace/WorkspaceMenu.tsx:87 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
  • Click handler on a non-interactive <div> REDACTED:409 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
AC2 · Forms & labels · <label> that labels no control · ×9
  • <label> that labels no control web/app/(workspace)/partners/groups/[groupId]/page.tsx:333 — This <label> has no htmlFor and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label htmlFor="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control web/app/(workspace)/partners/groups/[groupId]/page.tsx:342 — This <label> has no htmlFor and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label htmlFor="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control web/app/(workspace)/partners/new/page.tsx:306 — This <label> has no htmlFor and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label htmlFor="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control web/app/(workspace)/partners/new/page.tsx:321 — This <label> has no htmlFor and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label htmlFor="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control web/app/(workspace)/partners/new/page.tsx:332 — This <label> has no htmlFor and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label htmlFor="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control web/app/(workspace)/partners/new/page.tsx:338 — This <label> has no htmlFor and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label htmlFor="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control web/components/agents/ConnectedAgents.tsx:271 — This <label> has no htmlFor and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label htmlFor="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control web/components/agents/ConnectedAgents.tsx:299 — This <label> has no htmlFor and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label htmlFor="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
  • <label> that labels no control web/components/agents/ConnectedAgents.tsx:318 — This <label> has no htmlFor and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label htmlFor="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
AC2 · Forms & labels · <textarea> without a programmatic label · ×7
  • <textarea> without a programmatic label web/app/(workspace)/learning/books/components/BookChatPanel.tsx:605 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <textarea> without a programmatic label web/app/(workspace)/learning/books/components/blocks/BlockBodyEditor.tsx:52 — This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <textarea> without a programmatic label web/app/(workspace)/learning/books/components/blocks/UserNoteBlock.tsx:93 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <textarea> without a programmatic label web/app/(workspace)/partners/groups/[groupId]/page.tsx:345 — This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <textarea> without a programmatic label web/app/(workspace)/partners/groups/new/page.tsx:156 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <textarea> without a programmatic label web/components/chat/home/AskUserOptions.tsx:1538 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
  • <textarea> without a programmatic label web/components/chat/home/SubagentTabBody.tsx:143 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D31 · IaC & Container Security · High IaC · ×6
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
AC2 · Forms & labels · <button> with no accessible text · ×4
  • <button> with no accessible text web/app/(workspace)/learning/books/components/BookChatPanel.tsx:478 — A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
  • <button> with no accessible text web/app/(workspace)/learning/books/components/BookChatPanel.tsx:578 — A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
  • <button> with no accessible text web/app/(workspace)/learning/books/components/BookHealthBanner.tsx:359 — A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
  • <button> with no accessible text web/app/(workspace)/partners/groups/[groupId]/page.tsx:324 — A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
AC2 · Forms & labels · <select> without a programmatic label · ×2
  • <select> without a programmatic label web/components/knowledge/CreateKbModal.tsx:1047 — This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <select> without a programmatic label web/components/knowledge/CreateKbModal.tsx:1080 — This control has no associated label. Add a <label htmlFor> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · Critical CVE · ×2
  • REDACTED
  • REDACTED
AC4 · Keyboard semantics · Clickable role="button" that no keyboard user can reach · ×1
  • Clickable role="button" that no keyboard user can reach web/components/activity/ActivityRow.tsx:107 — This <div> announces itself as a role="button" and binds a click, but nothing can put focus on it: no tabIndex={0} in any spelling, no key handler, and nothing in this file moves focus or sets aria-activedescendant. The role tells assistive tech what the control IS; it does not make the control reachable, so a keyboard user cannot operate it at all (WCAG 2.1.1). Give it tabIndex={0}="0" and an Enter/Space key handler, or make it a native <button>. If a parent widget owns the keyboard model, that parent must move focus onto the active role="button" or point aria-activedescendant at it.
AC4 · Keyboard semantics · Hover-only interaction on <nav> · ×1
  • Hover-only interaction on <nav> web/components/chat/home/TurnNavigator.tsx:271 — This <nav> binds mouse-enter and mouse-leave and nothing else — no click, no key handler, no focus handler, and no tabIndex={0}, so it cannot even take focus. A keyboard user cannot hover, so whatever the pair reveals or highlights is reachable with a mouse only. Bind the same state to focus/blur as well, and add tabIndex={0}="0" so the element can receive that focus.
AC4 · Keyboard semantics · Click handler on a non-interactive <circle> · ×1
  • Click handler on a non-interactive <circle> web/components/memory/MemoryGraph.tsx:734 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
AC4 · Keyboard semantics · Hover-only interaction on <div> · ×1
  • Hover-only interaction on <div> web/components/partners/PartnerComposer.tsx:569 — This <div> binds mouse-enter and mouse-leave and nothing else — no click, no key handler, no focus handler, and no tabIndex={0}, so it cannot even take focus. A keyboard user cannot hover, so whatever the pair reveals or highlights is reachable with a mouse only. Bind the same state to focus/blur as well, and add tabIndex={0}="0" so the element can receive that focus.
AC4 · Keyboard semantics · Clickable role="separator" that no keyboard user can reach · ×1
  • Clickable role="separator" that no keyboard user can reach web/components/quiz/QuizConfigPanel.tsx:749 — This <div> announces itself as a role="separator" and is operated by pointerdown, pointerup and pointermove, but nothing can put focus on it: no tabIndex={0}, no key handler, and nothing in its scripts moves focus. A keyboard cannot produce a pointer drag, so the control cannot be operated at all (WCAG 2.1.1). Give it tabIndex={0}="0" and move it with the arrow keys in a key handler (with aria-valuenow for the position it holds).
AC4 · Keyboard semantics · Double-click handler on a non-interactive <span> · ×1
  • Double-click handler on a non-interactive <span> web/components/settings/ModelCards.tsx:202 — This <span> binds double-click and nothing else. No click, no key handler, and no tabIndex={0}, so it cannot even take focus. Nothing synthesises a double-click from the keyboard: Enter and Space fire a single click, and only on a native <button> or <a href>. So this behaviour has no keyboard path at all. Expose the same action on a real control, or add role + tabIndex={0} + a key handler alongside the double-click.
AC4 · Keyboard semantics · Double-click handler on a non-interactive <h3> · ×1
  • Double-click handler on a non-interactive <h3> REDACTED:53 — This <h3> binds double-click and nothing else. No click, no key handler, and no tabIndex={0}, so it cannot even take focus. Nothing synthesises a double-click from the keyboard: Enter and Space fire a single click, and only on a native <button> or <a href>. So this behaviour has no keyboard path at all. Expose the same action on a real control, or add role + tabIndex={0} + a key handler alongside the double-click.
AC5 · ARIA correctness · Unknown ARIA attribute "aria-hidden · ×1
  • Unknown ARIA attribute "aria-hidden:a" web/app/(workspace)/learning/books/components/PageOutlineNav.tsx:203 — This is not a valid WAI-ARIA attribute, so assistive technology ignores it (usually a typo). Use the correct aria-* attribute.
D11 · Test Reliability · Test suite cannot be installed from its own lockfile · ×1
  • Test suite cannot be installed from its own lockfile: web/ — The vitest suite in web/ was never exercised because its dependency install refused the committed lockfile — the dependency install for web/ refused the committed lockfile (npm error code EUSAGE), so the suite never ran. The suite is declared and committed but cannot be installed from what the repository ships, so neither this scan nor a new contributor can run it. The ask is the one the owner performs: run the install locally and commit the lockfile it writes.
D14 · License Compliance · Banned license · ×1
  • Banned license: pyte — `pyte` 0.8.2 is published on PyPI under `LGPL-3.0`, which this policy bans, and it is in the SHIPPED closure of this repository — so it is installed by everything that depends on this repository, not just by its test environment. A distribution offering SEVERAL licences is a choice and is only charged when every one of them is banned. Replace the package, or record an accepted exception. ★ The licence that makes this row is LGPL-3.0, and unmodified use is often permitted: the LGPL lets your code use an UNMODIFIED copy of the library that stays a separately installed package (its own entry in node_modules, site-packages or the gem path, which a user can replace) without your code coming under the LGPL. What it then asks is that you pass on its licence and notices and let users swap in their own build of it (LGPL-3.0 section 4). Modifying it, copying its code into yours, or merging it into one bundled or statically linked artifact is where the obligations grow, and this policy cannot see which you do — that is why it denies LGPL-3.0 by default. If you use it unmodified and separately installed, allow it in your repository's licence policy rather than replacing it: add `LGPL-3.0-only` / `LGPL-3.0-or-later` to the allow-list of the licence check your CI runs (`license-checker --onlyAllow`, the `allow-licenses` input of GitHub's dependency-review-action, `[licenses] allow` in cargo-deny's deny.toml), record why in the same change, and hide this row on the findings page with that reason. This scan's banned set is not read from that file, so the row stays until it is hidden.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · Critical vulnerability · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · High vulnerability · ×1
  • REDACTED
R8 · Dependency Hygiene · Unlisted import 'quickjs-emscripten' · ×1
  • Unlisted import 'quickjs-emscripten' tests/services/sandbox/javascript.test.mjs:7 — Imported but not declared in any reachable REDACTED — installs work only by hoisting accident.
R8 · Dependency Hygiene · Unlisted import '@tiptap/pm' · ×1
  • Unlisted import '@tiptap/pm' web/features/notes/components/NoteEditor.tsx:90 — Imported but not declared in any reachable REDACTED — installs work only by hoisting accident.
R8 · Dependency Hygiene · Unlisted import 'jszip' · ×1
  • Unlisted import 'jszip' web/tests/epub-reader.audit.ts:2 — Imported but not declared in any reachable REDACTED — installs work only by hoisting accident.
R8 · Dependency Hygiene · Unlisted import 'prettier' · ×1
  • Unlisted import 'prettier' web/scripts/generate-contracts.mjs:6 — Imported but not declared in any reachable REDACTED — installs work only by hoisting accident.
R8 · Dependency Hygiene · Unlisted import 'sharp' · ×1
  • Unlisted import 'sharp' web/scripts/sync-logo-assets.mjs:7 — Imported but not declared in any reachable REDACTED — installs work only by hoisting accident.
Serious — 3840 finding(s)
D15 · Churn × Complexity Hotspots · Hotspot · ×329
  • Hotspot: web/features/chat/ChatStateAdapter.tsx web/features/chat/ChatStateAdapter.tsx:2031 — web/features/chat/ChatStateAdapter.tsx changed 46 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 457 in ChatStateAdapter.ChatStateAdapterProvider at line 2031. 30 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 00:50:27 +08:00' --until='2026-11-01 00:50:27 +08:00' --full-history --no-merges -- web/features/chat/ChatStateAdapter.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: web/features/chat/components/ChatWorkspace.tsx web/features/chat/components/ChatWorkspace.tsx:274 — web/features/chat/components/ChatWorkspace.tsx changed 53 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 341 in ChatWorkspace.ChatWorkspace at line 274. 22 of those changes were fix/bug commits, and the other 31 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 00:50:27 +08:00' --until='2026-11-01 00:50:27 +08:00' --full-history --no-merges -- web/features/chat/components/ChatWorkspace.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: web/features/settings/store/SettingsStore.tsx web/features/settings/store/SettingsStore.tsx:644 — web/features/settings/store/SettingsStore.tsx changed 37 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 285 in SettingsStore.SettingsProvider at line 644. 10 of those changes were fix/bug commits, and the other 27 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 00:50:27 +08:00' --until='2026-11-01 00:50:27 +08:00' --full-history --no-merges -- web/features/settings/store/SettingsStore.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: deeptutor/services/session/turns/executor.py deeptutor/services/session/turns/executor.py:142 — deeptutor/services/session/turns/executor.py changed 39 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 213 in TurnExecutor._run_turn at line 142. 19 of those changes were fix/bug commits, and the other 20 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 00:50:27 +08:00' --until='2026-11-01 00:50:27 +08:00' --full-history --no-merges -- deeptutor/services/session/turns/executor.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: web/components/chat/home/ChatComposer.tsx web/components/chat/home/ChatComposer.tsx:200 — web/components/chat/home/ChatComposer.tsx changed 28 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 204 in ChatComposer.ChatComposer at line 200. 11 of those changes were fix/bug commits, and the other 17 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 00:50:27 +08:00' --until='2026-11-01 00:50:27 +08:00' --full-history --no-merges -- web/components/chat/home/ChatComposer.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: web/features/chat/messages/ChatMessageList.tsx web/features/chat/messages/ChatMessageList.tsx:2130 — web/features/chat/messages/ChatMessageList.tsx changed 53 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 104 in ChatMessageList.ChatMessageList at line 2130. 26 of those changes were fix/bug commits, and the other 27 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 00:50:27 +08:00' --until='2026-11-01 00:50:27 +08:00' --full-history --no-merges -- web/features/chat/messages/ChatMessageList.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: deeptutor/services/session/turns/request_preparer.py deeptutor/services/session/turns/request_preparer.py:180 — deeptutor/services/session/turns/request_preparer.py changed 29 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 177 in TurnRequestPreparer.start_turn at line 180. 14 of those changes were fix/bug commits, and the other 15 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 00:50:27 +08:00' --until='2026-11-01 00:50:27 +08:00' --full-history --no-merges -- deeptutor/services/session/turns/request_preparer.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: web/components/reading/ReaderPane.tsx web/components/reading/ReaderPane.tsx:180 — web/components/reading/ReaderPane.tsx changed 31 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 165 in ReaderPane.ReaderPane at line 180. 9 of those changes were fix/bug commits, and the other 22 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 00:50:27 +08:00' --until='2026-11-01 00:50:27 +08:00' --full-history --no-merges -- web/components/reading/ReaderPane.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: deeptutor/agents/loop/agent_loop.py deeptutor/agents/loop/agent_loop.py:639 — deeptutor/agents/loop/agent_loop.py changed 43 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 109 in AgentLoop._call_llm at line 639. 14 of those changes were fix/bug commits, and the other 29 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 00:50:27 +08:00' --until='2026-11-01 00:50:27 +08:00' --full-history --no-merges -- deeptutor/agents/loop/agent_loop.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: web/components/settings/ServiceConfigEditor.tsx web/components/settings/ServiceConfigEditor.tsx:102 — web/components/settings/ServiceConfigEditor.tsx changed 31 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 141 in ServiceConfigEditor.ServiceConfigEditor at line 102. 4 of those changes were fix/bug commits, and the other 27 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 00:50:27 +08:00' --until='2026-11-01 00:50:27 +08:00' --full-history --no-merges -- web/components/settings/ServiceConfigEditor.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: web/features/co-writer/components/CoWriterWorkspace.tsx web/features/co-writer/components/CoWriterWorkspace.tsx:182 — web/features/co-writer/components/CoWriterWorkspace.tsx changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 297 in CoWriterWorkspace.CoWriterWorkspace at line 182. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 00:50:27 +08:00' --until='2026-11-01 00:50:27 +08:00' --full-history --no-merges -- web/features/co-writer/components/CoWriterWorkspace.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: web/components/partners/PartnerChat.tsx web/components/partners/PartnerChat.tsx:296 — web/components/partners/PartnerChat.tsx changed 17 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 181 in PartnerChat.PartnerChat at line 296. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 00:50:27 +08:00' --until='2026-11-01 00:50:27 +08:00' --full-history --no-merges -- web/components/partners/PartnerChat.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: web/app/(workspace)/learning/books/BooksRoute.tsx web/app/(workspace)/learning/books/BooksRoute.tsx:104 — web/app/(workspace)/learning/books/BooksRoute.tsx changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 234 in BooksRoute.BookPageInner at line 104. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 00:50:27 +08:00' --until='2026-11-01 00:50:27 +08:00' --full-history --no-merges -- web/app/(workspace)/learning/books/BooksRoute.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: deeptutor/knowledge/manager.py deeptutor/knowledge/manager.py:1465 — deeptutor/knowledge/manager.py changed 35 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 79 in KnowledgeBaseManager._get_info at line 1465. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 00:50:27 +08:00' --until='2026-11-01 00:50:27 +08:00' --full-history --no-merges -- deeptutor/knowledge/manager.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: deeptutor/capabilities/mastery/tools.py deeptutor/capabilities/mastery/tools.py:1253 — deeptutor/capabilities/mastery/tools.py changed 48 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 54 in MasteryQuizTool.execute at line 1253. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 00:50:27 +08:00' --until='2026-11-01 00:50:27 +08:00' --full-history --no-merges -- deeptutor/capabilities/mastery/tools.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: web/components/knowledge/CreateKbModal.tsx web/components/knowledge/CreateKbModal.tsx:129 — web/components/knowledge/CreateKbModal.tsx changed 21 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 121 in CreateKbModal.CreateKbModal at line 129. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 00:50:27 +08:00' --until='2026-11-01 00:50:27 +08:00' --full-history --no-merges -- web/components/knowledge/CreateKbModal.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: deeptutor/services/session/sqlite_store.py deeptutor/services/session/sqlite_store.py:4053 — deeptutor/services/session/sqlite_store.py changed 47 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 52 in SQLiteSessionStore._serialize_notebook_entry at line 4053. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 00:50:27 +08:00' --until='2026-11-01 00:50:27 +08:00' --full-history --no-merges -- deeptutor/services/session/sqlite_store.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: web/components/space/learning/MasteryStudy.tsx web/components/space/learning/MasteryStudy.tsx:165 — web/components/space/learning/MasteryStudy.tsx changed 32 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 71 in MasteryStudy.MasteryStudy at line 165. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 00:50:27 +08:00' --until='2026-11-01 00:50:27 +08:00' --full-history --no-merges -- web/components/space/learning/MasteryStudy.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: web/components/chat/home/SessionViewerPanel.tsx web/components/chat/home/SessionViewerPanel.tsx:387 — web/components/chat/home/SessionViewerPanel.tsx changed 22 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 87 in SessionViewerPanel.SessionViewerPanelInner at line 387. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 00:50:27 +08:00' --until='2026-11-01 00:50:27 +08:00' --full-history --no-merges -- web/components/chat/home/SessionViewerPanel.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: web/components/quiz/QuizViewer.tsx web/components/quiz/QuizViewer.tsx:191 — web/components/quiz/QuizViewer.tsx changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 194 in QuizViewer.QuizViewer at line 191. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 00:50:27 +08:00' --until='2026-11-01 00:50:27 +08:00' --full-history --no-merges -- web/components/quiz/QuizViewer.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: deeptutor/services/config/provider_runtime.py deeptutor/services/config/provider_runtime.py:906 — deeptutor/services/config/provider_runtime.py changed 33 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 48 in provider_runtime.resolve_llm_runtime_config at line 906. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 00:50:27 +08:00' --until='2026-11-01 00:50:27 +08:00' --full-history --no-merges -- deeptutor/services/config/provider_runtime.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: deeptutor/learning/service.py deeptutor/learning/service.py:1734 — deeptutor/learning/service.py changed 34 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 44 in LearningService._replace_module_set at line 1734. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 00:50:27 +08:00' --until='2026-11-01 00:50:27 +08:00' --full-history --no-merges -- deeptutor/learning/service.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: web/components/reading/workspace/ReadingWorkspace.tsx web/components/reading/workspace/ReadingWorkspace.tsx:129 — web/components/reading/workspace/ReadingWorkspace.tsx changed 25 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 59 in ReadingWorkspace.ReadingWorkspacePage at line 129. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 00:50:27 +08:00' --until='2026-11-01 00:50:27 +08:00' --full-history --no-merges -- web/components/reading/workspace/ReadingWorkspace.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: web/components/chat/home/StandaloneComposer.tsx web/components/chat/home/StandaloneComposer.tsx:233 — web/components/chat/home/StandaloneComposer.tsx changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 92 in StandaloneComposer.StandaloneComposerImpl at line 233. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 00:50:27 +08:00' --until='2026-11-01 00:50:27 +08:00' --full-history --no-merges -- web/components/chat/home/StandaloneComposer.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Hotspot: web/app/(workspace)/partners/[partnerId]/page.tsx web/app/(workspace)/partners/[partnerId]/page.tsx:65 — web/app/(workspace)/partners/[partnerId]/page.tsx changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 132 in page.PartnerDetail at line 65. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 00:50:27 +08:00' --until='2026-11-01 00:50:27 +08:00' --full-history --no-merges -- web/app/(workspace)/partners/[partnerId]/page.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • + 304 more in this group — see findings.md.
D3 · God Classes · FunctionTooLong · ×322
  • FunctionTooLong: CoWriterWorkspace.CoWriterWorkspace web/features/co-writer/components/CoWriterWorkspace.tsx:182 — FunctionTooLong — CoWriterWorkspace runs 1869 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1769 over it, 18.69× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: ChatStateAdapter.ChatStateAdapterProvider web/features/chat/ChatStateAdapter.tsx:2031 — FunctionTooLong — ChatStateAdapterProvider runs 1693 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1593 over it, 16.93× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: SettingsStore.SettingsProvider web/features/settings/store/SettingsStore.tsx:644 — FunctionTooLong — SettingsProvider runs 1398 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1298 over it, 13.98× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: ChatComposer.ChatComposer web/components/chat/home/ChatComposer.tsx:200 — FunctionTooLong — ChatComposer runs 1159 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1059 over it, 11.59× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: ServiceConfigEditor.ServiceConfigEditor web/components/settings/ServiceConfigEditor.tsx:102 — FunctionTooLong — ServiceConfigEditor runs 988 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 888 over it, 9.88× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: QuizViewer.QuizViewer web/components/quiz/QuizViewer.tsx:191 — FunctionTooLong — QuizViewer runs 957 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 857 over it, 9.57× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: ReaderPane.ReaderPane web/components/reading/ReaderPane.tsx:180 — FunctionTooLong — ReaderPane runs 880 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 780 over it, 8.80× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: PartnerChat.PartnerChat web/components/partners/PartnerChat.tsx:296 — FunctionTooLong — PartnerChat runs 854 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 754 over it, 8.54× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: MediaReadingStage.MediaReadingStage web/components/reading/workspace/MediaReadingStage.tsx:57 — FunctionTooLong — MediaReadingStage runs 843 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 743 over it, 8.43× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: page.AdminUsersPage web/app/(admin)/admin/users/page.tsx:56 — FunctionTooLong — AdminUsersPage runs 840 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 740 over it, 8.40× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: BooksRoute.BookPageInner web/app/(workspace)/learning/books/BooksRoute.tsx:104 — FunctionTooLong — BookPageInner runs 827 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 727 over it, 8.27× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: SkillsSection.SkillsSection web/components/space/SkillsSection.tsx:78 — FunctionTooLong — SkillsSection runs 778 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 678 over it, 7.78× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: NoteEditor.NoteEditor web/features/notes/components/NoteEditor.tsx:697 — FunctionTooLong — NoteEditor runs 765 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 665 over it, 7.65× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: StandaloneComposer.StandaloneComposerImpl web/components/chat/home/StandaloneComposer.tsx:233 — FunctionTooLong — StandaloneComposerImpl runs 663 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 563 over it, 6.63× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: page.PartnerDetail web/app/(workspace)/partners/[partnerId]/page.tsx:65 — FunctionTooLong — PartnerDetail runs 657 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 557 over it, 6.57× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: ChatStateAdapter.reduce web/features/chat/ChatStateAdapter.tsx:802 — FunctionTooLong — reduce runs 645 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 545 over it, 6.45× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: NoteWorkspace.NoteWorkspace web/features/notes/components/NoteWorkspace.tsx:46 — FunctionTooLong — NoteWorkspace runs 621 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 521 over it, 6.21× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: CalendarPage.CalendarPage web/features/calendar/components/CalendarPage.tsx:77 — FunctionTooLong — CalendarPage runs 576 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 476 over it, 5.76× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: MasteryStudy.MasteryStudy web/components/space/learning/MasteryStudy.tsx:165 — FunctionTooLong — MasteryStudy runs 574 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 474 over it, 5.74× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: GrantEditor.GrantEditor web/features/multi-user/components/GrantEditor.tsx:161 — FunctionTooLong — GrantEditor runs 571 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 471 over it, 5.71× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: CreateKbModal.CreateKbModal web/components/knowledge/CreateKbModal.tsx:129 — FunctionTooLong — CreateKbModal runs 546 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 446 over it, 5.46× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: SubagentSettingsEditor.SubagentSettingsEditor web/components/settings/SubagentSettingsEditor.tsx:324 — FunctionTooLong — SubagentSettingsEditor runs 515 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 415 over it, 5.15× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: PageReader.PageReader web/app/(workspace)/learning/books/components/PageReader.tsx:122 — FunctionTooLong — PageReader runs 514 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 414 over it, 5.14× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: TimeGrid.TimeGrid web/features/calendar/components/TimeGrid.tsx:70 — FunctionTooLong — TimeGrid runs 487 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 387 over it, 4.87× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: MinerUEngineSettings.MinerUEngineSettings web/components/settings/MinerUEngineSettings.tsx:86 — FunctionTooLong — MinerUEngineSettings runs 485 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 385 over it, 4.85× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • + 297 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×143
  • FileTooLong: chat/ChatStateAdapter.tsx web/features/chat/ChatStateAdapter.tsx — FileTooLong — 3164 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2664 over it, 6.33× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: mastery/tools.py deeptutor/capabilities/mastery/tools.py — FileTooLong — 2814 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2314 over it, 5.63× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: session/sqlite_store.py deeptutor/services/session/sqlite_store.py — FileTooLong — 2731 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2231 over it, 5.46× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: learning/service.py deeptutor/learning/service.py — FileTooLong — 2694 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2194 over it, 5.39× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: research/pipeline.py deeptutor/agents/research/pipeline.py — FileTooLong — 2362 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1862 over it, 4.72× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: components/ChatWorkspace.tsx web/features/chat/components/ChatWorkspace.tsx — FileTooLong — 2322 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1822 over it, 4.64× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: messages/ChatMessageList.tsx web/features/chat/messages/ChatMessageList.tsx — FileTooLong — 2055 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1555 over it, 4.11× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: components/CoWriterWorkspace.tsx web/features/co-writer/components/CoWriterWorkspace.tsx — FileTooLong — 2044 significant lines (blank, comment-only and punctuation-only lines excluded), about 91% of them inside a single declaration: CoWriterWorkspace (182-2526). The bar is 500 significant lines; this is 1544 over it, 4.09× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: store/SettingsStore.tsx web/features/settings/store/SettingsStore.tsx — FileTooLong — 1875 significant lines (blank, comment-only and punctuation-only lines excluded), about 75% of them inside a single declaration: SettingsProvider (644-2612). The bar is 500 significant lines; this is 1375 over it, 3.75× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: channels/feishu.py deeptutor/partners/channels/feishu.py — FileTooLong — 1794 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1294 over it, 3.59× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: knowledge/manager.py deeptutor/knowledge/manager.py — FileTooLong — 1726 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1226 over it, 3.45× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: question/pipeline.py deeptutor/agents/question/pipeline.py — FileTooLong — 1683 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1183 over it, 3.37× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: engines/EngineDetail.tsx web/features/knowledge/components/engines/EngineDetail.tsx — FileTooLong — 1669 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1169 over it, 3.34× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: builtin/__init__.py deeptutor/tools/builtin/__init__.py — FileTooLong — 1650 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1150 over it, 3.30× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: routers/settings.py deeptutor/api/routers/settings.py — FileTooLong — 1635 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1135 over it, 3.27× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: settings/ServiceConfigEditor.tsx web/components/settings/ServiceConfigEditor.tsx — FileTooLong — 1535 significant lines (blank, comment-only and punctuation-only lines excluded), about 64% of them inside a single declaration: ServiceConfigEditor (102-1343). The bar is 500 significant lines; this is 1035 over it, 3.07× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: routers/partners.py deeptutor/api/routers/partners.py — FileTooLong — 1520 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1020 over it, 3.04× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: book/engine.py deeptutor/book/engine.py — FileTooLong — 1491 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 991 over it, 2.98× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: loop/pipeline.py deeptutor/agents/loop/pipeline.py — FileTooLong — 1447 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 947 over it, 2.89× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: session/pocketbase_store.py deeptutor/services/session/pocketbase_store.py — FileTooLong — 1430 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 930 over it, 2.86× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: knowledge/CreateKbModal.tsx web/components/knowledge/CreateKbModal.tsx — FileTooLong — 1396 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 896 over it, 2.79× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: runtime/launcher.py deeptutor/runtime/launcher.py — FileTooLong — 1394 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 894 over it, 2.79× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: routers/book.py deeptutor/api/routers/book.py — FileTooLong — 1376 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 876 over it, 2.75× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: partner_groups/manager.py deeptutor/services/partner_groups/manager.py — FileTooLong — 1362 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 862 over it, 2.72× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: routers/auth.py deeptutor/api/routers/auth.py — FileTooLong — 1358 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 858 over it, 2.72× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • + 118 more in this group — see findings.md.
D15 · Churn × Complexity Hotspots · Repeated repair · ×43
  • Repeated repair: deeptutor/knowledge/add_documents.py deeptutor/knowledge/add_documents.py:165 — deeptutor/knowledge/add_documents.py changed 20 times in last 90 days and 12 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is DocumentAdder.__init__ at line 165), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: publish one LlamaIndex version per folder sync”; “fix(knowledge): keep same-named documents when creating a KB”; “fix: support Windows data volume permission checks”; “fix(knowledge): track confirmed files during empty-index bootstrap (#1481)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 00:50:27 +08:00' --until='2026-11-01 00:50:27 +08:00' --full-history --no-merges -- deeptutor/knowledge/add_documents.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: deeptutor/core/turn_request.py deeptutor/core/turn_request.py:251 — deeptutor/core/turn_request.py changed 17 times in last 90 days and 9 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is TurnRequest._translate_legacy_runtime_config at line 251), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(turn): accept a blank answer_by so "Ask Dito" side chats start”; “fix(mastery): retain incremental grouped replies and partial feedback”; “fix(reading): accept video playback time in the reading viewport”; “fix(web): recover every unaccepted chat submission”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 00:50:27 +08:00' --until='2026-11-01 00:50:27 +08:00' --full-history --no-merges -- deeptutor/core/turn_request.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: deeptutor/runtime/orchestrator.py deeptutor/runtime/orchestrator.py:64 — deeptutor/runtime/orchestrator.py changed 15 times in last 90 days and 8 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is ChatOrchestrator.handle at line 64), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: prepare modular installs and align dev documentation”; “fix(mastery): finish bounded memory and count preparation usage (#1920, #1926)”; “fix(runtime): localize incomplete turn notices”; “fix(runtime): preserve incomplete capability terminal outcome”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 00:50:27 +08:00' --until='2026-11-01 00:50:27 +08:00' --full-history --no-merges -- deeptutor/runtime/orchestrator.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: REDACTED REDACTED:914 — REDACTED changed 10 times in last 90 days and 8 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is markdown-display.normalizeAtxHeadings at line 914), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: repair CJK emphasis boundaries for Japanese and Korean replies too”; “fix(web): normalize malformed ATX headings safely”; “Revert "feat: add remote Hermes connected agent backend (#1208)" (#1212)”; “fix: preserve raw content during Chinese Markdown streaming (#1178)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 00:50:27 +08:00' --until='2026-11-01 00:50:27 +08:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: deeptutor/services/llm/request_compat.py deeptutor/services/llm/request_compat.py:12 — deeptutor/services/llm/request_compat.py changed 9 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 7 (its worst body is request_compat._exception_chain at line 12), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: scope GLM image retries to text-only content validation”; “fix(llm): match zhipu/GLM multimodal rejection so text-only retry fires”; “fix(llm): require schema context for 404 fallback”; “fix(llm): stop matching bare 'tool' in schema-fallback detector”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 00:50:27 +08:00' --until='2026-11-01 00:50:27 +08:00' --full-history --no-merges -- deeptutor/services/llm/request_compat.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: deeptutor/services/rag/pipelines/lightrag/indexing_policy.py deeptutor/services/rag/pipelines/lightrag/indexing_policy.py:366 — deeptutor/services/rag/pipelines/lightrag/indexing_policy.py changed 9 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is indexing_policy.snapshot_from_persisted at line 366), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: retain bound index provenance and embedding-only controls”; “fix: keep recovered LightRAG index policy and provenance aligned”; “fix: enforce native LightRAG embedding compatibility”; “fix(lightrag): use provider defaults for automatic reasoning”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 00:50:27 +08:00' --until='2026-11-01 00:50:27 +08:00' --full-history --no-merges -- deeptutor/services/rag/pipelines/lightrag/indexing_policy.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: deeptutor/knowledge/initializer.py deeptutor/knowledge/initializer.py:179 — deeptutor/knowledge/initializer.py changed 11 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is KnowledgeBaseInitializer.process_documents at line 179), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(knowledge): keep same-named documents when creating a KB”; “fix(knowledge): make long-document indexing recoverable and publication verified (#1612)”; “fix: support Windows data volume permission checks”; “fix(docker): remap PUID/PGID for Unraid bind mounts (#1458)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 00:50:27 +08:00' --until='2026-11-01 00:50:27 +08:00' --full-history --no-merges -- deeptutor/knowledge/initializer.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: REDACTED REDACTED:427 — REDACTED changed 9 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is assessment.record_assessment at line 427), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(learning): preserve latest assessment projections on retries (#1542)”; “fix(learning): persist cross-surface assessment evidence safely (#1542)”; “fix(notebook): decouple evidence from chat sessions (#1519)”; “fix(mastery): bind repairs to exact question evidence”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 00:50:27 +08:00' --until='2026-11-01 00:50:27 +08:00' --full-history --no-merges -- REDACTED`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: deeptutor/services/app_update.py deeptutor/services/app_update.py:219 — deeptutor/services/app_update.py changed 8 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is app_update.detect_installation at line 219), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(update): distinguish desktop scopes from systemd services (#1555)”; “fix(update): refuse in-app handoff inside systemd services (#1555)”; “fix(errors): finish the sweep for failure notices that hide their cause”; “Revert "feat: add remote Hermes connected agent backend (#1208)" (#1212)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 00:50:27 +08:00' --until='2026-11-01 00:50:27 +08:00' --full-history --no-merges -- deeptutor/services/app_update.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: deeptutor/services/llm/config.py deeptutor/services/llm/config.py:193 — deeptutor/services/llm/config.py changed 8 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is config._get_llm_config_from_resolver at line 193), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(settings): require a model ID and keep model panels URL-driven”; “fix(llm): survive api_key key pools in the config resolver (#1300)”; “fix(tests): stop the partner suite writing to the real account store”; “fix(embedding): survive provider rate limits — key rotation, retry budget, global throttle (#962)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 00:50:27 +08:00' --until='2026-11-01 00:50:27 +08:00' --full-history --no-merges -- deeptutor/services/llm/config.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: deeptutor/services/rag/service.py deeptutor/services/rag/service.py:127 — deeptutor/services/rag/service.py changed 8 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is RAGService.search at line 127), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: contain query rewrite failures at the rewrite service boundary”; “fix: apply ruff format to REDACTED”; “fix(rag): wrap maybe_rewrite in try/except for fail-open safety”; “fix(knowledge): make long-document indexing recoverable and publication verified (#1612)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 00:50:27 +08:00' --until='2026-11-01 00:50:27 +08:00' --full-history --no-merges -- deeptutor/services/rag/service.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: deeptutor/learning/pending.py deeptutor/learning/pending.py:97 — deeptutor/learning/pending.py changed 8 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is pending.resolve_answer at line 97), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(ci): restore the ruff gate on dev”; “fix(tools): decode unicode escapes in ask_user payloads”; “fix(mastery): require explicit choice answer intent”; “fix(mastery): don't freeze choice gates on clarifying composer text”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 00:50:27 +08:00' --until='2026-11-01 00:50:27 +08:00' --full-history --no-merges -- deeptutor/learning/pending.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: deeptutor/services/embedding/client.py deeptutor/services/embedding/client.py:118 — deeptutor/services/embedding/client.py changed 7 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is EmbeddingClient.embed at line 118), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: embedding local keyless, qwen3-Instruct thinking, embedding concurrency (#1797)”; “fix: embedding concurrency, local Lemonade, reading fences, and learner nav (#1783)”; “fix(rag): log swallowed embedding/image progress and LightRAG meta failures (#1703)”; “fix: avoid blocking the embedding event loop”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 00:50:27 +08:00' --until='2026-11-01 00:50:27 +08:00' --full-history --no-merges -- deeptutor/services/embedding/client.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: web/features/chat/trace/memory.ts web/features/chat/trace/memory.ts:99 — web/features/chat/trace/memory.ts changed 7 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is memory.compactTracePreview at line 99), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: preserve tutoring replies and stabilize preview runtime”; “fix: resolve verified learning, ingestion and delivery regressions”; “fix(chat): keep a just-finished turn's reasoning where the reader left it”; “Revert "feat: add remote Hermes connected agent backend (#1208)" (#1212)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 00:50:27 +08:00' --until='2026-11-01 00:50:27 +08:00' --full-history --no-merges -- web/features/chat/trace/memory.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: web/proxy.ts web/proxy.ts:51 — web/proxy.ts changed 7 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is proxy.proxy at line 51), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: knowledge base listing through proxy”; “fix(auth): forward requested handoff host and avoid shared quota lockout”; “fix: stream large knowledge uploads through web (#868)”; “fix(runtime): spell the server-side backend address as the IPv4 loopback everywhere”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 00:50:27 +08:00' --until='2026-11-01 00:50:27 +08:00' --full-history --no-merges -- web/proxy.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: deeptutor/services/parsing/engines/mineru/config.py deeptutor/services/parsing/engines/mineru/config.py:108 — deeptutor/services/parsing/engines/mineru/config.py changed 6 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is config.resolve_mineru_config at line 108), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(parsing): isolate native MinerU failures during KB indexing (#1982)”; “fix(parsing): add opt-in normalization for tiny scanned PDF pages”; “fix(parsing): map local MinerU failures to actionable errors (#1612)”; “fix(embedding): survive provider rate limits — key rotation, retry budget, global throttle (#962)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 00:50:27 +08:00' --until='2026-11-01 00:50:27 +08:00' --full-history --no-merges -- deeptutor/services/parsing/engines/mineru/config.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: web/lib/reading-outline.ts web/lib/reading-outline.ts:78 — web/lib/reading-outline.ts changed 6 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is reading-outline.stepMarkdownFence at line 78), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: embedding concurrency, local Lemonade, reading fences, and learner nav (#1783)”; “fix(reading): preserve annotation offsets around heading anchors”; “fix(reading): keep heading anchors through highlights”; “fix(reading): separate outline views and stabilize heading jumps”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 00:50:27 +08:00' --until='2026-11-01 00:50:27 +08:00' --full-history --no-merges -- web/lib/reading-outline.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: deeptutor/services/rag/index_versioning.py deeptutor/services/rag/index_versioning.py:141 — deeptutor/services/rag/index_versioning.py changed 5 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is index_versioning._entry_from_flat_version at line 141), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(rag): keep batch publishing independent of version retention”; “fix: publish one LlamaIndex version per folder sync”; “fix(knowledge): make long-document indexing recoverable and publication verified (#1612)”; “fix(embedding): enable Jina retrieval roles”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 00:50:27 +08:00' --until='2026-11-01 00:50:27 +08:00' --full-history --no-merges -- deeptutor/services/rag/index_versioning.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: deeptutor/services/parsing/engines/mineru/readiness.py deeptutor/services/parsing/engines/mineru/readiness.py:45 — deeptutor/services/parsing/engines/mineru/readiness.py changed 5 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is readiness.mineru_models_ready at line 45), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(readiness): fail closed when MinerU model cache root is unreadable”; “fix: verify MinerU repository names in ModelScope cache”; “fix: detect MinerU models in ModelScope cache layout”; “fix(embedding): survive provider rate limits — key rotation, retry budget, global throttle (#962)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 00:50:27 +08:00' --until='2026-11-01 00:50:27 +08:00' --full-history --no-merges -- deeptutor/services/parsing/engines/mineru/readiness.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: deeptutor/services/memory/consolidator/chunker.py deeptutor/services/memory/consolidator/chunker.py:43 — deeptutor/services/memory/consolidator/chunker.py changed 5 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is chunker.chunk_with_boundary at line 43), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: recognize unspaced CJK memory sentence boundaries”; “fix(memory): size chunk windows by the stride that overlap leaves”; “fix(llm): correlate interleaved tool calls through one accumulator”; “fix(memory): size chunk windows by the stride overlap leaves”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 00:50:27 +08:00' --until='2026-11-01 00:50:27 +08:00' --full-history --no-merges -- deeptutor/services/memory/consolidator/chunker.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: deeptutor/textbook_struct/chapter_rebuild.py deeptutor/textbook_struct/chapter_rebuild.py:149 — deeptutor/textbook_struct/chapter_rebuild.py changed 5 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is chapter_rebuild.detect_frames at line 149), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(textbook_struct): keep the higher-page chapter hit when deduping”; “fix(chat, text): replay the visible failed turn and retain repeated section titles”; “fix(textbook): retain shared boundary pages in chapter spans”; “fix(textbook): expose header rebuild and preserve final page range”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 00:50:27 +08:00' --until='2026-11-01 00:50:27 +08:00' --full-history --no-merges -- deeptutor/textbook_struct/chapter_rebuild.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: deeptutor/book/blocks/_llm_writer.py deeptutor/book/blocks/_llm_writer.py:80 — deeptutor/book/blocks/_llm_writer.py changed 5 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is _llm_writer._normalize_json_payload at line 80), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(book): retry output-capped structured responses”; “fix(book): isolate scratchpad from generated content (#1366)”; “fix(question): tell a starved plan apart from an empty one, and retry it”; “fix(book): give Book a reachable token budget, and retry a starved plan”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 00:50:27 +08:00' --until='2026-11-01 00:50:27 +08:00' --full-history --no-merges -- deeptutor/book/blocks/_llm_writer.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: deeptutor/services/llm/error_mapping.py deeptutor/services/llm/error_mapping.py:59 — deeptutor/services/llm/error_mapping.py changed 5 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is error_mapping.parse_retry_after_seconds at line 59), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: resolve verified learning, ingestion and delivery regressions”; “fix(embedding): parse HTTP-date Retry-After values”; “fix(rag): improve local LlamaIndex pipeline compatibility (#864)”; “fix: converge LightRAG transport failures and cancellation (#940)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 00:50:27 +08:00' --until='2026-11-01 00:50:27 +08:00' --full-history --no-merges -- deeptutor/services/llm/error_mapping.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: deeptutor/capabilities/marginnote4/store.py deeptutor/capabilities/marginnote4/store.py:291 — deeptutor/capabilities/marginnote4/store.py changed 4 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is MarginNoteStore.ingest at line 291), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(capabilities): escape LIKE wildcards in the MarginNote store”; “fix(marginnote4): close the store's SQLite connections”; “fix(marginnote4): one rule for where a library's store lives”; “fix(marginnote4): close the device bridge's auth boundary”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 00:50:27 +08:00' --until='2026-11-01 00:50:27 +08:00' --full-history --no-merges -- deeptutor/capabilities/marginnote4/store.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • Repeated repair: deeptutor/services/llm/provider_core/codebuddy_provider.py deeptutor/services/llm/provider_core/codebuddy_provider.py:455 — deeptutor/services/llm/provider_core/codebuddy_provider.py changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is codebuddy_provider._build_tool_options at line 455), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(llm): bound Claude session lifecycle and share SDK wire adaptation”; “fix(codebuddy): omit SDK exception bodies from warning logs”; “fix: log silently swallowed failures in five services (#1707)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-08-03..2026-11-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-03 00:50:27 +08:00' --until='2026-11-01 00:50:27 +08:00' --full-history --no-merges -- deeptutor/services/llm/provider_core/codebuddy_provider.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
  • + 18 more in this group — see findings.md.
R11 · Import Boundaries · Boundary violation [package · ×40
  • Boundary violation [package:third-party-deep-import] web/components/common/code-block-themes.ts:10 — web/components/common/code-block-themes.ts:10 imports react-syntax-highlighter/dist/esm/styles/prism/one-dark, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:third-party-deep-import] web/components/common/code-block-themes.ts:11 — web/components/common/code-block-themes.ts:11 imports react-syntax-highlighter/dist/esm/styles/prism/a11y-dark, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:third-party-deep-import] web/components/common/code-block-themes.ts:12 — web/components/common/code-block-themes.ts:12 imports react-syntax-highlighter/dist/esm/styles/prism/a11y-one-light, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:third-party-deep-import] web/components/common/code-block-themes.ts:13 — web/components/common/code-block-themes.ts:13 imports react-syntax-highlighter/dist/esm/styles/prism/atom-dark, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:third-party-deep-import] web/components/common/code-block-themes.ts:14 — web/components/common/code-block-themes.ts:14 imports react-syntax-highlighter/dist/esm/styles/prism/base16-ateliersulphurpool.light, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:third-party-deep-import] web/components/common/code-block-themes.ts:15 — web/components/common/code-block-themes.ts:15 imports react-syntax-highlighter/dist/esm/styles/prism/cb, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:third-party-deep-import] web/components/common/code-block-themes.ts:16 — web/components/common/code-block-themes.ts:16 imports react-syntax-highlighter/dist/esm/styles/prism/coldark-cold, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:third-party-deep-import] web/components/common/code-block-themes.ts:17 — web/components/common/code-block-themes.ts:17 imports react-syntax-highlighter/dist/esm/styles/prism/coldark-dark, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:third-party-deep-import] web/components/common/code-block-themes.ts:18 — web/components/common/code-block-themes.ts:18 imports react-syntax-highlighter/dist/esm/styles/prism/coy-without-shadows, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:third-party-deep-import] web/components/common/code-block-themes.ts:19 — web/components/common/code-block-themes.ts:19 imports react-syntax-highlighter/dist/esm/styles/prism/coy, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:third-party-deep-import] web/components/common/code-block-themes.ts:20 — web/components/common/code-block-themes.ts:20 imports react-syntax-highlighter/dist/esm/styles/prism/darcula, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:third-party-deep-import] web/components/common/code-block-themes.ts:21 — web/components/common/code-block-themes.ts:21 imports react-syntax-highlighter/dist/esm/styles/prism/dark, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:third-party-deep-import] web/components/common/code-block-themes.ts:22 — web/components/common/code-block-themes.ts:22 imports react-syntax-highlighter/dist/esm/styles/prism/dracula, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:third-party-deep-import] web/components/common/code-block-themes.ts:23 — web/components/common/code-block-themes.ts:23 imports react-syntax-highlighter/dist/esm/styles/prism/duotone-dark, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:third-party-deep-import] web/components/common/code-block-themes.ts:24 — web/components/common/code-block-themes.ts:24 imports react-syntax-highlighter/dist/esm/styles/prism/duotone-earth, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:third-party-deep-import] web/components/common/code-block-themes.ts:25 — web/components/common/code-block-themes.ts:25 imports react-syntax-highlighter/dist/esm/styles/prism/duotone-forest, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:third-party-deep-import] web/components/common/code-block-themes.ts:26 — web/components/common/code-block-themes.ts:26 imports react-syntax-highlighter/dist/esm/styles/prism/duotone-light, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:third-party-deep-import] web/components/common/code-block-themes.ts:27 — web/components/common/code-block-themes.ts:27 imports react-syntax-highlighter/dist/esm/styles/prism/duotone-sea, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:third-party-deep-import] web/components/common/code-block-themes.ts:28 — web/components/common/code-block-themes.ts:28 imports react-syntax-highlighter/dist/esm/styles/prism/duotone-space, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:third-party-deep-import] web/components/common/code-block-themes.ts:29 — web/components/common/code-block-themes.ts:29 imports react-syntax-highlighter/dist/esm/styles/prism/funky, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:third-party-deep-import] web/components/common/code-block-themes.ts:30 — web/components/common/code-block-themes.ts:30 imports react-syntax-highlighter/dist/esm/styles/prism/ghcolors, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:third-party-deep-import] web/components/common/code-block-themes.ts:31 — web/components/common/code-block-themes.ts:31 imports react-syntax-highlighter/dist/esm/styles/prism/gruvbox-dark, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:third-party-deep-import] web/components/common/code-block-themes.ts:32 — web/components/common/code-block-themes.ts:32 imports react-syntax-highlighter/dist/esm/styles/prism/gruvbox-light, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:third-party-deep-import] web/components/common/code-block-themes.ts:33 — web/components/common/code-block-themes.ts:33 imports react-syntax-highlighter/dist/esm/styles/prism/holi-theme, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:third-party-deep-import] web/components/common/code-block-themes.ts:34 — web/components/common/code-block-themes.ts:34 imports react-syntax-highlighter/dist/esm/styles/prism/hopscotch, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • + 15 more in this group — see findings.md.
R4 · Test Coverage · No test reaches this file · ×40
  • No test reaches this file web/components/memory/MemorySection.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file web/components/space/SkillsSection.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file web/components/cli-apps/CliAppsSection.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file web/components/memory/MemoryGraph.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file web/components/settings/ConnectionsEditor.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file web/components/mcp/McpCatalogBrowser.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file web/components/reading/library/MaterialLibrary.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file web/components/space/MyAgentsSection.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file web/components/space/PersonasSection.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file web/components/space/EduHubImportModal.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file web/components/space/ImportWizard.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file web/components/reading/library/ReadingLibrary.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file web/app/(workspace)/partners/new/page.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file web/app/(utility)/profile/page.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file web/components/knowledge/KnowledgePage.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file deeptutor/agents/video_lesson/remotion/kit.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file web/components/reading/library/ReadingFolder.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file web/app/(workspace)/co-writer/page.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file web/components/agents/ConnectedAgents.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file web/components/space/McpStoreSection.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file web/app/(workspace)/partners/groups/new/page.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file web/app/(workspace)/partners/page.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file web/components/memory/MemoryL1Workbench.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file web/components/partners/SoulPicker.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file web/components/memory/MemoryHub.tsx:1 — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • + 15 more in this group — see findings.md.
AC6 · Visual & motion safety · Focus outline removed inline · ×37
  • Focus outline removed inline web/app/(admin)/admin/users/page.tsx:370 — <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline web/app/(workspace)/learning/books/components/BookChatPanel.tsx:605 — <textarea> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline web/app/(workspace)/learning/books/components/BookCreator.tsx:226 — <textarea> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline web/app/(workspace)/learning/books/components/BookCreator.tsx:257 — <select> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline web/app/(workspace)/learning/books/components/BookCreator.tsx:374 — <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline web/app/(workspace)/learning/books/components/BookCreator.tsx:384 — <textarea> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline web/app/(workspace)/learning/books/components/BookCreator.tsx:395 — <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline web/app/(workspace)/learning/books/components/BookCreator.tsx:405 — <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline web/app/(workspace)/learning/books/components/BookCreator.tsx:415 — <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline web/app/(workspace)/learning/books/components/SpineEditor.tsx:313 — <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline web/app/(workspace)/learning/books/components/SpineEditor.tsx:366 — <select> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline web/app/(workspace)/learning/books/components/SpineEditor.tsx:392 — <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline web/app/(workspace)/learning/books/components/SpineEditor.tsx:405 — <textarea> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline web/app/(workspace)/learning/books/components/blocks/BlockBodyEditor.tsx:52 — <textarea> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline web/app/(workspace)/learning/books/components/blocks/UserNoteBlock.tsx:93 — <textarea> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline web/app/(workspace)/partners/groups/[groupId]/page.tsx:336 — <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline web/app/(workspace)/partners/groups/[groupId]/page.tsx:345 — <textarea> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline web/app/(workspace)/partners/groups/new/page.tsx:143 — <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline web/app/(workspace)/partners/groups/new/page.tsx:149 — <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline web/app/(workspace)/partners/groups/new/page.tsx:156 — <textarea> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline web/app/(workspace)/partners/new/page.tsx:309 — <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline web/app/(workspace)/partners/new/page.tsx:324 — <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline web/components/agents/ConnectedAgents.tsx:302 — <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline web/components/agents/ConnectedAgents.tsx:324 — <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline web/components/chat/QuestionBankPicker.tsx:248 — <select> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • + 12 more in this group — see findings.md.
X3 · Exception handling · Swallowed exception (empty catch) · ×35
  • Swallowed exception (empty catch) web/shared/storage/store.ts:173 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) web/shared/storage/store.ts:174 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) web/shared/api/client.ts:218 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) web/scripts/dev.mjs:41 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) web/scripts/route_budgets.mjs:65 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) web/lib/app-update.ts:77 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) web/lib/auth.ts:59 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) web/lib/auth.ts:220 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) web/lib/book-ws-operation.ts:74 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) web/lib/chat-markdown-note.ts:91 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) web/lib/chat-markdown-note.ts:96 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) web/lib/chat-markdown-note.ts:113 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) web/lib/cli-apps-api.ts:121 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) web/lib/clipboard.ts:86 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) web/lib/codex-oauth.ts:165 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) web/lib/failed-submissions.ts:99 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) web/lib/failed-submissions.ts:148 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) web/lib/learning-api.ts:613 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) web/lib/mcp-api.ts:310 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) web/lib/notebook-api.ts:299 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) web/lib/notifications.ts:45 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) web/lib/partner-session.ts:89 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) web/lib/pending-prompt.ts:30 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) web/lib/profile-api.ts:75 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) web/lib/quiz-judge.ts:68 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • + 10 more in this group — see findings.md.
D3 · God Classes · ClassTooLong · ×30
  • ClassTooLong: CoWriterWorkspace web/features/co-writer/components/CoWriterWorkspace.tsx:1 — ClassTooLong — 1869 significant lines (blank, comment-only and punctuation-only lines excluded), 4 methods. The bar is 400 significant lines; this is 1469 over it, 4.67× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: ServiceConfigEditor web/components/settings/ServiceConfigEditor.tsx:1 — ClassTooLong — 988 significant lines (blank, comment-only and punctuation-only lines excluded), 8 methods. The bar is 400 significant lines; this is 588 over it, 2.47× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: QuizViewer web/components/quiz/QuizViewer.tsx:1 — ClassTooLong — 957 significant lines (blank, comment-only and punctuation-only lines excluded), 8 methods. The bar is 400 significant lines; this is 557 over it, 2.39× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: ReaderPane web/components/reading/ReaderPane.tsx:1 — ClassTooLong — 880 significant lines (blank, comment-only and punctuation-only lines excluded), 7 methods. The bar is 400 significant lines; this is 480 over it, 2.20× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: PartnerChat web/components/partners/PartnerChat.tsx:1 — ClassTooLong — 854 significant lines (blank, comment-only and punctuation-only lines excluded), 10 methods. The bar is 400 significant lines; this is 454 over it, 2.14× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: MediaReadingStage web/components/reading/workspace/MediaReadingStage.tsx:1 — ClassTooLong — 843 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 443 over it, 2.11× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: SkillsSection web/components/space/SkillsSection.tsx:1 — ClassTooLong — 778 significant lines (blank, comment-only and punctuation-only lines excluded), 5 methods. The bar is 400 significant lines; this is 378 over it, 1.95× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: NoteEditor web/features/notes/components/NoteEditor.tsx:1 — ClassTooLong — 765 significant lines (blank, comment-only and punctuation-only lines excluded), 6 methods. The bar is 400 significant lines; this is 365 over it, 1.91× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: NoteWorkspace web/features/notes/components/NoteWorkspace.tsx:1 — ClassTooLong — 621 significant lines (blank, comment-only and punctuation-only lines excluded), 4 methods. The bar is 400 significant lines; this is 221 over it, 1.55× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: CalendarPage web/features/calendar/components/CalendarPage.tsx:1 — ClassTooLong — 576 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 176 over it, 1.44× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: MasteryStudy web/components/space/learning/MasteryStudy.tsx:1 — ClassTooLong — 574 significant lines (blank, comment-only and punctuation-only lines excluded), 3 methods. The bar is 400 significant lines; this is 174 over it, 1.44× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: GrantEditor web/features/multi-user/components/GrantEditor.tsx:1 — ClassTooLong — 571 significant lines (blank, comment-only and punctuation-only lines excluded), 8 methods. The bar is 400 significant lines; this is 171 over it, 1.43× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: CreateKbModal web/components/knowledge/CreateKbModal.tsx:1 — ClassTooLong — 546 significant lines (blank, comment-only and punctuation-only lines excluded), 9 methods. The bar is 400 significant lines; this is 146 over it, 1.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: SubagentSettingsEditor web/components/settings/SubagentSettingsEditor.tsx:1 — ClassTooLong — 515 significant lines (blank, comment-only and punctuation-only lines excluded), 3 methods. The bar is 400 significant lines; this is 115 over it, 1.29× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: PageReader web/app/(workspace)/learning/books/components/PageReader.tsx:1 — ClassTooLong — 514 significant lines (blank, comment-only and punctuation-only lines excluded), 4 methods. The bar is 400 significant lines; this is 114 over it, 1.29× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: TimeGrid web/features/calendar/components/TimeGrid.tsx:1 — ClassTooLong — 487 significant lines (blank, comment-only and punctuation-only lines excluded), 5 methods. The bar is 400 significant lines; this is 87 over it, 1.22× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: MinerUEngineSettings web/components/settings/MinerUEngineSettings.tsx:1 — ClassTooLong — 485 significant lines (blank, comment-only and punctuation-only lines excluded), 2 methods. The bar is 400 significant lines; this is 85 over it, 1.21× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: SaveToNotebookModal web/components/notebook/SaveToNotebookModal.tsx:1 — ClassTooLong — 483 significant lines (blank, comment-only and punctuation-only lines excluded), 8 methods. The bar is 400 significant lines; this is 83 over it, 1.21× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: ChatMessageList web/features/chat/messages/ChatMessageList.tsx:1 — ClassTooLong — 466 significant lines (blank, comment-only and punctuation-only lines excluded), 31 methods. The bar is 400 significant lines; this is 66 over it, 1.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: OrganizedSessionList web/components/sessions/OrganizedSessionList.tsx:1 — ClassTooLong — 463 significant lines (blank, comment-only and punctuation-only lines excluded), 2 methods. The bar is 400 significant lines; this is 63 over it, 1.16× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: PartnerComposer web/components/partners/PartnerComposer.tsx:1 — ClassTooLong — 454 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 54 over it, 1.14× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: EpubDocumentView web/components/reading/EpubDocumentView.tsx:1 — ClassTooLong — 447 significant lines (blank, comment-only and punctuation-only lines excluded), 2 methods. The bar is 400 significant lines; this is 47 over it, 1.12× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: PersonasSection web/components/space/PersonasSection.tsx:1 — ClassTooLong — 442 significant lines (blank, comment-only and punctuation-only lines excluded), 3 methods. The bar is 400 significant lines; this is 42 over it, 1.11× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: NoteBlockPreview web/features/notes/components/NoteBlockPreview.tsx:1 — ClassTooLong — 432 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 32 over it, 1.08× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: PartnerConfigure web/components/partners/PartnerConfigure.tsx:1 — ClassTooLong — 420 significant lines (blank, comment-only and punctuation-only lines excluded), 2 methods. The bar is 400 significant lines; this is 20 over it, 1.05× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • + 5 more in this group — see findings.md.
AX7 · Slice cohesion · Cross-slice coupling · ×27
  • Cross-slice coupling: calendar → chat web/features/calendar/components/CalendarPage.tsx:351 — `CalendarPage` (slice 'calendar') depends on `HeaderActionButton` from slice 'chat'.
  • Cross-slice coupling: calendar → chat web/features/calendar/components/EventEditor.tsx:73 — `EventEditor` (slice 'calendar') depends on `HeaderActionButton` from slice 'chat'.
  • Cross-slice coupling: calendar → chat web/features/calendar/components/ItemDetails.tsx:106 — `EventDetails` (slice 'calendar') depends on `HeaderActionButton` from slice 'chat'.
  • Cross-slice coupling: chat → capabilities web/features/chat/components/ChatWorkspace.tsx:283 — `ChatWorkspace` (slice 'chat') depends on `useCapabilityCatalog` from slice 'capabilities'.
  • Cross-slice coupling: chat → capabilities web/features/chat/components/ChatWorkspace.tsx:645 — `ChatWorkspace` (slice 'chat') depends on `getChatCapability` from slice 'capabilities'.
  • Cross-slice coupling: chat → knowledge web/features/chat/components/ChatWorkspace.tsx:1396 — `ChatWorkspace` (slice 'chat') depends on `listKnowledgeBases` from slice 'knowledge'.
  • Cross-slice coupling: chat → capabilities web/features/chat/components/ChatWorkspace.tsx:1486 — `ChatWorkspace` (slice 'chat') depends on `ToolName` from slice 'capabilities'.
  • Cross-slice coupling: chat → capabilities web/features/chat/components/ChatWorkspace.tsx:1487 — `ChatWorkspace` (slice 'chat') depends on `ALL_TOOLS` from slice 'capabilities'.
  • Cross-slice coupling: chat → settings web/features/chat/components/ChatWorkspace.tsx:2964 — `ChatWorkspace` (slice 'chat') depends on `RESPONSE_LANGUAGE_OPTIONS` from slice 'settings'.
  • Cross-slice coupling: co-writer → chat web/features/co-writer/components/CoWriterWorkspace.tsx:262 — `CoWriterWorkspace` (slice 'co-writer') depends on `LLMSelection` from slice 'chat'.
  • Cross-slice coupling: co-writer → knowledge web/features/co-writer/components/CoWriterWorkspace.tsx:408 — `CoWriterWorkspace` (slice 'co-writer') depends on `listKnowledgeBases` from slice 'knowledge'.
  • Cross-slice coupling: notes → chat web/features/notes/components/NoteCompanion.tsx:158 — `resultBlock` (slice 'notes') depends on `MessageItem` from slice 'chat'.
  • Cross-slice coupling: notes → chat web/features/notes/components/NoteCompanion.tsx:234 — `ThreadPanel` (slice 'notes') depends on `useChatStateAdapter` from slice 'chat'.
  • Cross-slice coupling: notes → chat web/features/notes/components/NoteCompanion.tsx:283 — `ThreadPanel` (slice 'notes') depends on `RoughActionButton` from slice 'chat'.
  • Cross-slice coupling: notes → chat web/features/notes/components/NoteCompanion.tsx:314 — `ThreadPanel` (slice 'notes') depends on `COMMAND_CONFIRMATION_FAILED` from slice 'chat'.
  • Cross-slice coupling: notes → chat web/features/notes/components/NoteCompanion.tsx:419 — `ThreadPanel` (slice 'notes') depends on `ChatMessageList` from slice 'chat'.
  • Cross-slice coupling: notes → chat web/features/notes/components/NoteCompanion.tsx:432 — `ThreadPanel` (slice 'notes') depends on `MessageAttachment` from slice 'chat'.
  • Cross-slice coupling: notes → chat web/features/notes/components/NoteCompanion.tsx:658 — `ThreadComposer` (slice 'notes') depends on `LLMSelection` from slice 'chat'.
  • Cross-slice coupling: notes → chat web/features/notes/components/useNoteThreads.ts:82 — `useNoteThreads` (slice 'notes') depends on `useChatStateAdapter` from slice 'chat'.
  • Cross-slice coupling: notes → chat web/features/notes/components/useNoteThreads.ts:450 — `useNoteThreads` (slice 'notes') depends on `MessageItem` from slice 'chat'.
  • Cross-slice coupling: settings → runtime-status web/features/settings/sections/NetworkSettingsSection.tsx:97 — `NetworkSettingsPage` (slice 'settings') depends on `useRuntimeStatus` from slice 'runtime-status'.
  • Cross-slice coupling: settings → runtime-status web/features/settings/sections/NetworkSettingsSection.tsx:221 — `NetworkSettingsPage` (slice 'settings') depends on `RuntimeHealthCard` from slice 'runtime-status'.
  • Cross-slice coupling: settings → runtime-status web/features/settings/sections/NetworkSettingsSection.tsx:227 — `NetworkSettingsPage` (slice 'settings') depends on `TurnCoordinationSettings` from slice 'runtime-status'.
  • Cross-slice coupling: tasks → calendar web/features/tasks/components/KanbanBoard.tsx:48 — `KanbanBoard` (slice 'tasks') depends on `useTaskBlocks` from slice 'calendar'.
  • Cross-slice coupling: tasks → calendar web/features/tasks/components/KanbanBoard.tsx:86 — `KanbanBoard` (slice 'tasks') depends on `dateKey` from slice 'calendar'.
  • + 2 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×25
  • Duplicated block (8 lines × 2) deeptutor/agents/loop/pipeline.py:1651 — deeptutor/agents/loop/pipeline.py:1651-1658 | deeptutor/agents/loop/pipeline.py:1673-1680 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/agents/loop/pipeline.py:1651` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) deeptutor/agents/research/pipeline.py:2513 — deeptutor/agents/research/pipeline.py:2513-2520 | deeptutor/agents/research/pipeline.py:2539-2546 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) deeptutor/api/routers/partners.py:1280 — deeptutor/api/routers/partners.py:1280-1287 | deeptutor/api/routers/partners.py:1295-1302 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) deeptutor/api/routers/question_notebook.py:195 — deeptutor/api/routers/question_notebook.py:195-202 | REDACTED:188-195 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (8 lines × 2) deeptutor/api/routers/question_notebook.py:311 — deeptutor/api/routers/question_notebook.py:311-318 | deeptutor/api/routers/question_notebook.py:442-449 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) deeptutor/learning/storage.py:381 — deeptutor/learning/storage.py:381-388 | deeptutor/learning/storage.py:1667-1674 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/learning/storage.py:381` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) deeptutor/services/codex_auth/storage.py:92 — deeptutor/services/codex_auth/storage.py:92-99 | deeptutor/services/settings/interface_settings.py:300-307 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/services/codex_auth/storage.py:92` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `deeptutor/services/codex_auth/storage.py:100` calls `chmod` and `deeptutor/services/settings/interface_settings.py:308` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 2) deeptutor/services/config/provider_runtime.py:1414 — deeptutor/services/config/provider_runtime.py:1414-1421 | deeptutor/services/config/provider_runtime.py:1455-1462 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) deeptutor/services/imagegen/adapters/dashscope.py:121 — deeptutor/services/imagegen/adapters/dashscope.py:121-128 | deeptutor/services/videogen/adapters/dashscope.py:230-237 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (8 lines × 2) deeptutor/services/session/sqlite_store.py:1190 — deeptutor/services/session/sqlite_store.py:1190-1199 | deeptutor/services/session/sqlite_store.py:1250-1257 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) deeptutor/services/subagent/claude_code.py:332 — deeptutor/services/subagent/claude_code.py:332-339 | deeptutor/services/subagent/opencode_family.py:452-459 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) deeptutor/services/voice/adapters/gemini.py:60 — deeptutor/services/voice/adapters/gemini.py:60-69 | deeptutor/services/voice/adapters/mimo.py:24-31 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (8 lines × 2) deeptutor/services/voice/adapters/mistral.py:80 — deeptutor/services/voice/adapters/mistral.py:80-87 | deeptutor/services/voice/adapters/xai.py:91-98 — before extracting anything, compare `deeptutor/services/voice/adapters/mistral.py` and `deeptutor/services/voice/adapters/xai.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (8 lines × 2) deeptutor/services/workspace/service.py:451 — deeptutor/services/workspace/service.py:451-458 | deeptutor/services/workspace/service.py:567-574 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `deeptutor/services/workspace/service.py:564` calls `str`, `strip`, `WorkspaceError` and `deeptutor/services/workspace/service.py:448` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 2) deeptutor/tools/builtin/__init__.py:65 — deeptutor/tools/builtin/__init__.py:65-72 | deeptutor/tools/builtin/__init__.py:725-732 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/tools/builtin/__init__.py:65` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (8 lines × 2) deeptutor/tools/workspace.py:63 — deeptutor/tools/workspace.py:63-70 | deeptutor/tools/workspace.py:146-153 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/tools/workspace.py:63` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) deeptutor/utils/document_extractor.py:1110 — deeptutor/utils/document_extractor.py:1110-1117 | deeptutor/utils/document_images.py:742-749 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (8 lines × 2) deeptutor_cli/kb.py:678 — deeptutor_cli/kb.py:678-685 | deeptutor_cli/kb.py:694-701 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor_cli/kb.py:678` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) deeptutor_cli/plugin.py:274 — deeptutor_cli/plugin.py:274-281 | deeptutor_cli/plugin.py:289-296 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) deeptutor/agents/loop/pipeline.py:115 — deeptutor/agents/loop/pipeline.py:115-122 | deeptutor/agents/research/pipeline.py:2674-2681 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) deeptutor/book/storage.py:83 — deeptutor/book/storage.py:83-90 | deeptutor/co_writer/storage.py:77-84 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) deeptutor/reading/catalog_store.py:68 — deeptutor/reading/catalog_store.py:68-75 | deeptutor/services/practice/storage.py:106-113 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (8 lines × 2) deeptutor/services/subagent/hermes.py:43 — deeptutor/services/subagent/hermes.py:43-50 | deeptutor/services/subagent/openclaw.py:41-48 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) deeptutor/services/voice/adapters/mistral.py:50 — deeptutor/services/voice/adapters/mistral.py:50-57 | deeptutor/services/voice/adapters/xai.py:53-60 — before extracting anything, compare `deeptutor/services/voice/adapters/mistral.py` and `deeptutor/services/voice/adapters/xai.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) deeptutor/agents/loop/pipeline.py:245 — deeptutor/agents/loop/pipeline.py:245-252 | deeptutor/agents/research/pipeline.py:484-491 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
X17 · Uncapped recursion over a caller-supplied document · Recursive walk over a caller-supplied document has no depth cap · ×25
  • Recursive walk over a caller-supplied document has no depth cap web/features/runtime-status/model.ts:50 — `parseRuntimeStatus` is exported, takes a document from its caller (line 79) and hands it to `hasCredentialLikeKey`, which calls itself at line 50 (`hasCredentialLikeKey`) with a piece of `value` (and at line 53) — and nowhere in `hasCredentialLikeKey` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `hasCredentialLikeKey` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap web/features/notes/model/blocks.ts:13 — `blockPreview` is exported, takes a document from its caller (line 27) and hands it to `inlineText`, which calls itself at line 13 (`inlineText`) with a piece of `value` — and nowhere in `inlineText` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `inlineText` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap web/features/notes/model/blocks.ts:100 — `blockPreview` is exported and takes `block: NoteBlock` from its caller, and it calls itself at line 100 (`blockPreview`) with a piece of `block` — and nowhere in `blockPreview` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `blockPreview` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap web/features/notes/model/threads.ts:76 — `inlineText` is exported and takes `content: unknown` from its caller, and it calls itself at line 76 (`inlineText`) with a piece of `content` — and nowhere in `inlineText` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `inlineText` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap packages/chat-engine/src/context/conversation.ts:25 — `estimateValue` is exported and takes `value: unknown` from its caller, and it calls itself at line 25 (`estimateValue`) with a piece of `value` (and at line 31) — and nowhere in `estimateValue` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `estimateValue` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap deeptutor/utils/config_manager.py:51 — `save_config` is public, takes a document from its caller (line 69) and hands it to `_deep_update`, which calls itself at line 51 (`self._deep_update`) with a piece of `target` — and nowhere in `_deep_update` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_deep_update` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap deeptutor/utils/document_images.py:422 — `render_docx_text` is public, takes a document from its caller (line 431) and hands it to `_render_omml`, which calls itself at line 422 (`_render_omml`) with a piece of `node` — and nowhere in `_render_omml` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_render_omml` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap deeptutor/utils/document_images.py:443 — `render_docx_text` is public and takes `node: Any` from its caller, and it calls itself at line 443 (`render_docx_text`) with a piece of `node` — and nowhere in `render_docx_text` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `render_docx_text` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap deeptutor/services/rag/source_pages.py:127 — `build_pdf_documents` is public, takes a document from its caller (line 145) and hands it to `_list_item_pieces`, which calls itself at line 127 (`_list_item_pieces`) with a piece of `value` — and nowhere in `_list_item_pieces` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_list_item_pieces` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap deeptutor/services/rag/pipelines/lightrag/indexing_policy.py:668 — `public_policy` is public and takes `policy: dict[str, Any]` from its caller, and it calls itself at line 668 (`public_policy`) with a piece of `policy` (and at line 673) — and nowhere in `public_policy` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `public_policy` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap deeptutor/services/partners/manager.py:155 — `mask_channel_secrets` is public, takes a document from its caller (line 150) and hands it to `_walk`, which calls itself at line 155 (`_walk`) with a piece of `value` (and at line 157, line 159) — and nowhere in `_walk` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_walk` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap deeptutor/services/memory/settings.py:132 — `save_memory_settings` is public, takes a document from its caller (line 82) and hands it to `_from_dict`, which calls itself at line 132 (`_from_dict`) with a piece of `raw` (and at line 137) — and nowhere in `_from_dict` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_from_dict` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap REDACTED:125 — `resolve_references` is public and takes `payload: Any` from its caller, and it calls itself at line 125 (`resolve_references`) with a piece of `payload` (and at line 127) — and nowhere in `resolve_references` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `resolve_references` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap deeptutor/services/llm/usage_estimation.py:36 — `estimate_prompt_tokens` is public, takes a document from its caller (line 15) and hands it to `without_image_payloads`, which calls itself at line 36 (`without_image_payloads`) with a piece of `value` (and at line 40) — and nowhere in `without_image_payloads` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `without_image_payloads` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap deeptutor/services/llm/utils.py:306 — `extract_response_content` is public and takes `message: object` from its caller, and it calls itself at line 306 (`extract_response_content`) with a piece of `message` — and nowhere in `extract_response_content` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `extract_response_content` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap deeptutor/services/llm/provider_core/openai_compat_provider.py:1115 — `chat` is public and takes `extra_kwargs: Any` from its caller, and it calls itself at line 1115 (`self.chat`) with a piece of `extra_kwargs` — and nowhere in `chat` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `chat` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap deeptutor/services/llm/provider_core/openai_compat_provider.py:1318 — `chat_stream` is public and takes `extra_kwargs: Any` from its caller, and it calls itself at line 1318 (`self.chat_stream`) with a piece of `extra_kwargs` — and nowhere in `chat_stream` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `chat_stream` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap deeptutor/services/config/model_catalog.py:83 — `restore_catalog_secrets` is public, takes a document from its caller (line 99) and hands it to `_restore_secret_value`, which calls itself at line 83 (`_restore_secret_value`) with a piece of `proposed` (and at line 87) — and nowhere in `_restore_secret_value` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_restore_secret_value` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap deeptutor/services/config/origins.py:16 — `normalize_origins` is public, takes a document from its caller (line 47) and hands it to `_raw_origin_items`, which calls itself at line 16 (`_raw_origin_items`) with a piece of `value` — and nowhere in `_raw_origin_items` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_raw_origin_items` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap deeptutor/notes/blocks.py:203 — `inline_markdown` is public and takes `content: Any` from its caller, and it calls itself at line 203 (`inline_markdown`) with a piece of `content` — and nowhere in `inline_markdown` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `inline_markdown` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap deeptutor/multi_user/grants.py:329 — `validate_grant` is public, takes a document from its caller (line 316) and hands it to `walk`, which calls itself at line 329 (`walk`) with a piece of `value` (and at line 332) — and nowhere in `walk` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `walk` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap deeptutor/learning/outline_revision.py:47 — `exact_diff` is public and takes `before: Any` from its caller, and it calls itself at line 47 (`exact_diff`) with a piece of `before` (and at line 63) — and nowhere in `exact_diff` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `exact_diff` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap deeptutor/co_writer/edit_agent.py:72 — `append_history` is public, takes a document from its caller (line 76) and hands it to `_clip_history_value`, which calls itself at line 72 (`_clip_history_value`) with a piece of `value` — and nowhere in `_clip_history_value` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_clip_history_value` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap deeptutor/api/routers/_partners_channel_schema.py:68 — `inline_refs` is public, takes a document from its caller (line 49) and hands it to `_walk`, which calls itself at line 68 (`_walk`) with a piece of `node` (and at line 69, line 71) — and nowhere in `_walk` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_walk` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap deeptutor/api/routers/_partners_channel_schema.py:116 — `collect_secret_fields` is public and takes `schema: dict[str, Any]` from its caller, and it calls itself at line 116 (`collect_secret_fields`) with a piece of `schema` — and nowhere in `collect_secret_fields` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `collect_secret_fields` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
D3 · God Classes · TooManyMethods · ×24
  • TooManyMethods: SQLiteSessionStore deeptutor/services/session/sqlite_store.py:255 — TooManyMethods — 187 methods. The bar is 30 methods; this is 157 over it, 6.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: AgenticLoopPipeline deeptutor/agents/loop/pipeline.py:200 — TooManyMethods — 73 methods. The bar is 30 methods; this is 43 over it, 2.43× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: PathService deeptutor/services/path_service.py:66 — TooManyMethods — 70 methods. The bar is 30 methods; this is 40 over it, 2.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: RuntimeSettingsService deeptutor/services/config/runtime_settings.py:509 — TooManyMethods — 64 methods. The bar is 30 methods; this is 34 over it, 2.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: FeishuChannel deeptutor/partners/channels/feishu.py:396 — TooManyMethods — 60 methods. The bar is 30 methods; this is 30 over it, 2.00× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: KnowledgeBaseManager deeptutor/knowledge/manager.py:325 — TooManyMethods — 55 methods. The bar is 30 methods; this is 25 over it, 1.83× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: LearningStore deeptutor/learning/storage.py:396 — TooManyMethods — 55 methods. The bar is 30 methods; this is 25 over it, 1.83× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: BookEngine deeptutor/book/engine.py:317 — TooManyMethods — 54 methods. The bar is 30 methods; this is 24 over it, 1.80× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: PocketBaseSessionStore deeptutor/services/session/pocketbase_store.py:171 — TooManyMethods — 54 methods. The bar is 30 methods; this is 24 over it, 1.80× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: LearningService deeptutor/learning/service.py:328 — TooManyMethods — 51 methods. The bar is 30 methods; this is 21 over it, 1.70× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: PartnerManager deeptutor/services/partners/manager.py:492 — TooManyMethods — 51 methods. The bar is 30 methods; this is 21 over it, 1.70× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ReadingStore deeptutor/reading/store.py:161 — TooManyMethods — 50 methods. The bar is 30 methods; this is 20 over it, 1.67× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: PartnerGroupManager deeptutor/services/partner_groups/manager.py:132 — TooManyMethods — 49 methods. The bar is 30 methods; this is 19 over it, 1.63× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: SkillService deeptutor/services/skill/service.py:220 — TooManyMethods — 48 methods. The bar is 30 methods; this is 18 over it, 1.60× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: QuestionPipeline deeptutor/agents/question/pipeline.py:369 — TooManyMethods — 46 methods. The bar is 30 methods; this is 16 over it, 1.53× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ResearchPipeline deeptutor/agents/research/pipeline.py:341 — TooManyMethods — 44 methods. The bar is 30 methods; this is 14 over it, 1.47× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: MatrixChannel deeptutor/partners/channels/matrix.py:204 — TooManyMethods — 44 methods. The bar is 30 methods; this is 14 over it, 1.47× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ReadingCatalogStore deeptutor/reading/catalog_store.py:54 — TooManyMethods — 44 methods. The bar is 30 methods; this is 14 over it, 1.47× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: MochatChannel deeptutor/partners/channels/mochat.py:276 — TooManyMethods — 38 methods. The bar is 30 methods; this is 8 over it, 1.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ZulipChannel deeptutor/partners/channels/zulip.py:64 — TooManyMethods — 38 methods. The bar is 30 methods; this is 8 over it, 1.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: OpenAICompatProvider deeptutor/services/llm/provider_core/openai_compat_provider.py:188 — TooManyMethods — 38 methods. The bar is 30 methods; this is 8 over it, 1.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: CitationManager deeptutor/agents/research/utils/citation_manager.py:62 — TooManyMethods — 32 methods. The bar is 30 methods; this is 2 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: TelegramChannel deeptutor/partners/channels/telegram.py:274 — TooManyMethods — 32 methods. The bar is 30 methods; this is 2 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: ContentWorkspaceService deeptutor/services/workspace/service.py:80 — TooManyMethods — 31 methods. The bar is 30 methods; this is 1 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
AC4 · Keyboard semantics · Modal dialog does not manage focus · ×22
  • Modal dialog does not manage focus web/app/(admin)/admin/users/page.tsx:797 — This <div role="dialog"> is a modal dialog, but focus is moved into it, but nothing keeps it there: Tab walks out to the page behind, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
  • Modal dialog does not manage focus web/app/(admin)/admin/users/page.tsx:921 — This <div role="dialog"> is a modal dialog, but focus is moved into it, but nothing keeps it there: Tab walks out to the page behind, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
  • Modal dialog does not manage focus web/app/(workspace)/learning/books/components/BookGenerationActivity.tsx:235 — This <div role="dialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
  • Modal dialog does not manage focus web/components/chat/home/ContextBudgetChip.tsx:251 — This <div role="dialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
  • Modal dialog does not manage focus web/components/chat/home/SessionViewerPanel.tsx:1142 — This <div role="dialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
  • Modal dialog does not manage focus web/components/chat/preview/FilePreviewDrawer.tsx:211 — This <div role="dialog"> is a modal dialog, but focus is moved into it, but nothing keeps it there: Tab walks out to the page behind, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
  • Modal dialog does not manage focus web/components/reading/AnnotationPopover.tsx:303 — This <div role="dialog"> is a modal dialog, but focus is moved into it, but nothing keeps it there: Tab walks out to the page behind, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
  • Modal dialog does not manage focus web/components/reading/AnnotationPopover.tsx:332 — This <div role="dialog"> is a modal dialog, but focus is moved into it, but nothing keeps it there: Tab walks out to the page behind, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
  • Modal dialog does not manage focus web/components/reading/library/FolderDialog.tsx:74 — This <form role="dialog"> is a modal dialog, but focus is moved into it, but nothing keeps it there: Tab walks out to the page behind, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
  • Modal dialog does not manage focus web/components/settings/SettingsTourOverlay.tsx:170 — This <div role="dialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
  • Modal dialog does not manage focus web/components/sidebar/CommandPalette.tsx:175 — This <div role="dialog"> is a modal dialog, but focus is moved into it, but nothing keeps it there: Tab walks out to the page behind, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
  • Modal dialog does not manage focus web/components/space/EduHubImportModal.tsx:170 — This <div role="dialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
  • Modal dialog does not manage focus web/components/space/PersonasSection.tsx:391 — This <div role="dialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
  • Modal dialog does not manage focus web/components/space/PersonasSection.tsx:467 — This <div role="dialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
  • Modal dialog does not manage focus web/components/space/SkillsSection.tsx:742 — This <div role="dialog"> is a modal dialog, but focus is moved into it, but nothing keeps it there: Tab walks out to the page behind, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
  • Modal dialog does not manage focus web/components/space/SkillsSection.tsx:818 — This <div role="dialog"> is a modal dialog, but focus is moved into it, but nothing keeps it there: Tab walks out to the page behind, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
  • Modal dialog does not manage focus web/components/space/learning/ConfirmDialog.tsx:32 — This <div role="alertdialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
  • Modal dialog does not manage focus web/components/space/learning/CreateTopicWizard.tsx:116 — This <div role="dialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
  • Modal dialog does not manage focus web/components/space/learning/EditTopicRouteDialog.tsx:73 — This <div role="dialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
  • Modal dialog does not manage focus web/components/tasks/TaskColorPicker.tsx:114 — This <div role="dialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
  • Modal dialog does not manage focus web/components/ui/ConfirmDialog.tsx:56 — This <div role="alertdialog"> is a modal dialog, but focus is moved into it, but nothing keeps it there: Tab walks out to the page behind, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
  • Modal dialog does not manage focus web/features/calendar/components/AnchoredPopover.tsx:89 — This <div role="dialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×19
  • Duplicated block (10 lines × 2) deeptutor/agents/_shared/tool_composition.py:136 — deeptutor/agents/_shared/tool_composition.py:136-145 | deeptutor/services/settings/interface_settings.py:240-249 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) deeptutor/agents/loop/pipeline.py:308 — deeptutor/agents/loop/pipeline.py:308-317 | deeptutor/agents/research/pipeline.py:493-502 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/agents/loop/pipeline.py:308` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) deeptutor/agents/loop/pipeline.py:1087 — deeptutor/agents/loop/pipeline.py:1087-1096 | deeptutor/agents/research/pipeline.py:2171-2180 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (10 lines × 2) deeptutor/api/routers/notebook.py:294 — deeptutor/api/routers/notebook.py:294-303 | deeptutor/api/routers/notebook.py:430-439 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/api/routers/notebook.py:294` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) deeptutor/api/routers/partner_groups.py:463 — deeptutor/api/routers/partner_groups.py:463-472 | deeptutor/api/routers/partner_groups.py:474-483 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/api/routers/partner_groups.py:463` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) deeptutor/app/container.py:289 — deeptutor/app/container.py:289-298 | deeptutor/services/session/legacy_migration.py:264-273 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) deeptutor/book/agents/spine_agent.py:165 — deeptutor/book/agents/spine_agent.py:165-174 | deeptutor/book/agents/spine_synthesizer.py:445-454 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) deeptutor/capabilities/marginnote4/store.py:411 — deeptutor/capabilities/marginnote4/store.py:411-420 | deeptutor/capabilities/marginnote4/store.py:437-446 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) deeptutor/co_writer/storage.py:282 — deeptutor/co_writer/storage.py:282-291 | deeptutor/learning/migration.py:127-136 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (10 lines × 2) deeptutor/knowledge/manager.py:873 — deeptutor/knowledge/manager.py:873-882 | deeptutor/knowledge/manager.py:918-927 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `deeptutor/knowledge/manager.py:917` calls `normalize_provider_name` and `deeptutor/knowledge/manager.py:872` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (10 lines × 2) deeptutor/services/config/provider_runtime.py:844 — deeptutor/services/config/provider_runtime.py:844-853 | deeptutor/services/config/provider_runtime.py:1042-1051 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) deeptutor/services/memory/consolidator/modes/audit.py:413 — deeptutor/services/memory/consolidator/modes/audit.py:413-422 | deeptutor/services/memory/consolidator/modes/audit.py:438-447 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) deeptutor/services/partner_groups/manager.py:718 — deeptutor/services/partner_groups/manager.py:718-727 | deeptutor/services/partner_groups/manager.py:1265-1274 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) deeptutor/services/rag/pipelines/graphrag/completion_adapter.py:137 — deeptutor/services/rag/pipelines/graphrag/completion_adapter.py:137-146 | deeptutor/services/rag/pipelines/graphrag/completion_adapter.py:166-175 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) deeptutor/services/workspace/data_migration.py:680 — deeptutor/services/workspace/data_migration.py:680-689 | deeptutor/services/workspace/data_migration.py:1072-1081 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/services/workspace/data_migration.py:680` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) deeptutor/agents/question/pipeline.py:1704 — deeptutor/agents/question/pipeline.py:1704-1713 | deeptutor/agents/research/pipeline.py:2232-2241 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) deeptutor/agents/question/pipeline.py:1769 — deeptutor/agents/question/pipeline.py:1769-1778 | deeptutor/agents/research/pipeline.py:2262-2271 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) deeptutor/agents/question/pipeline.py:1826 — deeptutor/agents/question/pipeline.py:1826-1835 | deeptutor/agents/research/pipeline.py:2320-2329 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) deeptutor/services/rag/pipelines/graphrag/pipeline.py:56 — deeptutor/services/rag/pipelines/graphrag/pipeline.py:56-65 | deeptutor/services/rag/pipelines/lightrag/pipeline.py:113-122 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×19
  • Duplicated block (5 lines × 2) deeptutor/agents/loop/pipeline.py:133 — deeptutor/agents/loop/pipeline.py:133-137 | deeptutor/api/routers/unified_ws.py:34-38 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 2) deeptutor/agents/research/utils/citation_manager.py:715 — deeptutor/agents/research/utils/citation_manager.py:715-721 | deeptutor/agents/research/utils/citation_manager.py:725-729 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 2) deeptutor/api/routers/co_writer.py:736 — deeptutor/api/routers/co_writer.py:736-744 | deeptutor/api/routers/co_writer.py:758-762 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) deeptutor/api/routers/workspace.py:74 — deeptutor/api/routers/workspace.py:74-78 | deeptutor/api/routers/workspace.py:209-213 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) deeptutor/multi_user/partner_access.py:54 — deeptutor/multi_user/partner_access.py:54-58 | deeptutor/multi_user/skill_access.py:12-16 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/multi_user/partner_access.py:54` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 2) deeptutor/reading/ingestion.py:671 — deeptutor/reading/ingestion.py:671-675 | deeptutor/video_learning/service.py:87-91 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (5 lines × 2) deeptutor/services/config/provider_runtime.py:838 — deeptutor/services/config/provider_runtime.py:838-842 | deeptutor/services/config/provider_runtime.py:1036-1040 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) deeptutor/services/config/provider_runtime.py:1334 — deeptutor/services/config/provider_runtime.py:1334-1338 | deeptutor/services/config/provider_runtime.py:1377-1381 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) deeptutor/services/session/sqlite_store.py:3576 — deeptutor/services/session/sqlite_store.py:3576-3580 | deeptutor/services/session/sqlite_store.py:3645-3649 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) deeptutor/services/session/sqlite_store.py:3605 — deeptutor/services/session/sqlite_store.py:3605-3609 | deeptutor/services/session/sqlite_store.py:3727-3731 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `deeptutor/services/session/sqlite_store.py:3604` calls `str`, `get` and `deeptutor/services/session/sqlite_store.py:3726` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (5 lines × 2) deeptutor/services/storage/attachment_store.py:194 — deeptutor/services/storage/attachment_store.py:194-198 | deeptutor/services/storage/attachment_store.py:202-206 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) deeptutor/tools/list_notebook.py:117 — deeptutor/tools/list_notebook.py:117-121 | deeptutor/tools/write_note.py:108-112 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (5 lines × 2) deeptutor_cli/kb.py:277 — deeptutor_cli/kb.py:277-281 | deeptutor_cli/kb.py:343-347 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor_cli/kb.py:277` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `docs` to `list[str] = typer.Option([], "--doc", "-d", help="Document paths.")` in one and `list[str] = typer.Option([], "--doc", "-d", help="Document paths to add.")` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (5 lines × 2) deeptutor/services/config/model_catalog.py:263 — deeptutor/services/config/model_catalog.py:263-267 | deeptutor/services/config/settings_draft.py:62-66 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (5 lines × 2) deeptutor/services/memory/consolidator/modes/dedup.py:205 — deeptutor/services/memory/consolidator/modes/dedup.py:205-209 | deeptutor/services/memory/consolidator/modes/merge.py:209-213 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 2) deeptutor/services/rag/pipelines/lightrag/sidecar.py:16 — deeptutor/services/rag/pipelines/lightrag/sidecar.py:16-20 | deeptutor/services/subagent/codex.py:255-259 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (5 lines × 2) deeptutor/book/blocks/flash_cards.py:25 — deeptutor/book/blocks/flash_cards.py:25-29 | deeptutor/book/blocks/quiz.py:20-24 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (5 lines × 2) deeptutor/multi_user/knowledge_access.py:82 — deeptutor/multi_user/knowledge_access.py:82-86 | deeptutor/multi_user/knowledge_access.py:318-322 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) deeptutor/partners/channels/telegram.py:116 — deeptutor/partners/channels/telegram.py:116-120 | deeptutor/services/app_update.py:451-455 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×18
  • Duplicated block (12 lines × 2) deeptutor/agents/question/pipeline.py:2067 — deeptutor/agents/question/pipeline.py:2067-2078 | deeptutor/agents/research/pipeline.py:2773-2784 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/agents/question/pipeline.py:2067` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) deeptutor/agents/question/pipeline.py:2080 — deeptutor/agents/question/pipeline.py:2080-2091 | deeptutor/agents/research/pipeline.py:2786-2797 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (12 lines × 2) deeptutor/api/routers/dashboard.py:128 — deeptutor/api/routers/dashboard.py:128-139 | deeptutor/api/routers/dashboard.py:253-264 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) deeptutor/api/routers/knowledge.py:5082 — deeptutor/api/routers/knowledge.py:5082-5093 | deeptutor/api/routers/knowledge.py:5151-5162 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) deeptutor/api/routers/render_storage.py:99 — deeptutor/api/routers/render_storage.py:99-110 | deeptutor/api/routers/render_storage.py:182-193 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/api/routers/render_storage.py:99` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) deeptutor/knowledge/add_documents.py:795 — deeptutor/knowledge/add_documents.py:795-806 | deeptutor/knowledge/initializer.py:405-416 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `deeptutor/knowledge/initializer.py:417` calls `add_argument` and `deeptutor/knowledge/add_documents.py:807` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12 lines × 2) deeptutor/services/chat_hints.py:272 — deeptutor/services/chat_hints.py:272-285 | deeptutor/services/reading_hints.py:436-447 — before extracting anything, compare `deeptutor/services/chat_hints.py` and `deeptutor/services/reading_hints.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/services/chat_hints.py:272` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) deeptutor/services/config/model_catalog.py:309 — deeptutor/services/config/model_catalog.py:309-320 | deeptutor/services/config/settings_draft.py:96-107 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/services/config/model_catalog.py:309` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (12 lines × 2) deeptutor/services/config/provider_runtime.py:1393 — deeptutor/services/config/provider_runtime.py:1393-1404 | deeptutor/services/config/provider_runtime.py:1434-1445 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/services/config/provider_runtime.py:1393` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12 lines × 2) deeptutor/services/file_io.py:89 — deeptutor/services/file_io.py:89-100 | deeptutor/services/file_io.py:112-123 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) deeptutor/services/github_source/sync.py:139 — deeptutor/services/github_source/sync.py:139-150 | deeptutor/services/github_source/sync.py:154-165 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) deeptutor/services/llm/provider_core/anthropic_provider.py:533 — deeptutor/services/llm/provider_core/anthropic_provider.py:533-544 | deeptutor/services/llm/provider_core/anthropic_provider.py:564-575 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) deeptutor/services/persona/service.py:132 — deeptutor/services/persona/service.py:132-143 | deeptutor/services/skill/service.py:353-364 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) deeptutor/services/search/providers/brave.py:43 — deeptutor/services/search/providers/brave.py:43-54 | deeptutor/services/search/providers/duckduckgo.py:32-43 — before extracting anything, compare `deeptutor/services/search/providers/brave.py` and `deeptutor/services/search/providers/duckduckgo.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/services/search/providers/brave.py:43` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `deeptutor/services/search/providers/brave.py:55` calls `str`, `get` and `deeptutor/services/search/providers/duckduckgo.py:44` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12 lines × 2) deeptutor/services/skill/hub.py:320 — deeptutor/services/skill/hub.py:320-331 | deeptutor/services/skill/hub.py:453-464 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) deeptutor/services/subagent/antigravity.py:209 — deeptutor/services/subagent/antigravity.py:209-220 | deeptutor/services/subagent/claude_code.py:155-166 — before extracting anything, compare `deeptutor/services/subagent/antigravity.py` and `deeptutor/services/subagent/claude_code.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) deeptutor/services/web_source/snapshot_assets.py:110 — deeptutor/services/web_source/snapshot_assets.py:110-121 | deeptutor/tools/web_fetch.py:126-137 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (12 lines × 2) deeptutor/services/workspace/data_migration.py:519 — deeptutor/services/workspace/data_migration.py:519-530 | deeptutor/services/workspace/data_migration.py:600-611 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×16
  • Duplicated block (9 lines × 2) deeptutor/api/routers/notebook.py:319 — deeptutor/api/routers/notebook.py:319-327 | deeptutor/api/routers/notebook.py:389-397 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) deeptutor/api/routers/partner_groups.py:307 — deeptutor/api/routers/partner_groups.py:307-315 | deeptutor/api/routers/partner_groups.py:327-335 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/api/routers/partner_groups.py:307` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (9 lines × 2) deeptutor/api/routers/subagents.py:166 — deeptutor/api/routers/subagents.py:166-174 | deeptutor/api/routers/subagents.py:205-213 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) deeptutor/api/routers/video_learning.py:466 — deeptutor/api/routers/video_learning.py:466-474 | deeptutor/video_learning/service.py:497-505 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (9 lines × 2) deeptutor/book/blocks/callout.py:38 — deeptutor/book/blocks/callout.py:38-46 | deeptutor/book/blocks/code.py:74-82 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `deeptutor/book/blocks/code.py:71` calls `str`, `get` and `deeptutor/book/blocks/callout.py:36` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 2) deeptutor/book/context.py:309 — deeptutor/book/context.py:309-317 | deeptutor/book/context.py:339-347 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) deeptutor/partners/channels/weixin.py:560 — deeptutor/partners/channels/weixin.py:560-568 | deeptutor/partners/channels/weixin.py:607-615 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) deeptutor/plugins/runtime.py:246 — deeptutor/plugins/runtime.py:246-254 | deeptutor/plugins/runtime.py:334-342 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) deeptutor/runtime/registry/scoped_registry.py:91 — deeptutor/runtime/registry/scoped_registry.py:91-99 | deeptutor/runtime/registry/tool_registry.py:139-147 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) deeptutor/runtime/update_worker.py:90 — deeptutor/runtime/update_worker.py:90-100 | deeptutor/services/app_update.py:643-651 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (9 lines × 2) deeptutor/services/embedding/adapters/cohere.py:152 — deeptutor/services/embedding/adapters/cohere.py:152-160 | deeptutor/services/embedding/adapters/ollama.py:120-130 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/services/embedding/adapters/cohere.py:152` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) deeptutor/services/llm/provider_core/openai_compat_provider.py:1096 — deeptutor/services/llm/provider_core/openai_compat_provider.py:1096-1104 | deeptutor/services/llm/provider_core/openai_compat_provider.py:1255-1263 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/services/llm/provider_core/openai_compat_provider.py:1096` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) deeptutor/services/mcp/oauth.py:122 — deeptutor/services/mcp/oauth.py:122-130 | REDACTED:173-181 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (9 lines × 2) deeptutor/services/search/providers/doubao.py:137 — deeptutor/services/search/providers/doubao.py:137-145 | deeptutor/services/search/providers/zhipu.py:105-113 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/services/search/providers/doubao.py:137` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (9 lines × 2) deeptutor/services/videogen/adapters/async_task.py:73 — deeptutor/services/videogen/adapters/async_task.py:73-81 | deeptutor/services/videogen/adapters/dashscope.py:81-89 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `deeptutor/services/videogen/adapters/async_task.py:83` calls `get` and `deeptutor/services/videogen/adapters/dashscope.py:90` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 2) deeptutor/book/agents/ideation_agent.py:36 — deeptutor/book/agents/ideation_agent.py:36-44 | deeptutor/book/agents/spine_agent.py:42-50 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×16
  • Duplicated block (7 lines × 2) deeptutor/agents/math_animator/retry_manager.py:103 — deeptutor/agents/math_animator/retry_manager.py:103-112 | deeptutor/agents/math_animator/retry_manager.py:139-145 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/agents/math_animator/retry_manager.py:103` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) deeptutor/agents/question/pipeline.py:431 — deeptutor/agents/question/pipeline.py:431-437 | deeptutor/agents/research/pipeline.py:499-505 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/agents/question/pipeline.py:431` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `deeptutor/agents/question/pipeline.py:438` calls `default_optional_tools` and `deeptutor/agents/research/pipeline.py:509` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 2) deeptutor/capabilities/reading/tools.py:450 — deeptutor/capabilities/reading/tools.py:450-457 | deeptutor/capabilities/reading/tools.py:541-547 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `deeptutor/capabilities/reading/tools.py:448` calls `to_thread` and `deeptutor/capabilities/reading/tools.py:539` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 2) deeptutor/learning/storage.py:839 — deeptutor/learning/storage.py:839-845 | deeptutor/learning/storage.py:853-859 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) deeptutor/reading/catalog_store.py:426 — deeptutor/reading/catalog_store.py:426-432 | deeptutor/reading/catalog_store.py:646-652 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) deeptutor/reading/ingestion.py:650 — deeptutor/reading/ingestion.py:650-656 | deeptutor/video_learning/service.py:73-79 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) deeptutor/runtime/ts_engine/client.py:171 — deeptutor/runtime/ts_engine/client.py:171-177 | deeptutor/runtime/ts_engine/client.py:252-258 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) deeptutor/services/config/provider_runtime.py:1303 — deeptutor/services/config/provider_runtime.py:1303-1309 | deeptutor/services/config/provider_runtime.py:1357-1363 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) deeptutor/services/mcp/config.py:144 — deeptutor/services/mcp/config.py:144-150 | deeptutor/services/mcp/user_config.py:216-222 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `deeptutor/services/mcp/user_config.py:223` calls `chmod` and `deeptutor/services/mcp/config.py:151` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (7 lines × 2) deeptutor/services/rag/pipelines/llamaindex/pipeline.py:299 — deeptutor/services/rag/pipelines/llamaindex/pipeline.py:299-306 | deeptutor/services/rag/pipelines/llamaindex/pipeline.py:535-541 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) deeptutor_cli/common.py:137 — deeptutor_cli/common.py:137-143 | deeptutor_cli/common.py:172-178 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor_cli/common.py:137` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) deeptutor/services/chat_hints.py:241 — deeptutor/services/chat_hints.py:241-247 | deeptutor/services/reading_hints.py:407-413 — before extracting anything, compare `deeptutor/services/chat_hints.py` and `deeptutor/services/reading_hints.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) deeptutor/services/config/launch_settings.py:31 — deeptutor/services/config/launch_settings.py:31-37 | deeptutor/services/config/runtime_settings.py:479-485 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) deeptutor/services/session/pocketbase_store.py:913 — deeptutor/services/session/pocketbase_store.py:913-919 | deeptutor/services/session/sqlite_store.py:3343-3349 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (7 lines × 2) deeptutor/api/routers/creations.py:35 — deeptutor/api/routers/creations.py:35-41 | deeptutor/api/routers/partners.py:128-134 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (7 lines × 2) deeptutor/agents/notebook/analysis_agent.py:25 — deeptutor/agents/notebook/analysis_agent.py:25-31 | deeptutor/agents/notebook/summarize_agent.py:17-23 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `deeptutor/agents/notebook/summarize_agent.py:24` calls `getattr` and `deeptutor/agents/notebook/analysis_agent.py:35` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D30 · Dependency Vulnerabilities · Medium CVE · ×15
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×13
  • Duplicated block (6 lines × 2) deeptutor/agents/math_animator/request_config.py:31 — deeptutor/agents/math_animator/request_config.py:31-36 | deeptutor/agents/research/request_config.py:58-63 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (6 lines × 2) deeptutor/agents/question/history.py:76 — deeptutor/agents/question/history.py:76-81 | deeptutor/services/model_selection/llm.py:106-111 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 2) deeptutor/api/routers/co_writer.py:727 — deeptutor/api/routers/co_writer.py:727-732 | deeptutor/api/routers/co_writer.py:749-754 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/api/routers/co_writer.py:727` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) deeptutor/reading/knowledge_capture.py:38 — deeptutor/reading/knowledge_capture.py:38-43 | deeptutor/reading/knowledge_capture.py:135-140 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) deeptutor/runtime/ts_engine/client.py:124 — deeptutor/runtime/ts_engine/client.py:124-129 | deeptutor/runtime/ts_engine/client.py:190-195 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) deeptutor/services/cli_apps/state.py:201 — deeptutor/services/cli_apps/state.py:201-206 | deeptutor/video_learning/invidious_account_storage.py:78-83 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (6 lines × 2) deeptutor/services/embedding/adapters/openai_compatible.py:117 — deeptutor/services/embedding/adapters/openai_compatible.py:117-122 | deeptutor/services/embedding/adapters/openai_compatible.py:123-128 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) deeptutor/services/memory/consolidator/modes/audit.py:138 — deeptutor/services/memory/consolidator/modes/audit.py:138-143 | deeptutor/services/memory/consolidator/modes/audit.py:278-283 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 2) deeptutor/services/search/providers/serper.py:95 — deeptutor/services/search/providers/serper.py:95-100 | deeptutor/services/search/providers/tavily.py:93-98 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (6 lines × 2) deeptutor/tools/builtin/__init__.py:1257 — deeptutor/tools/builtin/__init__.py:1257-1262 | deeptutor/tools/partner_memory.py:177-182 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/tools/builtin/__init__.py:1257` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (6 lines × 2) deeptutor/book/export.py:111 — deeptutor/book/export.py:111-116 | deeptutor/partners/channels/mochat.py:86-91 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 2) deeptutor/services/parsing/engines/_install.py:257 — deeptutor/services/parsing/engines/_install.py:257-262 | deeptutor/services/parsing/engines/mineru/models.py:206-211 — before extracting anything, compare `deeptutor/services/parsing/engines/_install.py` and `deeptutor/services/parsing/engines/mineru/models.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 2) deeptutor/services/llm/provider_core/claude_code_provider.py:403 — deeptutor/services/llm/provider_core/claude_code_provider.py:403-408 | deeptutor/services/llm/provider_core/codebuddy_provider.py:520-525 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Note first that the copies are not typed on the same thing: the declarations holding them bind `session` to `_ClaudeCodeSession` in one and `_CodeBuddySession` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D31 · IaC & Container Security · Medium IaC · ×12
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×11
  • Duplicated block (13 lines × 2) deeptutor/agents/question/pipeline.py:2016 — deeptutor/agents/question/pipeline.py:2016-2028 | deeptutor/agents/research/pipeline.py:2358-2370 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13 lines × 2) deeptutor/book/agents/spine_agent.py:117 — deeptutor/book/agents/spine_agent.py:117-129 | deeptutor/book/agents/spine_synthesizer.py:426-438 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13 lines × 2) deeptutor/learning/service.py:1024 — deeptutor/learning/service.py:1024-1036 | deeptutor/learning/service.py:1134-1146 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13 lines × 2) deeptutor/multi_user/device_credentials.py:116 — deeptutor/multi_user/device_credentials.py:116-128 | deeptutor/multi_user/guardians.py:61-73 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13 lines × 2) deeptutor/services/memory/snapshot/adapters.py:183 — deeptutor/services/memory/snapshot/adapters.py:183-195 | deeptutor/services/memory/snapshot/adapters.py:217-229 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `deeptutor/services/memory/snapshot/adapters.py:215` calls `is_dir` and `deeptutor/services/memory/snapshot/adapters.py:182` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (13 lines × 2) deeptutor/services/parsing/engines/_install.py:158 — deeptutor/services/parsing/engines/_install.py:158-170 | deeptutor/services/parsing/engines/mineru/models.py:157-169 — before extracting anything, compare `deeptutor/services/parsing/engines/_install.py` and `deeptutor/services/parsing/engines/mineru/models.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13 lines × 2) deeptutor/services/search/providers/bocha.py:115 — deeptutor/services/search/providers/bocha.py:115-127 | deeptutor/services/search/providers/zhipu.py:125-137 — before extracting anything, compare `deeptutor/services/search/providers/bocha.py` and `deeptutor/services/search/providers/zhipu.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/services/search/providers/bocha.py:115` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13 lines × 2) deeptutor/services/session/_turn_runtime_shared.py:140 — deeptutor/services/session/_turn_runtime_shared.py:140-152 | deeptutor/services/session/_turn_runtime_shared.py:156-168 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (13 lines × 2) deeptutor/utils/document_extractor.py:888 — deeptutor/utils/document_extractor.py:888-900 | deeptutor/utils/document_extractor.py:928-940 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13 lines × 2) deeptutor_cli/kb.py:605 — deeptutor_cli/kb.py:605-617 | deeptutor_cli/kb.py:638-650 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13 lines × 2) scripts/export_discord_history.py:312 — scripts/export_discord_history.py:312-324 | scripts/export_discord_history.py:345-357 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×10
  • Duplicated block (11 lines × 2) deeptutor/api/routers/memory.py:531 — deeptutor/api/routers/memory.py:531-541 | deeptutor/api/routers/memory.py:546-556 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. Note first that the copies are not typed on the same thing: the declarations holding them bind `payload` to `UpdateRequest | None = None` in one and `AuditRequest | None = None` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (11 lines × 2) deeptutor/capabilities/solve/tools.py:111 — deeptutor/capabilities/solve/tools.py:111-121 | deeptutor/capabilities/solve/tools.py:260-270 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) deeptutor/partners/channels/feishu.py:1176 — deeptutor/partners/channels/feishu.py:1176-1186 | deeptutor/partners/channels/feishu.py:1211-1221 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/partners/channels/feishu.py:1176` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (11 lines × 2) deeptutor/services/config/runtime_settings.py:923 — deeptutor/services/config/runtime_settings.py:923-933 | deeptutor/services/config/runtime_settings.py:951-961 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) deeptutor/services/imagegen/adapters/dashscope.py:105 — deeptutor/services/imagegen/adapters/dashscope.py:105-115 | deeptutor/services/videogen/adapters/dashscope.py:214-224 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (11 lines × 2) deeptutor/services/mastery_hints.py:241 — deeptutor/services/mastery_hints.py:241-251 | deeptutor/services/mastery_hints.py:253-263 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) deeptutor/services/parsing/engines/mineru/local.py:356 — deeptutor/services/parsing/engines/mineru/local.py:356-366 | deeptutor/services/skill/service.py:699-709 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (11 lines × 2) deeptutor/services/search/providers/google_browser_scraper.py:67 — deeptutor/services/search/providers/google_browser_scraper.py:67-77 | deeptutor/services/search/providers/searxng.py:56-66 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (11 lines × 2) deeptutor/services/voice/speech_text.py:474 — deeptutor/services/voice/speech_text.py:474-484 | deeptutor/services/voice/speech_text.py:533-543 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) deeptutor/agents/question/pipeline.py:1848 — deeptutor/agents/question/pipeline.py:1848-1858 | deeptutor/agents/research/pipeline.py:2342-2352 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
AC1 · Text alternatives · <video> without a captions track · ×8
  • <video> without a captions track web/app/(workspace)/learning/books/components/blocks/AnimationBlock.tsx:58 — Video with no captions <track> offers no captions. This player's source is set at runtime, so there is no caption file to author here: give the player a way to carry captions — accept a track/captions URL alongside the media and render a <track kind="captions"> when one is supplied — and capture that asset wherever the media enters the product (upload, import or generation).
  • <video> without a captions track web/components/chat/preview/previewers/VideoPreview.tsx:30 — Video with no captions <track> offers no captions. This player's source is set at runtime, so there is no caption file to author here: give the player a way to carry captions — accept a track/captions URL alongside the media and render a <track kind="captions"> when one is supplied — and capture that asset wherever the media enters the product (upload, import or generation).
  • <video> without a captions track web/components/math-animator/MathAnimatorViewer.tsx:99 — Video with no captions <track> offers no captions. This player's source is set at runtime, so there is no caption file to author here: give the player a way to carry captions — accept a track/captions URL alongside the media and render a <track kind="captions"> when one is supplied — and capture that asset wherever the media enters the product (upload, import or generation).
  • <video> without a captions track web/components/notebook/NotebookFavoriteContent.tsx:51 — Video with no captions <track> offers no captions. This player's source is set at runtime, so there is no caption file to author here: give the player a way to carry captions — accept a track/captions URL alongside the media and render a <track kind="captions"> when one is supplied — and capture that asset wherever the media enters the product (upload, import or generation).
  • <video> without a captions track web/components/reading/workspace/MediaReadingStage.tsx:654 — Video with no captions <track> offers no captions. This player's source is set at runtime, so there is no caption file to author here: give the player a way to carry captions — accept a track/captions URL alongside the media and render a <track kind="captions"> when one is supplied — and capture that asset wherever the media enters the product (upload, import or generation).
  • <video> without a captions track web/components/settings/ServicePreviewPanel.tsx:332 — Video with no captions <track> offers no captions. This player's source is set at runtime, so there is no caption file to author here: give the player a way to carry captions — accept a track/captions URL alongside the media and render a <track kind="captions"> when one is supplied — and capture that asset wherever the media enters the product (upload, import or generation).
  • <video> without a captions track web/features/chat/messages/ChatMessageList.tsx:664 — Video with no captions <track> offers no captions. This player's source is set at runtime, so there is no caption file to author here: give the player a way to carry captions — accept a track/captions URL alongside the media and render a <track kind="captions"> when one is supplied — and capture that asset wherever the media enters the product (upload, import or generation).
  • <video> without a captions track web/features/notes/components/NoteResult.tsx:42 — Video with no captions <track> offers no captions. This player's source is set at runtime, so there is no caption file to author here: give the player a way to carry captions — accept a track/captions URL alongside the media and render a <track kind="captions"> when one is supplied — and capture that asset wherever the media enters the product (upload, import or generation).
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×8
  • Duplicated block (14 lines × 2) deeptutor/agents/notebook/analysis_agent.py:98 — deeptutor/agents/notebook/analysis_agent.py:98-111 | deeptutor/agents/notebook/analysis_agent.py:226-239 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/agents/notebook/analysis_agent.py:98` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14 lines × 2) deeptutor/agents/question/pipeline.py:439 — deeptutor/agents/question/pipeline.py:439-452 | deeptutor/agents/research/pipeline.py:509-522 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `deeptutor/agents/question/pipeline.py:438` calls `default_optional_tools` and `deeptutor/agents/research/pipeline.py:505` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (14 lines × 2) deeptutor/partners/channels/mochat.py:607 — deeptutor/partners/channels/mochat.py:607-620 | deeptutor/partners/channels/mochat.py:641-654 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14 lines × 2) deeptutor/runtime/orchestrator.py:88 — deeptutor/runtime/orchestrator.py:88-101 | deeptutor/runtime/orchestrator.py:121-134 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/runtime/orchestrator.py:88` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (14 lines × 2) deeptutor/services/embedding/adapters/cohere.py:126 — deeptutor/services/embedding/adapters/cohere.py:126-139 | deeptutor/services/embedding/adapters/jina.py:112-125 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (14 lines × 2) deeptutor/services/llm/factory.py:441 — deeptutor/services/llm/factory.py:441-454 | deeptutor/services/llm/factory.py:499-512 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/services/llm/factory.py:441` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14 lines × 2) deeptutor/services/search/providers/bocha.py:96 — deeptutor/services/search/providers/bocha.py:96-109 | deeptutor/services/search/providers/qianfan.py:109-122 — before extracting anything, compare `deeptutor/services/search/providers/bocha.py` and `deeptutor/services/search/providers/qianfan.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/services/search/providers/bocha.py:96` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `deeptutor/services/search/providers/qianfan.py:125` calls `get` and `deeptutor/services/search/providers/bocha.py:110` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (14 lines × 2) deeptutor/services/subagent/deepseek_harness.py:109 — deeptutor/services/subagent/deepseek_harness.py:109-122 | deeptutor/services/subagent/hermes.py:100-113 — before extracting anything, compare `deeptutor/services/subagent/deepseek_harness.py` and `deeptutor/services/subagent/hermes.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×7
  • Duplicated block (17 lines × 2) deeptutor/agents/loop/pipeline.py:1968 — deeptutor/agents/loop/pipeline.py:1968-1984 | deeptutor/agents/loop/pipeline.py:1985-2001 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (17 lines × 2) deeptutor/capabilities/explore_context/capability.py:49 — deeptutor/capabilities/explore_context/capability.py:49-65 | deeptutor/capabilities/reading/capability.py:77-93 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (17 lines × 2) deeptutor/learning/service.py:1005 — deeptutor/learning/service.py:1005-1021 | deeptutor/learning/service.py:1048-1064 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (17 lines × 2) deeptutor/services/chat_hints.py:207 — deeptutor/services/chat_hints.py:207-223 | deeptutor/services/reading_hints.py:361-377 — before extracting anything, compare `deeptutor/services/chat_hints.py` and `deeptutor/services/reading_hints.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (17 lines × 2) deeptutor/services/memory/consolidator/modes/audit.py:83 — deeptutor/services/memory/consolidator/modes/audit.py:83-99 | deeptutor/services/memory/consolidator/modes/update.py:96-112 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `deeptutor/services/memory/consolidator/modes/update.py:92` calls `llm_selection` and `deeptutor/services/memory/consolidator/modes/audit.py:82` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (17 lines × 2) deeptutor/services/partner_groups/manager.py:985 — deeptutor/services/partner_groups/manager.py:985-1001 | deeptutor/services/partner_groups/manager.py:1047-1063 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/services/partner_groups/manager.py:985` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 2) deeptutor/services/voice/adapters/dashscope.py:286 — deeptutor/services/voice/adapters/dashscope.py:286-302 | deeptutor/services/voice/audio.py:43-59 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/services/voice/adapters/dashscope.py:286` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (10–11 lines × 2) · ×7
  • Duplicated block (10–11 lines × 2) deeptutor/agents/question/pipeline.py:1565 — deeptutor/agents/question/pipeline.py:1565-1575 | deeptutor/agents/research/pipeline.py:1092-1101 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/agents/question/pipeline.py:1565` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10–11 lines × 2) deeptutor/api/routers/multi_user.py:898 — deeptutor/api/routers/multi_user.py:898-907 | deeptutor/api/routers/skills.py:257-267 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. Note first that the copies are not typed on the same thing: the declarations holding them bind `payload` to `SkillInstallPayload` in one and `InstallSkillRequest` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (10–11 lines × 2) deeptutor/api/routers/system.py:339 — deeptutor/api/routers/system.py:339-349 | deeptutor/api/routers/system.py:351-360 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10–11 lines × 2) deeptutor/api/utils/task_log_stream.py:54 — deeptutor/api/utils/task_log_stream.py:54-64 | deeptutor/api/utils/task_log_stream.py:126-135 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (10–11 lines × 2) deeptutor/knowledge/add_documents.py:808 — deeptutor/knowledge/add_documents.py:808-817 | deeptutor/knowledge/initializer.py:418-428 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (10–11 lines × 2) deeptutor/reading/extract.py:351 — deeptutor/reading/extract.py:351-360 | deeptutor/utils/document_extractor.py:556-566 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (10–11 lines × 2) deeptutor/services/rag/pipelines/lightrag/pipeline.py:389 — deeptutor/services/rag/pipelines/lightrag/pipeline.py:389-398 | deeptutor/services/rag/pipelines/lightrag/pipeline.py:492-502 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/services/rag/pipelines/lightrag/pipeline.py:492` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8 lines × 3) · ×7
  • Duplicated block (8 lines × 3) deeptutor/agents/loop/pipeline.py:1086 — deeptutor/agents/loop/pipeline.py:1086-1093 | deeptutor/agents/research/pipeline.py:2170-2177 | deeptutor/capabilities/explore_context/explorer.py:459-466 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
  • Duplicated block (8 lines × 3) deeptutor/agents/question/pipeline.py:2086 — deeptutor/agents/question/pipeline.py:2086-2093 | deeptutor/agents/research/pipeline.py:2792-2799 | deeptutor/agents/research/pipeline.py:3178-3185 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
  • Duplicated block (8 lines × 3) deeptutor/services/search/providers/bocha.py:95 — deeptutor/services/search/providers/bocha.py:95-102 | deeptutor/services/search/providers/firecrawl.py:102-109 | deeptutor/services/search/providers/qianfan.py:108-115 — before extracting anything, compare `deeptutor/services/search/providers/bocha.py` and `deeptutor/services/search/providers/qianfan.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/services/search/providers/bocha.py:95` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `deeptutor/services/search/providers/qianfan.py:105` calls `str`, `get` and `deeptutor/services/search/providers/firecrawl.py:100` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 3) deeptutor/services/search/providers/brave.py:46 — deeptutor/services/search/providers/brave.py:46-53 | deeptutor/services/search/providers/duckduckgo.py:35-42 | deeptutor/services/search/providers/searxng.py:74-81 — before extracting anything, compare `deeptutor/services/search/providers/brave.py` and `deeptutor/services/search/providers/duckduckgo.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/services/search/providers/brave.py:46` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `deeptutor/services/search/providers/brave.py:55` calls `str`, `get` and `deeptutor/services/search/providers/duckduckgo.py:44` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 3) deeptutor/agents/_shared/tool_composition.py:292 — deeptutor/agents/_shared/tool_composition.py:292-299 | deeptutor/services/memory/consolidator/references.py:349-356 | deeptutor/services/skill/service.py:276-283 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 3) deeptutor/capabilities/marginnote4/binding.py:20 — deeptutor/capabilities/marginnote4/binding.py:20-27 | deeptutor/capabilities/obsidian/binding.py:23-30 | deeptutor/capabilities/subagent/binding.py:24-31 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 3) deeptutor/services/subagent/claude_code.py:72 — deeptutor/services/subagent/claude_code.py:72-79 | deeptutor/services/subagent/codex.py:72-79 | deeptutor/services/subagent/kimi.py:81-88 — before extracting anything, compare `deeptutor/services/subagent/claude_code.py` and `deeptutor/services/subagent/kimi.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
PF3 · Async & latency hygiene · Sync-over-async blocking · ×7
  • Sync-over-async blocking deeptutor/partners/channels/feishu.py:480 — `start` is async and calls time.sleep — a blocking call inside async code stalls the event loop — every other task on it waits for as long as it runs.
  • Sync-over-async blocking apps/desktop/platforms/windows-x64/package.mjs:39 — `execFileSync` in `packageWindows` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking apps/desktop/platforms/windows-x64/package.mjs:43 — `execFileSync` in `packageWindows` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking apps/desktop/scripts/lib/macos.mjs:29 — `execFileSync` in `packageMac` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking apps/desktop/scripts/lib/macos.mjs:30 — `execFileSync` in `packageMac` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking apps/desktop/scripts/lib/macos.mjs:40 — `execFileSync` in `packageMac` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking web/scripts/route_budgets.mjs:172 — `fs.readFileSync` in `main` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
D29 · Static Analysis (SAST) · REDACTED · ×5
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (12–13 lines × 2) · ×5
  • Duplicated block (12–13 lines × 2) deeptutor/agents/loop/agent_loop.py:912 — deeptutor/agents/loop/agent_loop.py:912-924 | deeptutor/runtime/agentic/labeled_step.py:525-536 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12–13 lines × 2) deeptutor/knowledge/manager.py:2282 — deeptutor/knowledge/manager.py:2282-2293 | deeptutor/knowledge/manager.py:2377-2389 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12–13 lines × 2) deeptutor/services/search/providers/bocha.py:88 — deeptutor/services/search/providers/bocha.py:88-100 | deeptutor/services/search/providers/zhipu.py:99-110 — before extracting anything, compare `deeptutor/services/search/providers/bocha.py` and `deeptutor/services/search/providers/zhipu.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/services/search/providers/bocha.py:88` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (12–13 lines × 2) deeptutor/services/workspace/render_storage.py:43 — deeptutor/services/workspace/render_storage.py:43-55 | deeptutor/services/workspace/render_storage.py:98-109 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/services/workspace/render_storage.py:43` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (12–13 lines × 2) deeptutor/tools/media_gen_tool.py:190 — deeptutor/tools/media_gen_tool.py:190-201 | deeptutor/tools/media_gen_tool.py:281-293 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/tools/media_gen_tool.py:190` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
X2 · Cancellation propagation · Async function without AbortSignal · ×5
  • Async function without AbortSignal: apiFetch web/shared/api/client.ts:28 — `apiFetch` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: waitForServer web/scripts/route_budgets.mjs:56 — `waitForServer` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: loadRouteChunks web/scripts/route_budgets.mjs:112 — `loadRouteChunks` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: assertRootRedirect web/scripts/route_budgets.mjs:120 — `assertRootRedirect` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: fetchNode apps/desktop/scripts/build-runtime.mjs:33 — `fetchNode` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
X3 · Exception handling · Swallowed exception (caught, then discarded) · ×5
  • Swallowed exception (caught, then discarded) web/lib/book-ws-operation.ts:102 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) web/lib/quiz-judge.ts:87 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) web/lib/use-book-stream.ts:75 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) web/lib/chat-import/claude-code.ts:148 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
  • Swallowed exception (caught, then discarded) web/lib/chat-import/codex.ts:222 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, narrow the catch to the exception this call can actually raise, or say in a comment on the catch why the failure genuinely cannot matter.
D10 · Test Quality · No assertions · ×4
  • No assertions: displays unreadable or missing source states rather than permanent loading web/tests/kb-visual-coverage.spec.tsx:26 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: distinguishes voice failure from an empty live list and allows retry web/tests/settings-service-preview.spec.tsx:55 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: shows an actionable instance failure web/tests/watching-browser.spec.tsx:97 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
  • No assertions: api error surfaces user-friendly feedback (alert or message) web/tests/e2e/compliance-and-ux.audit.ts:90 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
D29 · Static Analysis (SAST) · REDACTED · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D35 · Change Coupling · Change coupling · ×4
  • Change coupling: sessions.py ↔ protocol.py deeptutor/api/routers/sessions.py:1 — `deeptutor/api/routers/sessions.py` and `deeptutor/services/session/protocol.py` change together 60% of the time (6 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `58afb10b` fix: harden tutor-thread source recovery; `3a0ed2b5` fix(turns): surface and retry orphaned worker loss (#1570); `9b066b5f` feat(sessions): add recycle bin for deleted chats (#1398) — run `git show` on any of them.
  • Change coupling: add_documents.py ↔ initializer.py deeptutor/knowledge/add_documents.py:1 — `deeptutor/knowledge/add_documents.py` and `deeptutor/knowledge/initializer.py` change together 53% of the time (9 of the 17 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `8899ae6d` fix(knowledge): keep same-named documents when creating a KB; `80da6cee` fix: support Windows data volume permission checks; `388399c3` fix(docker): remap PUID/PGID for Unraid bind mounts (#1458) — run `git show` on any of them.
  • Change coupling: protocol.py ↔ session-api.ts deeptutor/services/session/protocol.py:1 — `deeptutor/services/session/protocol.py` and `web/lib/session-api.ts` change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit — they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary — an event or message name, a route, a serialised shape — that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other's build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `019ed329` fix(session): preserve opaque PocketBase message cursors; `3a0ed2b5` fix(turns): surface and retry orphaned worker loss (#1570); `9b066b5f` feat(sessions): add recycle bin for deleted chats (#1398) — run `git show` on any of them.
  • Change coupling: ServiceConfigEditor.tsx ↔ SettingsOverview.tsx web/components/settings/ServiceConfigEditor.tsx:1 — `web/components/settings/ServiceConfigEditor.tsx` and `web/components/settings/SettingsOverview.tsx` change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `4c6498b7` feat(i18n): add Ukrainian as a full interface and output language; `32848a6b` feat: add french as supported language; `a2f124a6` feat(settings): Models/Chat/Agents categories scroll in one page — run `git show` on any of them.
D4 · Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) · ×4
  • Members sharing a duplicated core (5 members, 50+ identical tokens) deeptutor/api/routers/book.py:932 — deeptutor/api/routers/book.py:932-955 | deeptutor/api/routers/book.py:974-1000 | deeptutor/api/routers/book.py:1044-1069 | deeptutor/api/routers/book.py:1074-1099 | deeptutor/api/routers/book.py:1348-1370 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) deeptutor/services/config/runtime_settings.py:902 — deeptutor/services/config/runtime_settings.py:902-947 | deeptutor/services/config/runtime_settings.py:950-966 | deeptutor/services/config/runtime_settings.py:969-988 | deeptutor/services/config/runtime_settings.py:991-1010 | deeptutor/services/config/runtime_settings.py:1025-1036 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) deeptutor/services/search/providers/bocha.py:42 — deeptutor/services/search/providers/bocha.py:42-132 | deeptutor/services/search/providers/firecrawl.py:44-136 | deeptutor/services/search/providers/qianfan.py:51-149 | deeptutor/services/search/providers/serper.py:53-215 | deeptutor/services/search/providers/zhipu.py:46-142 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
  • Members sharing a duplicated core (5 members, 50+ identical tokens) deeptutor/services/subagent/antigravity.py:192 — deeptutor/services/subagent/antigravity.py:192-240 | deeptutor/services/subagent/claude_code.py:139-179 | deeptutor/services/subagent/codex.py:133-163 | deeptutor/services/subagent/grok.py:127-178 | deeptutor/services/subagent/kimi.py:133-174 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×4
  • Members sharing a duplicated core (4 members, 50+ identical tokens) deeptutor/api/routers/book.py:874 — deeptutor/api/routers/book.py:874-901 | deeptutor/api/routers/book.py:1409-1426 | deeptutor/api/routers/book.py:1431-1448 | deeptutor/api/routers/book.py:1453-1469 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) deeptutor/book/blocks/animation.py:33 — deeptutor/book/blocks/animation.py:33-137 | deeptutor/book/blocks/code.py:67-116 | deeptutor/book/blocks/figure.py:34-132 | deeptutor/book/blocks/interactive.py:34-110 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) deeptutor/services/memory/consolidator/modes/audit.py:137 — deeptutor/services/memory/consolidator/modes/audit.py:137-258 | deeptutor/services/memory/consolidator/modes/audit.py:274-398 | deeptutor/services/memory/consolidator/modes/update.py:150-357 | deeptutor/services/memory/consolidator/modes/update.py:373-586 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) deeptutor/services/partner_groups/manager.py:865 — deeptutor/services/partner_groups/manager.py:865-909 | deeptutor/services/partner_groups/manager.py:918-968 | deeptutor/services/partner_groups/manager.py:978-1028 | deeptutor/services/partner_groups/manager.py:1038-1090 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×4
  • Duplicated block (16 lines × 2) deeptutor/agents/question/capability.py:273 — deeptutor/agents/question/capability.py:273-288 | deeptutor/agents/question/capability.py:303-318 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/agents/question/capability.py:273` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (16 lines × 2) deeptutor/agents/question/pipeline.py:1581 — deeptutor/agents/question/pipeline.py:1581-1596 | deeptutor/agents/research/pipeline.py:2068-2083 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (16 lines × 2) deeptutor/capabilities/obsidian/binding.py:50 — deeptutor/capabilities/obsidian/binding.py:50-65 | deeptutor/capabilities/subagent/binding.py:85-100 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/capabilities/obsidian/binding.py:50` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (16 lines × 2) deeptutor/services/search/providers/aliyun_iqs.py:132 — deeptutor/services/search/providers/aliyun_iqs.py:132-147 | deeptutor/services/search/providers/bocha.py:106-121 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/services/search/providers/aliyun_iqs.py:132` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×4
  • Duplicated block (15 lines × 2) deeptutor/api/routers/knowledge.py:771 — deeptutor/api/routers/knowledge.py:771-785 | deeptutor/api/routers/knowledge.py:801-815 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/api/routers/knowledge.py:771` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (15 lines × 2) deeptutor/api/routers/partners.py:1515 — deeptutor/api/routers/partners.py:1515-1529 | deeptutor/api/routers/partners.py:1570-1584 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (15 lines × 2) deeptutor/partners/channels/weixin.py:1164 — deeptutor/partners/channels/weixin.py:1164-1178 | deeptutor/partners/channels/weixin.py:1315-1329 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (15 lines × 2) deeptutor/services/llm/config.py:218 — deeptutor/services/llm/config.py:218-232 | deeptutor/services/model_selection/runtime.py:15-29 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
P7 · Outbound HTTP resilience · Outbound HTTP without resilience · ×4
  • Outbound HTTP without resilience deeptutor/partners/channels/dingtalk.py:175 — `httpx.AsyncClient(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience deeptutor/partners/channels/lark_http.py:43 — `requests.Session(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience deeptutor/services/llm/openai_http_client.py:102 — `httpx.AsyncClient(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
  • Outbound HTTP without resilience deeptutor/services/llm/openai_http_client.py:153 — `httpx.AsyncClient(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
R7 · Dead Code · Dead file (~1 LoC) · ×4
  • Dead file (~1 LoC) web/features/knowledge/components/engines/GraphRagForm.tsx — no import path from any entry point (133 application, 15 tooling, 470 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
  • Dead file (~1 LoC) web/features/knowledge/components/engines/ImaForm.tsx — no import path from any entry point (133 application, 15 tooling, 470 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
  • Dead file (~1 LoC) web/features/knowledge/components/engines/LightRagForm.tsx — no import path from any entry point (133 application, 15 tooling, 470 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
  • Dead file (~1 LoC) web/features/knowledge/components/engines/LlamaIndexForm.tsx — no import path from any entry point (133 application, 15 tooling, 470 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
X24 · Document value interpolated into markup unescaped · Untrusted text written into markup unescaped · ×4
  • Untrusted text written into markup unescaped web/components/Mermaid.tsx:176 — `svg` is text this program did not author, and it is written into the text of an element through `dangerouslySetInnerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped web/components/ThemeScript.tsx:59 — `themeScript` is text this program did not author, and it is written into the text of an element through `dangerouslySetInnerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped REDACTED:142 — `svg` is text this program did not author, and it is written into the text of an element through `dangerouslySetInnerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
  • Untrusted text written into markup unescaped REDACTED:31 — `html` is text this program did not author, and it is written into the text of an element through `dangerouslySetInnerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
D36 · Supply-chain Provenance & Signing · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (21 lines × 2) · ×3
  • Duplicated block (21 lines × 2) deeptutor/book/blocks/figure.py:70 — deeptutor/book/blocks/figure.py:70-90 | deeptutor/book/blocks/interactive.py:69-89 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (21 lines × 2) deeptutor/services/config/launch_settings.py:54 — deeptutor/services/config/launch_settings.py:54-74 | deeptutor/services/settings/interface_settings.py:121-141 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (21 lines × 2) REDACTED:399 — REDACTED:399-419 | REDACTED:422-442 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (19 lines × 2) · ×3
  • Duplicated block (19 lines × 2) deeptutor/api/routers/knowledge.py:1150 — deeptutor/api/routers/knowledge.py:1150-1168 | deeptutor/api/routers/knowledge.py:3827-3845 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/api/routers/knowledge.py:1150` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (19 lines × 2) deeptutor/services/memory/consolidator/modes/update.py:176 — deeptutor/services/memory/consolidator/modes/update.py:176-194 | deeptutor/services/memory/consolidator/modes/update.py:404-422 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (19 lines × 2) deeptutor/services/embedding/adapters/jina.py:143 — deeptutor/services/embedding/adapters/jina.py:143-161 | deeptutor/services/embedding/adapters/openai_compatible.py:388-406 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (16–17 lines × 2) · ×3
  • Duplicated block (16–17 lines × 2) deeptutor/api/routers/render_storage.py:81 — deeptutor/api/routers/render_storage.py:81-97 | deeptutor/api/routers/render_storage.py:165-180 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/api/routers/render_storage.py:81` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (16–17 lines × 2) deeptutor/services/session/pocketbase_store.py:1476 — deeptutor/services/session/pocketbase_store.py:1476-1491 | deeptutor/services/session/pocketbase_store.py:1501-1517 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (16–17 lines × 2) deeptutor/services/subagent/deepseek_harness.py:150 — deeptutor/services/subagent/deepseek_harness.py:150-165 | deeptutor/services/subagent/hermes.py:128-144 — before extracting anything, compare `deeptutor/services/subagent/deepseek_harness.py` and `deeptutor/services/subagent/hermes.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/services/subagent/hermes.py:128` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (10–12 lines × 2) · ×3
  • Duplicated block (10–12 lines × 2) deeptutor/agents/math_animator/retry_manager.py:114 — deeptutor/agents/math_animator/retry_manager.py:114-125 | deeptutor/agents/math_animator/retry_manager.py:147-156 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/agents/math_animator/retry_manager.py:114` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (10–12 lines × 2) deeptutor/services/search/providers/google_browser_scraper.py:30 — deeptutor/services/search/providers/google_browser_scraper.py:30-41 | deeptutor/services/search/providers/searxng.py:21-30 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (10–12 lines × 2) deeptutor_cli/kb.py:660 — deeptutor_cli/kb.py:660-671 | deeptutor_cli/kb.py:708-717 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor_cli/kb.py:660` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (5 lines × 4) · ×3
  • Duplicated block (5 lines × 4) deeptutor/api/routers/book.py:895 — deeptutor/api/routers/book.py:895-900 | deeptutor/api/routers/book.py:1421-1425 | deeptutor/api/routers/book.py:1443-1447 | deeptutor/api/routers/book.py:1464-1468 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/api/routers/book.py:895` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 4) deeptutor/services/search/providers/bocha.py:88 — deeptutor/services/search/providers/bocha.py:88-92 | deeptutor/services/search/providers/brave.py:43-47 | deeptutor/services/search/providers/duckduckgo.py:32-36 | deeptutor/services/search/providers/zhipu.py:99-103 — before extracting anything, compare `deeptutor/services/search/providers/bocha.py` and `deeptutor/services/search/providers/zhipu.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `deeptutor/services/search/providers/bocha.py:94` calls `str`, `get` and `deeptutor/services/search/providers/zhipu.py:105` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (5 lines × 4) deeptutor/learning/migration.py:49 — deeptutor/learning/migration.py:49-53 | deeptutor/plugins/lifecycle.py:350-354 | deeptutor/services/rag/pipelines/lightrag/ingress.py:55-59 | deeptutor/services/workspace/data_migration.py:123-127 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times.
D4 · Code Duplication · Duplicated block (5 lines × 3) · ×3
  • Duplicated block (5 lines × 3) deeptutor/agents/math_animator/request_config.py:31 — deeptutor/agents/math_animator/request_config.py:31-35 | deeptutor/agents/research/request_config.py:58-62 | deeptutor/runtime/request_contracts.py:102-106 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
  • Duplicated block (5 lines × 3) deeptutor/services/search/providers/aliyun_iqs.py:113 — deeptutor/services/search/providers/aliyun_iqs.py:113-117 | deeptutor/services/search/providers/firecrawl.py:98-102 | deeptutor/services/search/providers/qianfan.py:102-106 — before extracting anything, compare `deeptutor/services/search/providers/firecrawl.py` and `deeptutor/services/search/providers/qianfan.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 3) deeptutor/services/subagent/deepseek_harness.py:113 — deeptutor/services/subagent/deepseek_harness.py:113-117 | deeptutor/services/subagent/hermes.py:104-108 | deeptutor/services/subagent/opencode_family.py:124-128 — before extracting anything, compare `deeptutor/services/subagent/deepseek_harness.py` and `deeptutor/services/subagent/hermes.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/services/subagent/deepseek_harness.py:113` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D6 · Cohesion (LCOM4) · Low cohesion · ×3
  • Low cohesion: AgenticLoopPipeline (LCOM4 8) deeptutor/agents/loop/pipeline.py:200 — AgenticLoopPipeline's methods fall into 8 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 8 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: PocketBaseSessionStore (LCOM4 7) deeptutor/services/session/pocketbase_store.py:171 — PocketBaseSessionStore's methods fall into 7 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 7 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: MemoryStore (LCOM4 4) deeptutor/services/memory/store.py:69 — MemoryStore's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
X1 · Async correctness · Task from `loop.create_task` is not kept · ×3
  • Task from `loop.create_task` is not kept deeptutor/services/llm/provider_factory.py:171 — The task this creates is not kept anywhere. The event loop holds only a weak reference to its tasks, so a task nobody references can be garbage-collected before it finishes (Python's documentation for `asyncio.create_task`: save a reference to the result); and nothing ever awaits it, so an exception it raises is never handled — it surfaces, if at all, as "Task exception was never retrieved" in a log. Keep the task: `await` it, gather it, start it in an `asyncio.TaskGroup` (`async with asyncio.TaskGroup() as tg: tg.create_task(…)`), or, for genuine fire-and-forget, add it to a set and `task.add_done_callback(tasks.discard)` with a callback that also reads its exception.
  • Task from `loop.create_task` is not kept deeptutor/runtime/agentic/client.py:244 — The task this creates is not kept anywhere. The event loop holds only a weak reference to its tasks, so a task nobody references can be garbage-collected before it finishes (Python's documentation for `asyncio.create_task`: save a reference to the result); and nothing ever awaits it, so an exception it raises is never handled — it surfaces, if at all, as "Task exception was never retrieved" in a log. Keep the task: `await` it, gather it, start it in an `asyncio.TaskGroup` (`async with asyncio.TaskGroup() as tg: tg.create_task(…)`), or, for genuine fire-and-forget, add it to a set and `task.add_done_callback(tasks.discard)` with a callback that also reads its exception.
  • Task from `loop.create_task` is not kept deeptutor/knowledge/progress_tracker.py:102 — The task this creates is not kept anywhere. The event loop holds only a weak reference to its tasks, so a task nobody references can be garbage-collected before it finishes (Python's documentation for `asyncio.create_task`: save a reference to the result); and nothing ever awaits it, so an exception it raises is never handled — it surfaces, if at all, as "Task exception was never retrieved" in a log. Keep the task: `await` it, gather it, start it in an `asyncio.TaskGroup` (`async with asyncio.TaskGroup() as tg: tg.create_task(…)`), or, for genuine fire-and-forget, add it to a set and `task.add_done_callback(tasks.discard)` with a callback that also reads its exception.
AC1 · Text alternatives · <canvas> without a text alternative · ×2
  • <canvas> without a text alternative web/components/reading/PdfPage.tsx:215 — A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
  • <canvas> without a text alternative REDACTED:113 — A <canvas> with no aria-label/title and no inner fallback content can't be described by assistive tech. Add a name or fallback content.
D1 · Cyclomatic Complexity · OrganizedSessionList.OrganizedSessionList · ×2
  • OrganizedSessionList.OrganizedSessionList::renderRow (cyclomatic 34) web/components/sessions/OrganizedSessionList.tsx:303 — OrganizedSessionList.OrganizedSessionList::renderRow has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (OrganizedSessionList.OrganizedSessionList::renderGroup) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • OrganizedSessionList.OrganizedSessionList::renderGroup (cyclomatic 19) web/components/sessions/OrganizedSessionList.tsx:591 — OrganizedSessionList.OrganizedSessionList::renderGroup has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: one other method here (OrganizedSessionList.OrganizedSessionList::renderRow) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D10 · Test Quality · Skipped test · ×2
  • Skipped test: (unnamed test) web/tests/e2e/multi-worker-turns.audit.ts:10 — Skipped — switched off by test.skip
  • Skipped test: (unnamed test) web/tests/e2e/turn-lifecycle.audit.ts:9 — Skipped — switched off by test.skip
D2 · Cognitive Complexity · OrganizedSessionList.OrganizedSessionList · ×2
  • OrganizedSessionList.OrganizedSessionList::renderRow (cognitive 48) web/components/sessions/OrganizedSessionList.tsx:303 — OrganizedSessionList.OrganizedSessionList::renderRow has cognitive complexity 48 (threshold 15). Drivers by points: ternaries 27 (43 pts), boolean chains 5 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (OrganizedSessionList.OrganizedSessionList::renderGroup) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • OrganizedSessionList.OrganizedSessionList::renderGroup (cognitive 19) web/components/sessions/OrganizedSessionList.tsx:591 — OrganizedSessionList.OrganizedSessionList::renderGroup has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 14 (15 pts), boolean chains 3, if/else 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: one other method here (OrganizedSessionList.OrganizedSessionList::renderRow) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · InlineFileCard.makeFileLinkRemarkPlugin · ×2
  • InlineFileCard.makeFileLinkRemarkPlugin::visit (cognitive 27) web/components/common/InlineFileCard.tsx:313 — InlineFileCard.makeFileLinkRemarkPlugin::visit has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 5, ternaries 1 (4 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 2 other methods here (InlineFileCard.makeFileLinkRemarkPlugin, InlineFileCard.makeFileLinkRemarkPlugin::splitText) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • InlineFileCard.makeFileLinkRemarkPlugin::splitText (cognitive 16) web/components/common/InlineFileCard.tsx:279 — InlineFileCard.makeFileLinkRemarkPlugin::splitText has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 2 other methods here (InlineFileCard.makeFileLinkRemarkPlugin, InlineFileCard.makeFileLinkRemarkPlugin::visit) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D3 · God Classes · MethodTooLong · ×2
  • MethodTooLong: ToolDispatcher.run packages/chat-engine/src/tools/dispatcher.ts:40 — MethodTooLong — run runs 202 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 102 over it, 2.02× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: NativeSession.operate packages/chat-engine/src/native/session.ts:169 — MethodTooLong — operate runs 192 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 92 over it, 1.92× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
D4 · Code Duplication · Duplicated block (23 lines × 2) · ×2
  • Duplicated block (23 lines × 2) deeptutor/knowledge/manager.py:2257 — deeptutor/knowledge/manager.py:2257-2279 | deeptutor/knowledge/manager.py:2350-2374 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (23 lines × 2) deeptutor/services/memory/consolidator/modes/update.py:215 — deeptutor/services/memory/consolidator/modes/update.py:215-237 | deeptutor/services/memory/consolidator/modes/update.py:443-465 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (20 lines × 2) · ×2
  • Duplicated block (20 lines × 2) deeptutor/agents/question/pipeline.py:1795 — deeptutor/agents/question/pipeline.py:1795-1814 | deeptutor/agents/research/pipeline.py:2289-2308 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (20 lines × 2) deeptutor/services/search/providers/brave.py:56 — deeptutor/services/search/providers/brave.py:56-75 | deeptutor/services/search/providers/duckduckgo.py:44-63 — before extracting anything, compare `deeptutor/services/search/providers/brave.py` and `deeptutor/services/search/providers/duckduckgo.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/services/search/providers/brave.py:56` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `deeptutor/services/search/providers/brave.py:55` calls `str`, `get` and `deeptutor/services/search/providers/duckduckgo.py:43` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (17–19 lines × 2) · ×2
  • Duplicated block (17–19 lines × 2) deeptutor/multi_user/session_handoff.py:339 — deeptutor/multi_user/session_handoff.py:339-357 | deeptutor/multi_user/session_handoff.py:411-427 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (17–19 lines × 2) deeptutor/services/web_source/bilingual.py:164 — deeptutor/services/web_source/bilingual.py:164-180 | deeptutor/services/web_source/bilingual.py:214-232 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (16–18 lines × 2) · ×2
  • Duplicated block (16–18 lines × 2) deeptutor/api/routers/system.py:505 — deeptutor/api/routers/system.py:505-520 | deeptutor/api/routers/system.py:560-577 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/api/routers/system.py:505` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (16–18 lines × 2) deeptutor/services/session/sqlite_store.py:2798 — deeptutor/services/session/sqlite_store.py:2798-2813 | deeptutor/services/session/sqlite_store.py:2925-2942 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/services/session/sqlite_store.py:2925` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. Note first that the copies are not typed on the same thing: the declarations holding them bind `leaf_message_id` to `int` in one and `int | None = None` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (15–17 lines × 2) · ×2
  • Duplicated block (15–17 lines × 2) deeptutor/agents/math_animator/capability.py:39 — deeptutor/agents/math_animator/capability.py:39-53 | deeptutor/agents/visualize/capability.py:305-321 — `deeptutor/agents/math_animator/capability.py` and `deeptutor/agents/visualize/capability.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 6 separate duplicated blocks between them, totalling at least 246 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (15–17 lines × 2) deeptutor/services/skill/hub.py:524 — deeptutor/services/skill/hub.py:524-538 | deeptutor/services/skill/hub.py:581-597 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/services/skill/hub.py:524` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (11–15 lines × 2) · ×2
  • Duplicated block (11–15 lines × 2) deeptutor/reading/store.py:351 — deeptutor/reading/store.py:351-361 | deeptutor/reading/store.py:537-551 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/reading/store.py:351` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (11–15 lines × 2) deeptutor/services/partner_groups/store.py:60 — deeptutor/services/partner_groups/store.py:60-70 | deeptutor/services/persona/service.py:351-365 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (12–14 lines × 2) · ×2
  • Duplicated block (12–14 lines × 2) deeptutor/services/storage/attachment_store.py:178 — deeptutor/services/storage/attachment_store.py:178-191 | deeptutor/services/storage/file_library.py:188-199 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (12–14 lines × 2) deeptutor_cli/kb.py:289 — deeptutor_cli/kb.py:289-302 | deeptutor_cli/kb.py:349-360 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor_cli/kb.py:289` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. Note first that the copies are not typed on the same thing: the declarations holding them bind `docs` to `list[str] = typer.Option([], "--doc", "-d", help="Document paths.")` in one and `list[str] = typer.Option([], "--doc", "-d", help="Document paths to add.")` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (12 lines × 4) · ×2
  • Duplicated block (12 lines × 4) deeptutor/services/memory/consolidator/modes/audit.py:149 — deeptutor/services/memory/consolidator/modes/audit.py:149-160 | deeptutor/services/memory/consolidator/modes/audit.py:289-300 | deeptutor/services/memory/consolidator/modes/update.py:197-208 | deeptutor/services/memory/consolidator/modes/update.py:425-436 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
  • Duplicated block (12 lines × 4) deeptutor/services/partner_groups/manager.py:894 — deeptutor/services/partner_groups/manager.py:894-905 | deeptutor/services/partner_groups/manager.py:949-964 | deeptutor/services/partner_groups/manager.py:1008-1024 | deeptutor/services/partner_groups/manager.py:1070-1086 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/services/partner_groups/manager.py:894` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (9–12 lines × 2) · ×2
  • Duplicated block (9–12 lines × 2) deeptutor/partners/channels/telegram.py:315 — deeptutor/partners/channels/telegram.py:315-326 | deeptutor/partners/channels/zulip.py:91-99 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `deeptutor/partners/channels/telegram.py:327` calls `isdigit` and `deeptutor/partners/channels/zulip.py:100` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9–12 lines × 2) deeptutor/reading/store.py:312 — deeptutor/reading/store.py:312-323 | deeptutor/reading/store.py:515-523 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (9 lines × 3) · ×2
  • Duplicated block (9 lines × 3) deeptutor/agents/math_animator/capability.py:223 — deeptutor/agents/math_animator/capability.py:223-231 | deeptutor/agents/question/capability.py:349-357 | deeptutor/agents/visualize/capability.py:494-502 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
  • Duplicated block (9 lines × 3) deeptutor/book/blocks/deep_dive.py:40 — deeptutor/book/blocks/deep_dive.py:40-48 | deeptutor/book/blocks/flash_cards.py:42-50 | deeptutor/book/blocks/timeline.py:38-46 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/book/blocks/deep_dive.py:40` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (7–8 lines × 2) · ×2
  • Duplicated block (7–8 lines × 2) deeptutor/api/routers/knowledge.py:2371 — deeptutor/api/routers/knowledge.py:2371-2377 | deeptutor/api/routers/knowledge.py:2399-2406 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7–8 lines × 2) deeptutor_cli/init_wizard.py:678 — deeptutor_cli/init_wizard.py:678-685 | deeptutor_cli/init_wizard.py:800-806 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `deeptutor_cli/init_wizard.py:675` calls `warn`, `format` and `deeptutor_cli/init_wizard.py:798` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (6 lines × 3) · ×2
  • Duplicated block (6 lines × 3) deeptutor/services/chat_hints.py:117 — deeptutor/services/chat_hints.py:117-122 | deeptutor/services/mastery_hints.py:169-174 | deeptutor/services/reading_hints.py:158-163 — before extracting anything, compare `deeptutor/services/chat_hints.py` and `deeptutor/services/reading_hints.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (6 lines × 3) deeptutor/services/cli_apps/state.py:198 — deeptutor/services/cli_apps/state.py:198-203 | deeptutor/services/mcp/oauth.py:121-126 | REDACTED:172-177 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `deeptutor/services/mcp/oauth.py:127` calls `chmod` and `deeptutor/services/cli_apps/state.py:204` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
R10 · Code Duplication · Duplicated block with local edits (105 matched lines × 2 locations) · ×2
  • Duplicated block with local edits (105 matched lines × 2 locations) web/components/space/ChatHistorySection.tsx:62 — web/components/space/ChatHistorySection.tsx:62 · web/components/space/MyAgentsSection.tsx:90 — the two spans are one implementation copied and then locally edited — 634 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
  • Duplicated block with local edits (105 matched lines × 2 locations) web/features/settings/sections/DocumentParsingSettingsSection.tsx:389 — web/features/settings/sections/DocumentParsingSettingsSection.tsx:389 · web/features/settings/sections/DocumentParsingSettingsSection.tsx:683 — the two spans are one implementation copied and then locally edited — 467 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (51 matched lines × 2 locations) · ×2
  • Duplicated block with local edits (51 matched lines × 2 locations) web/components/common/Modal.tsx:61 — web/components/common/Modal.tsx:61 · web/components/common/PickerShell.tsx:179 — the two spans are one implementation copied and then locally edited — 349 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
  • Duplicated block with local edits (51 matched lines × 2 locations) web/hooks/useVoiceAutoplay.ts:17 — web/hooks/useVoiceAutoplay.ts:17 · web/hooks/useVoiceMathSpeak.ts:7 — the two spans are one implementation copied and then locally edited — 316 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (38 lines × 2 locations) · ×2
  • Duplicated block (38 lines × 2 locations) web/components/cli-apps/CliAppsSection.tsx:959 — web/components/cli-apps/CliAppsSection.tsx:959 · web/components/mcp/McpCatalogBrowser.tsx:723 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
  • Duplicated block (38 lines × 2 locations) web/components/partners/PartnerModelPicker.tsx:21 — web/components/partners/PartnerModelPicker.tsx:21 · web/components/partners/PartnerModelSelect.tsx:164 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block with local edits (38 matched lines × 2 locations) · ×2
  • Duplicated block with local edits (38 matched lines × 2 locations) web/components/knowledge/KbGitHubSourcesSection.tsx:17 — web/components/knowledge/KbGitHubSourcesSection.tsx:17 · web/components/knowledge/KbWebSourcesSection.tsx:29 — the two spans are one implementation copied and then locally edited — 266 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
  • Duplicated block with local edits (38 matched lines × 2 locations) web/components/reading/library/ReadingFolder.tsx:192 — web/components/reading/library/ReadingFolder.tsx:192 · web/components/reading/library/ReadingLibrary.tsx:331 — the two spans are one implementation copied and then locally edited — 138 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (37 matched lines × 2 locations) · ×2
  • Duplicated block with local edits (37 matched lines × 2 locations) web/lib/admin-api.ts:36 — web/lib/admin-api.ts:36 · web/lib/profile-api.ts:14 — the two spans are one implementation copied and then locally edited — 238 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
  • Duplicated block with local edits (37 matched lines × 2 locations) web/lib/partner-groups-api.ts:84 — web/lib/partner-groups-api.ts:84 · web/lib/partners-api.ts:172 — the two spans are one implementation copied and then locally edited — 202 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (36 lines × 2 locations) · ×2
  • Duplicated block (36 lines × 2 locations) web/components/chat/home/StandaloneComposer.tsx:471 — web/components/chat/home/StandaloneComposer.tsx:471 · web/features/chat/components/ChatWorkspace.tsx:1564 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (36 lines × 2 locations) web/components/notebook/useNotebookLibrary.ts:271 — web/components/notebook/useNotebookLibrary.ts:271 · web/context/AppShellContext.tsx:400 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
AC3 · Page structure · Data table has no header cells · ×1
  • Data table has no header cells web/components/chat/preview/previewers/XlsxPreview.tsx:116 — A <table> with data cells but no <th> gives assistive technology no way to associate cells with their headers. Mark the header row/column cells as <th> (with a scope).
AC6 · Visual & motion safety · Low contrast Tailwind colour pair (3.8 · ×1
  • Low contrast Tailwind colour pair (3.8:1) web/app/(workspace)/partners/groups/[groupId]/page.tsx:404 — This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
AC6 · Visual & motion safety · Low contrast Tailwind colour pair (4.4 · ×1
  • Low contrast Tailwind colour pair (4.4:1) web/components/chat/QuestionBankPicker.tsx:322 — This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
AC6 · Visual & motion safety · Low contrast Tailwind colour pair (3.3 · ×1
  • Low contrast Tailwind colour pair (3.3:1) web/components/knowledge/KbIndexVersionsSection.tsx:487 — This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
AC7 · A11y enforcement · Accessibility enforcement below the top rung · ×1
  • Accessibility enforcement below the top rung REDACTED:74 — No accessibility enforcement found — no a11y linter (eslint-plugin-jsx-a11y) and no axe/pa11y/Lighthouse in tests or CI. Start with the linter to catch issues at author time. What was searched, so you can tell an absence from a miss: the 594 markup file(s) this pass actually assessed, the linter configuration checked in beside them, and this repository's test and CI files — matched by name against the accessibility checkers this dimension carries. An audit run outside the repository, a hosted scanner, or a check whose name is not one of those, is not seen here.
D1 · Cyclomatic Complexity · ChatStateAdapter.ChatStateAdapterProvider (cyclomatic 457) · ×1
  • ChatStateAdapter.ChatStateAdapterProvider (cyclomatic 457) web/features/chat/ChatStateAdapter.tsx:2031 — ChatStateAdapter.ChatStateAdapterProvider has cyclomatic complexity 457 (threshold 15). Most of this is not in the body itself: 2 of the 457 points are its own statements and the rest belongs to 53 function literals inside it that branch (lines 3014, 2215, 2714, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · ChatWorkspace.ChatWorkspace (cyclomatic 341) · ×1
  • ChatWorkspace.ChatWorkspace (cyclomatic 341) web/features/chat/components/ChatWorkspace.tsx:274 — ChatWorkspace.ChatWorkspace has cyclomatic complexity 341 (threshold 15). Of this number, 43 points are the body's own statements and 298 belong to 95 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · CoWriterWorkspace.CoWriterWorkspace (cyclomatic 297) · ×1
  • CoWriterWorkspace.CoWriterWorkspace (cyclomatic 297) web/features/co-writer/components/CoWriterWorkspace.tsx:182 — CoWriterWorkspace.CoWriterWorkspace has cyclomatic complexity 297 (threshold 15). Of this number, 57 points are the body's own statements and 240 belong to 71 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · SettingsStore.SettingsProvider (cyclomatic 285) · ×1
  • SettingsStore.SettingsProvider (cyclomatic 285) web/features/settings/store/SettingsStore.tsx:644 — SettingsStore.SettingsProvider has cyclomatic complexity 285 (threshold 15). Most of this is not in the body itself: 6 of the 285 points are its own statements and the rest belongs to 67 function literals inside it that branch (lines 1928, 800, 2205, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · BooksRoute.BookPageInner (cyclomatic 234) · ×1
  • BooksRoute.BookPageInner (cyclomatic 234) web/app/(workspace)/learning/books/BooksRoute.tsx:104 — BooksRoute.BookPageInner has cyclomatic complexity 234 (threshold 15). Of this number, 63 points are the body's own statements and 171 belong to 55 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · TurnExecutor._run_turn (cyclomatic 213) · ×1
  • TurnExecutor._run_turn (cyclomatic 213) deeptutor/services/session/turns/executor.py:142 — TurnExecutor._run_turn has cyclomatic complexity 213 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ChatComposer.ChatComposer (cyclomatic 204) · ×1
  • ChatComposer.ChatComposer (cyclomatic 204) web/components/chat/home/ChatComposer.tsx:200 — ChatComposer.ChatComposer has cyclomatic complexity 204 (threshold 15). Of this number, 118 points are the body's own statements and 86 belong to 37 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · QuizViewer.QuizViewer (cyclomatic 194) · ×1
  • QuizViewer.QuizViewer (cyclomatic 194) web/components/quiz/QuizViewer.tsx:191 — QuizViewer.QuizViewer has cyclomatic complexity 194 (threshold 15). Of this number, 51 points are the body's own statements and 143 belong to 33 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ChatStateAdapter.reduce (cyclomatic 187) · ×1
  • ChatStateAdapter.reduce (cyclomatic 187) web/features/chat/ChatStateAdapter.tsx:802 — ChatStateAdapter.reduce has cyclomatic complexity 187 (threshold 15). Of this number, 165 points are the body's own statements and 22 belong to 8 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PartnerChat.PartnerChat (cyclomatic 181) · ×1
  • PartnerChat.PartnerChat (cyclomatic 181) web/components/partners/PartnerChat.tsx:296 — PartnerChat.PartnerChat has cyclomatic complexity 181 (threshold 15). Of this number, 18 points are the body's own statements and 163 belong to 32 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TurnRequestPreparer.start_turn (cyclomatic 177) · ×1
  • TurnRequestPreparer.start_turn (cyclomatic 177) deeptutor/services/session/turns/request_preparer.py:180 — TurnRequestPreparer.start_turn has cyclomatic complexity 177 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ReaderPane.ReaderPane (cyclomatic 165) · ×1
  • ReaderPane.ReaderPane (cyclomatic 165) web/components/reading/ReaderPane.tsx:180 — ReaderPane.ReaderPane has cyclomatic complexity 165 (threshold 15). Of this number, 51 points are the body's own statements and 114 belong to 37 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · NoteWorkspace.NoteWorkspace (cyclomatic 155) · ×1
  • NoteWorkspace.NoteWorkspace (cyclomatic 155) web/features/notes/components/NoteWorkspace.tsx:46 — NoteWorkspace.NoteWorkspace has cyclomatic complexity 155 (threshold 15). Of this number, 34 points are the body's own statements and 121 belong to 50 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ServiceConfigEditor.ServiceConfigEditor (cyclomatic 141) · ×1
  • ServiceConfigEditor.ServiceConfigEditor (cyclomatic 141) web/components/settings/ServiceConfigEditor.tsx:102 — ServiceConfigEditor.ServiceConfigEditor has cyclomatic complexity 141 (threshold 15). Of this number, 37 points are the body's own statements and 104 belong to 21 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · MediaReadingStage.MediaReadingStage (cyclomatic 137) · ×1
  • MediaReadingStage.MediaReadingStage (cyclomatic 137) web/components/reading/workspace/MediaReadingStage.tsx:57 — MediaReadingStage.MediaReadingStage has cyclomatic complexity 137 (threshold 15). Of this number, 51 points are the body's own statements and 86 belong to 29 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · page.PartnerDetail (cyclomatic 132) · ×1
  • page.PartnerDetail (cyclomatic 132) web/app/(workspace)/partners/[partnerId]/page.tsx:65 — page.PartnerDetail has cyclomatic complexity 132 (threshold 15). Of this number, 50 points are the body's own statements and 82 belong to 27 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PageReader.PageReader (cyclomatic 121) · ×1
  • PageReader.PageReader (cyclomatic 121) web/app/(workspace)/learning/books/components/PageReader.tsx:122 — PageReader.PageReader has cyclomatic complexity 121 (threshold 15). Of this number, 60 points are the body's own statements and 61 belong to 11 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · CreateKbModal.CreateKbModal (cyclomatic 121) · ×1
  • CreateKbModal.CreateKbModal (cyclomatic 121) web/components/knowledge/CreateKbModal.tsx:129 — CreateKbModal.CreateKbModal has cyclomatic complexity 121 (threshold 15). Of this number, 32 points are the body's own statements and 89 belong to 15 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ModelsWorkspace.ModelEditor (cyclomatic 119) · ×1
  • ModelsWorkspace.ModelEditor (cyclomatic 119) web/components/settings/ModelsWorkspace.tsx:703 — ModelsWorkspace.ModelEditor has cyclomatic complexity 119 (threshold 15). Of this number, 85 points are the body's own statements and 34 belong to 7 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · AgentLoop._call_llm (cyclomatic 109) · ×1
  • AgentLoop._call_llm (cyclomatic 109) deeptutor/agents/loop/agent_loop.py:639 — AgentLoop._call_llm has cyclomatic complexity 109 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · EpubDocumentView.EpubDocumentView (cyclomatic 108) · ×1
  • EpubDocumentView.EpubDocumentView (cyclomatic 108) web/components/reading/EpubDocumentView.tsx:167 — EpubDocumentView.EpubDocumentView has cyclomatic complexity 108 (threshold 15). Most of this is not in the body itself: 8 of the 108 points are its own statements and the rest belongs to 23 function literals inside it that branch (lines 412, 565, 339, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · TimeGrid.TimeGrid (cyclomatic 107) · ×1
  • TimeGrid.TimeGrid (cyclomatic 107) web/features/calendar/components/TimeGrid.tsx:70 — TimeGrid.TimeGrid has cyclomatic complexity 107 (threshold 15). Most of this is not in the body itself: 2 of the 107 points are its own statements and the rest belongs to 40 function items inside it that branch (a function literal at line 162, a function literal at line 238, a function literal at line 325, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · CalendarPage.CalendarPage (cyclomatic 107) · ×1
  • CalendarPage.CalendarPage (cyclomatic 107) web/features/calendar/components/CalendarPage.tsx:77 — CalendarPage.CalendarPage has cyclomatic complexity 107 (threshold 15). Of this number, 46 points are the body's own statements and 61 belong to 28 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ChatMessageList.ChatMessageList (cyclomatic 104) · ×1
  • ChatMessageList.ChatMessageList (cyclomatic 104) web/features/chat/messages/ChatMessageList.tsx:2130 — ChatMessageList.ChatMessageList has cyclomatic complexity 104 (threshold 15). Most of this is not in the body itself: 5 of the 104 points are its own statements and the rest belongs to 13 function items inside it that branch (a function literal at line 2457, a function literal at line 2622, a function literal at line 2301, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · page.AdminUsersPage (cyclomatic 100) · ×1
  • page.AdminUsersPage (cyclomatic 100) web/app/(admin)/admin/users/page.tsx:56 — page.AdminUsersPage has cyclomatic complexity 100 (threshold 15). Of this number, 37 points are the body's own statements and 63 belong to 20 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · NoteEditor.NoteEditor (cyclomatic 97) · ×1
  • NoteEditor.NoteEditor (cyclomatic 97) web/features/notes/components/NoteEditor.tsx:697 — NoteEditor.NoteEditor has cyclomatic complexity 97 (threshold 15). Most of this is not in the body itself: 3 of the 97 points are its own statements and the rest belongs to 38 function items inside it that branch (a function literal at line 1484, a function literal at line 1441, a function literal at line 1460, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · AskUserOptions.extractMessageSegments (cyclomatic 94) · ×1
  • AskUserOptions.extractMessageSegments (cyclomatic 94) web/components/chat/home/AskUserOptions.tsx:348 — AskUserOptions.extractMessageSegments has cyclomatic complexity 94 (threshold 15). Of this number, 67 points are the body's own statements and 27 belong to 6 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SkillsSection.SkillsSection (cyclomatic 93) · ×1
  • SkillsSection.SkillsSection (cyclomatic 93) web/components/space/SkillsSection.tsx:78 — SkillsSection.SkillsSection has cyclomatic complexity 93 (threshold 15). Of this number, 27 points are the body's own statements and 66 belong to 25 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · StandaloneComposer.StandaloneComposerImpl (cyclomatic 92) · ×1
  • StandaloneComposer.StandaloneComposerImpl (cyclomatic 92) web/components/chat/home/StandaloneComposer.tsx:233 — StandaloneComposer.StandaloneComposerImpl has cyclomatic complexity 92 (threshold 15). Most of this is not in the body itself: 13 of the 92 points are its own statements and the rest belongs to 28 function literals inside it that branch (lines 741, 447, 397, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · QuestionCard.QuestionCard (cyclomatic 90) · ×1
  • QuestionCard.QuestionCard (cyclomatic 90) web/components/space/question-bank/QuestionCard.tsx:136 — QuestionCard.QuestionCard has cyclomatic complexity 90 (threshold 15). Of this number, 85 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · ChatMessageList.AssistantMessage (cyclomatic 90) · ×1
  • ChatMessageList.AssistantMessage (cyclomatic 90) web/features/chat/messages/ChatMessageList.tsx:732 — ChatMessageList.AssistantMessage has cyclomatic complexity 90 (threshold 15). Of this number, 49 points are the body's own statements and 41 belong to 17 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SessionViewerPanel.SessionViewerPanelInner (cyclomatic 87) · ×1
  • SessionViewerPanel.SessionViewerPanelInner (cyclomatic 87) web/components/chat/home/SessionViewerPanel.tsx:387 — SessionViewerPanel.SessionViewerPanelInner has cyclomatic complexity 87 (threshold 15). Of this number, 19 points are the body's own statements and 68 belong to 36 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ModelsWorkspace.ModelsWorkspace (cyclomatic 87) · ×1
  • ModelsWorkspace.ModelsWorkspace (cyclomatic 87) web/components/settings/ModelsWorkspace.tsx:63 — ModelsWorkspace.ModelsWorkspace has cyclomatic complexity 87 (threshold 15). Of this number, 18 points are the body's own statements and 69 belong to 15 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · RichMarkdownRenderer.RichMarkdownRenderer (cyclomatic 86) · ×1
  • RichMarkdownRenderer.RichMarkdownRenderer (cyclomatic 86) web/components/common/RichMarkdownRenderer.tsx:106 — RichMarkdownRenderer.RichMarkdownRenderer has cyclomatic complexity 86 (threshold 15). Most of this is not in the body itself: 12 of the 86 points are its own statements and the rest belongs to 27 function items inside it that branch (a function literal at line 425, a function literal at line 552, a function literal at line 528, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · BookChatPanel.BookChatPanel (cyclomatic 85) · ×1
  • BookChatPanel.BookChatPanel (cyclomatic 85) web/app/(workspace)/learning/books/components/BookChatPanel.tsx:103 — BookChatPanel.BookChatPanel has cyclomatic complexity 85 (threshold 15). Most of this is not in the body itself: 11 of the 85 points are its own statements and the rest belongs to 26 function items inside it that branch (send, a function literal at line 252, handleEvent, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · KbIndexVersionsSection.KbIndexVersionsSection (cyclomatic 85) · ×1
  • KbIndexVersionsSection.KbIndexVersionsSection (cyclomatic 85) web/components/knowledge/KbIndexVersionsSection.tsx:50 — KbIndexVersionsSection.KbIndexVersionsSection has cyclomatic complexity 85 (threshold 15). Of this number, 60 points are the body's own statements and 25 belong to 10 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · ServiceConfigEditor.ProfileFields (cyclomatic 84) · ×1
  • ServiceConfigEditor.ProfileFields (cyclomatic 84) web/components/settings/ServiceConfigEditor.tsx:1426 — ServiceConfigEditor.ProfileFields has cyclomatic complexity 84 (threshold 15). Of this number, 57 points are the body's own statements and 27 belong to 5 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · KnowledgeBaseManager._get_info (cyclomatic 79) · ×1
  • KnowledgeBaseManager._get_info (cyclomatic 79) deeptutor/knowledge/manager.py:1465 — KnowledgeBaseManager._get_info has cyclomatic complexity 79 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · GrantEditor.GrantEditor (cyclomatic 79) · ×1
  • GrantEditor.GrantEditor (cyclomatic 79) web/features/multi-user/components/GrantEditor.tsx:161 — GrantEditor.GrantEditor has cyclomatic complexity 79 (threshold 15). Of this number, 43 points are the body's own statements and 36 belong to 27 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MasteryQuestionCard.SingleMasteryQuestionCard (cyclomatic 78) · ×1
  • MasteryQuestionCard.SingleMasteryQuestionCard (cyclomatic 78) web/components/chat/home/MasteryQuestionCard.tsx:125 — MasteryQuestionCard.SingleMasteryQuestionCard has cyclomatic complexity 78 (threshold 15). Of this number, 57 points are the body's own statements and 21 belong to 8 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TurnRequestPreparer.regenerate_last_turn (cyclomatic 76) · ×1
  • TurnRequestPreparer.regenerate_last_turn (cyclomatic 76) deeptutor/services/session/turns/request_preparer.py:1002 — TurnRequestPreparer.regenerate_last_turn has cyclomatic complexity 76 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ChatMessageList.UserMessage (cyclomatic 75) · ×1
  • ChatMessageList.UserMessage (cyclomatic 75) web/features/chat/messages/ChatMessageList.tsx:1709 — ChatMessageList.UserMessage has cyclomatic complexity 75 (threshold 15). Of this number, 47 points are the body's own statements and 28 belong to 11 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · registry_edit.merge_registry_edit (cyclomatic 73) · ×1
  • registry_edit.merge_registry_edit (cyclomatic 73) deeptutor/services/settings/registry_edit.py:67 — registry_edit.merge_registry_edit has cyclomatic complexity 73 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ComposerResources.ComposerResources (cyclomatic 73) · ×1
  • ComposerResources.ComposerResources (cyclomatic 73) web/components/chat/home/ComposerResources.tsx:55 — ComposerResources.ComposerResources has cyclomatic complexity 73 (threshold 15). Of this number, 25 points are the body's own statements and 48 belong to 12 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · MasteryStudy.MasteryStudy (cyclomatic 71) · ×1
  • MasteryStudy.MasteryStudy (cyclomatic 71) web/components/space/learning/MasteryStudy.tsx:165 — MasteryStudy.MasteryStudy has cyclomatic complexity 71 (threshold 15). Of this number, 22 points are the body's own statements and 49 belong to 21 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · knowledge.websocket_progress (cyclomatic 70) · ×1
  • knowledge.websocket_progress (cyclomatic 70) deeptutor/api/routers/knowledge.py:4437 — knowledge.websocket_progress has cyclomatic complexity 70 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PdfDocumentView.PdfDocumentView (cyclomatic 70) · ×1
  • PdfDocumentView.PdfDocumentView (cyclomatic 70) web/components/reading/PdfDocumentView.tsx:83 — PdfDocumentView.PdfDocumentView has cyclomatic complexity 70 (threshold 15). Most of this is not in the body itself: 9 of the 70 points are its own statements and the rest belongs to 17 function literals inside it that branch (lines 428, 218, 376, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · CodexOAuthCard.CodexOAuthCard (cyclomatic 70) · ×1
  • CodexOAuthCard.CodexOAuthCard (cyclomatic 70) web/components/settings/CodexOAuthCard.tsx:32 — CodexOAuthCard.CodexOAuthCard has cyclomatic complexity 70 (threshold 15). Of this number, 28 points are the body's own statements and 42 belong to 18 function items inside it that branch. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · KnowledgePage.KnowledgePage (cyclomatic 69) · ×1
  • KnowledgePage.KnowledgePage (cyclomatic 69) web/components/knowledge/KnowledgePage.tsx:50 — KnowledgePage.KnowledgePage has cyclomatic complexity 69 (threshold 15). Of this number, 19 points are the body's own statements and 50 belong to 18 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · WatchingBrowser.WatchingBrowser (cyclomatic 69) · ×1
  • WatchingBrowser.WatchingBrowser (cyclomatic 69) web/components/watching/WatchingBrowser.tsx:30 — WatchingBrowser.WatchingBrowser has cyclomatic complexity 69 (threshold 15). Of this number, 21 points are the body's own statements and 48 belong to 19 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ToolsSettingsSection.ToolsSettingsPage (cyclomatic 69) · ×1
  • ToolsSettingsSection.ToolsSettingsPage (cyclomatic 69) web/features/settings/sections/ToolsSettingsSection.tsx:78 — ToolsSettingsSection.ToolsSettingsPage has cyclomatic complexity 69 (threshold 15). Of this number, 25 points are the body's own statements and 44 belong to 9 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · PartnerComposer.PartnerComposer (cyclomatic 68) · ×1
  • PartnerComposer.PartnerComposer (cyclomatic 68) web/components/partners/PartnerComposer.tsx:42 — PartnerComposer.PartnerComposer has cyclomatic complexity 68 (threshold 15). Of this number, 19 points are the body's own statements and 49 belong to 20 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · SourceNavigator.SourceNavigator (cyclomatic 66) · ×1
  • SourceNavigator.SourceNavigator (cyclomatic 66) web/components/reading/workspace/SourceNavigator.tsx:40 — SourceNavigator.SourceNavigator has cyclomatic complexity 66 (threshold 15). Of this number, 30 points are the body's own statements and 36 belong to 14 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ProvidersWorkspace.ProvidersWorkspace (cyclomatic 66) · ×1
  • ProvidersWorkspace.ProvidersWorkspace (cyclomatic 66) web/components/settings/ProvidersWorkspace.tsx:48 — ProvidersWorkspace.ProvidersWorkspace has cyclomatic complexity 66 (threshold 15). Of this number, 36 points are the body's own statements and 30 belong to 13 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · QuizFollowupContext.QuizFollowupProvider (cyclomatic 66) · ×1
  • QuizFollowupContext.QuizFollowupProvider (cyclomatic 66) web/context/QuizFollowupContext.tsx:241 — QuizFollowupContext.QuizFollowupProvider has cyclomatic complexity 66 (threshold 15). Most of this is not in the body itself: 1 of the 66 points is its own statement and the rest belongs to 14 function literals inside it that branch (lines 475, 311, 354, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · NoteLearningContent.NoteLearningContent (cyclomatic 66) · ×1
  • NoteLearningContent.NoteLearningContent (cyclomatic 66) web/features/notes/components/NoteLearningContent.tsx:35 — NoteLearningContent.NoteLearningContent has cyclomatic complexity 66 (threshold 15). Of this number, 56 points are the body's own statements and 10 belong to 6 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · MinerUEngineSettings.MinerUEngineSettings (cyclomatic 65) · ×1
  • MinerUEngineSettings.MinerUEngineSettings (cyclomatic 65) web/components/settings/MinerUEngineSettings.tsx:86 — MinerUEngineSettings.MinerUEngineSettings has cyclomatic complexity 65 (threshold 15). Of this number, 29 points are the body's own statements and 36 belong to 10 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · book.book_websocket (cyclomatic 64) · ×1
  • book.book_websocket (cyclomatic 64) deeptutor/api/routers/book.py:1530 — book.book_websocket has cyclomatic complexity 64 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · WeixinChannel._process_message (cyclomatic 64) · ×1
  • WeixinChannel._process_message (cyclomatic 64) deeptutor/partners/channels/weixin.py:489 — WeixinChannel._process_message has cyclomatic complexity 64 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · unified_ws.unified_websocket (cyclomatic 62) · ×1
  • unified_ws.unified_websocket (cyclomatic 62) deeptutor/api/routers/unified_ws.py:44 — unified_ws.unified_websocket has cyclomatic complexity 62 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PartnerRunner._execute_turn (cyclomatic 62) · ×1
  • PartnerRunner._execute_turn (cyclomatic 62) deeptutor/services/partners/runtime.py:437 — PartnerRunner._execute_turn has cyclomatic complexity 62 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · source_visuals.retrieve_visual (cyclomatic 62) · ×1
  • source_visuals.retrieve_visual (cyclomatic 62) deeptutor/services/rag/source_visuals.py:203 — source_visuals.retrieve_visual has cyclomatic complexity 62 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · dependencies._forward_closure (cyclomatic 61) · ×1
  • dependencies._forward_closure (cyclomatic 61) deeptutor/services/workspace/dependencies.py:115 — dependencies._forward_closure has cyclomatic complexity 61 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · NativeSession.operate (cyclomatic 61) · ×1
  • NativeSession.operate (cyclomatic 61) packages/chat-engine/src/native/session.ts:169 — NativeSession.operate has cyclomatic complexity 61 (threshold 15). Of this number, 60 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BookReferencePicker.BookReferencePicker (cyclomatic 61) · ×1
  • BookReferencePicker.BookReferencePicker (cyclomatic 61) web/components/chat/BookReferencePicker.tsx:54 — BookReferencePicker.BookReferencePicker has cyclomatic complexity 61 (threshold 15). Most of this is not in the body itself: 12 of the 61 points are its own statements and the rest belongs to 18 function items inside it that branch (a function literal at line 319, togglePage, a function literal at line 193, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · PartnerCommandHandler._model (cyclomatic 60) · ×1
  • PartnerCommandHandler._model (cyclomatic 60) deeptutor/services/partners/commands.py:236 — PartnerCommandHandler._model has cyclomatic complexity 60 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TextUnitView.TextUnitView (cyclomatic 59) · ×1
  • TextUnitView.TextUnitView (cyclomatic 59) web/components/reading/TextUnitView.tsx:87 — TextUnitView.TextUnitView has cyclomatic complexity 59 (threshold 15). Most of this is not in the body itself: 13 of the 59 points are its own statements and the rest belongs to 17 function literals inside it that branch (lines 409, 170, 233, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · ReadingWorkspace.ReadingWorkspacePage (cyclomatic 59) · ×1
  • ReadingWorkspace.ReadingWorkspacePage (cyclomatic 59) web/components/reading/workspace/ReadingWorkspace.tsx:129 — ReadingWorkspace.ReadingWorkspacePage has cyclomatic complexity 59 (threshold 15). Of this number, 38 points are the body's own statements and 21 belong to 11 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · NoteBlockPreview.NoteBlockPreview (cyclomatic 59) · ×1
  • NoteBlockPreview.NoteBlockPreview (cyclomatic 59) web/features/notes/components/NoteBlockPreview.tsx:25 — NoteBlockPreview.NoteBlockPreview has cyclomatic complexity 59 (threshold 15). Of this number, 53 points are the body's own statements and 6 belong to 4 function items inside it that branch. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · MyAgentsPicker.MyAgentsPicker (cyclomatic 58) · ×1
  • MyAgentsPicker.MyAgentsPicker (cyclomatic 58) web/components/chat/MyAgentsPicker.tsx:85 — MyAgentsPicker.MyAgentsPicker has cyclomatic complexity 58 (threshold 15). Most of this is not in the body itself: 6 of the 58 points are its own statements and the rest belongs to 21 function items inside it that branch (a function literal at line 166, a function literal at line 397, a function literal at line 231, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · AskUserOptions.InteractiveAskUserCard (cyclomatic 58) · ×1
  • AskUserOptions.InteractiveAskUserCard (cyclomatic 58) web/components/chat/home/AskUserOptions.tsx:1033 — AskUserOptions.InteractiveAskUserCard has cyclomatic complexity 58 (threshold 15). Of this number, 23 points are the body's own statements and 35 belong to 9 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · useNoteThreads.useNoteThreads (cyclomatic 58) · ×1
  • useNoteThreads.useNoteThreads (cyclomatic 58) web/features/notes/components/useNoteThreads.ts:66 — useNoteThreads.useNoteThreads has cyclomatic complexity 58 (threshold 15). Most of this is not in the body itself: 9 of the 58 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 452, 270, 521, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · HistorySessionPicker.HistorySessionPicker (cyclomatic 57) · ×1
  • HistorySessionPicker.HistorySessionPicker (cyclomatic 57) web/components/chat/HistorySessionPicker.tsx:53 — HistorySessionPicker.HistorySessionPicker has cyclomatic complexity 57 (threshold 15). Of this number, 24 points are the body's own statements and 33 belong to 16 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · quiz_judge.websocket_quiz_judge (cyclomatic 56) · ×1
  • quiz_judge.websocket_quiz_judge (cyclomatic 56) deeptutor/api/routers/quiz_judge.py:309 — quiz_judge.websocket_quiz_judge has cyclomatic complexity 56 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · BookHealthBanner.BookHealthBanner (cyclomatic 56) · ×1
  • BookHealthBanner.BookHealthBanner (cyclomatic 56) web/app/(workspace)/learning/books/components/BookHealthBanner.tsx:47 — BookHealthBanner.BookHealthBanner has cyclomatic complexity 56 (threshold 15). Of this number, 43 points are the body's own statements and 13 belong to 5 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · page.ProfilePage (cyclomatic 55) · ×1
  • page.ProfilePage (cyclomatic 55) web/app/(utility)/profile/page.tsx:100 — page.ProfilePage has cyclomatic complexity 55 (threshold 15). Of this number, 25 points are the body's own statements and 30 belong to 12 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MasteryQuizTool.execute (cyclomatic 54) · ×1
  • MasteryQuizTool.execute (cyclomatic 54) deeptutor/capabilities/mastery/tools.py:1253 — MasteryQuizTool.execute has cyclomatic complexity 54 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · KnowledgeBaseDetail.KnowledgeBaseDetail (cyclomatic 54) · ×1
  • KnowledgeBaseDetail.KnowledgeBaseDetail (cyclomatic 54) web/components/knowledge/KnowledgeBaseDetail.tsx:111 — KnowledgeBaseDetail.KnowledgeBaseDetail has cyclomatic complexity 54 (threshold 15). Of this number, 43 points are the body's own statements and 11 belong to 6 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · SubagentSettingsEditor.SubagentSettingsEditor (cyclomatic 54) · ×1
  • SubagentSettingsEditor.SubagentSettingsEditor (cyclomatic 54) web/components/settings/SubagentSettingsEditor.tsx:324 — SubagentSettingsEditor.SubagentSettingsEditor has cyclomatic complexity 54 (threshold 15). Of this number, 42 points are the body's own statements and 12 belong to 5 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · NoteFavoritesPicker.NoteFavoritesPicker (cyclomatic 54) · ×1
  • NoteFavoritesPicker.NoteFavoritesPicker (cyclomatic 54) web/features/notes/components/NoteFavoritesPicker.tsx:35 — NoteFavoritesPicker.NoteFavoritesPicker has cyclomatic complexity 54 (threshold 15). Of this number, 19 points are the body's own statements and 35 belong to 15 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · sidecar.build_ir (cyclomatic 53) · ×1
  • sidecar.build_ir (cyclomatic 53) deeptutor/services/rag/pipelines/lightrag/sidecar.py:118 — sidecar.build_ir has cyclomatic complexity 53 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · page.MasteryTopicPage (cyclomatic 53) · ×1
  • page.MasteryTopicPage (cyclomatic 53) web/app/(workspace)/learning/mastery/[pathId]/page.tsx:70 — page.MasteryTopicPage has cyclomatic complexity 53 (threshold 15). Of this number, 31 points are the body's own statements and 22 belong to 16 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MemoryRunPanel.MemoryRunPanel (cyclomatic 53) · ×1
  • MemoryRunPanel.MemoryRunPanel (cyclomatic 53) web/components/memory/MemoryRunPanel.tsx:59 — MemoryRunPanel.MemoryRunPanel has cyclomatic complexity 53 (threshold 15). Most of this is not in the body itself: 13 of the 53 points are its own statements and the rest belongs to 12 function literals inside it that branch (lines 225, 140, 176, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · PartnerArchives.PartnerArchives (cyclomatic 53) · ×1
  • PartnerArchives.PartnerArchives (cyclomatic 53) web/components/partners/PartnerArchives.tsx:144 — PartnerArchives.PartnerArchives has cyclomatic complexity 53 (threshold 15). Most of this is not in the body itself: 12 of the 53 points are its own statements and the rest belongs to 16 function literals inside it that branch (lines 275, 345, 215, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · KanbanBoard.KanbanBoard (cyclomatic 53) · ×1
  • KanbanBoard.KanbanBoard (cyclomatic 53) web/features/tasks/components/KanbanBoard.tsx:45 — KanbanBoard.KanbanBoard has cyclomatic complexity 53 (threshold 15). Of this number, 19 points are the body's own statements and 34 belong to 10 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · SQLiteSessionStore._serialize_notebook_entry (cyclomatic 52) · ×1
  • SQLiteSessionStore._serialize_notebook_entry (cyclomatic 52) deeptutor/services/session/sqlite_store.py:4053 — SQLiteSessionStore._serialize_notebook_entry has cyclomatic complexity 52 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · page.WhisperPage (cyclomatic 52) · ×1
  • page.WhisperPage (cyclomatic 52) web/app/(workspace)/whisper/page.tsx:39 — page.WhisperPage has cyclomatic complexity 52 (threshold 15). Of this number, 19 points are the body's own statements and 33 belong to 8 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ReadingReferencePicker.ReadingReferencePicker (cyclomatic 52) · ×1
  • ReadingReferencePicker.ReadingReferencePicker (cyclomatic 52) web/components/chat/ReadingReferencePicker.tsx:56 — ReadingReferencePicker.ReadingReferencePicker has cyclomatic complexity 52 (threshold 15). Most of this is not in the body itself: 14 of the 52 points are its own statements and the rest belongs to 20 function items inside it that branch (addUnits, a function literal at line 355, a function literal at line 108, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · FeishuChannel.send (cyclomatic 51) · ×1
  • FeishuChannel.send (cyclomatic 51) deeptutor/partners/channels/feishu.py:2115 — FeishuChannel.send has cyclomatic complexity 51 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · parsing.consume_sdk_stream (cyclomatic 51) · ×1
  • parsing.consume_sdk_stream (cyclomatic 51) deeptutor/services/llm/provider_core/openai_responses/parsing.py:549 — parsing.consume_sdk_stream has cyclomatic complexity 51 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TracePresentation.describeToolCall (cyclomatic 51) · ×1
  • TracePresentation.describeToolCall (cyclomatic 51) web/features/chat/trace/TracePresentation.tsx:148 — TracePresentation.describeToolCall has cyclomatic complexity 51 (threshold 15). Of this number, 48 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · manager._reconcile_embedding_flags (cyclomatic 50) · ×1
  • manager._reconcile_embedding_flags (cyclomatic 50) deeptutor/knowledge/manager.py:161 — manager._reconcile_embedding_flags has cyclomatic complexity 50 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TurnNavigator.TurnNavigator (cyclomatic 50) · ×1
  • TurnNavigator.TurnNavigator (cyclomatic 50) web/components/chat/home/TurnNavigator.tsx:90 — TurnNavigator.TurnNavigator has cyclomatic complexity 50 (threshold 15). Most of this is not in the body itself: 12 of the 50 points are its own statements and the rest belongs to 11 function literals inside it that branch (lines 208, 291, 134, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · TracePresentation.TraceRowItem (cyclomatic 50) · ×1
  • TracePresentation.TraceRowItem (cyclomatic 50) web/features/chat/trace/TracePresentation.tsx:977 — TracePresentation.TraceRowItem has cyclomatic complexity 50 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MasteryGradeTool.execute (cyclomatic 49) · ×1
  • MasteryGradeTool.execute (cyclomatic 49) deeptutor/capabilities/mastery/tools.py:1653 — MasteryGradeTool.execute has cyclomatic complexity 49 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · SimpleMarkdownRenderer.SimpleMarkdownRenderer (cyclomatic 49) · ×1
  • SimpleMarkdownRenderer.SimpleMarkdownRenderer (cyclomatic 49) web/components/common/SimpleMarkdownRenderer.tsx:30 — SimpleMarkdownRenderer.SimpleMarkdownRenderer has cyclomatic complexity 49 (threshold 15). Most of this is not in the body itself: 12 of the 49 points are its own statements and the rest belongs to 21 function literals inside it that branch (lines 329, 305, 383, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · KbDocumentsSection.KbDocumentsSection (cyclomatic 49) · ×1
  • KbDocumentsSection.KbDocumentsSection (cyclomatic 49) web/components/knowledge/KbDocumentsSection.tsx:43 — KbDocumentsSection.KbDocumentsSection has cyclomatic complexity 49 (threshold 15). Of this number, 39 points are the body's own statements and 10 belong to 5 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · AboutSettingsSection.AboutSettingsPage (cyclomatic 49) · ×1
  • AboutSettingsSection.AboutSettingsPage (cyclomatic 49) web/features/settings/sections/AboutSettingsSection.tsx:59 — AboutSettingsSection.AboutSettingsPage has cyclomatic complexity 49 (threshold 15). Of this number, 30 points are the body's own statements and 19 belong to 7 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · provider_runtime.resolve_llm_runtime_config (cyclomatic 48) · ×1
  • provider_runtime.resolve_llm_runtime_config (cyclomatic 48) deeptutor/services/config/provider_runtime.py:906 — provider_runtime.resolve_llm_runtime_config has cyclomatic complexity 48 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · source_inventory._collect_from_user_message (cyclomatic 48) · ×1
  • source_inventory._collect_from_user_message (cyclomatic 48) deeptutor/services/session/source_inventory.py:467 — source_inventory._collect_from_user_message has cyclomatic complexity 48 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PickerShell.PickerShell (cyclomatic 48) · ×1
  • PickerShell.PickerShell (cyclomatic 48) web/components/common/PickerShell.tsx:98 — PickerShell.PickerShell has cyclomatic complexity 48 (threshold 15). Most of this is not in the body itself: 13 of the 48 points are its own statements and the rest belongs to 10 function items inside it that branch (a function literal at line 131, a function literal at line 225, a function literal at line 210, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · KbDocumentList.KbDocumentList (cyclomatic 48) · ×1
  • KbDocumentList.KbDocumentList (cyclomatic 48) web/components/knowledge/KbDocumentList.tsx:108 — KbDocumentList.KbDocumentList has cyclomatic complexity 48 (threshold 15). Most of this is not in the body itself: 11 of the 48 points are its own statements and the rest belongs to 12 function items inside it that branch (renderNode, handleMove, a function literal at line 130, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · NotebookConsole.NotebookDetail (cyclomatic 48) · ×1
  • NotebookConsole.NotebookDetail (cyclomatic 48) web/components/notebook/NotebookConsole.tsx:458 — NotebookConsole.NotebookDetail has cyclomatic complexity 48 (threshold 15). Of this number, 19 points are the body's own statements and 29 belong to 12 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · labeled_step.run_labeled_step (cyclomatic 47) · ×1
  • labeled_step.run_labeled_step (cyclomatic 47) deeptutor/runtime/agentic/labeled_step.py:139 — labeled_step.run_labeled_step has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · marks.normalize_mark (cyclomatic 47) · ×1
  • marks.normalize_mark (cyclomatic 47) deeptutor/video_learning/marks.py:138 — marks.normalize_mark has cyclomatic complexity 47 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · page.NewPartnerPage (cyclomatic 47) · ×1
  • page.NewPartnerPage (cyclomatic 47) web/app/(workspace)/partners/new/page.tsx:42 — page.NewPartnerPage has cyclomatic complexity 47 (threshold 15). Of this number, 19 points are the body's own statements and 28 belong to 7 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · StarterSuggestions.StarterSuggestions (cyclomatic 47) · ×1
  • StarterSuggestions.StarterSuggestions (cyclomatic 47) web/components/chat/home/StarterSuggestions.tsx:93 — StarterSuggestions.StarterSuggestions has cyclomatic complexity 47 (threshold 15). Most of this is not in the body itself: 9 of the 47 points are its own statements and the rest belongs to 10 function literals inside it that branch (lines 181, 157, 141, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · PracticeSession.PracticeTurn (cyclomatic 47) · ×1
  • PracticeSession.PracticeTurn (cyclomatic 47) web/components/learning/practice/PracticeSession.tsx:126 — PracticeSession.PracticeTurn has cyclomatic complexity 47 (threshold 15). Of this number, 24 points are the body's own statements and 23 belong to 8 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SidebarShell.SidebarShell (cyclomatic 47) · ×1
  • SidebarShell.SidebarShell (cyclomatic 47) web/components/sidebar/SidebarShell.tsx:104 — SidebarShell.SidebarShell has cyclomatic complexity 47 (threshold 15). Of this number, 36 points are the body's own statements and 11 belong to 4 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · kb_health.detect_kb_drift (cyclomatic 46) · ×1
  • kb_health.detect_kb_drift (cyclomatic 46) deeptutor/book/kb_health.py:177 — kb_health.detect_kb_drift has cyclomatic complexity 46 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · local.parse_document_with_mineru_result (cyclomatic 46) · ×1
  • local.parse_document_with_mineru_result (cyclomatic 46) deeptutor/services/parsing/engines/mineru/local.py:125 — local.parse_document_with_mineru_result has cyclomatic complexity 46 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BlockRenderer.BlockRenderer (cyclomatic 46) · ×1
  • BlockRenderer.BlockRenderer (cyclomatic 46) web/app/(workspace)/learning/books/components/blocks/BlockRenderer.tsx:85 — BlockRenderer.BlockRenderer has cyclomatic complexity 46 (threshold 15). Of this number, 44 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · MemorySection.MemorySection (cyclomatic 46) · ×1
  • MemorySection.MemorySection (cyclomatic 46) web/components/memory/MemorySection.tsx:264 — MemorySection.MemorySection has cyclomatic complexity 46 (threshold 15). Of this number, 16 points are the body's own statements and 30 belong to 10 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PartnerChannels.PartnerChannels (cyclomatic 46) · ×1
  • PartnerChannels.PartnerChannels (cyclomatic 46) web/components/partners/PartnerChannels.tsx:43 — PartnerChannels.PartnerChannels has cyclomatic complexity 46 (threshold 15). Of this number, 24 points are the body's own statements and 22 belong to 9 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · sessions.update_session_organization (cyclomatic 45) · ×1
  • sessions.update_session_organization (cyclomatic 45) deeptutor/api/routers/sessions.py:574 — sessions.update_session_organization has cyclomatic complexity 45 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · provider_probe.probe_provider (cyclomatic 45) · ×1
  • provider_probe.probe_provider (cyclomatic 45) deeptutor/services/settings/provider_probe.py:193 — provider_probe.probe_provider has cyclomatic complexity 45 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PersonasSection.PersonasSection (cyclomatic 45) · ×1
  • PersonasSection.PersonasSection (cyclomatic 45) web/components/space/PersonasSection.tsx:63 — PersonasSection.PersonasSection has cyclomatic complexity 45 (threshold 15). Of this number, 17 points are the body's own statements and 28 belong to 10 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · turn-event.parseTurnEvent (cyclomatic 45) · ×1
  • turn-event.parseTurnEvent (cyclomatic 45) web/contracts/parse/turn-event.ts:78 — turn-event.parseTurnEvent has cyclomatic complexity 45 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · NoteEditor.Handles (cyclomatic 45) · ×1
  • NoteEditor.Handles (cyclomatic 45) web/features/notes/components/NoteEditor.tsx:386 — NoteEditor.Handles has cyclomatic complexity 45 (threshold 15). Most of this is not in the body itself: 11 of the 45 points are its own statements and the rest belongs to 15 function literals inside it that branch (lines 399, 587, 426, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · book-activity.preparationRows (cyclomatic 45) · ×1
  • book-activity.preparationRows (cyclomatic 45) web/lib/book-activity.ts:165 — book-activity.preparationRows has cyclomatic complexity 45 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LearningService._replace_module_set (cyclomatic 44) · ×1
  • LearningService._replace_module_set (cyclomatic 44) deeptutor/learning/service.py:1734 — LearningService._replace_module_set has cyclomatic complexity 44 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · exercise_lookup.lookup_exercises (cyclomatic 44) · ×1
  • exercise_lookup.lookup_exercises (cyclomatic 44) deeptutor/services/rag/pipelines/llamaindex/exercise_lookup.py:313 — exercise_lookup.lookup_exercises has cyclomatic complexity 44 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TurnLifecycle.subscribe_turn (cyclomatic 44) · ×1
  • TurnLifecycle.subscribe_turn (cyclomatic 44) deeptutor/services/session/turns/lifecycle.py:380 — TurnLifecycle.subscribe_turn has cyclomatic complexity 44 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · IndexingModelSelector.IndexingModelSelector (cyclomatic 44) · ×1
  • IndexingModelSelector.IndexingModelSelector (cyclomatic 44) web/components/knowledge/IndexingModelSelector.tsx:81 — IndexingModelSelector.IndexingModelSelector has cyclomatic complexity 44 (threshold 15). Of this number, 39 points are the body's own statements and 5 belong to 4 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · blocks.blockPreview (cyclomatic 44) · ×1
  • blocks.blockPreview (cyclomatic 44) web/features/notes/model/blocks.ts:27 — blocks.blockPreview has cyclomatic complexity 44 (threshold 15). Of this number, 41 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · GuardianSettingsSection.GuardianSettingsPage (cyclomatic 44) · ×1
  • GuardianSettingsSection.GuardianSettingsPage (cyclomatic 44) web/features/settings/sections/GuardianSettingsSection.tsx:44 — GuardianSettingsSection.GuardianSettingsPage has cyclomatic complexity 44 (threshold 15). Of this number, 21 points are the body's own statements and 23 belong to 12 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · lesson_evidence.prepare_lesson (cyclomatic 43) · ×1
  • lesson_evidence.prepare_lesson (cyclomatic 43) deeptutor/learning/lesson_evidence.py:590 — lesson_evidence.prepare_lesson has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · topic_generation.materialize_modules (cyclomatic 43) · ×1
  • topic_generation.materialize_modules (cyclomatic 43) deeptutor/learning/topic_generation.py:308 — topic_generation.materialize_modules has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · blocks.blocks_to_markdown (cyclomatic 43) · ×1
  • blocks.blocks_to_markdown (cyclomatic 43) deeptutor/notes/blocks.py:222 — blocks.blocks_to_markdown has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ReadingStore.ingest_units (cyclomatic 43) · ×1
  • ReadingStore.ingest_units (cyclomatic 43) deeptutor/reading/store.py:610 — ReadingStore.ingest_units has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ModelCatalogService._normalize (cyclomatic 43) · ×1
  • ModelCatalogService._normalize (cyclomatic 43) deeptutor/services/config/model_catalog.py:472 — ModelCatalogService._normalize has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _turn_runtime_shared._format_followup_question_context (cyclomatic 43) · ×1
  • _turn_runtime_shared._format_followup_question_context (cyclomatic 43) deeptutor/services/session/_turn_runtime_shared.py:1237 — _turn_runtime_shared._format_followup_question_context has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · QuizBlock.QuizQuestionCard (cyclomatic 43) · ×1
  • QuizBlock.QuizQuestionCard (cyclomatic 43) web/app/(workspace)/learning/books/components/blocks/QuizBlock.tsx:134 — QuizBlock.QuizQuestionCard has cyclomatic complexity 43 (threshold 15). Of this number, 29 points are the body's own statements and 14 belong to 3 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · SidebarNav.SidebarNav (cyclomatic 43) · ×1
  • SidebarNav.SidebarNav (cyclomatic 43) web/components/sidebar/SidebarNav.tsx:89 — SidebarNav.SidebarNav has cyclomatic complexity 43 (threshold 15). Of this number, 17 points are the body's own statements and 26 belong to 13 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · partner_groups.partner_group_ws (cyclomatic 42) · ×1
  • partner_groups.partner_group_ws (cyclomatic 42) deeptutor/api/routers/partner_groups.py:339 — partner_groups.partner_group_ws has cyclomatic complexity 42 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · parsing.consume_sse (cyclomatic 42) · ×1
  • parsing.consume_sse (cyclomatic 42) deeptutor/services/llm/provider_core/openai_responses/parsing.py:358 — parsing.consume_sse has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · RAGTool._retrieve (cyclomatic 42) · ×1
  • RAGTool._retrieve (cyclomatic 42) deeptutor/tools/builtin/__init__.py:293 — RAGTool._retrieve has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · QuestionBankPicker.QuestionBankPicker (cyclomatic 42) · ×1
  • QuestionBankPicker.QuestionBankPicker (cyclomatic 42) web/components/chat/QuestionBankPicker.tsx:57 — QuestionBankPicker.QuestionBankPicker has cyclomatic complexity 42 (threshold 15). Most of this is not in the body itself: 10 of the 42 points are its own statements and the rest belongs to 12 function items inside it that branch (a function literal at line 111, a function literal at line 297, a function literal at line 85, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · NoteTopBar.NoteTopBar (cyclomatic 42) · ×1
  • NoteTopBar.NoteTopBar (cyclomatic 42) web/features/notes/components/NoteTopBar.tsx:49 — NoteTopBar.NoteTopBar has cyclomatic complexity 42 (threshold 15). Of this number, 33 points are the body's own statements and 9 belong to 5 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · exercise_lookup.collect_exercises (cyclomatic 41) · ×1
  • exercise_lookup.collect_exercises (cyclomatic 41) deeptutor/services/rag/pipelines/llamaindex/exercise_lookup.py:137 — exercise_lookup.collect_exercises has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · chat._apply_command (cyclomatic 41) · ×1
  • chat._apply_command (cyclomatic 41) deeptutor_cli/chat.py:192 — chat._apply_command has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FilePreviewDrawer.FilePreviewDrawer (cyclomatic 41) · ×1
  • FilePreviewDrawer.FilePreviewDrawer (cyclomatic 41) web/components/chat/preview/FilePreviewDrawer.tsx:64 — FilePreviewDrawer.FilePreviewDrawer has cyclomatic complexity 41 (threshold 15). Of this number, 21 points are the body's own statements and 20 belong to 7 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ChatSpaceMenu.ChatSpaceMenu (cyclomatic 41) · ×1
  • ChatSpaceMenu.ChatSpaceMenu (cyclomatic 41) web/components/chat/space/ChatSpaceMenu.tsx:105 — ChatSpaceMenu.ChatSpaceMenu has cyclomatic complexity 41 (threshold 15). Most of this is not in the body itself: 7 of the 41 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 257, 128, 216, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · NotebookRecordRow.NotebookRecordRow (cyclomatic 41) · ×1
  • NotebookRecordRow.NotebookRecordRow (cyclomatic 41) web/components/notebook/NotebookRecordRow.tsx:109 — NotebookRecordRow.NotebookRecordRow has cyclomatic complexity 41 (threshold 15). Of this number, 25 points are the body's own statements and 16 belong to 8 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ChannelOnboardingPanel.ChannelOnboardingPanel (cyclomatic 40) · ×1
  • ChannelOnboardingPanel.ChannelOnboardingPanel (cyclomatic 40) web/components/partners/ChannelOnboardingPanel.tsx:25 — ChannelOnboardingPanel.ChannelOnboardingPanel has cyclomatic complexity 40 (threshold 15). Of this number, 21 points are the body's own statements and 19 belong to 9 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ReadingExtensionBar.ExtensionToolbar (cyclomatic 40) · ×1
  • ReadingExtensionBar.ExtensionToolbar (cyclomatic 40) web/components/reading/ReadingExtensionBar.tsx:90 — ReadingExtensionBar.ExtensionToolbar has cyclomatic complexity 40 (threshold 15). Most of this is not in the body itself: 5 of the 40 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 209, run, a function literal at line 122, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · NetworkSettingsSection.NetworkSettingsPage (cyclomatic 40) · ×1
  • NetworkSettingsSection.NetworkSettingsPage (cyclomatic 40) web/features/settings/sections/NetworkSettingsSection.tsx:95 — NetworkSettingsSection.NetworkSettingsPage has cyclomatic complexity 40 (threshold 15). Most of this is not in the body itself: 15 of the 40 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 110, 164, 146, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · OpenAICompatProvider.chat_stream (cyclomatic 39) · ×1
  • OpenAICompatProvider.chat_stream (cyclomatic 39) deeptutor/services/llm/provider_core/openai_compat_provider.py:1138 — OpenAICompatProvider.chat_stream has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · source_filter.filter_web_search_response (cyclomatic 39) · ×1
  • source_filter.filter_web_search_response (cyclomatic 39) REDACTED:352 — source_filter.filter_web_search_response has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · chat-completions.request (cyclomatic 39) · ×1
  • chat-completions.request (cyclomatic 39) packages/chat-engine/src/providers/chat-completions.ts:50 — chat-completions.request has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (chat-completions.request::ingest) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · KbFilePreview.KbFilePreview (cyclomatic 39) · ×1
  • KbFilePreview.KbFilePreview (cyclomatic 39) web/components/knowledge/KbFilePreview.tsx:112 — KbFilePreview.KbFilePreview has cyclomatic complexity 39 (threshold 15). Of this number, 31 points are the body's own statements and 8 belong to 6 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MathAnimatorViewer.MathAnimatorViewer (cyclomatic 39) · ×1
  • MathAnimatorViewer.MathAnimatorViewer (cyclomatic 39) web/components/math-animator/MathAnimatorViewer.tsx:10 — MathAnimatorViewer.MathAnimatorViewer has cyclomatic complexity 39 (threshold 15). Of this number, 19 points are the body's own statements and 20 belong to 4 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · EventEditor.EventEditor (cyclomatic 39) · ×1
  • EventEditor.EventEditor (cyclomatic 39) web/features/calendar/components/EventEditor.tsx:26 — EventEditor.EventEditor has cyclomatic complexity 39 (threshold 15). Of this number, 20 points are the body's own statements and 19 belong to 9 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · NoteCompanion.ThreadPanel (cyclomatic 39) · ×1
  • NoteCompanion.ThreadPanel (cyclomatic 39) web/features/notes/components/NoteCompanion.tsx:203 — NoteCompanion.ThreadPanel has cyclomatic complexity 39 (threshold 15). Of this number, 22 points are the body's own statements and 17 belong to 11 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · book-progress.reduceBookEvent (cyclomatic 39) · ×1
  • book-progress.reduceBookEvent (cyclomatic 39) web/lib/book-progress.ts:206 — book-progress.reduceBookEvent has cyclomatic complexity 39 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · AgenticLoopPipeline._augment_tool_kwargs (cyclomatic 38) · ×1
  • AgenticLoopPipeline._augment_tool_kwargs (cyclomatic 38) deeptutor/agents/loop/pipeline.py:1397 — AgenticLoopPipeline._augment_tool_kwargs has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · provider_links.resolve_profile_provider (cyclomatic 38) · ×1
  • provider_links.resolve_profile_provider (cyclomatic 38) deeptutor/services/config/provider_links.py:120 — provider_links.resolve_profile_provider has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · readiness.catalog_service_rows (cyclomatic 38) · ×1
  • readiness.catalog_service_rows (cyclomatic 38) deeptutor/services/config/readiness.py:230 — readiness.catalog_service_rows has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · reasoning_params.build_openai_compatible_reasoning_kwargs (cyclomatic 38) · ×1
  • reasoning_params.build_openai_compatible_reasoning_kwargs (cyclomatic 38) deeptutor/services/llm/reasoning_params.py:173 — reasoning_params.build_openai_compatible_reasoning_kwargs has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · model_history.normalize_model_turn (cyclomatic 38) · ×1
  • model_history.normalize_model_turn (cyclomatic 38) deeptutor/services/session/model_history.py:44 — model_history.normalize_model_turn has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BookLibrary.BookLibrary (cyclomatic 38) · ×1
  • BookLibrary.BookLibrary (cyclomatic 38) web/app/(workspace)/learning/books/components/BookLibrary.tsx:82 — BookLibrary.BookLibrary has cyclomatic complexity 38 (threshold 15). Most of this is not in the body itself: 9 of the 38 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 204, 99, 110, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · LightRagRoleModelsEditor.LightRagRoleModelsEditor (cyclomatic 38) · ×1
  • LightRagRoleModelsEditor.LightRagRoleModelsEditor (cyclomatic 38) web/components/knowledge/LightRagRoleModelsEditor.tsx:114 — LightRagRoleModelsEditor.LightRagRoleModelsEditor has cyclomatic complexity 38 (threshold 15). Of this number, 21 points are the body's own statements and 17 belong to 6 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · KbIndexingRun.KbIndexingRun (cyclomatic 38) · ×1
  • KbIndexingRun.KbIndexingRun (cyclomatic 38) web/components/knowledge/KbIndexingRun.tsx:26 — KbIndexingRun.KbIndexingRun has cyclomatic complexity 38 (threshold 15). Of this number, 19 points are the body's own statements and 19 belong to 7 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · PartnerConfigure.PartnerConfigure (cyclomatic 38) · ×1
  • PartnerConfigure.PartnerConfigure (cyclomatic 38) web/components/partners/PartnerConfigure.tsx:67 — PartnerConfigure.PartnerConfigure has cyclomatic complexity 38 (threshold 15). Of this number, 16 points are the body's own statements and 22 belong to 12 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · provider_runtime.resolve_embedding_runtime_config (cyclomatic 37) · ×1
  • provider_runtime.resolve_embedding_runtime_config (cyclomatic 37) deeptutor/services/config/provider_runtime.py:1198 — provider_runtime.resolve_embedding_runtime_config has cyclomatic complexity 37 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · OpenAICompatibleEmbeddingAdapter.embed (cyclomatic 37) · ×1
  • OpenAICompatibleEmbeddingAdapter.embed (cyclomatic 37) deeptutor/services/embedding/adapters/openai_compatible.py:171 — OpenAICompatibleEmbeddingAdapter.embed has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · parsing.parse_response_output (cyclomatic 37) · ×1
  • parsing.parse_response_output (cyclomatic 37) deeptutor/services/llm/provider_core/openai_responses/parsing.py:456 — parsing.parse_response_output has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DoubaoProvider.search (cyclomatic 37) · ×1
  • DoubaoProvider.search (cyclomatic 37) deeptutor/services/search/providers/doubao.py:39 — DoubaoProvider.search has cyclomatic complexity 37 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · page.CoWriterHomePage (cyclomatic 37) · ×1
  • page.CoWriterHomePage (cyclomatic 37) web/app/(workspace)/co-writer/page.tsx:144 — page.CoWriterHomePage has cyclomatic complexity 37 (threshold 15). Of this number, 18 points are the body's own statements and 19 belong to 8 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CreationDraftCard.CreationDraftCard (cyclomatic 37) · ×1
  • CreationDraftCard.CreationDraftCard (cyclomatic 37) web/components/chat/home/CreationDraftCard.tsx:42 — CreationDraftCard.CreationDraftCard has cyclomatic complexity 37 (threshold 15). Of this number, 25 points are the body's own statements and 12 belong to 4 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AppShellContext.AppShellProvider (cyclomatic 37) · ×1
  • AppShellContext.AppShellProvider (cyclomatic 37) web/context/AppShellContext.tsx:90 — AppShellContext.AppShellProvider has cyclomatic complexity 37 (threshold 15). Most of this is not in the body itself: 1 of the 37 points is its own statement and the rest belongs to 9 function literals inside it that branch (lines 203, 118, 282, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · OutputFileActions.OutputFileActions (cyclomatic 37) · ×1
  • OutputFileActions.OutputFileActions (cyclomatic 37) web/components/files/OutputFileActions.tsx:27 — OutputFileActions.OutputFileActions has cyclomatic complexity 37 (threshold 15). Of this number, 23 points are the body's own statements and 14 belong to 6 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PracticePage.PracticeCollectionPage (cyclomatic 37) · ×1
  • PracticePage.PracticeCollectionPage (cyclomatic 37) web/components/learning/practice/PracticePage.tsx:24 — PracticePage.PracticeCollectionPage has cyclomatic complexity 37 (threshold 15). Of this number, 19 points are the body's own statements and 18 belong to 5 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ResearchOutlineEditor.ResearchOutlineEditor (cyclomatic 37) · ×1
  • ResearchOutlineEditor.ResearchOutlineEditor (cyclomatic 37) web/components/research/ResearchOutlineEditor.tsx:25 — ResearchOutlineEditor.ResearchOutlineEditor has cyclomatic complexity 37 (threshold 15). Of this number, 27 points are the body's own statements and 10 belong to 6 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · EngineDetail.ModelsSection (cyclomatic 37) · ×1
  • EngineDetail.ModelsSection (cyclomatic 37) web/features/knowledge/components/engines/EngineDetail.tsx:1454 — EngineDetail.ModelsSection has cyclomatic complexity 37 (threshold 15). Most of this is not in the body itself: 5 of the 37 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 1549, 1496, 1511, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · useKnowledgeProgress.useKnowledgeProgress.subscribeWs (cyclomatic 37) · ×1
  • useKnowledgeProgress.useKnowledgeProgress.subscribeWs (cyclomatic 37) web/hooks/useKnowledgeProgress.ts:149 — useKnowledgeProgress.useKnowledgeProgress.subscribeWs has cyclomatic complexity 37 (threshold 15). Of this number, 20 points are the body's own statements and 17 belong to 5 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · reasoning.supported_reasoning_efforts (cyclomatic 36) · ×1
  • reasoning.supported_reasoning_efforts (cyclomatic 36) deeptutor/services/model_selection/reasoning.py:16 — reasoning.supported_reasoning_efforts has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · html_extractor._element_to_markdown (cyclomatic 36) · ×1
  • html_extractor._element_to_markdown (cyclomatic 36) deeptutor/services/web_source/html_extractor.py:420 — html_extractor._element_to_markdown has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · KbLinkedFoldersSection.KbLinkedFoldersSection (cyclomatic 36) · ×1
  • KbLinkedFoldersSection.KbLinkedFoldersSection (cyclomatic 36) web/components/knowledge/KbLinkedFoldersSection.tsx:36 — KbLinkedFoldersSection.KbLinkedFoldersSection has cyclomatic complexity 36 (threshold 15). Of this number, 19 points are the body's own statements and 17 belong to 5 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · LocationCrumbs.InstanceCrumb (cyclomatic 36) · ×1
  • LocationCrumbs.InstanceCrumb (cyclomatic 36) web/components/layout/LocationCrumbs.tsx:81 — LocationCrumbs.InstanceCrumb has cyclomatic complexity 36 (threshold 15). Of this number, 19 points are the body's own statements and 17 belong to 8 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · MemoryGraph.GraphView (cyclomatic 36) · ×1
  • MemoryGraph.GraphView (cyclomatic 36) web/components/memory/MemoryGraph.tsx:354 — MemoryGraph.GraphView has cyclomatic complexity 36 (threshold 15). Most of this is not in the body itself: 2 of the 36 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 595, 373, 424, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · MemoryRunPanel.systemEventDisplay (cyclomatic 36) · ×1
  • MemoryRunPanel.systemEventDisplay (cyclomatic 36) web/components/memory/MemoryRunPanel.tsx:539 — MemoryRunPanel.systemEventDisplay has cyclomatic complexity 36 (threshold 15). Of this number, 34 points are the body's own statements and 2 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SoulPicker.SoulPicker (cyclomatic 36) · ×1
  • SoulPicker.SoulPicker (cyclomatic 36) web/components/partners/SoulPicker.tsx:47 — SoulPicker.SoulPicker has cyclomatic complexity 36 (threshold 15). Of this number, 25 points are the body's own statements and 11 belong to 7 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · schema-form.SchemaField (cyclomatic 36) · ×1
  • schema-form.SchemaField (cyclomatic 36) web/components/partners/schema-form.tsx:151 — schema-form.SchemaField has cyclomatic complexity 36 (threshold 15). Of this number, 30 points are the body's own statements and 6 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · QuizFollowupTabBody.QuizFollowupTabBody (cyclomatic 36) · ×1
  • QuizFollowupTabBody.QuizFollowupTabBody (cyclomatic 36) web/components/quiz/QuizFollowupTabBody.tsx:69 — QuizFollowupTabBody.QuizFollowupTabBody has cyclomatic complexity 36 (threshold 15). Of this number, 23 points are the body's own statements and 13 belong to 7 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ChatStateAdapter.hydrateRequestSnapshot (cyclomatic 36) · ×1
  • ChatStateAdapter.hydrateRequestSnapshot (cyclomatic 36) web/features/chat/ChatStateAdapter.tsx:1908 — ChatStateAdapter.hydrateRequestSnapshot has cyclomatic complexity 36 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · book.quiz_attempt (cyclomatic 35) · ×1
  • book.quiz_attempt (cyclomatic 35) deeptutor/api/routers/book.py:1103 — book.quiz_attempt has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TurnApplicationService.subscribe_turn (cyclomatic 35) · ×1
  • TurnApplicationService.subscribe_turn (cyclomatic 35) deeptutor/app/service.py:248 — TurnApplicationService.subscribe_turn has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · tools._revise_points (cyclomatic 35) · ×1
  • tools._revise_points (cyclomatic 35) deeptutor/capabilities/mastery/tools.py:3521 — tools._revise_points has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ReadingStore.ingest (cyclomatic 35) · ×1
  • ReadingStore.ingest (cyclomatic 35) deeptutor/reading/store.py:254 — ReadingStore.ingest has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CalendarStore.update (cyclomatic 35) · ×1
  • CalendarStore.update (cyclomatic 35) deeptutor/services/calendar/store.py:240 — CalendarStore.update has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · llm.list_llm_options (cyclomatic 35) · ×1
  • llm.list_llm_options (cyclomatic 35) deeptutor/services/model_selection/llm.py:95 — llm.list_llm_options has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ContextBuilder.build (cyclomatic 35) · ×1
  • ContextBuilder.build (cyclomatic 35) deeptutor/services/session/context_builder.py:624 — ContextBuilder.build has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MasteryQuestionCard.GroupedMasteryQuestionCard (cyclomatic 35) · ×1
  • MasteryQuestionCard.GroupedMasteryQuestionCard (cyclomatic 35) web/components/chat/home/MasteryQuestionCard.tsx:366 — MasteryQuestionCard.GroupedMasteryQuestionCard has cyclomatic complexity 35 (threshold 15). Of this number, 24 points are the body's own statements and 11 belong to 5 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · useDragSort.useDragSort.handlePointerDown.<returned closure> (cyclomatic 35) · ×1
  • useDragSort.useDragSort.handlePointerDown.<returned closure> (cyclomatic 35) web/hooks/useDragSort.ts:105 — useDragSort.useDragSort.handlePointerDown.<returned closure> has cyclomatic complexity 35 (threshold 15). Most of this is not in the body itself: 9 of the 35 points are its own statements and the rest belongs to 10 function items inside it that branch (followEdges, onMove, activate, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · SpineSynthesizer._coerce_chapters (cyclomatic 34) · ×1
  • SpineSynthesizer._coerce_chapters (cyclomatic 34) deeptutor/book/agents/spine_synthesizer.py:422 — SpineSynthesizer._coerce_chapters has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · KnowledgeBaseManager.update_kb_status (cyclomatic 34) · ×1
  • KnowledgeBaseManager.update_kb_status (cyclomatic 34) deeptutor/knowledge/manager.py:503 — KnowledgeBaseManager.update_kb_status has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PartnerManager._outbound_router (cyclomatic 34) · ×1
  • PartnerManager._outbound_router (cyclomatic 34) deeptutor/services/partners/manager.py:770 — PartnerManager._outbound_router has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · discovery.discover_voices (cyclomatic 34) · ×1
  • discovery.discover_voices (cyclomatic 34) deeptutor/services/voice/discovery.py:62 — discovery.discover_voices has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · data_migration.migrate_data (cyclomatic 34) · ×1
  • data_migration.migrate_data (cyclomatic 34) deeptutor/services/workspace/data_migration.py:561 — data_migration.migrate_data has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · KbIndexVersionsSection.IndexVersionRow (cyclomatic 34) · ×1
  • KbIndexVersionsSection.IndexVersionRow (cyclomatic 34) web/components/knowledge/KbIndexVersionsSection.tsx:436 — KbIndexVersionsSection.IndexVersionRow has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · KbSettingsSection.KbSettingsSection (cyclomatic 34) · ×1
  • KbSettingsSection.KbSettingsSection (cyclomatic 34) web/components/knowledge/KbSettingsSection.tsx:27 — KbSettingsSection.KbSettingsSection has cyclomatic complexity 34 (threshold 15). Of this number, 28 points are the body's own statements and 6 belong to 3 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · McpCatalogBrowser.EntryDetail (cyclomatic 34) · ×1
  • McpCatalogBrowser.EntryDetail (cyclomatic 34) web/components/mcp/McpCatalogBrowser.tsx:420 — McpCatalogBrowser.EntryDetail has cyclomatic complexity 34 (threshold 15). Of this number, 29 points are the body's own statements and 5 belong to 3 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · useMemoryRun.useMemoryRun.attach (cyclomatic 34) · ×1
  • useMemoryRun.useMemoryRun.attach (cyclomatic 34) web/components/memory/useMemoryRun.ts:164 — useMemoryRun.useMemoryRun.attach has cyclomatic complexity 34 (threshold 15). Of this number, 18 points are the body's own statements and 16 belong to 5 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · NoteCompanion.ThreadComposer (cyclomatic 34) · ×1
  • NoteCompanion.ThreadComposer (cyclomatic 34) web/features/notes/components/NoteCompanion.tsx:627 — NoteCompanion.ThreadComposer has cyclomatic complexity 34 (threshold 15). Of this number, 23 points are the body's own statements and 11 belong to 6 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · WorkspaceSettingsSection.WorkspaceRow (cyclomatic 34) · ×1
  • WorkspaceSettingsSection.WorkspaceRow (cyclomatic 34) web/features/settings/sections/WorkspaceSettingsSection.tsx:23 — WorkspaceSettingsSection.WorkspaceRow has cyclomatic complexity 34 (threshold 15). Of this number, 30 points are the body's own statements and 4 belong to 4 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · memory-graph.buildGraph (cyclomatic 34) · ×1
  • memory-graph.buildGraph (cyclomatic 34) web/lib/memory-graph.ts:322 — memory-graph.buildGraph has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 8 of the 34 points are its own statements and the rest belongs to 9 function items inside it that branch (a function literal at line 619, a function literal at line 579, pushEdge, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · Tooltip.Tooltip (cyclomatic 34) · ×1
  • Tooltip.Tooltip (cyclomatic 34) web/shared/ui/Tooltip.tsx:41 — Tooltip.Tooltip has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 9 of the 34 points are its own statements and the rest belongs to 12 function literals inside it that branch (lines 135, 96, 119, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · TurnApplicationService.start_turn (cyclomatic 33) · ×1
  • TurnApplicationService.start_turn (cyclomatic 33) deeptutor/app/service.py:113 — TurnApplicationService.start_turn has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · launcher.start (cyclomatic 33) · ×1
  • launcher.start (cyclomatic 33) deeptutor/runtime/launcher.py:1513 — launcher.start has cyclomatic complexity 33 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · evaluation.load_cases (cyclomatic 33) · ×1
  • evaluation.load_cases (cyclomatic 33) deeptutor/services/memory/evaluation.py:82 — evaluation.load_cases has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SQLiteSessionStore._upsert_notebook_entries_in_conn (cyclomatic 33) · ×1
  • SQLiteSessionStore._upsert_notebook_entries_in_conn (cyclomatic 33) deeptutor/services/session/sqlite_store.py:3413 — SQLiteSessionStore._upsert_notebook_entries_in_conn has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HermesRemoteBackend.consult (cyclomatic 33) · ×1
  • HermesRemoteBackend.consult (cyclomatic 33) deeptutor/services/subagent/hermes_remote.py:110 — HermesRemoteBackend.consult has cyclomatic complexity 33 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · SessionList.SessionList (cyclomatic 33) · ×1
  • SessionList.SessionList (cyclomatic 33) web/components/SessionList.tsx:31 — SessionList.SessionList has cyclomatic complexity 33 (threshold 15). Most of this is not in the body itself: 6 of the 33 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 249, a function literal at line 139, commitEdit, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · MemoryWorkbench.MemoryWorkbench (cyclomatic 33) · ×1
  • MemoryWorkbench.MemoryWorkbench (cyclomatic 33) web/components/memory/MemoryWorkbench.tsx:183 — MemoryWorkbench.MemoryWorkbench has cyclomatic complexity 33 (threshold 15). Most of this is not in the body itself: 10 of the 33 points are its own statements and the rest belongs to 12 function literals inside it that branch (lines 259, 217, 227, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · ServicePreviewPanel.Preview (cyclomatic 33) · ×1
  • ServicePreviewPanel.Preview (cyclomatic 33) web/components/settings/ServicePreviewPanel.tsx:52 — ServicePreviewPanel.Preview has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (ServicePreviewPanel.Preview::run) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · useQuestionBank.useQuestionBank (cyclomatic 33) · ×1
  • useQuestionBank.useQuestionBank (cyclomatic 33) web/components/space/question-bank/useQuestionBank.ts:142 — useQuestionBank.useQuestionBank has cyclomatic complexity 33 (threshold 15). Most of this is not in the body itself: 1 of the 33 points is its own statement and the rest belongs to 15 function literals inside it that branch (lines 176, 372, 214, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · WorkspacePill.WorkspacePill (cyclomatic 33) · ×1
  • WorkspacePill.WorkspacePill (cyclomatic 33) web/components/workspaces/WorkspacePill.tsx:28 — WorkspacePill.WorkspacePill has cyclomatic complexity 33 (threshold 15). Of this number, 20 points are the body's own statements and 13 belong to 7 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · LearningService._grade_group (cyclomatic 32) · ×1
  • LearningService._grade_group (cyclomatic 32) deeptutor/learning/service.py:1412 — LearningService._grade_group has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · visual_practice.prepare_visual (cyclomatic 32) · ×1
  • visual_practice.prepare_visual (cyclomatic 32) deeptutor/learning/visual_practice.py:92 — visual_practice.prepare_visual has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · WeixinChannel.send (cyclomatic 32) · ×1
  • WeixinChannel.send (cyclomatic 32) deeptutor/partners/channels/weixin.py:943 — WeixinChannel.send has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · importing.normalize_question (cyclomatic 32) · ×1
  • importing.normalize_question (cyclomatic 32) deeptutor/services/practice/importing.py:130 — importing.normalize_question has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ClaudeCodeBackend._handle_event (cyclomatic 32) · ×1
  • ClaudeCodeBackend._handle_event (cyclomatic 32) deeptutor/services/subagent/claude_code.py:181 — ClaudeCodeBackend._handle_event has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · deepseek_harness._sdk_notification_events (cyclomatic 32) · ×1
  • deepseek_harness._sdk_notification_events (cyclomatic 32) deeptutor/services/subagent/deepseek_harness.py:258 — deepseek_harness._sdk_notification_events has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BookSidebar.BookSidebar (cyclomatic 32) · ×1
  • BookSidebar.BookSidebar (cyclomatic 32) web/app/(workspace)/learning/books/components/BookSidebar.tsx:67 — BookSidebar.BookSidebar has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 15 of the 32 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 241, 113, 84, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · SpineEditor.SpineEditor (cyclomatic 32) · ×1
  • SpineEditor.SpineEditor (cyclomatic 32) web/app/(workspace)/learning/books/components/SpineEditor.tsx:120 — SpineEditor.SpineEditor has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 13 of the 32 points are its own statements and the rest belongs to 14 function items inside it that branch (a function literal at line 213, a function literal at line 156, a function literal at line 237, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · AnswerModeMenu.PartnerLinkList (cyclomatic 32) · ×1
  • AnswerModeMenu.PartnerLinkList (cyclomatic 32) web/components/chat/home/AnswerModeMenu.tsx:306 — AnswerModeMenu.PartnerLinkList has cyclomatic complexity 32 (threshold 15). Of this number, 26 points are the body's own statements and 6 belong to 5 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · McpServerForm.McpServerForm (cyclomatic 32) · ×1
  • McpServerForm.McpServerForm (cyclomatic 32) web/components/mcp/McpServerForm.tsx:27 — McpServerForm.McpServerForm has cyclomatic complexity 32 (threshold 15). Of this number, 20 points are the body's own statements and 12 belong to 5 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · MemorySection.L1View (cyclomatic 32) · ×1
  • MemorySection.L1View (cyclomatic 32) web/components/memory/MemorySection.tsx:660 — MemorySection.L1View has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 11 of the 32 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 756, 776, 716, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · useReadingWorkspace.useReadingWorkspace (cyclomatic 32) · ×1
  • useReadingWorkspace.useReadingWorkspace (cyclomatic 32) web/components/reading/workspace/useReadingWorkspace.ts:51 — useReadingWorkspace.useReadingWorkspace has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 2 of the 32 points are its own statements and the rest belongs to 15 function literals inside it that branch (lines 179, 453, 191, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · VisualizationViewer.sanitizeSvg (cyclomatic 32) · ×1
  • VisualizationViewer.sanitizeSvg (cyclomatic 32) REDACTED:274 — VisualizationViewer.sanitizeSvg has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 6 of the 32 points are its own statements and the rest belongs to 5 function items inside it that branch (walk, rescope, a function literal at line 328, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · DataMigrationSettingsSection.DataMigrationSettingsSection (cyclomatic 32) · ×1
  • DataMigrationSettingsSection.DataMigrationSettingsSection (cyclomatic 32) web/features/settings/sections/DataMigrationSettingsSection.tsx:74 — DataMigrationSettingsSection.DataMigrationSettingsSection has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 9 of the 32 points are its own statements and the rest belongs to 13 function items inside it that branch (run, a function literal at line 239, a function literal at line 365, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · book-activity.buildBookActivity (cyclomatic 32) · ×1
  • book-activity.buildBookActivity (cyclomatic 32) web/lib/book-activity.ts:368 — book-activity.buildBookActivity has cyclomatic complexity 32 (threshold 15). Of this number, 31 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · feishu._extract_element_content (cyclomatic 31) · ×1
  • feishu._extract_element_content (cyclomatic 31) deeptutor/partners/channels/feishu.py:151 — feishu._extract_element_content has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · readiness.build_settings_readiness (cyclomatic 31) · ×1
  • readiness.build_settings_readiness (cyclomatic 31) deeptutor/services/config/readiness.py:886 — readiness.build_settings_readiness has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · GrokBackend._handle_event (cyclomatic 31) · ×1
  • GrokBackend._handle_event (cyclomatic 31) deeptutor/services/subagent/grok.py:180 — GrokBackend._handle_event has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PartnerBackend.consult (cyclomatic 31) · ×1
  • PartnerBackend.consult (cyclomatic 31) deeptutor/services/subagent/partner.py:72 — PartnerBackend.consult has cyclomatic complexity 31 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · crawler.crawl_docs_site (cyclomatic 31) · ×1
  • crawler.crawl_docs_site (cyclomatic 31) deeptutor/services/web_source/crawler.py:347 — crawler.crawl_docs_site has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · data_migration.preview (cyclomatic 31) · ×1
  • data_migration.preview (cyclomatic 31) deeptutor/services/workspace/data_migration.py:315 — data_migration.preview has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · setup_config.prepare_profiles (cyclomatic 31) · ×1
  • setup_config.prepare_profiles (cyclomatic 31) deeptutor_cli/setup_config.py:106 — setup_config.prepare_profiles has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · types.validateNativeInput (cyclomatic 31) · ×1
  • types.validateNativeInput (cyclomatic 31) packages/chat-engine/src/native/types.ts:190 — types.validateNativeInput has cyclomatic complexity 31 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · ModelSelector.ModelSelector (cyclomatic 31) · ×1
  • ModelSelector.ModelSelector (cyclomatic 31) web/components/chat/home/ModelSelector.tsx:107 — ModelSelector.ModelSelector has cyclomatic complexity 31 (threshold 15). Of this number, 30 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PracticeInsights.PracticeInsights (cyclomatic 31) · ×1
  • PracticeInsights.PracticeInsights (cyclomatic 31) web/components/learning/practice/PracticeInsights.tsx:32 — PracticeInsights.PracticeInsights has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 14 of the 31 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 55, 119, 136, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · ProviderModelDiscovery.DiscoveryForm (cyclomatic 31) · ×1
  • ProviderModelDiscovery.DiscoveryForm (cyclomatic 31) web/components/settings/ProviderModelDiscovery.tsx:50 — ProviderModelDiscovery.DiscoveryForm has cyclomatic complexity 31 (threshold 15). Of this number, 22 points are the body's own statements and 9 belong to 3 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · RegistryControls.RegistryModelIdField (cyclomatic 31) · ×1
  • RegistryControls.RegistryModelIdField (cyclomatic 31) REDACTED:330 — RegistryControls.RegistryModelIdField has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 15 of the 31 points are its own statements and the rest belongs to 4 function items inside it that branch (onKeyDown, a function literal at line 401, a function literal at line 481, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · ChatMessageList.PlayAudioButton (cyclomatic 31) · ×1
  • ChatMessageList.PlayAudioButton (cyclomatic 31) web/features/chat/messages/ChatMessageList.tsx:1464 — ChatMessageList.PlayAudioButton has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 6 of the 31 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 1503, 1587, 1483, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · DocumentParsingSettingsSection.DocumentParsingSettingsPage (cyclomatic 31) · ×1
  • DocumentParsingSettingsSection.DocumentParsingSettingsPage (cyclomatic 31) web/features/settings/sections/DocumentParsingSettingsSection.tsx:66 — DocumentParsingSettingsSection.DocumentParsingSettingsPage has cyclomatic complexity 31 (threshold 15). Of this number, 21 points are the body's own statements and 10 belong to 3 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · DocumentParsingSettingsSection.DoclingPanel (cyclomatic 31) · ×1
  • DocumentParsingSettingsSection.DoclingPanel (cyclomatic 31) web/features/settings/sections/DocumentParsingSettingsSection.tsx:358 — DocumentParsingSettingsSection.DoclingPanel has cyclomatic complexity 31 (threshold 15). Of this number, 20 points are the body's own statements and 11 belong to 3 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · StartersSettingsSection.StarterSettingsPage (cyclomatic 31) · ×1
  • StartersSettingsSection.StarterSettingsPage (cyclomatic 31) web/features/settings/sections/StartersSettingsSection.tsx:27 — StartersSettingsSection.StarterSettingsPage has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 12 of the 31 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 38, 91, 78, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · provider-registry.reconcileRegistrySave (cyclomatic 31) · ×1
  • provider-registry.reconcileRegistrySave (cyclomatic 31) web/lib/provider-registry.ts:259 — provider-registry.reconcileRegistrySave has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _rag_helpers.optional_rag_lookup (cyclomatic 30) · ×1
  • _rag_helpers.optional_rag_lookup (cyclomatic 30) deeptutor/book/blocks/_rag_helpers.py:47 — _rag_helpers.optional_rag_lookup has cyclomatic complexity 30 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · LearningService.grade_interaction_semantic (cyclomatic 30) · ×1
  • LearningService.grade_interaction_semantic (cyclomatic 30) deeptutor/learning/service.py:3118 — LearningService.grade_interaction_semantic has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ingestion._load_bilibili_media (cyclomatic 30) · ×1
  • ingestion._load_bilibili_media (cyclomatic 30) deeptutor/reading/ingestion.py:820 — ingestion._load_bilibili_media has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ReadingStore.refresh_document (cyclomatic 30) · ×1
  • ReadingStore.refresh_document (cyclomatic 30) deeptutor/reading/store.py:445 — ReadingStore.refresh_document has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ReadingStore.save_annotation (cyclomatic 30) · ×1
  • ReadingStore.save_annotation (cyclomatic 30) deeptutor/reading/store.py:1331 — ReadingStore.save_annotation has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · importing.parse_rows (cyclomatic 30) · ×1
  • importing.parse_rows (cyclomatic 30) deeptutor/services/practice/importing.py:57 — importing.parse_rows has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · kb_move.preview_kb_move (cyclomatic 30) · ×1
  • kb_move.preview_kb_move (cyclomatic 30) deeptutor/services/workspace/kb_move.py:86 — kb_move.preview_kb_move has cyclomatic complexity 30 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · FileDropZone.FileDropZone (cyclomatic 30) · ×1
  • FileDropZone.FileDropZone (cyclomatic 30) web/components/knowledge/FileDropZone.tsx:37 — FileDropZone.FileDropZone has cyclomatic complexity 30 (threshold 15). Of this number, 15 points are the body's own statements and 15 belong to 8 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · SaveToNotebookModal.SaveToNotebookModal · ×1
  • SaveToNotebookModal.SaveToNotebookModal::handleSave (cyclomatic 30) web/components/notebook/SaveToNotebookModal.tsx:322 — SaveToNotebookModal.SaveToNotebookModal::handleSave has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (SaveToNotebookModal.SaveToNotebookModal) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · WeixinQrLogin.WeixinQrLogin (cyclomatic 30) · ×1
  • WeixinQrLogin.WeixinQrLogin (cyclomatic 30) REDACTED:26 — WeixinQrLogin.WeixinQrLogin has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 13 of the 30 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 66, statusLine, a function literal at line 48, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · GroupComposer.GroupComposer (cyclomatic 30) · ×1
  • GroupComposer.GroupComposer (cyclomatic 30) web/components/partners/group/GroupComposer.tsx:34 — GroupComposer.GroupComposer has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 10 of the 30 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 198, submit, a function literal at line 67, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · RegistryControls.ProbeForm (cyclomatic 30) · ×1
  • RegistryControls.ProbeForm (cyclomatic 30) REDACTED:141 — RegistryControls.ProbeForm has cyclomatic complexity 30 (threshold 15). Of this number, 22 points are the body's own statements and 8 belong to 2 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · CodeBuddyAuthCard.CodeBuddyAuthCard (cyclomatic 30) · ×1
  • CodeBuddyAuthCard.CodeBuddyAuthCard (cyclomatic 30) web/components/settings/CodeBuddyAuthCard.tsx:25 — CodeBuddyAuthCard.CodeBuddyAuthCard has cyclomatic complexity 30 (threshold 15). Of this number, 18 points are the body's own statements and 12 belong to 5 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ReviewTrail.ReviewTrail (cyclomatic 30) · ×1
  • ReviewTrail.ReviewTrail (cyclomatic 30) web/components/space/learning/ReviewTrail.tsx:81 — ReviewTrail.ReviewTrail has cyclomatic complexity 30 (threshold 15). Of this number, 22 points are the body's own statements and 8 belong to 4 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · MessageThreadMarker.MessageThreadMarker (cyclomatic 30) · ×1
  • MessageThreadMarker.MessageThreadMarker (cyclomatic 30) web/features/chat/messages/MessageThreadMarker.tsx:50 — MessageThreadMarker.MessageThreadMarker has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 7 of the 30 points are its own statements and the rest belongs to 10 function items inside it that branch (a function literal at line 205, a function literal at line 73, a function literal at line 102, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · ChatMessageList.GeneratedFileCards (cyclomatic 30) · ×1
  • ChatMessageList.GeneratedFileCards (cyclomatic 30) web/features/chat/messages/ChatMessageList.tsx:588 — ChatMessageList.GeneratedFileCards has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 2 of the 30 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 612, 601, 606). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · NoteFavoriteBlock.NoteFavoriteBlock (cyclomatic 30) · ×1
  • NoteFavoriteBlock.NoteFavoriteBlock (cyclomatic 30) web/features/notes/components/NoteFavoriteBlock.tsx:23 — NoteFavoriteBlock.NoteFavoriteBlock has cyclomatic complexity 30 (threshold 15). Of this number, 27 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · useMasteryStudySession.useMasteryStudySession (cyclomatic 30) · ×1
  • useMasteryStudySession.useMasteryStudySession (cyclomatic 30) web/hooks/useMasteryStudySession.ts:37 — useMasteryStudySession.useMasteryStudySession has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 13 of the 30 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 150, 178, 235, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · DeepQuestionCapability.run (cyclomatic 29) · ×1
  • DeepQuestionCapability.run (cyclomatic 29) deeptutor/agents/question/capability.py:32 — DeepQuestionCapability.run has cyclomatic complexity 29 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · knowledge._save_uploaded_files (cyclomatic 29) · ×1
  • knowledge._save_uploaded_files (cyclomatic 29) deeptutor/api/routers/knowledge.py:417 — knowledge._save_uploaded_files has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · knowledge._list_knowledge_bases (cyclomatic 29) · ×1
  • knowledge._list_knowledge_bases (cyclomatic 29) deeptutor/api/routers/knowledge.py:2804 — knowledge._list_knowledge_bases has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · quiz_judge._build_judge_user_prompt (cyclomatic 29) · ×1
  • quiz_judge._build_judge_user_prompt (cyclomatic 29) deeptutor/api/routers/quiz_judge.py:129 — quiz_judge._build_judge_user_prompt has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · sessions._attach_orphaned_failed_turns (cyclomatic 29) · ×1
  • sessions._attach_orphaned_failed_turns (cyclomatic 29) deeptutor/api/routers/sessions.py:314 — sessions._attach_orphaned_failed_turns has cyclomatic complexity 29 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · CoWriterStorage.update_document (cyclomatic 29) · ×1
  • CoWriterStorage.update_document (cyclomatic 29) deeptutor/co_writer/storage.py:298 — CoWriterStorage.update_document has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · topic_materials.build_topic_materials (cyclomatic 29) · ×1
  • topic_materials.build_topic_materials (cyclomatic 29) deeptutor/learning/topic_materials.py:426 — topic_materials.build_topic_materials has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FeishuChannel.send_delta (cyclomatic 29) · ×1
  • FeishuChannel.send_delta (cyclomatic 29) deeptutor/partners/channels/feishu.py:1615 — FeishuChannel.send_delta has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MSTeamsChannel._handle_activity (cyclomatic 29) · ×1
  • MSTeamsChannel._handle_activity (cyclomatic 29) deeptutor/partners/channels/msteams.py:303 — MSTeamsChannel._handle_activity has cyclomatic complexity 29 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · provider_runtime.resolve_tts_runtime_config (cyclomatic 29) · ×1
  • provider_runtime.resolve_tts_runtime_config (cyclomatic 29) deeptutor/services/config/provider_runtime.py:1298 — provider_runtime.resolve_tts_runtime_config has cyclomatic complexity 29 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · factory._resolve_call_config (cyclomatic 29) · ×1
  • factory._resolve_call_config (cyclomatic 29) deeptutor/services/llm/factory.py:157 — factory._resolve_call_config has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _turn_runtime_shared._resolve_selection_tutor_context (cyclomatic 29) · ×1
  • _turn_runtime_shared._resolve_selection_tutor_context (cyclomatic 29) deeptutor/services/session/_turn_runtime_shared.py:1612 — _turn_runtime_shared._resolve_selection_tutor_context has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ask_user_trace.extract_ask_user_clarification_blocks (cyclomatic 29) · ×1
  • ask_user_trace.extract_ask_user_clarification_blocks (cyclomatic 29) deeptutor/services/session/ask_user_trace.py:58 — ask_user_trace.extract_ask_user_clarification_blocks has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · attachment_parsing.parse_chat_pdf_attachments (cyclomatic 29) · ×1
  • attachment_parsing.parse_chat_pdf_attachments (cyclomatic 29) deeptutor/services/session/attachment_parsing.py:19 — attachment_parsing.parse_chat_pdf_attachments has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SQLiteSessionStore._delete_turn_by_message_sync (cyclomatic 29) · ×1
  • SQLiteSessionStore._delete_turn_by_message_sync (cyclomatic 29) deeptutor/services/session/sqlite_store.py:2398 — SQLiteSessionStore._delete_turn_by_message_sync has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · kb_move.move_kb (cyclomatic 29) · ×1
  • kb_move.move_kb (cyclomatic 29) deeptutor/services/workspace/kb_move.py:326 — kb_move.move_kb has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ask_user._build_question (cyclomatic 29) · ×1
  • ask_user._build_question (cyclomatic 29) deeptutor/tools/ask_user.py:243 — ask_user._build_question has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BookCreator.BookCreator (cyclomatic 29) · ×1
  • BookCreator.BookCreator (cyclomatic 29) web/app/(workspace)/learning/books/components/BookCreator.tsx:86 — BookCreator.BookCreator has cyclomatic complexity 29 (threshold 15). Of this number, 18 points are the body's own statements and 11 belong to 5 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · BookGenerationActivity.BookGenerationActivity (cyclomatic 29) · ×1
  • BookGenerationActivity.BookGenerationActivity (cyclomatic 29) web/app/(workspace)/learning/books/components/BookGenerationActivity.tsx:57 — BookGenerationActivity.BookGenerationActivity has cyclomatic complexity 29 (threshold 15). Of this number, 20 points are the body's own statements and 9 belong to 8 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · AskUserOptions.extractAskUserPayload (cyclomatic 29) · ×1
  • AskUserOptions.extractAskUserPayload (cyclomatic 29) web/components/chat/home/AskUserOptions.tsx:138 — AskUserOptions.extractAskUserPayload has cyclomatic complexity 29 (threshold 15). Of this number, 26 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ChannelRuntimeStatus.ChannelRuntimeStatus (cyclomatic 29) · ×1
  • ChannelRuntimeStatus.ChannelRuntimeStatus (cyclomatic 29) web/components/partners/ChannelRuntimeStatus.tsx:13 — ChannelRuntimeStatus.ChannelRuntimeStatus has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 13 of the 29 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 53, 34, 25, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · ChatSessionMenu.ChatSessionMenu (cyclomatic 29) · ×1
  • ChatSessionMenu.ChatSessionMenu (cyclomatic 29) web/features/chat/components/ChatSessionMenu.tsx:60 — ChatSessionMenu.ChatSessionMenu has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 12 of the 29 points are its own statements and the rest belongs to 11 function items inside it that branch (a function literal at line 88, a function literal at line 103, toggle, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · TracePresentation.TraceRowBody (cyclomatic 29) · ×1
  • TracePresentation.TraceRowBody (cyclomatic 29) web/features/chat/trace/TracePresentation.tsx:741 — TracePresentation.TraceRowBody has cyclomatic complexity 29 (threshold 15). Of this number, 19 points are the body's own statements and 10 belong to 7 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · ClassicLearningDashboard.ClassicLearningDashboard (cyclomatic 29) · ×1
  • ClassicLearningDashboard.ClassicLearningDashboard (cyclomatic 29) web/features/ui-layout/classic/ClassicLearningDashboard.tsx:36 — ClassicLearningDashboard.ClassicLearningDashboard has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 14 of the 29 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 66, 51, 142). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · pipeline._citation_source_preview (cyclomatic 28) · ×1
  • pipeline._citation_source_preview (cyclomatic 28) deeptutor/agents/research/pipeline.py:2508 — pipeline._citation_source_preview has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · utils.validate_visualization (cyclomatic 28) · ×1
  • utils.validate_visualization (cyclomatic 28) deeptutor/agents/visualize/utils.py:112 — utils.validate_visualization has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · main.lifespan (cyclomatic 28) · ×1
  • main.lifespan (cyclomatic 28) deeptutor/api/main.py:109 — main.lifespan has cyclomatic complexity 28 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · knowledge._create_knowledge_base_owned (cyclomatic 28) · ×1
  • knowledge._create_knowledge_base_owned (cyclomatic 28) deeptutor/api/routers/knowledge.py:3594 — knowledge._create_knowledge_base_owned has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · question.websocket_question_generate (cyclomatic 28) · ×1
  • question.websocket_question_generate (cyclomatic 28) deeptutor/api/routers/question.py:362 — question.websocket_question_generate has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FeishuChannel._on_message (cyclomatic 28) · ×1
  • FeishuChannel._on_message (cyclomatic 28) deeptutor/partners/channels/feishu.py:2333 — FeishuChannel._on_message has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · embedding_endpoint.normalize_embedding_endpoint_for_display (cyclomatic 28) · ×1
  • embedding_endpoint.normalize_embedding_endpoint_for_display (cyclomatic 28) deeptutor/services/config/embedding_endpoint.py:194 — embedding_endpoint.normalize_embedding_endpoint_for_display has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · GeminiEmbeddingAdapter._embed_native (cyclomatic 28) · ×1
  • GeminiEmbeddingAdapter._embed_native (cyclomatic 28) deeptutor/services/embedding/adapters/gemini.py:256 — GeminiEmbeddingAdapter._embed_native has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PartnerRunner._build_context (cyclomatic 28) · ×1
  • PartnerRunner._build_context (cyclomatic 28) deeptutor/services/partners/runtime.py:695 — PartnerRunner._build_context has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · source_pages.build_pdf_documents (cyclomatic 28) · ×1
  • source_pages.build_pdf_documents (cyclomatic 28) deeptutor/services/rag/source_pages.py:145 — source_pages.build_pdf_documents has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · search.web_search (cyclomatic 28) · ×1
  • search.web_search (cyclomatic 28) deeptutor/services/search/__init__.py:131 — search.web_search has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · bilingual.detect_bilingual_pairings (cyclomatic 28) · ×1
  • bilingual.detect_bilingual_pairings (cyclomatic 28) deeptutor/services/web_source/bilingual.py:129 — bilingual.detect_bilingual_pairings has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · document_extractor._epub_package_navigation (cyclomatic 28) · ×1
  • document_extractor._epub_package_navigation (cyclomatic 28) deeptutor/utils/document_extractor.py:811 — document_extractor._epub_package_navigation has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · run-loop.runLoop (cyclomatic 28) · ×1
  • run-loop.runLoop (cyclomatic 28) packages/chat-engine/src/core/run-loop.ts:5 — run-loop.runLoop has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ComposerTrayMenu.TrayMenu (cyclomatic 28) · ×1
  • ComposerTrayMenu.TrayMenu (cyclomatic 28) web/components/chat/home/ComposerTrayMenu.tsx:59 — ComposerTrayMenu.TrayMenu has cyclomatic complexity 28 (threshold 15). Of this number, 19 points are the body's own statements and 9 belong to 3 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · KbWebSourcesSection.KbWebSourcesSection (cyclomatic 28) · ×1
  • KbWebSourcesSection.KbWebSourcesSection (cyclomatic 28) web/components/knowledge/KbWebSourcesSection.tsx:33 — KbWebSourcesSection.KbWebSourcesSection has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 12 of the 28 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 52, handleAdd, handleRemove, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · AnnotationPopover.AnnotationPopover (cyclomatic 28) · ×1
  • AnnotationPopover.AnnotationPopover (cyclomatic 28) web/components/reading/AnnotationPopover.tsx:74 — AnnotationPopover.AnnotationPopover has cyclomatic complexity 28 (threshold 15). Of this number, 15 points are the body's own statements and 13 belong to 8 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ReadingCompanion.ReadingCompanion (cyclomatic 28) · ×1
  • ReadingCompanion.ReadingCompanion (cyclomatic 28) web/components/reading/workspace/ReadingCompanion.tsx:78 — ReadingCompanion.ReadingCompanion has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 6 of the 28 points are its own statements and the rest belongs to 13 function literals inside it that branch (lines 233, 289, 303, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · ChatHistorySection.ChatHistorySection (cyclomatic 28) · ×1
  • ChatHistorySection.ChatHistorySection (cyclomatic 28) web/components/space/ChatHistorySection.tsx:56 — ChatHistorySection.ChatHistorySection has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 8 of the 28 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 158, 137, 84, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · MyAgentsSection.MyAgentsSection (cyclomatic 28) · ×1
  • MyAgentsSection.MyAgentsSection (cyclomatic 28) web/components/space/MyAgentsSection.tsx:89 — MyAgentsSection.MyAgentsSection has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 7 of the 28 points are its own statements and the rest belongs to 10 function literals inside it that branch (lines 207, 122, 124, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · TracePresentation.getTraceHeader (cyclomatic 28) · ×1
  • TracePresentation.getTraceHeader (cyclomatic 28) web/features/chat/trace/TracePresentation.tsx:372 — TracePresentation.getTraceHeader has cyclomatic complexity 28 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · GuardianRelationshipsEditor.GuardianRelationshipsEditor (cyclomatic 28) · ×1
  • GuardianRelationshipsEditor.GuardianRelationshipsEditor (cyclomatic 28) web/features/multi-user/components/GuardianRelationshipsEditor.tsx:33 — GuardianRelationshipsEditor.GuardianRelationshipsEditor has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 13 of the 28 points are its own statements and the rest belongs to 9 function items inside it that branch (a function literal at line 91, addRelationship, resetCredentials, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · languages.normalizeLanguage (cyclomatic 28) · ×1
  • languages.normalizeLanguage (cyclomatic 28) web/i18n/languages.ts:25 — languages.normalizeLanguage has cyclomatic complexity 28 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · reading-citations.linkifyLocatorCitations (cyclomatic 28) · ×1
  • reading-citations.linkifyLocatorCitations (cyclomatic 28) web/lib/reading-citations.ts:236 — reading-citations.linkifyLocatorCitations has cyclomatic complexity 28 (threshold 15). Of this number, 25 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · reasoning-effort.tableReasoningEffortOptions (cyclomatic 28) · ×1
  • reasoning-effort.tableReasoningEffortOptions (cyclomatic 28) web/lib/reasoning-effort.ts:98 — reasoning-effort.tableReasoningEffortOptions has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · python_scheduler.run_loop (cyclomatic 27) · ×1
  • python_scheduler.run_loop (cyclomatic 27) deeptutor/agents/loop/python_scheduler.py:15 — python_scheduler.run_loop has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · reading_extensions.submit_quiz_answers (cyclomatic 27) · ×1
  • reading_extensions.submit_quiz_answers (cyclomatic 27) deeptutor/api/routers/reading_extensions.py:364 — reading_extensions.submit_quiz_answers has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SpineSynthesizer._coerce_graph (cyclomatic 27) · ×1
  • SpineSynthesizer._coerce_graph (cyclomatic 27) deeptutor/book/agents/spine_synthesizer.py:361 — SpineSynthesizer._coerce_graph has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MasteryLoopCapability.augment_kwargs (cyclomatic 27) · ×1
  • MasteryLoopCapability.augment_kwargs (cyclomatic 27) deeptutor/capabilities/mastery/loop.py:108 — MasteryLoopCapability.augment_kwargs has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FeishuChannel._on_card_action_sync (cyclomatic 27) · ×1
  • FeishuChannel._on_card_action_sync (cyclomatic 27) deeptutor/partners/channels/feishu.py:1991 — FeishuChannel._on_card_action_sync has cyclomatic complexity 27 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · service.reconcile_codex_catalog_update (cyclomatic 27) · ×1
  • service.reconcile_codex_catalog_update (cyclomatic 27) REDACTED:237 — service.reconcile_codex_catalog_update has cyclomatic complexity 27 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · CallMeasurement.finish (cyclomatic 27) · ×1
  • CallMeasurement.finish (cyclomatic 27) deeptutor/services/llm/metrics.py:120 — CallMeasurement.finish has cyclomatic complexity 27 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · provider_factory._build_runtime_provider (cyclomatic 27) · ×1
  • provider_factory._build_runtime_provider (cyclomatic 27) deeptutor/services/llm/provider_factory.py:59 — provider_factory._build_runtime_provider has cyclomatic complexity 27 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · SessionTitleService._maybe_generate_session_title (cyclomatic 27) · ×1
  • SessionTitleService._maybe_generate_session_title (cyclomatic 27) deeptutor/services/session/turns/title_service.py:35 — SessionTitleService._maybe_generate_session_title has cyclomatic complexity 27 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · model-round.modelRound (cyclomatic 27) · ×1
  • model-round.modelRound (cyclomatic 27) packages/chat-engine/src/native/model-round.ts:14 — model-round.modelRound has cyclomatic complexity 27 (threshold 15). Of this number, 17 points are the body's own statements and 10 belong to 2 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · PageOutlineNav.PageOutlineNav (cyclomatic 27) · ×1
  • PageOutlineNav.PageOutlineNav (cyclomatic 27) web/app/(workspace)/learning/books/components/PageOutlineNav.tsx:99 — PageOutlineNav.PageOutlineNav has cyclomatic complexity 27 (threshold 15). Of this number, 15 points are the body's own statements and 12 belong to 4 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · SubagentTabBody.SubagentTabBody (cyclomatic 27) · ×1
  • SubagentTabBody.SubagentTabBody (cyclomatic 27) web/components/chat/home/SubagentTabBody.tsx:22 — SubagentTabBody.SubagentTabBody has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 9 of the 27 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 81, 46, 148, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · CategoryNavigation.CategoryTabs (cyclomatic 27) · ×1
  • CategoryNavigation.CategoryTabs (cyclomatic 27) web/components/sidebar/CategoryNavigation.tsx:88 — CategoryNavigation.CategoryTabs has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 10 of the 27 points are its own statements and the rest belongs to 5 function items inside it that branch (tab, a function literal at line 134, select, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · CalendarRuntime.CalendarRuntime (cyclomatic 27) · ×1
  • CalendarRuntime.CalendarRuntime (cyclomatic 27) web/features/calendar/components/CalendarRuntime.tsx:14 — CalendarRuntime.CalendarRuntime has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 7 of the 27 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 31, 51, 24, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · AttachmentsSettingsSection.AttachmentSettingsPage (cyclomatic 27) · ×1
  • AttachmentsSettingsSection.AttachmentSettingsPage (cyclomatic 27) web/features/settings/sections/AttachmentsSettingsSection.tsx:47 — AttachmentsSettingsSection.AttachmentSettingsPage has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 7 of the 27 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 60, 112, 98, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · ClassicSidebarShell.ClassicSidebarShell (cyclomatic 27) · ×1
  • ClassicSidebarShell.ClassicSidebarShell (cyclomatic 27) web/features/ui-layout/classic/ClassicSidebarShell.tsx:91 — ClassicSidebarShell.ClassicSidebarShell has cyclomatic complexity 27 (threshold 15). Of this number, 14 points are the body's own statements and 13 belong to 5 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · VideoLessonCapability.run (cyclomatic 26) · ×1
  • VideoLessonCapability.run (cyclomatic 26) deeptutor/agents/video_lesson/capability.py:28 — VideoLessonCapability.run has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ViewFigureTool.execute (cyclomatic 26) · ×1
  • ViewFigureTool.execute (cyclomatic 26) deeptutor/capabilities/reading/figure_view.py:75 — ViewFigureTool.execute has cyclomatic complexity 26 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · policy.next_objective (cyclomatic 26) · ×1
  • policy.next_objective (cyclomatic 26) deeptutor/learning/policy.py:281 — policy.next_objective has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LearningService._apply_grade (cyclomatic 26) · ×1
  • LearningService._apply_grade (cyclomatic 26) deeptutor/learning/service.py:574 — LearningService._apply_grade has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · lifecycle.change (cyclomatic 26) · ×1
  • lifecycle.change (cyclomatic 26) deeptutor/modules/lifecycle.py:152 — lifecycle.change has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · device_credentials._canonical_record (cyclomatic 26) · ×1
  • device_credentials._canonical_record (cyclomatic 26) deeptutor/multi_user/device_credentials.py:57 — device_credentials._canonical_record has cyclomatic complexity 26 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · model_access.redacted_model_access (cyclomatic 26) · ×1
  • model_access.redacted_model_access (cyclomatic 26) deeptutor/multi_user/model_access.py:72 — model_access.redacted_model_access has cyclomatic complexity 26 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · TelegramChannel.send_delta (cyclomatic 26) · ×1
  • TelegramChannel.send_delta (cyclomatic 26) deeptutor/partners/channels/telegram.py:624 — TelegramChannel.send_delta has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · WecomChannel._process_message (cyclomatic 26) · ×1
  • WecomChannel._process_message (cyclomatic 26) deeptutor/partners/channels/wecom.py:206 — WecomChannel._process_message has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · WeixinChannel._download_media_item (cyclomatic 26) · ×1
  • WeixinChannel._download_media_item (cyclomatic 26) deeptutor/partners/channels/weixin.py:688 — WeixinChannel._download_media_item has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · loop.run_agentic_loop (cyclomatic 26) · ×1
  • loop.run_agentic_loop (cyclomatic 26) deeptutor/runtime/agentic/loop.py:178 — loop.run_agentic_loop has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CodexModelCatalog._fetch (cyclomatic 26) · ×1
  • CodexModelCatalog._fetch (cyclomatic 26) deeptutor/services/codex_auth/catalog.py:182 — CodexModelCatalog._fetch has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · artifact_attachments.artifact_attachments (cyclomatic 26) · ×1
  • artifact_attachments.artifact_attachments (cyclomatic 26) deeptutor/services/session/artifact_attachments.py:52 — artifact_attachments.artifact_attachments has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SQLiteSessionStore._question_bank_filters (cyclomatic 26) · ×1
  • SQLiteSessionStore._question_bank_filters (cyclomatic 26) deeptutor/services/session/sqlite_store.py:4122 — SQLiteSessionStore._question_bank_filters has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · TurnLifecycle._coordinate_execution (cyclomatic 26) · ×1
  • TurnLifecycle._coordinate_execution (cyclomatic 26) deeptutor/services/session/turns/lifecycle.py:231 — TurnLifecycle._coordinate_execution has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · KimiBackend._handle_event (cyclomatic 26) · ×1
  • KimiBackend._handle_event (cyclomatic 26) deeptutor/services/subagent/kimi.py:176 — KimiBackend._handle_event has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · data_migration._selected_artifact_files (cyclomatic 26) · ×1
  • data_migration._selected_artifact_files (cyclomatic 26) deeptutor/services/workspace/data_migration.py:436 — data_migration._selected_artifact_files has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · bibtex_converter._scan_entry (cyclomatic 26) · ×1
  • bibtex_converter._scan_entry (cyclomatic 26) deeptutor/utils/bibtex_converter.py:224 — bibtex_converter._scan_entry has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Modal.Modal (cyclomatic 26) · ×1
  • Modal.Modal (cyclomatic 26) web/components/common/Modal.tsx:40 — Modal.Modal has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 9 of the 26 points are its own statements and the rest belongs to 6 function items inside it that branch (handleKeyDown, a function literal at line 84, handleBackdropMouseDown, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · ImaConnectionFields.ImaConnectionFields (cyclomatic 26) · ×1
  • ImaConnectionFields.ImaConnectionFields (cyclomatic 26) web/components/knowledge/ImaConnectionFields.tsx:9 — ImaConnectionFields.ImaConnectionFields has cyclomatic complexity 26 (threshold 15). Of this number, 25 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · KbWebSourcesSection.WebSourceCard (cyclomatic 26) · ×1
  • KbWebSourcesSection.WebSourceCard (cyclomatic 26) web/components/knowledge/KbWebSourcesSection.tsx:321 — KbWebSourcesSection.WebSourceCard has cyclomatic complexity 26 (threshold 15). Of this number, 24 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · useNotebookLibrary.useNotebookLibrary (cyclomatic 26) · ×1
  • useNotebookLibrary.useNotebookLibrary (cyclomatic 26) web/components/notebook/useNotebookLibrary.ts:63 — useNotebookLibrary.useNotebookLibrary has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 1 of the 26 points is its own statement and the rest belongs to 17 function literals inside it that branch (lines 82, 105, 153, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · ReadingExtensionBar.ExtensionResult (cyclomatic 26) · ×1
  • ReadingExtensionBar.ExtensionResult (cyclomatic 26) web/components/reading/ReadingExtensionBar.tsx:335 — ReadingExtensionBar.ExtensionResult has cyclomatic complexity 26 (threshold 15). Of this number, 21 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · AddProviderPanel.AddProviderPanel (cyclomatic 26) · ×1
  • AddProviderPanel.AddProviderPanel (cyclomatic 26) web/components/settings/AddProviderPanel.tsx:60 — AddProviderPanel.AddProviderPanel has cyclomatic complexity 26 (threshold 15). Of this number, 13 points are the body's own statements and 13 belong to 4 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · ServicePreviewPanel.Preview · ×1
  • ServicePreviewPanel.Preview::run (cyclomatic 26) web/components/settings/ServicePreviewPanel.tsx:86 — ServicePreviewPanel.Preview::run has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (ServicePreviewPanel.Preview) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · MonthView.MonthWeek (cyclomatic 26) · ×1
  • MonthView.MonthWeek (cyclomatic 26) web/features/calendar/components/MonthView.tsx:244 — MonthView.MonthWeek has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 5 of the 26 points are its own statements and the rest belongs to 10 function literals inside it that branch (lines 338, 318, 398, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · EngineDetail.LightRagServerForm (cyclomatic 26) · ×1
  • EngineDetail.LightRagServerForm (cyclomatic 26) web/features/knowledge/components/engines/EngineDetail.tsx:1275 — EngineDetail.LightRagServerForm has cyclomatic complexity 26 (threshold 15). Of this number, 16 points are the body's own statements and 10 belong to 4 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · CodeRetryManager.render_with_retries (cyclomatic 25) · ×1
  • CodeRetryManager.render_with_retries (cyclomatic 25) deeptutor/agents/math_animator/retry_manager.py:44 — CodeRetryManager.render_with_retries has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ResearchPipeline._parse_report_outline (cyclomatic 25) · ×1
  • ResearchPipeline._parse_report_outline (cyclomatic 25) deeptutor/agents/research/pipeline.py:1619 — ResearchPipeline._parse_report_outline has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · auth._install_request_workspace (cyclomatic 25) · ×1
  • auth._install_request_workspace (cyclomatic 25) deeptutor/api/routers/auth.py:508 — auth._install_request_workspace has cyclomatic complexity 25 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · knowledge.reindex_knowledge_base (cyclomatic 25) · ×1
  • knowledge.reindex_knowledge_base (cyclomatic 25) deeptutor/api/routers/knowledge.py:4107 — knowledge.reindex_knowledge_base has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · question.websocket_mimic_generate (cyclomatic 25) · ×1
  • question.websocket_mimic_generate (cyclomatic 25) deeptutor/api/routers/question.py:50 — question.websocket_mimic_generate has cyclomatic complexity 25 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · reading_extensions.run_extension_action (cyclomatic 25) · ×1
  • reading_extensions.run_extension_action (cyclomatic 25) deeptutor/api/routers/reading_extensions.py:196 — reading_extensions.run_extension_action has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · spine_synthesizer._build_chapter_map (cyclomatic 25) · ×1
  • spine_synthesizer._build_chapter_map (cyclomatic 25) deeptutor/book/agents/spine_synthesizer.py:528 — spine_synthesizer._build_chapter_map has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HandoffCapability._partner (cyclomatic 25) · ×1
  • HandoffCapability._partner (cyclomatic 25) deeptutor/capabilities/handoff/capability.py:251 — HandoffCapability._partner has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · SlackChannel._on_socket_request (cyclomatic 25) · ×1
  • SlackChannel._on_socket_request (cyclomatic 25) deeptutor/partners/channels/slack.py:175 — SlackChannel._on_socket_request has cyclomatic complexity 25 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · PluginRegistry._installed_records (cyclomatic 25) · ×1
  • PluginRegistry._installed_records (cyclomatic 25) deeptutor/plugins/registry.py:276 — PluginRegistry._installed_records has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · tool_dispatch._collect_outcome (cyclomatic 25) · ×1
  • tool_dispatch._collect_outcome (cyclomatic 25) deeptutor/runtime/agentic/tool_dispatch.py:854 — tool_dispatch._collect_outcome has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · provider_runtime._choose_resolved_provider (cyclomatic 25) · ×1
  • provider_runtime._choose_resolved_provider (cyclomatic 25) deeptutor/services/config/provider_runtime.py:856 — provider_runtime._choose_resolved_provider has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CohereEmbeddingAdapter.embed (cyclomatic 25) · ×1
  • CohereEmbeddingAdapter.embed (cyclomatic 25) deeptutor/services/embedding/adapters/cohere.py:55 — CohereEmbeddingAdapter.embed has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · factory.stream (cyclomatic 25) · ×1
  • factory.stream (cyclomatic 25) deeptutor/services/llm/factory.py:519 — factory.stream has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _turn_runtime_shared._request_snapshot_metadata (cyclomatic 25) · ×1
  • _turn_runtime_shared._request_snapshot_metadata (cyclomatic 25) deeptutor/services/session/_turn_runtime_shared.py:788 — _turn_runtime_shared._request_snapshot_metadata has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · interface_settings._normalize_language (cyclomatic 25) · ×1
  • interface_settings._normalize_language (cyclomatic 25) deeptutor/services/settings/interface_settings.py:100 — interface_settings._normalize_language has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CodexBackend._handle_event (cyclomatic 25) · ×1
  • CodexBackend._handle_event (cyclomatic 25) deeptutor/services/subagent/codex.py:165 — CodexBackend._handle_event has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HermesRemoteEventMapper.handle (cyclomatic 25) · ×1
  • HermesRemoteEventMapper.handle (cyclomatic 25) deeptutor/services/subagent/hermes_remote_events.py:43 — HermesRemoteEventMapper.handle has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · VolcengineTTSAdapter.synthesize (cyclomatic 25) · ×1
  • VolcengineTTSAdapter.synthesize (cyclomatic 25) deeptutor/services/voice/adapters/volcengine.py:62 — VolcengineTTSAdapter.synthesize has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · speech_text.verbalize_latex_for_speech (cyclomatic 25) · ×1
  • speech_text.verbalize_latex_for_speech (cyclomatic 25) deeptutor/services/voice/speech_text.py:750 — speech_text.verbalize_latex_for_speech has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · document_images._render_omml (cyclomatic 25) · ×1
  • document_images._render_omml (cyclomatic 25) deeptutor/utils/document_images.py:341 — document_images._render_omml has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · build_modules.build (cyclomatic 25) · ×1
  • build_modules.build (cyclomatic 25) scripts/build_modules.py:26 — build_modules.build has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · KbMarginNoteDevicesSection.KbMarginNoteDevicesSection (cyclomatic 25) · ×1
  • KbMarginNoteDevicesSection.KbMarginNoteDevicesSection (cyclomatic 25) web/components/knowledge/KbMarginNoteDevicesSection.tsx:36 — KbMarginNoteDevicesSection.KbMarginNoteDevicesSection has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 11 of the 25 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 222, handlePair, handleRevoke, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · LearningDashboard.LearningDashboard (cyclomatic 25) · ×1
  • LearningDashboard.LearningDashboard (cyclomatic 25) web/components/learning/LearningDashboard.tsx:33 — LearningDashboard.LearningDashboard has cyclomatic complexity 25 (threshold 15). Of this number, 18 points are the body's own statements and 7 belong to 3 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · PartnerModelSelect.PartnerModelSelect (cyclomatic 25) · ×1
  • PartnerModelSelect.PartnerModelSelect (cyclomatic 25) web/components/partners/PartnerModelSelect.tsx:27 — PartnerModelSelect.PartnerModelSelect has cyclomatic complexity 25 (threshold 15). Of this number, 22 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · MaterialLibrary.MaterialRow (cyclomatic 25) · ×1
  • MaterialLibrary.MaterialRow (cyclomatic 25) web/components/reading/library/MaterialLibrary.tsx:321 — MaterialLibrary.MaterialRow has cyclomatic complexity 25 (threshold 15). Of this number, 23 points are the body's own statements and 2 belong to 2 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · DimensionField.DimensionField (cyclomatic 25) · ×1
  • DimensionField.DimensionField (cyclomatic 25) web/components/settings/DimensionField.tsx:35 — DimensionField.DimensionField has cyclomatic complexity 25 (threshold 15). Of this number, 22 points are the body's own statements and 3 belong to 3 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · PartnerRoster.PartnerRoster (cyclomatic 25) · ×1
  • PartnerRoster.PartnerRoster (cyclomatic 25) web/components/sidebar/PartnerRoster.tsx:22 — PartnerRoster.PartnerRoster has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 1 of the 25 points is its own statement and the rest belongs to 11 function items inside it that branch (a function literal at line 34, a function literal at line 63, a function literal at line 72, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · CommandPalette.CommandPalette (cyclomatic 25) · ×1
  • CommandPalette.CommandPalette (cyclomatic 25) web/components/sidebar/CommandPalette.tsx:42 — CommandPalette.CommandPalette has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 5 of the 25 points are its own statements and the rest belongs to 13 function items inside it that branch (a function literal at line 190, a function literal at line 112, a function literal at line 79, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · ImportWizard.ImportWizard (cyclomatic 25) · ×1
  • ImportWizard.ImportWizard (cyclomatic 25) web/components/space/ImportWizard.tsx:59 — ImportWizard.ImportWizard has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 11 of the 25 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 160, 93, 114, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · ObjectiveDetail.ObjectiveDetail (cyclomatic 25) · ×1
  • ObjectiveDetail.ObjectiveDetail (cyclomatic 25) web/components/space/learning/ObjectiveDetail.tsx:19 — ObjectiveDetail.ObjectiveDetail has cyclomatic complexity 25 (threshold 15). Of this number, 23 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · CategoryMenu.CategoryMenu (cyclomatic 25) · ×1
  • CategoryMenu.CategoryMenu (cyclomatic 25) web/components/space/question-bank/CategoryMenu.tsx:38 — CategoryMenu.CategoryMenu has cyclomatic complexity 25 (threshold 15). Of this number, 14 points are the body's own statements and 11 belong to 9 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · QuestionBankSection.QuestionBankSection (cyclomatic 25) · ×1
  • QuestionBankSection.QuestionBankSection (cyclomatic 25) web/components/space/question-bank/QuestionBankSection.tsx:43 — QuestionBankSection.QuestionBankSection has cyclomatic complexity 25 (threshold 15). Of this number, 19 points are the body's own statements and 6 belong to 5 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ArchivedChatsSettingsSection.ArchivedChatsSettingsSection (cyclomatic 25) · ×1
  • ArchivedChatsSettingsSection.ArchivedChatsSettingsSection (cyclomatic 25) web/features/settings/sections/ArchivedChatsSettingsSection.tsx:36 — ArchivedChatsSettingsSection.ArchivedChatsSettingsSection has cyclomatic complexity 25 (threshold 15). Of this number, 13 points are the body's own statements and 12 belong to 8 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · UsageSettingsSection.UsageSettingsSection (cyclomatic 25) · ×1
  • UsageSettingsSection.UsageSettingsSection (cyclomatic 25) web/features/settings/sections/UsageSettingsSection.tsx:12 — UsageSettingsSection.UsageSettingsSection has cyclomatic complexity 25 (threshold 15). Of this number, 15 points are the body's own statements and 10 belong to 7 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · NativeAdapter.invoke (cyclomatic 24) · ×1
  • NativeAdapter.invoke (cyclomatic 24) deeptutor/agents/loop/native_adapter.py:24 — NativeAdapter.invoke has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · QuestionPipeline._collect_quiz_issues (cyclomatic 24) · ×1
  • QuestionPipeline._collect_quiz_issues (cyclomatic 24) deeptutor/agents/question/pipeline.py:1451 — QuestionPipeline._collect_quiz_issues has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MasteryReviseTool.execute (cyclomatic 24) · ×1
  • MasteryReviseTool.execute (cyclomatic 24) deeptutor/capabilities/mastery/tools.py:2950 — MasteryReviseTool.execute has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ProgressTracker.update (cyclomatic 24) · ×1
  • ProgressTracker.update (cyclomatic 24) deeptutor/knowledge/progress_tracker.py:176 — ProgressTracker.update has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · LearningService._evaluate_question (cyclomatic 24) · ×1
  • LearningService._evaluate_question (cyclomatic 24) deeptutor/learning/service.py:1568 — LearningService._evaluate_question has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MattermostChannel._handle_posted (cyclomatic 24) · ×1
  • MattermostChannel._handle_posted (cyclomatic 24) deeptutor/partners/channels/mattermost.py:247 — MattermostChannel._handle_posted has cyclomatic complexity 24 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · WhatsAppChannel._handle_bridge_message (cyclomatic 24) · ×1
  • WhatsAppChannel._handle_bridge_message (cyclomatic 24) deeptutor/partners/channels/whatsapp.py:119 — WhatsAppChannel._handle_bridge_message has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CodexOAuthService.public_status (cyclomatic 24) · ×1
  • CodexOAuthService.public_status (cyclomatic 24) REDACTED:948 — CodexOAuthService.public_status has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · OpenAICompatibleEmbeddingAdapter._extract_embeddings_from_response (cyclomatic 24) · ×1
  • OpenAICompatibleEmbeddingAdapter._extract_embeddings_from_response (cyclomatic 24) deeptutor/services/embedding/adapters/openai_compatible.py:70 — OpenAICompatibleEmbeddingAdapter._extract_embeddings_from_response has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ops._validate (cyclomatic 24) · ×1
  • ops._validate (cyclomatic 24) deeptutor/services/memory/ops.py:68 — ops._validate has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PathService.resolve_public_output_path (cyclomatic 24) · ×1
  • PathService.resolve_public_output_path (cyclomatic 24) deeptutor/services/path_service.py:143 — PathService.resolve_public_output_path has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · client.parse_catalog_xml (cyclomatic 24) · ×1
  • client.parse_catalog_xml (cyclomatic 24) deeptutor/services/rag/pipelines/kiwix/client.py:129 — client.parse_catalog_xml has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LlamaIndexDocumentLoader.load (cyclomatic 24) · ×1
  • LlamaIndexDocumentLoader.load (cyclomatic 24) deeptutor/services/rag/pipelines/llamaindex/document_loader.py:77 — LlamaIndexDocumentLoader.load has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · model_history.replay_group (cyclomatic 24) · ×1
  • model_history.replay_group (cyclomatic 24) deeptutor/services/session/model_history.py:165 — model_history.replay_group has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SQLiteSessionStore._record_assessment_sync (cyclomatic 24) · ×1
  • SQLiteSessionStore._record_assessment_sync (cyclomatic 24) deeptutor/services/session/sqlite_store.py:3633 — SQLiteSessionStore._record_assessment_sync has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · claude_models._capture_model_screen (cyclomatic 24) · ×1
  • claude_models._capture_model_screen (cyclomatic 24) deeptutor/services/subagent/claude_models.py:155 — claude_models._capture_model_screen has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MiniMaxTTSAdapter.synthesize (cyclomatic 24) · ×1
  • MiniMaxTTSAdapter.synthesize (cyclomatic 24) deeptutor/services/voice/adapters/minimax.py:17 — MiniMaxTTSAdapter.synthesize has cyclomatic complexity 24 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · folders.browse_folders (cyclomatic 24) · ×1
  • folders.browse_folders (cyclomatic 24) deeptutor/services/workspace/folders.py:12 — folders.browse_folders has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · export_discord_history.normalize_message (cyclomatic 24) · ×1
  • export_discord_history.normalize_message (cyclomatic 24) scripts/export_discord_history.py:100 — export_discord_history.normalize_message has cyclomatic complexity 24 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · workspace.workspaceTool (cyclomatic 24) · ×1
  • workspace.workspaceTool (cyclomatic 24) packages/chat-engine/src/tools/workspace.ts:131 — workspace.workspaceTool has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AnimationBlock.AnimationBlock (cyclomatic 24) · ×1
  • AnimationBlock.AnimationBlock (cyclomatic 24) web/app/(workspace)/learning/books/components/blocks/AnimationBlock.tsx:29 — AnimationBlock.AnimationBlock has cyclomatic complexity 24 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · Geogebra.Geogebra (cyclomatic 24) · ×1
  • Geogebra.Geogebra (cyclomatic 24) web/components/Geogebra.tsx:98 — Geogebra.Geogebra has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 5 of the 24 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 157, 124, 204). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · AnswerModeMenu.AnswerList (cyclomatic 24) · ×1
  • AnswerModeMenu.AnswerList (cyclomatic 24) web/components/chat/home/AnswerModeMenu.tsx:136 — AnswerModeMenu.AnswerList has cyclomatic complexity 24 (threshold 15). Of this number, 21 points are the body's own statements and 3 belong to 3 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · ContextBudgetChip.ContextBudgetChip (cyclomatic 24) · ×1
  • ContextBudgetChip.ContextBudgetChip (cyclomatic 24) web/components/chat/home/ContextBudgetChip.tsx:170 — ContextBudgetChip.ContextBudgetChip has cyclomatic complexity 24 (threshold 15). Of this number, 16 points are the body's own statements and 8 belong to 4 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · CliAppsSection.EntryDetail (cyclomatic 24) · ×1
  • CliAppsSection.EntryDetail (cyclomatic 24) web/components/cli-apps/CliAppsSection.tsx:590 — CliAppsSection.EntryDetail has cyclomatic complexity 24 (threshold 15). Of this number, 21 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PageCustomizeDialog.PageCustomizeDialog (cyclomatic 24) · ×1
  • PageCustomizeDialog.PageCustomizeDialog (cyclomatic 24) web/components/customization/PageCustomizeDialog.tsx:65 — PageCustomizeDialog.PageCustomizeDialog has cyclomatic complexity 24 (threshold 15). Of this number, 17 points are the body's own statements and 7 belong to 7 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · CreateKbModal.LinkModeFields (cyclomatic 24) · ×1
  • CreateKbModal.LinkModeFields (cyclomatic 24) web/components/knowledge/CreateKbModal.tsx:1403 — CreateKbModal.LinkModeFields has cyclomatic complexity 24 (threshold 15). Of this number, 16 points are the body's own statements and 8 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MemoryGraph.MemoryGraph (cyclomatic 24) · ×1
  • MemoryGraph.MemoryGraph (cyclomatic 24) web/components/memory/MemoryGraph.tsx:70 — MemoryGraph.MemoryGraph has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 8 of the 24 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 108, 165, 189, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · PartnerSeat.PartnerSeat (cyclomatic 24) · ×1
  • PartnerSeat.PartnerSeat (cyclomatic 24) web/components/partners/group/PartnerSeat.tsx:39 — PartnerSeat.PartnerSeat has cyclomatic complexity 24 (threshold 15). Of this number, 23 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · QuizConfigPanel.TypeMultiSelect (cyclomatic 24) · ×1
  • QuizConfigPanel.TypeMultiSelect (cyclomatic 24) web/components/quiz/QuizConfigPanel.tsx:383 — QuizConfigPanel.TypeMultiSelect has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 7 of the 24 points are its own statements and the rest belongs to 9 function items inside it that branch (a function literal at line 403, a function literal at line 452, toggle, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · ConnectionsEditor.AddConnectionPanel (cyclomatic 24) · ×1
  • ConnectionsEditor.AddConnectionPanel (cyclomatic 24) web/components/settings/ConnectionsEditor.tsx:506 — ConnectionsEditor.AddConnectionPanel has cyclomatic complexity 24 (threshold 15). Of this number, 18 points are the body's own statements and 6 belong to 4 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · VoiceDiscoveryField.VoiceLookup (cyclomatic 24) · ×1
  • VoiceDiscoveryField.VoiceLookup (cyclomatic 24) web/components/settings/VoiceDiscoveryField.tsx:63 — VoiceDiscoveryField.VoiceLookup has cyclomatic complexity 24 (threshold 15). Of this number, 15 points are the body's own statements and 9 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SettingsReadinessPanel.SettingsReadinessPanel (cyclomatic 24) · ×1
  • SettingsReadinessPanel.SettingsReadinessPanel (cyclomatic 24) web/components/settings/SettingsReadinessPanel.tsx:119 — SettingsReadinessPanel.SettingsReadinessPanel has cyclomatic complexity 24 (threshold 15). Of this number, 13 points are the body's own statements and 11 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SettingsTourOverlay.SettingsTourOverlay (cyclomatic 24) · ×1
  • SettingsTourOverlay.SettingsTourOverlay (cyclomatic 24) web/components/settings/SettingsTourOverlay.tsx:33 — SettingsTourOverlay.SettingsTourOverlay has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 10 of the 24 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 112, 70, 65, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · RouteDraftEditor.RouteDraftEditor (cyclomatic 24) · ×1
  • RouteDraftEditor.RouteDraftEditor (cyclomatic 24) web/components/space/learning/RouteDraftEditor.tsx:31 — RouteDraftEditor.RouteDraftEditor has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 8 of the 24 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 137, 197, 88, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · ServerFolderPicker.ServerFolderPicker (cyclomatic 24) · ×1
  • ServerFolderPicker.ServerFolderPicker (cyclomatic 24) web/components/workspaces/ServerFolderPicker.tsx:15 — ServerFolderPicker.ServerFolderPicker has cyclomatic complexity 24 (threshold 15). Of this number, 15 points are the body's own statements and 9 belong to 5 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · ReadingContext.ReadingProvider (cyclomatic 24) · ×1
  • ReadingContext.ReadingProvider (cyclomatic 24) web/context/ReadingContext.tsx:91 — ReadingContext.ReadingProvider has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 1 of the 24 points is its own statement and the rest belongs to 10 function literals inside it that branch (lines 115, 159, 183, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · TracePresentation.getDeepResearchStatusLabel (cyclomatic 24) · ×1
  • TracePresentation.getDeepResearchStatusLabel (cyclomatic 24) web/features/chat/trace/TracePresentation.tsx:1385 — TracePresentation.getDeepResearchStatusLabel has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · reading-selection.selectionTextWithoutLineNumbers (cyclomatic 24) · ×1
  • reading-selection.selectionTextWithoutLineNumbers (cyclomatic 24) web/lib/reading-selection.ts:144 — reading-selection.selectionTextWithoutLineNumbers has cyclomatic complexity 24 (threshold 15). Of this number, 23 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · turn-reconcile.reconcileTurnIds (cyclomatic 24) · ×1
  • turn-reconcile.reconcileTurnIds (cyclomatic 24) web/lib/turn-reconcile.ts:58 — turn-reconcile.reconcileTurnIds has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · i18n_audit.reportUntranslatedKeys (cyclomatic 24) · ×1
  • i18n_audit.reportUntranslatedKeys (cyclomatic 24) web/scripts/i18n_audit.mjs:127 — i18n_audit.reportUntranslatedKeys has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LoopPromptAssembler.blocks (cyclomatic 23) · ×1
  • LoopPromptAssembler.blocks (cyclomatic 23) deeptutor/agents/loop/prompt_blocks.py:119 — LoopPromptAssembler.blocks has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · QuestionPipeline._render_exploration_trace (cyclomatic 23) · ×1
  • QuestionPipeline._render_exploration_trace (cyclomatic 23) deeptutor/agents/question/pipeline.py:1176 — QuestionPipeline._render_exploration_trace has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ResearchPipeline.__init__ (cyclomatic 23) · ×1
  • ResearchPipeline.__init__ (cyclomatic 23) deeptutor/agents/research/pipeline.py:350 — ResearchPipeline.__init__ has cyclomatic complexity 23 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · CodeGeneratorAgent.process (cyclomatic 23) · ×1
  • CodeGeneratorAgent.process (cyclomatic 23) deeptutor/agents/visualize/agents/code_generator_agent.py:31 — CodeGeneratorAgent.process has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · spine_synthesizer._ensure_full_coverage (cyclomatic 23) · ×1
  • spine_synthesizer._ensure_full_coverage (cyclomatic 23) deeptutor/book/agents/spine_synthesizer.py:738 — spine_synthesizer._ensure_full_coverage has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SectionGenerator._generate (cyclomatic 23) · ×1
  • SectionGenerator._generate (cyclomatic 23) deeptutor/book/blocks/section.py:73 — SectionGenerator._generate has cyclomatic complexity 23 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · choices.recover_options_from_turn (cyclomatic 23) · ×1
  • choices.recover_options_from_turn (cyclomatic 23) deeptutor/capabilities/mastery/choices.py:217 — choices.recover_options_from_turn has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MasteryGradeTool._grade_group (cyclomatic 23) · ×1
  • MasteryGradeTool._grade_group (cyclomatic 23) deeptutor/capabilities/mastery/tools.py:1868 — MasteryGradeTool._grade_group has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LearningService.replace_modules (cyclomatic 23) · ×1
  • LearningService.replace_modules (cyclomatic 23) deeptutor/learning/service.py:393 — LearningService.replace_modules has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · launcher._terminate_all (cyclomatic 23) · ×1
  • launcher._terminate_all (cyclomatic 23) deeptutor/runtime/launcher.py:290 — launcher._terminate_all has cyclomatic complexity 23 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · RuntimeSettingsService._apply_system_process_overrides (cyclomatic 23) · ×1
  • RuntimeSettingsService._apply_system_process_overrides (cyclomatic 23) deeptutor/services/config/runtime_settings.py:901 — RuntimeSettingsService._apply_system_process_overrides has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · adapters.read_notebook_entities (cyclomatic 23) · ×1
  • adapters.read_notebook_entities (cyclomatic 23) deeptutor/services/memory/snapshot/adapters.py:113 — adapters.read_notebook_entities has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PartnerManager.list_partners (cyclomatic 23) · ×1
  • PartnerManager.list_partners (cyclomatic 23) deeptutor/services/partners/manager.py:1063 — PartnerManager.list_partners has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LightRagPipeline._reconcile (cyclomatic 23) · ×1
  • LightRagPipeline._reconcile (cyclomatic 23) deeptutor/services/rag/pipelines/lightrag/pipeline.py:154 — LightRagPipeline._reconcile has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · visual_coverage.record_coverage (cyclomatic 23) · ×1
  • visual_coverage.record_coverage (cyclomatic 23) deeptutor/services/rag/visual_coverage.py:22 — visual_coverage.record_coverage has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · usage_statistics.aggregate_usage (cyclomatic 23) · ×1
  • usage_statistics.aggregate_usage (cyclomatic 23) deeptutor/services/session/usage_statistics.py:160 — usage_statistics.aggregate_usage has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · OpencodeFamilyBackend._handle_bus_event (cyclomatic 23) · ×1
  • OpencodeFamilyBackend._handle_bus_event (cyclomatic 23) deeptutor/services/subagent/opencode_family.py:252 — OpencodeFamilyBackend._handle_bus_event has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · init_wizard.fetch_embedding_models (cyclomatic 23) · ×1
  • init_wizard.fetch_embedding_models (cyclomatic 23) deeptutor_cli/init_wizard.py:751 — init_wizard.fetch_embedding_models has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · page.NewPartnerGroupPage (cyclomatic 23) · ×1
  • page.NewPartnerGroupPage (cyclomatic 23) web/app/(workspace)/partners/groups/new/page.tsx:17 — page.NewPartnerGroupPage has cyclomatic complexity 23 (threshold 15). Of this number, 14 points are the body's own statements and 9 belong to 4 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ConnectKiwixModal.ConnectKiwixModal (cyclomatic 23) · ×1
  • ConnectKiwixModal.ConnectKiwixModal (cyclomatic 23) web/components/knowledge/ConnectKiwixModal.tsx:15 — ConnectKiwixModal.ConnectKiwixModal has cyclomatic complexity 23 (threshold 15). Of this number, 17 points are the body's own statements and 6 belong to 3 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · CreateKbModal.NewModeFields (cyclomatic 23) · ×1
  • CreateKbModal.NewModeFields (cyclomatic 23) web/components/knowledge/CreateKbModal.tsx:862 — CreateKbModal.NewModeFields has cyclomatic complexity 23 (threshold 15). Of this number, 16 points are the body's own statements and 7 belong to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · PartnerArchives.conversationPreview (cyclomatic 23) · ×1
  • PartnerArchives.conversationPreview (cyclomatic 23) web/components/partners/PartnerArchives.tsx:59 — PartnerArchives.conversationPreview has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 8 of the 23 points are its own statements and the rest belongs to 3 function items inside it that branch (tableCells, a function literal at line 84, a function literal at line 123). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · PdfPage.PdfPage (cyclomatic 23) · ×1
  • PdfPage.PdfPage (cyclomatic 23) web/components/reading/PdfPage.tsx:47 — PdfPage.PdfPage has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 3 of the 23 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 75, 69, 96, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · MaterialLibrary.MaterialLibraryPage (cyclomatic 23) · ×1
  • MaterialLibrary.MaterialLibraryPage (cyclomatic 23) web/components/reading/library/MaterialLibrary.tsx:60 — MaterialLibrary.MaterialLibraryPage has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 11 of the 23 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 129, 80, 115, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · LevelUpCelebration.LevelUpCelebration (cyclomatic 23) · ×1
  • LevelUpCelebration.LevelUpCelebration (cyclomatic 23) web/components/space/learning/LevelUpCelebration.tsx:145 — LevelUpCelebration.LevelUpCelebration has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 4 of the 23 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 224, 154, 231). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · NoteInlineReviews.NoteInlineReviews (cyclomatic 23) · ×1
  • NoteInlineReviews.NoteInlineReviews (cyclomatic 23) web/features/notes/components/NoteInlineReviews.tsx:22 — NoteInlineReviews.NoteInlineReviews has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 2 of the 23 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 112, 62, 53, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · NoteInsertMenu.NoteInsertMenu (cyclomatic 23) · ×1
  • NoteInsertMenu.NoteInsertMenu (cyclomatic 23) web/features/notes/components/NoteInsertMenu.tsx:19 — NoteInsertMenu.NoteInsertMenu has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 6 of the 23 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 98, 46, 58, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · NoteThreadMarkers.NoteThreadMarkers (cyclomatic 23) · ×1
  • NoteThreadMarkers.NoteThreadMarkers (cyclomatic 23) web/features/notes/components/NoteThreadMarkers.tsx:42 — NoteThreadMarkers.NoteThreadMarkers has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 8 of the 23 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 74, 120, 72, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · useKnowledgeProgress.useKnowledgeProgress.openTaskStream (cyclomatic 23) · ×1
  • useKnowledgeProgress.useKnowledgeProgress.openTaskStream (cyclomatic 23) web/hooks/useKnowledgeProgress.ts:274 — useKnowledgeProgress.useKnowledgeProgress.openTaskStream has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 1 of the 23 points is its own statement and the rest belongs to 9 function literals inside it that branch (lines 306, 313, 331, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · latex-normalize.scanFragmentEnd (cyclomatic 23) · ×1
  • latex-normalize.scanFragmentEnd (cyclomatic 23) REDACTED:361 — latex-normalize.scanFragmentEnd has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · provider-registry.stageRegistryAction (cyclomatic 23) · ×1
  • provider-registry.stageRegistryAction (cyclomatic 23) web/lib/provider-registry.ts:360 — provider-registry.stageRegistryAction has cyclomatic complexity 23 (threshold 15). Of this number, 21 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Dialog.Dialog (cyclomatic 23) · ×1
  • Dialog.Dialog (cyclomatic 23) web/shared/ui/Dialog.tsx:41 — Dialog.Dialog has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 7 of the 23 points are its own statements and the rest belongs to 6 function items inside it that branch (handleKeyDown, a function literal at line 81, handleBackdrop, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · auth.admin_import_users (cyclomatic 22) · ×1
  • auth.admin_import_users (cyclomatic 22) deeptutor/api/routers/auth.py:1831 — auth.admin_import_users has cyclomatic complexity 22 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · AnimationGenerator._generate (cyclomatic 22) · ×1
  • AnimationGenerator._generate (cyclomatic 22) deeptutor/book/blocks/animation.py:30 — AnimationGenerator._generate has cyclomatic complexity 22 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · history.reference_history_reads (cyclomatic 22) · ×1
  • history.reference_history_reads (cyclomatic 22) deeptutor/capabilities/mastery/history.py:62 — history.reference_history_reads has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · history.share_mastery_history (cyclomatic 22) · ×1
  • history.share_mastery_history (cyclomatic 22) deeptutor/capabilities/mastery/history.py:122 — history.share_mastery_history has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MasteryContextBuilder._summarize (cyclomatic 22) · ×1
  • MasteryContextBuilder._summarize (cyclomatic 22) deeptutor/capabilities/mastery/memory.py:182 — MasteryContextBuilder._summarize has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · generation.propose_generated_block (cyclomatic 22) · ×1
  • generation.propose_generated_block (cyclomatic 22) deeptutor/capabilities/notes/generation.py:77 — generation.propose_generated_block has cyclomatic complexity 22 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · InvokeOtherTool.execute (cyclomatic 22) · ×1
  • InvokeOtherTool.execute (cyclomatic 22) deeptutor/capabilities/partner_group/tools.py:43 — InvokeOtherTool.execute has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ConsultSubagentTool.execute (cyclomatic 22) · ×1
  • ConsultSubagentTool.execute (cyclomatic 22) deeptutor/capabilities/subagent/tools.py:78 — ConsultSubagentTool.execute has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · LearningService.repair_question_semantic (cyclomatic 22) · ×1
  • LearningService.repair_question_semantic (cyclomatic 22) deeptutor/learning/service.py:3253 — LearningService.repair_question_semantic has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · proposals.propose (cyclomatic 22) · ×1
  • proposals.propose (cyclomatic 22) deeptutor/notes/proposals.py:64 — proposals.propose has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · proposals.review (cyclomatic 22) · ×1
  • proposals.review (cyclomatic 22) deeptutor/notes/proposals.py:134 — proposals.review has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DiscordChannel.send_delta (cyclomatic 22) · ×1
  • DiscordChannel.send_delta (cyclomatic 22) deeptutor/partners/channels/discord.py:186 — DiscordChannel.send_delta has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · DiscordChannel._handle_message_create (cyclomatic 22) · ×1
  • DiscordChannel._handle_message_create (cyclomatic 22) deeptutor/partners/channels/discord.py:406 — DiscordChannel._handle_message_create has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MaterialManifest.from_dict (cyclomatic 22) · ×1
  • MaterialManifest.from_dict (cyclomatic 22) deeptutor/reading/models.py:261 — MaterialManifest.from_dict has cyclomatic complexity 22 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · ReadingStore._reanchor_annotations (cyclomatic 22) · ×1
  • ReadingStore._reanchor_annotations (cyclomatic 22) deeptutor/reading/store.py:1230 — ReadingStore._reanchor_annotations has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · recurrence.parse_rule (cyclomatic 22) · ×1
  • recurrence.parse_rule (cyclomatic 22) deeptutor/services/calendar/recurrence.py:98 — recurrence.parse_rule has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · launch_settings._normalize_language (cyclomatic 22) · ×1
  • launch_settings._normalize_language (cyclomatic 22) deeptutor/services/config/launch_settings.py:50 — launch_settings._normalize_language has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · provider_runtime._resolve_embedding_provider (cyclomatic 22) · ×1
  • provider_runtime._resolve_embedding_provider (cyclomatic 22) deeptutor/services/config/provider_runtime.py:1148 — provider_runtime._resolve_embedding_provider has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · converters.convert_messages (cyclomatic 22) · ×1
  • converters.convert_messages (cyclomatic 22) deeptutor/services/llm/provider_core/openai_responses/converters.py:16 — converters.convert_messages has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LightRagPipeline._add_documents_owned (cyclomatic 22) · ×1
  • LightRagPipeline._add_documents_owned (cyclomatic 22) deeptutor/services/rag/pipelines/lightrag/pipeline.py:505 — LightRagPipeline._add_documents_owned has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PerplexityProvider.search (cyclomatic 22) · ×1
  • PerplexityProvider.search (cyclomatic 22) deeptutor/services/search/providers/perplexity.py:50 — PerplexityProvider.search has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · QianfanProvider.search (cyclomatic 22) · ×1
  • QianfanProvider.search (cyclomatic 22) deeptutor/services/search/providers/qianfan.py:41 — QianfanProvider.search has cyclomatic complexity 22 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · source_filter._rejection_reason (cyclomatic 22) · ×1
  • source_filter._rejection_reason (cyclomatic 22) REDACTED:145 — source_filter._rejection_reason has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · SQLiteSessionStore._replace_submission_sync (cyclomatic 22) · ×1
  • SQLiteSessionStore._replace_submission_sync (cyclomatic 22) deeptutor/services/session/sqlite_store.py:1238 — SQLiteSessionStore._replace_submission_sync has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · codex._render_item (cyclomatic 22) · ×1
  • codex._render_item (cyclomatic 22) deeptutor/services/subagent/codex.py:262 — codex._render_item has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PartnerGroupBackend.consult (cyclomatic 22) · ×1
  • PartnerGroupBackend.consult (cyclomatic 22) deeptutor/services/subagent/partner_group.py:17 — PartnerGroupBackend.consult has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · GeminiTTSAdapter.synthesize (cyclomatic 22) · ×1
  • GeminiTTSAdapter.synthesize (cyclomatic 22) deeptutor/services/voice/adapters/gemini.py:55 — GeminiTTSAdapter.synthesize has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · session_transfer.transfer_sessions (cyclomatic 22) · ×1
  • session_transfer.transfer_sessions (cyclomatic 22) deeptutor/services/workspace/session_transfer.py:19 — session_transfer.transfer_sessions has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · web_fetch.fetch_url_as_markdown (cyclomatic 22) · ×1
  • web_fetch.fetch_url_as_markdown (cyclomatic 22) deeptutor/tools/web_fetch.py:74 — web_fetch.fetch_url_as_markdown has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · write_note._do_append (cyclomatic 22) · ×1
  • write_note._do_append (cyclomatic 22) deeptutor/tools/write_note.py:150 — write_note._do_append has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · write_note._do_edit (cyclomatic 22) · ×1
  • write_note._do_edit (cyclomatic 22) deeptutor/tools/write_note.py:291 — write_note._do_edit has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · document_extractor.extract_documents_from_records (cyclomatic 22) · ×1
  • document_extractor.extract_documents_from_records (cyclomatic 22) deeptutor/utils/document_extractor.py:1306 — document_extractor.extract_documents_from_records has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · document_images.extract_pdf_images (cyclomatic 22) · ×1
  • document_images.extract_pdf_images (cyclomatic 22) deeptutor/utils/document_images.py:826 — document_images.extract_pdf_images has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · builtin._geogebra_validator (cyclomatic 22) · ×1
  • builtin._geogebra_validator (cyclomatic 22) deeptutor/visualizers/builtin.py:105 — builtin._geogebra_validator has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · chat._chat_repl (cyclomatic 22) · ×1
  • chat._chat_repl (cyclomatic 22) deeptutor_cli/chat.py:86 — chat._chat_repl has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Conversation.project (cyclomatic 22) · ×1
  • Conversation.project (cyclomatic 22) packages/chat-engine/src/context/conversation.ts:133 — Conversation.project has cyclomatic complexity 22 (threshold 15). Of this number, 15 points are the body's own statements and 7 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · history.planHistory (cyclomatic 22) · ×1
  • history.planHistory (cyclomatic 22) packages/chat-engine/src/context/history.ts:42 — history.planHistory has cyclomatic complexity 22 (threshold 15). Of this number, 16 points are the body's own statements and 6 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AskUserOptions.normaliseAskUserPayload (cyclomatic 22) · ×1
  • AskUserOptions.normaliseAskUserPayload (cyclomatic 22) web/components/chat/home/AskUserOptions.tsx:904 — AskUserOptions.normaliseAskUserPayload has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · previewerFor.previewKindFor (cyclomatic 22) · ×1
  • previewerFor.previewKindFor (cyclomatic 22) web/components/chat/preview/previewerFor.ts:97 — previewerFor.previewKindFor has cyclomatic complexity 22 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · KbGitHubSourcesSection.KbGitHubSourcesSection (cyclomatic 22) · ×1
  • KbGitHubSourcesSection.KbGitHubSourcesSection (cyclomatic 22) web/components/knowledge/KbGitHubSourcesSection.tsx:21 — KbGitHubSourcesSection.KbGitHubSourcesSection has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 10 of the 22 points are its own statements and the rest belongs to 4 function items inside it that branch (handleAdd, handleSync, a function literal at line 38, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · useGroupSession.useGroupSession.handleFrame (cyclomatic 22) · ×1
  • useGroupSession.useGroupSession.handleFrame (cyclomatic 22) web/components/partners/group/useGroupSession.ts:156 — useGroupSession.useGroupSession.handleFrame has cyclomatic complexity 22 (threshold 15). Of this number, 14 points are the body's own statements and 8 belong to 7 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ConnectionsEditor.ConnectionsEditor (cyclomatic 22) · ×1
  • ConnectionsEditor.ConnectionsEditor (cyclomatic 22) web/components/settings/ConnectionsEditor.tsx:82 — ConnectionsEditor.ConnectionsEditor has cyclomatic complexity 22 (threshold 15). Of this number, 11 points are the body's own statements and 11 belong to 6 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MonthView.MonthView (cyclomatic 22) · ×1
  • MonthView.MonthView (cyclomatic 22) web/features/calendar/components/MonthView.tsx:49 — MonthView.MonthView has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 1 of the 22 points is its own statement and the rest belongs to 13 function items inside it that branch (a function literal at line 112, a function literal at line 128, a function literal at line 137, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · markdown.parseNoteMarkdown (cyclomatic 22) · ×1
  • markdown.parseNoteMarkdown (cyclomatic 22) REDACTED:4 — markdown.parseNoteMarkdown has cyclomatic complexity 22 (threshold 15). Of this number, 11 points are the body's own statements and 11 belong to 4 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · math-animator-types.extractMathAnimatorResult (cyclomatic 22) · ×1
  • math-animator-types.extractMathAnimatorResult (cyclomatic 22) web/lib/math-animator-types.ts:41 — math-animator-types.extractMathAnimatorResult has cyclomatic complexity 22 (threshold 15). Of this number, 18 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · start (cyclomatic 22) · ×1
  • start (cyclomatic 22) apps/desktop/src/runtime.mjs:69 — start has cyclomatic complexity 22 (threshold 15). Of this number, 14 points are the body's own statements and 8 belong to 4 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · AgenticLoopPipeline._resolve_workspace_export (cyclomatic 21) · ×1
  • AgenticLoopPipeline._resolve_workspace_export (cyclomatic 21) deeptutor/agents/loop/pipeline.py:1344 — AgenticLoopPipeline._resolve_workspace_export has cyclomatic complexity 21 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · QuestionPipeline._normalize_quiz_payload (cyclomatic 21) · ×1
  • QuestionPipeline._normalize_quiz_payload (cyclomatic 21) deeptutor/agents/question/pipeline.py:1407 — QuestionPipeline._normalize_quiz_payload has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · file_preview._source_path (cyclomatic 21) · ×1
  • file_preview._source_path (cyclomatic 21) deeptutor/api/routers/file_preview.py:31 — file_preview._source_path has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · settings.fetch_models_from_provider (cyclomatic 21) · ×1
  • settings.fetch_models_from_provider (cyclomatic 21) deeptutor/api/routers/settings.py:2040 — settings.fetch_models_from_provider has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SectionGenerator._fill_subsection (cyclomatic 21) · ×1
  • SectionGenerator._fill_subsection (cyclomatic 21) deeptutor/book/blocks/section.py:258 — SectionGenerator._fill_subsection has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BookEngine._materialize_overview_page (cyclomatic 21) · ×1
  • BookEngine._materialize_overview_page (cyclomatic 21) deeptutor/book/engine.py:753 — BookEngine._materialize_overview_page has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · engine._source_quality_summary (cyclomatic 21) · ×1
  • engine._source_quality_summary (cyclomatic 21) deeptutor/book/engine.py:171 — engine._source_quality_summary has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · MasteryRepairQuestionTool.execute (cyclomatic 21) · ×1
  • MasteryRepairQuestionTool.execute (cyclomatic 21) deeptutor/capabilities/mastery/tools.py:2156 — MasteryRepairQuestionTool.execute has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · KnowledgeBaseManager._read_and_reconcile_config (cyclomatic 21) · ×1
  • KnowledgeBaseManager._read_and_reconcile_config (cyclomatic 21) deeptutor/knowledge/manager.py:381 — KnowledgeBaseManager._read_and_reconcile_config has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · lesson_evidence.selected_scope (cyclomatic 21) · ×1
  • lesson_evidence.selected_scope (cyclomatic 21) deeptutor/learning/lesson_evidence.py:218 — lesson_evidence.selected_scope has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · semantic_assessment._attach_support (cyclomatic 21) · ×1
  • semantic_assessment._attach_support (cyclomatic 21) deeptutor/learning/semantic_assessment.py:363 — semantic_assessment._attach_support has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LearningService.record_learner_profile (cyclomatic 21) · ×1
  • LearningService.record_learner_profile (cyclomatic 21) deeptutor/learning/service.py:2099 — LearningService.record_learner_profile has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · catalog.manifests (cyclomatic 21) · ×1
  • catalog.manifests (cyclomatic 21) deeptutor/modules/catalog.py:25 — catalog.manifests has cyclomatic complexity 21 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D1 · Cyclomatic Complexity · book_permission.normalize_book_permission (cyclomatic 21) · ×1
  • book_permission.normalize_book_permission (cyclomatic 21) deeptutor/multi_user/book_permission.py:45 — book_permission.normalize_book_permission has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · EmailChannel._fetch_messages (cyclomatic 21) · ×1
  • EmailChannel._fetch_messages (cyclomatic 21) deeptutor/partners/channels/email.py:281 — EmailChannel._fetch_messages has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MSTeamsChannel._normalize_teams_reply_quote (cyclomatic 21) · ×1
  • MSTeamsChannel._normalize_teams_reply_quote (cyclomatic 21) deeptutor/partners/channels/msteams.py:418 — MSTeamsChannel._normalize_teams_reply_quote has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · tool_dispatch.dispatch_tool_calls (cyclomatic 21) · ×1
  • tool_dispatch.dispatch_tool_calls (cyclomatic 21) deeptutor/runtime/agentic/tool_dispatch.py:127 — tool_dispatch.dispatch_tool_calls has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · layers.read_layers (cyclomatic 21) · ×1
  • layers.read_layers (cyclomatic 21) deeptutor/services/calendar/layers.py:26 — layers.read_layers has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ModelCatalogService._apply_connection (cyclomatic 21) · ×1
  • ModelCatalogService._apply_connection (cyclomatic 21) deeptutor/services/config/model_catalog.py:410 — ModelCatalogService._apply_connection has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ChatCompletionsImagegenAdapter._extract_sources (cyclomatic 21) · ×1
  • ChatCompletionsImagegenAdapter._extract_sources (cyclomatic 21) deeptutor/services/imagegen/adapters/chat_completions.py:82 — ChatCompletionsImagegenAdapter._extract_sources has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · office_preview._render_sync (cyclomatic 21) · ×1
  • office_preview._render_sync (cyclomatic 21) deeptutor/services/office_preview.py:83 — office_preview._render_sync has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cloud._poll_for_zip (cyclomatic 21) · ×1
  • cloud._poll_for_zip (cyclomatic 21) deeptutor/services/parsing/engines/mineru/cloud.py:434 — cloud._poll_for_zip has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PartnerRunner._attachments_from_media (cyclomatic 21) · ×1
  • PartnerRunner._attachments_from_media (cyclomatic 21) deeptutor/services/partners/runtime.py:983 — PartnerRunner._attachments_from_media has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ingress.freeze_document (cyclomatic 21) · ×1
  • ingress.freeze_document (cyclomatic 21) deeptutor/services/rag/pipelines/lightrag/ingress.py:184 — ingress.freeze_document has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · client.resolve_oss_sdk_config (cyclomatic 21) · ×1
  • client.resolve_oss_sdk_config (cyclomatic 21) deeptutor/services/rag/pipelines/pageindex/client.py:32 — client.resolve_oss_sdk_config has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · source_pages.legacy_page_index (cyclomatic 21) · ×1
  • source_pages.legacy_page_index (cyclomatic 21) deeptutor/services/rag/source_pages.py:265 — source_pages.legacy_page_index has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · visual_assets._block_details (cyclomatic 21) · ×1
  • visual_assets._block_details (cyclomatic 21) deeptutor/services/rag/visual_assets.py:107 — visual_assets._block_details has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AliyunIQSProvider.search (cyclomatic 21) · ×1
  • AliyunIQSProvider.search (cyclomatic 21) deeptutor/services/search/providers/aliyun_iqs.py:49 — AliyunIQSProvider.search has cyclomatic complexity 21 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · GoogleBrowserScraperProvider.search (cyclomatic 21) · ×1
  • GoogleBrowserScraperProvider.search (cyclomatic 21) deeptutor/services/search/providers/google_browser_scraper.py:51 — GoogleBrowserScraperProvider.search has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SerperProvider.search (cyclomatic 21) · ×1
  • SerperProvider.search (cyclomatic 21) deeptutor/services/search/providers/serper.py:40 — SerperProvider.search has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · event_preview.compact_trace_preview (cyclomatic 21) · ×1
  • event_preview.compact_trace_preview (cyclomatic 21) deeptutor/services/session/event_preview.py:95 — event_preview.compact_trace_preview has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · legacy_migration._normalize_session (cyclomatic 21) · ×1
  • legacy_migration._normalize_session (cyclomatic 21) deeptutor/services/session/legacy_migration.py:73 — legacy_migration._normalize_session has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · QuestionBankQuery.normalized (cyclomatic 21) · ×1
  • QuestionBankQuery.normalized (cyclomatic 21) deeptutor/services/session/sqlite_store.py:221 — QuestionBankQuery.normalized has cyclomatic complexity 21 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · usage_recovery.model_evidence (cyclomatic 21) · ×1
  • usage_recovery.model_evidence (cyclomatic 21) deeptutor/services/session/usage_recovery.py:12 — usage_recovery.model_evidence has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · list_notebook._render_records (cyclomatic 21) · ×1
  • list_notebook._render_records (cyclomatic 21) deeptutor/tools/list_notebook.py:113 — list_notebook._render_records has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PartnerSearchTool.execute (cyclomatic 21) · ×1
  • PartnerSearchTool.execute (cyclomatic 21) deeptutor/tools/partner_memory.py:250 — PartnerSearchTool.execute has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ZoteroSearchClient._normalize (cyclomatic 21) · ×1
  • ZoteroSearchClient._normalize (cyclomatic 21) deeptutor/tools/zotero_search.py:105 — ZoteroSearchClient._normalize has cyclomatic complexity 21 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · document_extractor._extract_pdf (cyclomatic 21) · ×1
  • document_extractor._extract_pdf (cyclomatic 21) deeptutor/utils/document_extractor.py:367 — document_extractor._extract_pdf has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · document_images._extract_pptx_rich_ooxml (cyclomatic 21) · ×1
  • document_images._extract_pptx_rich_ooxml (cyclomatic 21) deeptutor/utils/document_images.py:711 — document_images._extract_pptx_rich_ooxml has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · init_cmd._embedding_step (cyclomatic 21) · ×1
  • init_cmd._embedding_step (cyclomatic 21) deeptutor_cli/init_cmd.py:269 — init_cmd._embedding_step has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · chat-completions.request · ×1
  • chat-completions.request::ingest (cyclomatic 21) packages/chat-engine/src/providers/chat-completions.ts:159 — chat-completions.request::ingest has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (chat-completions.request) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · ask-user.askPayload.questions (cyclomatic 21) · ×1
  • ask-user.askPayload.questions (cyclomatic 21) packages/chat-engine/src/tools/ask-user.ts:30 — ask-user.askPayload.questions has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DeepDiveBlock.DeepDiveBlock (cyclomatic 21) · ×1
  • DeepDiveBlock.DeepDiveBlock (cyclomatic 21) web/app/(workspace)/learning/books/components/blocks/DeepDiveBlock.tsx:21 — DeepDiveBlock.DeepDiveBlock has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 4 of the 21 points are its own statements and the rest belongs to 3 function items inside it that branch (a function literal at line 58, pageFor, a function literal at line 75). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · page.PartnersPage (cyclomatic 21) · ×1
  • page.PartnersPage (cyclomatic 21) web/app/(workspace)/partners/page.tsx:32 — page.PartnersPage has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 9 of the 21 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 124, 221, 65, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · PersonaPicker.PersonaPicker (cyclomatic 21) · ×1
  • PersonaPicker.PersonaPicker (cyclomatic 21) web/components/chat/PersonaPicker.tsx:17 — PersonaPicker.PersonaPicker has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 8 of the 21 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 40, 139, 59, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · McpCatalogBrowser.McpCatalogBrowser (cyclomatic 21) · ×1
  • McpCatalogBrowser.McpCatalogBrowser (cyclomatic 21) web/components/mcp/McpCatalogBrowser.tsx:85 — McpCatalogBrowser.McpCatalogBrowser has cyclomatic complexity 21 (threshold 15). Of this number, 12 points are the body's own statements and 9 belong to 6 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · SaveToNotebookModal.SaveToNotebookModal (cyclomatic 21) · ×1
  • SaveToNotebookModal.SaveToNotebookModal (cyclomatic 21) web/components/notebook/SaveToNotebookModal.tsx:149 — SaveToNotebookModal.SaveToNotebookModal has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (SaveToNotebookModal.SaveToNotebookModal::handleSave) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · ReadingActionsProvider.ReadingActionsProvider (cyclomatic 21) · ×1
  • ReadingActionsProvider.ReadingActionsProvider (cyclomatic 21) web/components/reading/ReadingActionsProvider.tsx:38 — ReadingActionsProvider.ReadingActionsProvider has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 1 of the 21 points is its own statement and the rest belongs to 8 function literals inside it that branch (lines 141, 77, 130, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · AddMaterialsDialog.AddMaterialsDialog · ×1
  • AddMaterialsDialog.AddMaterialsDialog::submit (cyclomatic 21) web/components/reading/library/AddMaterialsDialog.tsx:267 — AddMaterialsDialog.AddMaterialsDialog::submit has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (AddMaterialsDialog.AddMaterialsDialog) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · VoicePreviewPanel.PreviewRequest (cyclomatic 21) · ×1
  • VoicePreviewPanel.PreviewRequest (cyclomatic 21) web/components/settings/VoicePreviewPanel.tsx:34 — VoicePreviewPanel.PreviewRequest has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 8 of the 21 points are its own statements and the rest belongs to 3 function items inside it that branch (preview, a function literal at line 45, a function literal at line 57). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · ModelsWorkspace.ModelParameters (cyclomatic 21) · ×1
  • ModelsWorkspace.ModelParameters (cyclomatic 21) web/components/settings/ModelsWorkspace.tsx:1004 — ModelsWorkspace.ModelParameters has cyclomatic complexity 21 (threshold 15). Of this number, 18 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · buildStartTurnInput.buildStartTurnInput (cyclomatic 21) · ×1
  • buildStartTurnInput.buildStartTurnInput (cyclomatic 21) web/features/chat/controllers/buildStartTurnInput.ts:51 — buildStartTurnInput.buildStartTurnInput has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · UsageFooter.UsageFooter (cyclomatic 21) · ×1
  • UsageFooter.UsageFooter (cyclomatic 21) web/features/chat/messages/UsageFooter.tsx:9 — UsageFooter.UsageFooter has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 8 of the 21 points are its own statements and the rest belongs to 9 function items inside it that branch (a function literal at line 41, a function literal at line 65, a function literal at line 151, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · selectors.detectStreamingMode (cyclomatic 21) · ×1
  • selectors.detectStreamingMode (cyclomatic 21) web/features/chat/trace/selectors.ts:223 — selectors.detectStreamingMode has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TracePresentation.detectStreamingMode (cyclomatic 21) · ×1
  • TracePresentation.detectStreamingMode (cyclomatic 21) web/features/chat/trace/TracePresentation.tsx:1304 — TracePresentation.detectStreamingMode has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CapabilitiesSettingsSection.CapabilitiesSettingsPage (cyclomatic 21) · ×1
  • CapabilitiesSettingsSection.CapabilitiesSettingsPage (cyclomatic 21) web/features/settings/sections/CapabilitiesSettingsSection.tsx:88 — CapabilitiesSettingsSection.CapabilitiesSettingsPage has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 5 of the 21 points are its own statements and the rest belongs to 11 function items inside it that branch (a function literal at line 99, a function literal at line 152, patchChat, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · useChatAutoScroll.useChatAutoScroll (cyclomatic 21) · ×1
  • useChatAutoScroll.useChatAutoScroll (cyclomatic 21) web/hooks/useChatAutoScroll.ts:19 — useChatAutoScroll.useChatAutoScroll has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 1 of the 21 points is its own statement and the rest belongs to 10 function literals inside it that branch (lines 108, 84, 43, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · book-activity.chapterRows (cyclomatic 21) · ×1
  • book-activity.chapterRows (cyclomatic 21) web/lib/book-activity.ts:294 — book-activity.chapterRows has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 1 of the 21 points is its own statement and the rest belongs to 3 function literals inside it that branch (lines 303, 338, 300). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · mastery-question.parseQuestion (cyclomatic 21) · ×1
  • mastery-question.parseQuestion (cyclomatic 21) web/lib/mastery-question.ts:89 — mastery-question.parseQuestion has cyclomatic complexity 21 (threshold 15). Of this number, 19 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · reading-location-history.normalizeEntry (cyclomatic 21) · ×1
  • reading-location-history.normalizeEntry (cyclomatic 21) web/lib/reading-location-history.ts:31 — reading-location-history.normalizeEntry has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · reading-references.normalizeReadingReferences (cyclomatic 21) · ×1
  • reading-references.normalizeReadingReferences (cyclomatic 21) web/lib/reading-references.ts:48 — reading-references.normalizeReadingReferences has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · partners.partner_chat_ws (cyclomatic 20) · ×1
  • partners.partner_chat_ws (cyclomatic 20) deeptutor/api/routers/partners.py:1855 — partners.partner_chat_ws has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · video_learning._live_stream_url (cyclomatic 20) · ×1
  • video_learning._live_stream_url (cyclomatic 20) deeptutor/api/routers/video_learning.py:452 — video_learning._live_stream_url has cyclomatic complexity 20 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · export.render_block (cyclomatic 20) · ×1
  • export.render_block (cyclomatic 20) deeptutor/book/export.py:261 — export.render_block has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · inputs._resolve_chat_selections (cyclomatic 20) · ×1
  • inputs._resolve_chat_selections (cyclomatic 20) deeptutor/book/inputs.py:95 — inputs._resolve_chat_selections has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · HandoffCapability._subagent (cyclomatic 20) · ×1
  • HandoffCapability._subagent (cyclomatic 20) deeptutor/capabilities/handoff/capability.py:362 — HandoffCapability._subagent has cyclomatic complexity 20 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · MasteryNoteExplainedTool.execute (cyclomatic 20) · ×1
  • MasteryNoteExplainedTool.execute (cyclomatic 20) deeptutor/capabilities/mastery/tools.py:946 — MasteryNoteExplainedTool.execute has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · generation.result_learning_block (cyclomatic 20) · ×1
  • generation.result_learning_block (cyclomatic 20) deeptutor/capabilities/notes/generation.py:23 — generation.result_learning_block has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · binding._resolve (cyclomatic 20) · ×1
  • binding._resolve (cyclomatic 20) deeptutor/capabilities/subagent/binding.py:34 — binding._resolve has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · KnowledgeBaseManager._auto_register_kb (cyclomatic 20) · ×1
  • KnowledgeBaseManager._auto_register_kb (cyclomatic 20) deeptutor/knowledge/manager.py:745 — KnowledgeBaseManager._auto_register_kb has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · manager.main (cyclomatic 20) · ×1
  • manager.main (cyclomatic 20) deeptutor/knowledge/manager.py:2455 — manager.main has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · migration._prepare_mastery_v2_root (cyclomatic 20) · ×1
  • migration._prepare_mastery_v2_root (cyclomatic 20) deeptutor/learning/migration.py:185 — migration._prepare_mastery_v2_root has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · catalog.module_statuses (cyclomatic 20) · ×1
  • catalog.module_statuses (cyclomatic 20) deeptutor/modules/catalog.py:197 — catalog.module_statuses has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MatrixChannel._upload_and_send_attachment (cyclomatic 20) · ×1
  • MatrixChannel._upload_and_send_attachment (cyclomatic 20) deeptutor/partners/channels/matrix.py:396 — MatrixChannel._upload_and_send_attachment has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · TelegramChannel._on_message (cyclomatic 20) · ×1
  • TelegramChannel._on_message (cyclomatic 20) deeptutor/partners/channels/telegram.py:981 — TelegramChannel._on_message has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · references.resolve_reading_sources (cyclomatic 20) · ×1
  • references.resolve_reading_sources (cyclomatic 20) deeptutor/reading/references.py:84 — references.resolve_reading_sources has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · doctor._rag_check (cyclomatic 20) · ×1
  • doctor._rag_check (cyclomatic 20) deeptutor/services/doctor.py:224 — doctor._rag_check has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · multimodal._inject_images (cyclomatic 20) · ×1
  • multimodal._inject_images (cyclomatic 20) deeptutor/services/llm/multimodal.py:188 — multimodal._inject_images has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · OpenAICompatProvider._parse (cyclomatic 20) · ×1
  • OpenAICompatProvider._parse (cyclomatic 20) deeptutor/services/llm/provider_core/openai_compat_provider.py:888 — OpenAICompatProvider._parse has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · OpenAICompatProvider._parse_chunks (cyclomatic 20) · ×1
  • OpenAICompatProvider._parse_chunks (cyclomatic 20) deeptutor/services/llm/provider_core/openai_compat_provider.py:948 — OpenAICompatProvider._parse_chunks has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · usage_frame.usage_breakdown (cyclomatic 20) · ×1
  • usage_frame.usage_breakdown (cyclomatic 20) deeptutor/services/llm/usage_frame.py:80 — usage_frame.usage_breakdown has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ChannelOnboardingManager.apply (cyclomatic 20) · ×1
  • ChannelOnboardingManager.apply (cyclomatic 20) deeptutor/services/partners/channel_onboarding.py:200 — ChannelOnboardingManager.apply has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · LlamaIndexPipeline.search (cyclomatic 20) · ×1
  • LlamaIndexPipeline.search (cyclomatic 20) deeptutor/services/rag/pipelines/llamaindex/pipeline.py:314 — LlamaIndexPipeline.search has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · source_visuals.page_image (cyclomatic 20) · ×1
  • source_visuals.page_image (cyclomatic 20) deeptutor/services/rag/source_visuals.py:70 — source_visuals.page_image has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · visual_assets.collect_visual_assets (cyclomatic 20) · ×1
  • visual_assets.collect_visual_assets (cyclomatic 20) deeptutor/services/rag/visual_assets.py:176 — visual_assets.collect_visual_assets has cyclomatic complexity 20 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · serply._parse_row (cyclomatic 20) · ×1
  • serply._parse_row (cyclomatic 20) deeptutor/services/search/providers/serply.py:123 — serply._parse_row has cyclomatic complexity 20 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · source_inventory._add_fresh (cyclomatic 20) · ×1
  • source_inventory._add_fresh (cyclomatic 20) deeptutor/services/session/source_inventory.py:261 — source_inventory._add_fresh has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · data_migration.recover_operation (cyclomatic 20) · ×1
  • data_migration.recover_operation (cyclomatic 20) deeptutor/services/workspace/data_migration.py:1023 — data_migration.recover_operation has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · init_wizard.fetch_models (cyclomatic 20) · ×1
  • init_wizard.fetch_models (cyclomatic 20) deeptutor_cli/init_wizard.py:628 — init_wizard.fetch_models has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DiscordHistoryExporter._channel_record (cyclomatic 20) · ×1
  • DiscordHistoryExporter._channel_record (cyclomatic 20) scripts/export_discord_history.py:410 — DiscordHistoryExporter._channel_record has cyclomatic complexity 20 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · contracts.validateOutput (cyclomatic 20) · ×1
  • contracts.validateOutput (cyclomatic 20) packages/chat-engine/src/core/contracts.ts:69 — contracts.validateOutput has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · http.post (cyclomatic 20) · ×1
  • http.post (cyclomatic 20) packages/chat-engine/src/providers/http.ts:17 — http.post has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 4 of the 20 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 46, 36). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · ToolDispatcher.run · ×1
  • ToolDispatcher.run::execute (cyclomatic 20) packages/chat-engine/src/tools/dispatcher.ts:106 — ToolDispatcher.run::execute has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (ToolDispatcher.run) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · stdio.lines.on("line") (cyclomatic 20) · ×1
  • stdio.lines.on("line") (cyclomatic 20) packages/chat-engine/src/transport/stdio.ts:147 — stdio.lines.on("line") has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · page.PageCard (cyclomatic 20) · ×1
  • page.PageCard (cyclomatic 20) web/app/(workspace)/co-writer/page.tsx:36 — page.PageCard has cyclomatic complexity 20 (threshold 15). Of this number, 18 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · KnowledgeSelector.KnowledgeSelector (cyclomatic 20) · ×1
  • KnowledgeSelector.KnowledgeSelector (cyclomatic 20) web/components/chat/home/KnowledgeSelector.tsx:26 — KnowledgeSelector.KnowledgeSelector has cyclomatic complexity 20 (threshold 15). Of this number, 17 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · XlsxPreview.XlsxPreview (cyclomatic 20) · ×1
  • XlsxPreview.XlsxPreview (cyclomatic 20) web/components/chat/preview/previewers/XlsxPreview.tsx:25 — XlsxPreview.XlsxPreview has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 6 of the 20 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 42, 56, 32, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · MemoryRunPanel.groupByTurn (cyclomatic 20) · ×1
  • MemoryRunPanel.groupByTurn (cyclomatic 20) web/components/memory/MemoryRunPanel.tsx:437 — MemoryRunPanel.groupByTurn has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · QuizConfigPanel.QuizConfigPanel (cyclomatic 20) · ×1
  • QuizConfigPanel.QuizConfigPanel (cyclomatic 20) web/components/quiz/QuizConfigPanel.tsx:102 — QuizConfigPanel.QuizConfigPanel has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 7 of the 20 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 124, 171, 196, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · ReadingFolder.ReadingFolderPage (cyclomatic 20) · ×1
  • ReadingFolder.ReadingFolderPage (cyclomatic 20) web/components/reading/library/ReadingFolder.tsx:51 — ReadingFolder.ReadingFolderPage has cyclomatic complexity 20 (threshold 15). Of this number, 11 points are the body's own statements and 9 belong to 6 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · VoiceModelFields.VoiceModelFields (cyclomatic 20) · ×1
  • VoiceModelFields.VoiceModelFields (cyclomatic 20) web/components/settings/VoiceModelFields.tsx:14 — VoiceModelFields.VoiceModelFields has cyclomatic complexity 20 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · WorkspaceSidebar.WorkspaceSidebar (cyclomatic 20) · ×1
  • WorkspaceSidebar.WorkspaceSidebar (cyclomatic 20) web/components/sidebar/WorkspaceSidebar.tsx:35 — WorkspaceSidebar.WorkspaceSidebar has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 1 of the 20 points is its own statement and the rest belongs to 9 function literals inside it that branch (lines 180, 205, 54, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · VisualizeConfigPanel.VisualizeConfigPanel (cyclomatic 20) · ×1
  • VisualizeConfigPanel.VisualizeConfigPanel (cyclomatic 20) web/components/visualize/VisualizeConfigPanel.tsx:35 — VisualizeConfigPanel.VisualizeConfigPanel has cyclomatic complexity 20 (threshold 15). Of this number, 12 points are the body's own statements and 8 belong to 6 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · NoteTaskBlock.NoteTaskBlock (cyclomatic 20) · ×1
  • NoteTaskBlock.NoteTaskBlock (cyclomatic 20) web/features/notes/components/NoteTaskBlock.tsx:12 — NoteTaskBlock.NoteTaskBlock has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 8 of the 20 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 39, create, a function literal at line 35, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · WorkspaceSettingsSection.WorkspaceSettingsSection (cyclomatic 20) · ×1
  • WorkspaceSettingsSection.WorkspaceSettingsSection (cyclomatic 20) web/features/settings/sections/WorkspaceSettingsSection.tsx:100 — WorkspaceSettingsSection.WorkspaceSettingsSection has cyclomatic complexity 20 (threshold 15). Of this number, 14 points are the body's own statements and 6 belong to 4 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · useMasteryPathActivity.useMasteryPathActivity (cyclomatic 20) · ×1
  • useMasteryPathActivity.useMasteryPathActivity (cyclomatic 20) web/hooks/useMasteryPathActivity.ts:138 — useMasteryPathActivity.useMasteryPathActivity has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 4 of the 20 points are its own statements and the rest belongs to 11 function literals inside it that branch (lines 181, 155, 164, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · notebook-api.listNotebookEntries (cyclomatic 20) · ×1
  • notebook-api.listNotebookEntries (cyclomatic 20) web/lib/notebook-api.ts:331 — notebook-api.listNotebookEntries has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · latex.normalizeEditorMdInlineMathInProse (cyclomatic 20) · ×1
  • latex.normalizeEditorMdInlineMathInProse (cyclomatic 20) web/lib/latex.ts:92 — latex.normalizeEditorMdInlineMathInProse has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · visualize-types.extractVisualizeResult (cyclomatic 20) · ×1
  • visualize-types.extractVisualizeResult (cyclomatic 20) web/lib/visualize-types.ts:143 — visualize-types.extractVisualizeResult has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · AgenticLoopPipeline._build_loop_messages (cyclomatic 19) · ×1
  • AgenticLoopPipeline._build_loop_messages (cyclomatic 19) deeptutor/agents/loop/pipeline.py:480 — AgenticLoopPipeline._build_loop_messages has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FollowupAgent._render_question_context (cyclomatic 19) · ×1
  • FollowupAgent._render_question_context (cyclomatic 19) deeptutor/agents/question/agents/followup_agent.py:80 — FollowupAgent._render_question_context has cyclomatic complexity 19 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · SectionArchitect.plan_blocks_async (cyclomatic 19) · ×1
  • SectionArchitect.plan_blocks_async (cyclomatic 19) deeptutor/book/agents/page_planner.py:317 — SectionArchitect.plan_blocks_async has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SourceExplorer._design_queries (cyclomatic 19) · ×1
  • SourceExplorer._design_queries (cyclomatic 19) deeptutor/book/agents/source_explorer.py:253 — SourceExplorer._design_queries has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SectionGenerator._make_outline (cyclomatic 19) · ×1
  • SectionGenerator._make_outline (cyclomatic 19) deeptutor/book/blocks/section.py:176 — SectionGenerator._make_outline has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · AudioOverviewCapability.run (cyclomatic 19) · ×1
  • AudioOverviewCapability.run (cyclomatic 19) deeptutor/capabilities/audio_overview/capability.py:24 — AudioOverviewCapability.run has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · jobs.run_job (cyclomatic 19) · ×1
  • jobs.run_job (cyclomatic 19) deeptutor/capabilities/setup/jobs.py:194 — jobs.run_job has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · lifecycle.plan (cyclomatic 19) · ×1
  • lifecycle.plan (cyclomatic 19) deeptutor/modules/lifecycle.py:93 — lifecycle.plan has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · grants.load_grant (cyclomatic 19) · ×1
  • grants.load_grant (cyclomatic 19) deeptutor/multi_user/grants.py:217 — grants.load_grant has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · WeixinChannel._send_media_file (cyclomatic 19) · ×1
  • WeixinChannel._send_media_file (cyclomatic 19) deeptutor/partners/channels/weixin.py:1180 — WeixinChannel._send_media_file has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · PluginLifecycleManager.install (cyclomatic 19) · ×1
  • PluginLifecycleManager.install (cyclomatic 19) deeptutor/plugins/lifecycle.py:72 — PluginLifecycleManager.install has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · manifest._extensions (cyclomatic 19) · ×1
  • manifest._extensions (cyclomatic 19) deeptutor/plugins/manifest.py:324 — manifest._extensions has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · launcher._owned_orphan_started_at (cyclomatic 19) · ×1
  • launcher._owned_orphan_started_at (cyclomatic 19) deeptutor/runtime/launcher.py:672 — launcher._owned_orphan_started_at has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · view._build (cyclomatic 19) · ×1
  • view._build (cyclomatic 19) deeptutor/runtime/providers/view.py:96 — view._build has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · doctor._credentials_check (cyclomatic 19) · ×1
  • doctor._credentials_check (cyclomatic 19) deeptutor/services/doctor.py:99 — doctor._credentials_check has cyclomatic complexity 19 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · github_copilot_auth.login_github_copilot (cyclomatic 19) · ×1
  • github_copilot_auth.login_github_copilot (cyclomatic 19) deeptutor/services/github_copilot_auth.py:59 — github_copilot_auth.login_github_copilot has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AnthropicProvider.chat_stream (cyclomatic 19) · ×1
  • AnthropicProvider.chat_stream (cyclomatic 19) deeptutor/services/llm/provider_core/anthropic_provider.py:551 — AnthropicProvider.chat_stream has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · claude_code_provider._prompt_input (cyclomatic 19) · ×1
  • claude_code_provider._prompt_input (cyclomatic 19) deeptutor/services/llm/provider_core/claude_code_provider.py:421 — claude_code_provider._prompt_input has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · McpCatalogEntry.__post_init__ (cyclomatic 19) · ×1
  • McpCatalogEntry.__post_init__ (cyclomatic 19) deeptutor/services/mcp/catalog/models.py:163 — McpCatalogEntry.__post_init__ has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · adapters.read_quiz_entities (cyclomatic 19) · ×1
  • adapters.read_quiz_entities (cyclomatic 19) deeptutor/services/memory/snapshot/adapters.py:538 — adapters.read_quiz_entities has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PartnerManager._migrate_legacy_tutorbot (cyclomatic 19) · ×1
  • PartnerManager._migrate_legacy_tutorbot (cyclomatic 19) deeptutor/services/partners/manager.py:1520 — PartnerManager._migrate_legacy_tutorbot has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PartnerRunner.process_message (cyclomatic 19) · ×1
  • PartnerRunner.process_message (cyclomatic 19) deeptutor/services/partners/runtime.py:317 — PartnerRunner.process_message has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · embedding_binding.migrate_binding (cyclomatic 19) · ×1
  • embedding_binding.migrate_binding (cyclomatic 19) deeptutor/services/rag/embedding_binding.py:68 — embedding_binding.migrate_binding has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cache_reuse.inherit_index_cache (cyclomatic 19) · ×1
  • cache_reuse.inherit_index_cache (cyclomatic 19) deeptutor/services/rag/pipelines/lightrag/cache_reuse.py:81 — cache_reuse.inherit_index_cache has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · exercise_lookup.requested_exercises (cyclomatic 19) · ×1
  • exercise_lookup.requested_exercises (cyclomatic 19) deeptutor/services/rag/pipelines/llamaindex/exercise_lookup.py:49 — exercise_lookup.requested_exercises has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · storage.resolve_resumable_rebuild_dir (cyclomatic 19) · ×1
  • storage.resolve_resumable_rebuild_dir (cyclomatic 19) deeptutor/services/rag/pipelines/llamaindex/storage.py:109 — storage.resolve_resumable_rebuild_dir has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · reading_hints._sanitize (cyclomatic 19) · ×1
  • reading_hints._sanitize (cyclomatic 19) deeptutor/services/reading_hints.py:360 — reading_hints._sanitize has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · primitives.read_pdf (cyclomatic 19) · ×1
  • primitives.read_pdf (cyclomatic 19) deeptutor/services/research/primitives.py:311 — primitives.read_pdf has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · FirecrawlProvider.search (cyclomatic 19) · ×1
  • FirecrawlProvider.search (cyclomatic 19) deeptutor/services/search/providers/firecrawl.py:34 — FirecrawlProvider.search has cyclomatic complexity 19 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · _turn_runtime_shared._extract_followup_question_context (cyclomatic 19) · ×1
  • _turn_runtime_shared._extract_followup_question_context (cyclomatic 19) deeptutor/services/session/_turn_runtime_shared.py:1044 — _turn_runtime_shared._extract_followup_question_context has cyclomatic complexity 19 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · thread_attribution.backfill_thread_sources (cyclomatic 19) · ×1
  • thread_attribution.backfill_thread_sources (cyclomatic 19) deeptutor/services/session/thread_attribution.py:429 — thread_attribution.backfill_thread_sources has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · provider_probe.model_services (cyclomatic 19) · ×1
  • provider_probe.model_services (cyclomatic 19) deeptutor/services/settings/provider_probe.py:17 — provider_probe.model_services has cyclomatic complexity 19 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · SkillService.install_tree (cyclomatic 19) · ×1
  • SkillService.install_tree (cyclomatic 19) deeptutor/services/skill/service.py:632 — SkillService.install_tree has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · OpenClawBackend.consult (cyclomatic 19) · ×1
  • OpenClawBackend.consult (cyclomatic 19) deeptutor/services/subagent/openclaw.py:81 — OpenClawBackend.consult has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · OpencodeFamilyBackend._handle_part (cyclomatic 19) · ×1
  • OpencodeFamilyBackend._handle_part (cyclomatic 19) deeptutor/services/subagent/opencode_family.py:304 — OpencodeFamilyBackend._handle_part has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · partner._to_subagent_events (cyclomatic 19) · ×1
  • partner._to_subagent_events (cyclomatic 19) deeptutor/services/subagent/partner.py:211 — partner._to_subagent_events has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · speech_text._replace_limits_once (cyclomatic 19) · ×1
  • speech_text._replace_limits_once (cyclomatic 19) deeptutor/services/voice/speech_text.py:551 — speech_text._replace_limits_once has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · crawler._fetch_page (cyclomatic 19) · ×1
  • crawler._fetch_page (cyclomatic 19) deeptutor/services/web_source/crawler.py:193 — crawler._fetch_page has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · snapshot.build_snapshot (cyclomatic 19) · ×1
  • snapshot.build_snapshot (cyclomatic 19) deeptutor/services/workspace/snapshot.py:45 — snapshot.build_snapshot has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cron_tool.run_cron_action (cyclomatic 19) · ×1
  • cron_tool.run_cron_action (cyclomatic 19) deeptutor/tools/cron_tool.py:76 — cron_tool.run_cron_action has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · reading_refresh_figures.main (cyclomatic 19) · ×1
  • reading_refresh_figures.main (cyclomatic 19) scripts/reading_refresh_figures.py:129 — reading_refresh_figures.main has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · kit.Timeline (cyclomatic 19) · ×1
  • kit.Timeline (cyclomatic 19) deeptutor/agents/video_lesson/remotion/kit.tsx:301 — kit.Timeline has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 3 of the 19 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 321, 311). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · UserNoteBlock.UserNoteBlock (cyclomatic 19) · ×1
  • UserNoteBlock.UserNoteBlock (cyclomatic 19) web/app/(workspace)/learning/books/components/blocks/UserNoteBlock.tsx:26 — UserNoteBlock.UserNoteBlock has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 9 of the 19 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 97, a function literal at line 45, commit, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · page.PartnerGroupPage (cyclomatic 19) · ×1
  • page.PartnerGroupPage (cyclomatic 19) web/app/(workspace)/partners/groups/[groupId]/page.tsx:38 — page.PartnerGroupPage has cyclomatic complexity 19 (threshold 15). Of this number, 11 points are the body's own statements and 8 belong to 5 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · AskUserOptions.QuestionBody (cyclomatic 19) · ×1
  • AskUserOptions.QuestionBody (cyclomatic 19) web/components/chat/home/AskUserOptions.tsx:1432 — AskUserOptions.QuestionBody has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 8 of the 19 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 1481, 1457, 1489, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · MasteryHandoffCard.MasteryHandoff (cyclomatic 19) · ×1
  • MasteryHandoffCard.MasteryHandoff (cyclomatic 19) web/components/chat/home/MasteryHandoffCard.tsx:96 — MasteryHandoffCard.MasteryHandoff has cyclomatic complexity 19 (threshold 15). Of this number, 18 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PartnerDraftCard.PartnerDraftCard (cyclomatic 19) · ×1
  • PartnerDraftCard.PartnerDraftCard (cyclomatic 19) web/components/chat/home/PartnerDraftCard.tsx:18 — PartnerDraftCard.PartnerDraftCard has cyclomatic complexity 19 (threshold 15). Of this number, 17 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CliAppsSection.Store (cyclomatic 19) · ×1
  • CliAppsSection.Store (cyclomatic 19) web/components/cli-apps/CliAppsSection.tsx:323 — CliAppsSection.Store has cyclomatic complexity 19 (threshold 15). Of this number, 10 points are the body's own statements and 9 belong to 6 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · LightRagRoleModelsEditor.roleModelsValidationError (cyclomatic 19) · ×1
  • LightRagRoleModelsEditor.roleModelsValidationError (cyclomatic 19) web/components/knowledge/LightRagRoleModelsEditor.tsx:42 — LightRagRoleModelsEditor.roleModelsValidationError has cyclomatic complexity 19 (threshold 15). Of this number, 18 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · McpServerRow.McpServerRow (cyclomatic 19) · ×1
  • McpServerRow.McpServerRow (cyclomatic 19) web/components/mcp/McpServerRow.tsx:26 — McpServerRow.McpServerRow has cyclomatic complexity 19 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · PartnerChat.normalizeHistoryAttachments (cyclomatic 19) · ×1
  • PartnerChat.normalizeHistoryAttachments (cyclomatic 19) web/components/partners/PartnerChat.tsx:120 — PartnerChat.normalizeHistoryAttachments has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 2 of the 19 points are its own statements and the rest belongs to one function literal inside it that branches (line 125). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · ConnectionsEditor.ConnectionRow (cyclomatic 19) · ×1
  • ConnectionsEditor.ConnectionRow (cyclomatic 19) web/components/settings/ConnectionsEditor.tsx:286 — ConnectionsEditor.ConnectionRow has cyclomatic complexity 19 (threshold 15). Of this number, 17 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · TaskModelsWorkspace.TaskModelsWorkspace (cyclomatic 19) · ×1
  • TaskModelsWorkspace.TaskModelsWorkspace (cyclomatic 19) web/components/settings/TaskModelsWorkspace.tsx:124 — TaskModelsWorkspace.TaskModelsWorkspace has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 6 of the 19 points are its own statements and the rest belongs to 5 function items inside it that branch (choiceFor, modelSelect, save, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · ScopeEditorModal.ScopeEditorModal (cyclomatic 19) · ×1
  • ScopeEditorModal.ScopeEditorModal (cyclomatic 19) web/components/space/ScopeEditorModal.tsx:49 — ScopeEditorModal.ScopeEditorModal has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 6 of the 19 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 63, 99, 86, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · WorkspaceResourcePicker.WorkspaceResourcePicker (cyclomatic 19) · ×1
  • WorkspaceResourcePicker.WorkspaceResourcePicker (cyclomatic 19) web/components/workspaces/WorkspaceResourcePicker.tsx:12 — WorkspaceResourcePicker.WorkspaceResourcePicker has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 2 of the 19 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 72, 117, 34, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · TracePresentation.hasExpandableContent (cyclomatic 19) · ×1
  • TracePresentation.hasExpandableContent (cyclomatic 19) web/features/chat/trace/TracePresentation.tsx:914 — TracePresentation.hasExpandableContent has cyclomatic complexity 19 (threshold 15). Of this number, 12 points are the body's own statements and 7 belong to 5 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · TracePresentation.StreamingStatus (cyclomatic 19) · ×1
  • TracePresentation.StreamingStatus (cyclomatic 19) web/features/chat/trace/TracePresentation.tsx:1498 — TracePresentation.StreamingStatus has cyclomatic complexity 19 (threshold 15). Of this number, 18 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · EngineDetail.LlamaIndexForm (cyclomatic 19) · ×1
  • EngineDetail.LlamaIndexForm (cyclomatic 19) web/features/knowledge/components/engines/EngineDetail.tsx:399 — EngineDetail.LlamaIndexForm has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 7 of the 19 points are its own statements and the rest belongs to 7 function items inside it that branch (save, a function literal at line 430, a function literal at line 514, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · NoteOutline.NoteOutline (cyclomatic 19) · ×1
  • NoteOutline.NoteOutline (cyclomatic 19) web/features/notes/components/NoteOutline.tsx:38 — NoteOutline.NoteOutline has cyclomatic complexity 19 (threshold 15). Of this number, 11 points are the body's own statements and 8 belong to 4 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · failed-submissions.clearFailedSubmission (cyclomatic 19) · ×1
  • failed-submissions.clearFailedSubmission (cyclomatic 19) web/lib/failed-submissions.ts:344 — failed-submissions.clearFailedSubmission has cyclomatic complexity 19 (threshold 15). Of this number, 15 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · learning-dashboard.allLearningActivity (cyclomatic 19) · ×1
  • learning-dashboard.allLearningActivity (cyclomatic 19) web/lib/learning-dashboard.ts:40 — learning-dashboard.allLearningActivity has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 1 of the 19 points is its own statement and the rest belongs to 6 function literals inside it that branch (lines 64, 42, 53, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · memory-graph.parseDoc (cyclomatic 19) · ×1
  • memory-graph.parseDoc (cyclomatic 19) web/lib/memory-graph.ts:126 — memory-graph.parseDoc has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · session-activity.buildSessionActivity (cyclomatic 19) · ×1
  • session-activity.buildSessionActivity (cyclomatic 19) web/lib/session-activity.ts:73 — session-activity.buildSessionActivity has cyclomatic complexity 19 (threshold 15). Of this number, 10 points are the body's own statements and 9 belong to 4 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · QuestionPipeline._parse_plan (cyclomatic 18) · ×1
  • QuestionPipeline._parse_plan (cyclomatic 18) deeptutor/agents/question/pipeline.py:808 — QuestionPipeline._parse_plan has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · QuestionPipeline._build_llm_tool_schemas (cyclomatic 18) · ×1
  • QuestionPipeline._build_llm_tool_schemas (cyclomatic 18) deeptutor/agents/question/pipeline.py:1631 — QuestionPipeline._build_llm_tool_schemas has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ResearchPipeline._render_section_evidence (cyclomatic 18) · ×1
  • ResearchPipeline._render_section_evidence (cyclomatic 18) deeptutor/agents/research/pipeline.py:2008 — ResearchPipeline._render_section_evidence has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _BlockLoopHost._summarise_and_record (cyclomatic 18) · ×1
  • _BlockLoopHost._summarise_and_record (cyclomatic 18) deeptutor/agents/research/pipeline.py:2829 — _BlockLoopHost._summarise_and_record has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CitationManager._format_one_apa (cyclomatic 18) · ×1
  • CitationManager._format_one_apa (cyclomatic 18) deeptutor/agents/research/utils/citation_manager.py:641 — CitationManager._format_one_apa has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · auth._create_admin_user (cyclomatic 18) · ×1
  • auth._create_admin_user (cyclomatic 18) deeptutor/api/routers/auth.py:1723 — auth._create_admin_user has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SourceExplorer._collect_non_kb_chunks (cyclomatic 18) · ×1
  • SourceExplorer._collect_non_kb_chunks (cyclomatic 18) deeptutor/book/agents/source_explorer.py:581 — SourceExplorer._collect_non_kb_chunks has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · context.normalize_book_references (cyclomatic 18) · ×1
  • context.normalize_book_references (cyclomatic 18) deeptutor/book/context.py:42 — context.normalize_book_references has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · inputs._resolve_question_notebook (cyclomatic 18) · ×1
  • inputs._resolve_question_notebook (cyclomatic 18) deeptutor/book/inputs.py:232 — inputs._resolve_question_notebook has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ContextExplorer._call_llm (cyclomatic 18) · ×1
  • ContextExplorer._call_llm (cyclomatic 18) deeptutor/capabilities/explore_context/explorer.py:366 — ContextExplorer._call_llm has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · native.investigate_native (cyclomatic 18) · ×1
  • native.investigate_native (cyclomatic 18) deeptutor/capabilities/explore_context/native.py:19 — native.investigate_native has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · _AgentRelay.__call__ (cyclomatic 18) · ×1
  • _AgentRelay.__call__ (cyclomatic 18) deeptutor/capabilities/handoff/capability.py:425 — _AgentRelay.__call__ has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · grants.validate_grant (cyclomatic 18) · ×1
  • grants.validate_grant (cyclomatic 18) deeptutor/multi_user/grants.py:316 — grants.validate_grant has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · feishu._extract_interactive_content (cyclomatic 18) · ×1
  • feishu._extract_interactive_content (cyclomatic 18) deeptutor/partners/channels/feishu.py:108 — feishu._extract_interactive_content has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · feishu._extract_post_content (cyclomatic 18) · ×1
  • feishu._extract_post_content (cyclomatic 18) deeptutor/partners/channels/feishu.py:224 — feishu._extract_post_content has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TelegramChannel.send (cyclomatic 18) · ×1
  • TelegramChannel.send (cyclomatic 18) deeptutor/partners/channels/telegram.py:455 — TelegramChannel.send has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · lifecycle._manifest_from_wheel (cyclomatic 18) · ×1
  • lifecycle._manifest_from_wheel (cyclomatic 18) deeptutor/plugins/lifecycle.py:292 — lifecycle._manifest_from_wheel has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · Annotation.from_dict (cyclomatic 18) · ×1
  • Annotation.from_dict (cyclomatic 18) deeptutor/reading/models.py:415 — Annotation.from_dict has cyclomatic complexity 18 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · references.normalize_reading_references (cyclomatic 18) · ×1
  • references.normalize_reading_references (cyclomatic 18) deeptutor/reading/references.py:33 — references.normalize_reading_references has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · tool_dispatch.execute_tool_call (cyclomatic 18) · ×1
  • tool_dispatch.execute_tool_call (cyclomatic 18) deeptutor/runtime/agentic/tool_dispatch.py:666 — tool_dispatch.execute_tool_call has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CalendarStore.delete (cyclomatic 18) · ×1
  • CalendarStore.delete (cyclomatic 18) deeptutor/services/calendar/store.py:388 — CalendarStore.delete has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · CodexOAuthService._credentials_from_payload (cyclomatic 18) · ×1
  • CodexOAuthService._credentials_from_payload (cyclomatic 18) REDACTED:1081 — CodexOAuthService._credentials_from_payload has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · readiness.document_parser_rows (cyclomatic 18) · ×1
  • readiness.document_parser_rows (cyclomatic 18) deeptutor/services/config/readiness.py:417 — readiness.document_parser_rows has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · network.validate_mcp_url (cyclomatic 18) · ×1
  • network.validate_mcp_url (cyclomatic 18) deeptutor/services/mcp/network.py:75 — network.validate_mcp_url has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · document.parse (cyclomatic 18) · ×1
  • document.parse (cyclomatic 18) deeptutor/services/memory/document.py:105 — document.parse has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · evaluation.evaluate (cyclomatic 18) · ×1
  • evaluation.evaluate (cyclomatic 18) deeptutor/services/memory/evaluation.py:242 — evaluation.evaluate has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · adapters.read_book_entities (cyclomatic 18) · ×1
  • adapters.read_book_entities (cyclomatic 18) deeptutor/services/memory/snapshot/adapters.py:209 — adapters.read_book_entities has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · workspace.remove_asset (cyclomatic 18) · ×1
  • workspace.remove_asset (cyclomatic 18) deeptutor/services/partners/workspace.py:378 — workspace.remove_asset has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BochaProvider.search (cyclomatic 18) · ×1
  • BochaProvider.search (cyclomatic 18) deeptutor/services/search/providers/bocha.py:33 — BochaProvider.search has cyclomatic complexity 18 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · _turn_runtime_shared._format_question_bank_entry (cyclomatic 18) · ×1
  • _turn_runtime_shared._format_question_bank_entry (cyclomatic 18) deeptutor/services/session/_turn_runtime_shared.py:907 — _turn_runtime_shared._format_question_bank_entry has cyclomatic complexity 18 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · LegacyChatSessionMigrator._migrate_locked (cyclomatic 18) · ×1
  • LegacyChatSessionMigrator._migrate_locked (cyclomatic 18) deeptutor/services/session/legacy_migration.py:142 — LegacyChatSessionMigrator._migrate_locked has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · SQLiteSessionStore._begin_turn_sync (cyclomatic 18) · ×1
  • SQLiteSessionStore._begin_turn_sync (cyclomatic 18) deeptutor/services/session/sqlite_store.py:1460 — SQLiteSessionStore._begin_turn_sync has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MistralSTTAdapter.transcribe (cyclomatic 18) · ×1
  • MistralSTTAdapter.transcribe (cyclomatic 18) deeptutor/services/voice/adapters/mistral.py:94 — MistralSTTAdapter.transcribe has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · html_extractor.extract_page_language_and_alternates (cyclomatic 18) · ×1
  • html_extractor.extract_page_language_and_alternates (cyclomatic 18) deeptutor/services/web_source/html_extractor.py:584 — html_extractor.extract_page_language_and_alternates has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · WorkspaceCatalogMixin.update_workspace (cyclomatic 18) · ×1
  • WorkspaceCatalogMixin.update_workspace (cyclomatic 18) deeptutor/services/workspace/catalog.py:361 — WorkspaceCatalogMixin.update_workspace has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · dependencies._with_historical_references (cyclomatic 18) · ×1
  • dependencies._with_historical_references (cyclomatic 18) deeptutor/services/workspace/dependencies.py:319 — dependencies._with_historical_references has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · bibtex_converter._read_fields (cyclomatic 18) · ×1
  • bibtex_converter._read_fields (cyclomatic 18) deeptutor/utils/bibtex_converter.py:174 — bibtex_converter._read_fields has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · model-tool.modelTool (cyclomatic 18) · ×1
  • model-tool.modelTool (cyclomatic 18) packages/chat-engine/src/tools/model-tool.ts:13 — model-tool.modelTool has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ChatMarkdownNoteTab.ChatMarkdownNoteTab (cyclomatic 18) · ×1
  • ChatMarkdownNoteTab.ChatMarkdownNoteTab (cyclomatic 18) web/components/chat/home/ChatMarkdownNoteTab.tsx:11 — ChatMarkdownNoteTab.ChatMarkdownNoteTab has cyclomatic complexity 18 (threshold 15). Of this number, 10 points are the body's own statements and 8 belong to 2 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · CliAppsSection.Installed (cyclomatic 18) · ×1
  • CliAppsSection.Installed (cyclomatic 18) web/components/cli-apps/CliAppsSection.tsx:144 — CliAppsSection.Installed has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 6 of the 18 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 213, 162, 282). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · KnowledgeHome.KnowledgeHome (cyclomatic 18) · ×1
  • KnowledgeHome.KnowledgeHome (cyclomatic 18) web/components/knowledge/KnowledgeHome.tsx:97 — KnowledgeHome.KnowledgeHome has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 5 of the 18 points are its own statements and the rest belongs to 6 function items inside it that branch (renderProvider, a function literal at line 361, a function literal at line 271, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · PageIndexSettingsModal.PageIndexConfigForm (cyclomatic 18) · ×1
  • PageIndexSettingsModal.PageIndexConfigForm (cyclomatic 18) web/components/knowledge/PageIndexSettingsModal.tsx:28 — PageIndexSettingsModal.PageIndexConfigForm has cyclomatic complexity 18 (threshold 15). Of this number, 10 points are the body's own statements and 8 belong to 5 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · NotebookFavoriteContent.NotebookFavoriteContent (cyclomatic 18) · ×1
  • NotebookFavoriteContent.NotebookFavoriteContent (cyclomatic 18) web/components/notebook/NotebookFavoriteContent.tsx:26 — NotebookFavoriteContent.NotebookFavoriteContent has cyclomatic complexity 18 (threshold 15). Of this number, 14 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · NotebookSelector.NotebookSelector (cyclomatic 18) · ×1
  • NotebookSelector.NotebookSelector (cyclomatic 18) web/components/notebook/NotebookSelector.tsx:39 — NotebookSelector.NotebookSelector has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 7 of the 18 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 89, 166). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · GroupSidePanel.GroupSidePanel (cyclomatic 18) · ×1
  • GroupSidePanel.GroupSidePanel (cyclomatic 18) web/components/partners/group/GroupSidePanel.tsx:34 — GroupSidePanel.GroupSidePanel has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 6 of the 18 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 60, 127, 157, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · PartnerGroupChat.PartnerGroupChat (cyclomatic 18) · ×1
  • PartnerGroupChat.PartnerGroupChat (cyclomatic 18) web/components/partners/group/PartnerGroupChat.tsx:34 — PartnerGroupChat.PartnerGroupChat has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 4 of the 18 points are its own statements and the rest belongs to 10 function literals inside it that branch (lines 89, 99, 135, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · AddMaterialsDialog.AddMaterialsDialog (cyclomatic 18) · ×1
  • AddMaterialsDialog.AddMaterialsDialog (cyclomatic 18) web/components/reading/library/AddMaterialsDialog.tsx:69 — AddMaterialsDialog.AddMaterialsDialog has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (AddMaterialsDialog.AddMaterialsDialog::submit) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · TimeGrid.TimedBlock (cyclomatic 18) · ×1
  • TimeGrid.TimedBlock (cyclomatic 18) web/features/calendar/components/TimeGrid.tsx:687 — TimeGrid.TimedBlock has cyclomatic complexity 18 (threshold 15). Of this number, 16 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · recurrence.parseRule (cyclomatic 18) · ×1
  • recurrence.parseRule (cyclomatic 18) web/features/calendar/model/recurrence.ts:45 — recurrence.parseRule has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · recurrence.describeRule (cyclomatic 18) · ×1
  • recurrence.describeRule (cyclomatic 18) web/features/calendar/model/recurrence.ts:202 — recurrence.describeRule has cyclomatic complexity 18 (threshold 15). Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TracePresentation.ToolExchangeDetail (cyclomatic 18) · ×1
  • TracePresentation.ToolExchangeDetail (cyclomatic 18) web/features/chat/trace/TracePresentation.tsx:627 — TracePresentation.ToolExchangeDetail has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · TracePresentation.getResearchStageId (cyclomatic 18) · ×1
  • TracePresentation.getResearchStageId (cyclomatic 18) web/features/chat/trace/TracePresentation.tsx:1916 — TracePresentation.getResearchStageId has cyclomatic complexity 18 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · NoteTaskView.NoteTaskView (cyclomatic 18) · ×1
  • NoteTaskView.NoteTaskView (cyclomatic 18) web/features/notes/components/NoteTaskView.tsx:16 — NoteTaskView.NoteTaskView has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 6 of the 18 points are its own statements and the rest belongs to 10 function items inside it that branch (a function literal at line 37, a function literal at line 174, a function literal at line 30, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · useWorkspaceChatActions.useWorkspaceChatActions (cyclomatic 18) · ×1
  • useWorkspaceChatActions.useWorkspaceChatActions (cyclomatic 18) web/hooks/useWorkspaceChatActions.ts:20 — useWorkspaceChatActions.useWorkspaceChatActions has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 6 of the 18 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 60, 95, 51, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · message-branches.buildVisiblePath (cyclomatic 18) · ×1
  • message-branches.buildVisiblePath (cyclomatic 18) web/lib/message-branches.ts:137 — message-branches.buildVisiblePath has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · latex.convertFlowFenceToMermaid (cyclomatic 18) · ×1
  • latex.convertFlowFenceToMermaid (cyclomatic 18) web/lib/latex.ts:239 — latex.convertFlowFenceToMermaid has cyclomatic complexity 18 (threshold 15). Of this number, 12 points are the body's own statements and 6 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BaseAgent.call_llm (cyclomatic 17) · ×1
  • BaseAgent.call_llm (cyclomatic 17) deeptutor/agents/base_agent.py:349 — BaseAgent.call_llm has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · BaseAgent.stream_llm (cyclomatic 17) · ×1
  • BaseAgent.stream_llm (cyclomatic 17) deeptutor/agents/base_agent.py:519 — BaseAgent.stream_llm has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · native_tools.tool_runtime (cyclomatic 17) · ×1
  • native_tools.tool_runtime (cyclomatic 17) deeptutor/agents/loop/native_tools.py:11 — native_tools.tool_runtime has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AgenticLoopPipeline.run (cyclomatic 17) · ×1
  • AgenticLoopPipeline.run (cyclomatic 17) deeptutor/agents/loop/pipeline.py:397 — AgenticLoopPipeline.run has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · QuestionPipeline.__init__ (cyclomatic 17) · ×1
  • QuestionPipeline.__init__ (cyclomatic 17) deeptutor/agents/question/pipeline.py:372 — QuestionPipeline.__init__ has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · CitationManager._extract_web_citation (cyclomatic 17) · ×1
  • CitationManager._extract_web_citation (cyclomatic 17) deeptutor/agents/research/utils/citation_manager.py:385 — CitationManager._extract_web_citation has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · VisualizeCapability.run (cyclomatic 17) · ×1
  • VisualizeCapability.run (cyclomatic 17) deeptutor/agents/visualize/capability.py:92 — VisualizeCapability.run has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · auth.complete_session_handoff (cyclomatic 17) · ×1
  • auth.complete_session_handoff (cyclomatic 17) deeptutor/api/routers/auth.py:1115 — auth.complete_session_handoff has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · co_writer._run_react_edit (cyclomatic 17) · ×1
  • co_writer._run_react_edit (cyclomatic 17) deeptutor/api/routers/co_writer.py:331 — co_writer._run_react_edit has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · knowledge.run_upload_processing_task (cyclomatic 17) · ×1
  • knowledge.run_upload_processing_task (cyclomatic 17) deeptutor/api/routers/knowledge.py:1121 — knowledge.run_upload_processing_task has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · knowledge.connect_lightrag_server_route (cyclomatic 17) · ×1
  • knowledge.connect_lightrag_server_route (cyclomatic 17) deeptutor/api/routers/knowledge.py:2382 — knowledge.connect_lightrag_server_route has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · sessions._normalize_legacy_watching_session (cyclomatic 17) · ×1
  • sessions._normalize_legacy_watching_session (cyclomatic 17) deeptutor/api/routers/sessions.py:175 — sessions._normalize_legacy_watching_session has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · tool_options.build_tool_options (cyclomatic 17) · ×1
  • tool_options.build_tool_options (cyclomatic 17) deeptutor/api/utils/tool_options.py:27 — tool_options.build_tool_options has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · spine_synthesizer._topological_sort (cyclomatic 17) · ×1
  • spine_synthesizer._topological_sort (cyclomatic 17) deeptutor/book/agents/spine_synthesizer.py:689 — spine_synthesizer._topological_sort has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FlashCardsGenerator._generate (cyclomatic 17) · ×1
  • FlashCardsGenerator._generate (cyclomatic 17) deeptutor/book/blocks/flash_cards.py:22 — FlashCardsGenerator._generate has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · inputs.build_book_inputs (cyclomatic 17) · ×1
  • inputs.build_book_inputs (cyclomatic 17) deeptutor/book/inputs.py:315 — inputs.build_book_inputs has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MasteryLoopCapability._grade_seed (cyclomatic 17) · ×1
  • MasteryLoopCapability._grade_seed (cyclomatic 17) deeptutor/capabilities/mastery/loop.py:522 — MasteryLoopCapability._grade_seed has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · MasteryLoopPipeline.prepare_model_request (cyclomatic 17) · ×1
  • MasteryLoopPipeline.prepare_model_request (cyclomatic 17) deeptutor/capabilities/mastery/pipeline.py:79 — MasteryLoopPipeline.prepare_model_request has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · MasteryStatusTool.execute (cyclomatic 17) · ×1
  • MasteryStatusTool.execute (cyclomatic 17) deeptutor/capabilities/mastery/tools.py:795 — MasteryStatusTool.execute has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · IndexingRun._start (cyclomatic 17) · ×1
  • IndexingRun._start (cyclomatic 17) deeptutor/knowledge/indexing_run.py:179 — IndexingRun._start has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · EmailChannel._extract_text_body (cyclomatic 17) · ×1
  • EmailChannel._extract_text_body (cyclomatic 17) deeptutor/partners/channels/email.py:419 — EmailChannel._extract_text_body has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · NapcatChannel._parse_segments (cyclomatic 17) · ×1
  • NapcatChannel._parse_segments (cyclomatic 17) deeptutor/partners/channels/napcat.py:320 — NapcatChannel._parse_segments has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · registry._validate_state (cyclomatic 17) · ×1
  • registry._validate_state (cyclomatic 17) deeptutor/plugins/registry.py:487 — registry._validate_state has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · extract.split_markdown_by_headings (cyclomatic 17) · ×1
  • extract.split_markdown_by_headings (cyclomatic 17) deeptutor/reading/extract.py:441 — extract.split_markdown_by_headings has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · launcher._port_listeners_windows (cyclomatic 17) · ×1
  • launcher._port_listeners_windows (cyclomatic 17) deeptutor/runtime/launcher.py:502 — launcher._port_listeners_windows has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · catalog._parse (cyclomatic 17) · ×1
  • catalog._parse (cyclomatic 17) deeptutor/services/cli_apps/catalog.py:154 — catalog._parse has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · provider_runtime.resolve_stt_runtime_config (cyclomatic 17) · ×1
  • provider_runtime.resolve_stt_runtime_config (cyclomatic 17) deeptutor/services/config/provider_runtime.py:1352 — provider_runtime.resolve_stt_runtime_config has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This shape REPEATS in the file: one other method here (provider_runtime.resolve_imagegen_runtime_config) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · provider_runtime.resolve_imagegen_runtime_config (cyclomatic 17) · ×1
  • provider_runtime.resolve_imagegen_runtime_config (cyclomatic 17) deeptutor/services/config/provider_runtime.py:1388 — provider_runtime.resolve_imagegen_runtime_config has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This shape REPEATS in the file: one other method here (provider_runtime.resolve_stt_runtime_config) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · readiness.coordination_rows (cyclomatic 17) · ×1
  • readiness.coordination_rows (cyclomatic 17) deeptutor/services/config/readiness.py:698 — readiness.coordination_rows has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · OllamaEmbeddingAdapter.embed (cyclomatic 17) · ×1
  • OllamaEmbeddingAdapter.embed (cyclomatic 17) deeptutor/services/embedding/adapters/ollama.py:38 — OllamaEmbeddingAdapter.embed has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · OpenAISDKEmbeddingAdapter.embed (cyclomatic 17) · ×1
  • OpenAISDKEmbeddingAdapter.embed (cyclomatic 17) deeptutor/services/embedding/adapters/openai_sdk.py:60 — OpenAISDKEmbeddingAdapter.embed has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · sync.sync_source (cyclomatic 17) · ×1
  • sync.sync_source (cyclomatic 17) deeptutor/services/github_source/sync.py:168 — sync.sync_source has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · OpenAICompatProvider.chat (cyclomatic 17) · ×1
  • OpenAICompatProvider.chat (cyclomatic 17) deeptutor/services/llm/provider_core/openai_compat_provider.py:1043 — OpenAICompatProvider.chat has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · sdk_bridge._assistant_tool_calls (cyclomatic 17) · ×1
  • sdk_bridge._assistant_tool_calls (cyclomatic 17) deeptutor/services/llm/provider_core/sdk_bridge.py:86 — sdk_bridge._assistant_tool_calls has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ParseService._parse (cyclomatic 17) · ×1
  • ParseService._parse (cyclomatic 17) deeptutor/services/parsing/service.py:132 — ParseService._parse has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · provider.resolve_persisted_completion_provider (cyclomatic 17) · ×1
  • provider.resolve_persisted_completion_provider (cyclomatic 17) deeptutor/services/rag/pipelines/graphrag/provider.py:84 — provider.resolve_persisted_completion_provider has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · ingress.load_verified_bundle (cyclomatic 17) · ×1
  • ingress.load_verified_bundle (cyclomatic 17) deeptutor/services/rag/pipelines/lightrag/ingress.py:304 — ingress.load_verified_bundle has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · source_filter._web_risk_rejections (cyclomatic 17) · ×1
  • source_filter._web_risk_rejections (cyclomatic 17) REDACTED:282 — source_filter._web_risk_rejections has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _turn_runtime_shared._extract_selection_tutor_context (cyclomatic 17) · ×1
  • _turn_runtime_shared._extract_selection_tutor_context (cyclomatic 17) deeptutor/services/session/_turn_runtime_shared.py:1451 — _turn_runtime_shared._extract_selection_tutor_context has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · TurnLifecycle._publish_live_event (cyclomatic 17) · ×1
  • TurnLifecycle._publish_live_event (cyclomatic 17) deeptutor/services/session/turns/lifecycle.py:681 — TurnLifecycle._publish_live_event has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · usage_recovery.recover_summary (cyclomatic 17) · ×1
  • usage_recovery.recover_summary (cyclomatic 17) deeptutor/services/session/usage_recovery.py:44 — usage_recovery.recover_summary has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · provider_edit.merge_provider_edit (cyclomatic 17) · ×1
  • provider_edit.merge_provider_edit (cyclomatic 17) deeptutor/services/settings/provider_edit.py:9 — provider_edit.merge_provider_edit has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · provider_probe.probe_search_provider (cyclomatic 17) · ×1
  • provider_probe.probe_search_provider (cyclomatic 17) deeptutor/services/settings/provider_probe.py:144 — provider_probe.probe_search_provider has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · hub.preflight_skill_dir (cyclomatic 17) · ×1
  • hub.preflight_skill_dir (cyclomatic 17) deeptutor/services/skill/hub.py:833 — hub.preflight_skill_dir has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · crawler.crawl_and_diff (cyclomatic 17) · ×1
  • crawler.crawl_and_diff (cyclomatic 17) deeptutor/services/web_source/crawler.py:563 — crawler.crawl_and_diff has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · migration.migrate_locations (cyclomatic 17) · ×1
  • migration.migrate_locations (cyclomatic 17) deeptutor/services/workspace/migration.py:35 — migration.migrate_locations has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ContentWorkspaceService.search_page (cyclomatic 17) · ×1
  • ContentWorkspaceService.search_page (cyclomatic 17) deeptutor/services/workspace/service.py:554 — ContentWorkspaceService.search_page has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ListDirTool.execute (cyclomatic 17) · ×1
  • ListDirTool.execute (cyclomatic 17) deeptutor/tools/file_tools.py:230 — ListDirTool.execute has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · WorkspaceExportTool.execute (cyclomatic 17) · ×1
  • WorkspaceExportTool.execute (cyclomatic 17) deeptutor/tools/workspace.py:256 — WorkspaceExportTool.execute has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · write_note.write_note (cyclomatic 17) · ×1
  • write_note.write_note (cyclomatic 17) deeptutor/tools/write_note.py:61 — write_note.write_note has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · archive_extractor.safe_extract_zip (cyclomatic 17) · ×1
  • archive_extractor.safe_extract_zip (cyclomatic 17) deeptutor/utils/archive_extractor.py:86 — archive_extractor.safe_extract_zip has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · document_extractor.normalize_epub_archive (cyclomatic 17) · ×1
  • document_extractor.normalize_epub_archive (cyclomatic 17) deeptutor/utils/document_extractor.py:983 — document_extractor.normalize_epub_archive has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · json_parser.parse_json_response (cyclomatic 17) · ×1
  • json_parser.parse_json_response (cyclomatic 17) deeptutor/utils/json_parser.py:66 — json_parser.parse_json_response has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SubmitVisualizationTool.execute (cyclomatic 17) · ×1
  • SubmitVisualizationTool.execute (cyclomatic 17) deeptutor/visualizers/tool.py:64 — SubmitVisualizationTool.execute has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · init_cmd._llm_step (cyclomatic 17) · ×1
  • init_cmd._llm_step (cyclomatic 17) deeptutor_cli/init_cmd.py:69 — init_cmd._llm_step has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · init_cmd._search_step (cyclomatic 17) · ×1
  • init_cmd._search_step (cyclomatic 17) deeptutor_cli/init_cmd.py:382 — init_cmd._search_step has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DiscordHistoryExporter.export (cyclomatic 17) · ×1
  • DiscordHistoryExporter.export (cyclomatic 17) scripts/export_discord_history.py:454 — DiscordHistoryExporter.export has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · types.validateProvider (cyclomatic 17) · ×1
  • types.validateProvider (cyclomatic 17) packages/chat-engine/src/native/types.ts:129 — types.validateProvider has cyclomatic complexity 17 (threshold 15). Of this number, 15 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · ask-user-draft.partialJson · ×1
  • ask-user-draft.partialJson::value (cyclomatic 17) packages/chat-engine/src/tools/ask-user-draft.ts:28 — ask-user-draft.partialJson::value has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LearningCapturePanel.LearningCapturePanel (cyclomatic 17) · ×1
  • LearningCapturePanel.LearningCapturePanel (cyclomatic 17) web/app/(workspace)/learning/books/components/LearningCapturePanel.tsx:53 — LearningCapturePanel.LearningCapturePanel has cyclomatic complexity 17 (threshold 15). Of this number, 14 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SideChatResponderMenu.SideChatResponderMenu (cyclomatic 17) · ×1
  • SideChatResponderMenu.SideChatResponderMenu (cyclomatic 17) web/components/chat/home/SideChatResponderMenu.tsx:30 — SideChatResponderMenu.SideChatResponderMenu has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 7 of the 17 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 79, 80, 84, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · DocxPreview.DocxPreview (cyclomatic 17) · ×1
  • DocxPreview.DocxPreview (cyclomatic 17) web/components/chat/preview/previewers/DocxPreview.tsx:41 — DocxPreview.DocxPreview has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 3 of the 17 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 75, 49, 62, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · OfficePdfPreview.OfficePdfPreview (cyclomatic 17) · ×1
  • OfficePdfPreview.OfficePdfPreview (cyclomatic 17) web/components/chat/preview/previewers/OfficePdfPreview.tsx:23 — OfficePdfPreview.OfficePdfPreview has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 4 of the 17 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 43, 94). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · InlineFileCard.makeFileLinkRemarkPlugin · ×1
  • InlineFileCard.makeFileLinkRemarkPlugin::visit (cyclomatic 17) web/components/common/InlineFileCard.tsx:313 — InlineFileCard.makeFileLinkRemarkPlugin::visit has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · KbVisualCoverage.KbVisualCoverage (cyclomatic 17) · ×1
  • KbVisualCoverage.KbVisualCoverage (cyclomatic 17) web/components/knowledge/KbVisualCoverage.tsx:16 — KbVisualCoverage.KbVisualCoverage has cyclomatic complexity 17 (threshold 15). Of this number, 11 points are the body's own statements and 6 belong to 5 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · KbStatusBadge.KbStatusBadge (cyclomatic 17) · ×1
  • KbStatusBadge.KbStatusBadge (cyclomatic 17) web/components/knowledge/KbStatusBadge.tsx:18 — KbStatusBadge.KbStatusBadge has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · NewLearningPage.NewLearningPage (cyclomatic 17) · ×1
  • NewLearningPage.NewLearningPage (cyclomatic 17) web/components/learning/NewLearningPage.tsx:20 — NewLearningPage.NewLearningPage has cyclomatic complexity 17 (threshold 15). Of this number, 10 points are the body's own statements and 7 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ReviewHome.ReviewHome (cyclomatic 17) · ×1
  • ReviewHome.ReviewHome (cyclomatic 17) web/components/learning/practice/ReviewHome.tsx:19 — ReviewHome.ReviewHome has cyclomatic complexity 17 (threshold 15). Of this number, 9 points are the body's own statements and 8 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FaceEditor.FaceEditor (cyclomatic 17) · ×1
  • FaceEditor.FaceEditor (cyclomatic 17) web/components/partners/FaceEditor.tsx:91 — FaceEditor.FaceEditor has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 6 of the 17 points are its own statements and the rest belongs to 5 function items inside it that branch (handleFile, a function literal at line 138, a function literal at line 144, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · ReadingLibrary.ReadingLibraryPage (cyclomatic 17) · ×1
  • ReadingLibrary.ReadingLibraryPage (cyclomatic 17) web/components/reading/library/ReadingLibrary.tsx:50 — ReadingLibrary.ReadingLibraryPage has cyclomatic complexity 17 (threshold 15). Of this number, 9 points are the body's own statements and 8 belong to 6 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · useLearningMode.useReadingLearningMode (cyclomatic 17) · ×1
  • useLearningMode.useReadingLearningMode (cyclomatic 17) web/components/reading/workspace/useLearningMode.ts:40 — useLearningMode.useReadingLearningMode has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 1 of the 17 points is its own statement and the rest belongs to 7 function literals inside it that branch (lines 110, 88, 104, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · ModelsWorkspace.AddModelPanel (cyclomatic 17) · ×1
  • ModelsWorkspace.AddModelPanel (cyclomatic 17) web/components/settings/ModelsWorkspace.tsx:580 — ModelsWorkspace.AddModelPanel has cyclomatic complexity 17 (threshold 15). Of this number, 13 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · LearningJournalPanel.LearningJournalPanel (cyclomatic 17) · ×1
  • LearningJournalPanel.LearningJournalPanel (cyclomatic 17) web/components/space/LearningJournalPanel.tsx:9 — LearningJournalPanel.LearningJournalPanel has cyclomatic complexity 17 (threshold 15). Of this number, 14 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · McpStoreSection.McpStoreSection (cyclomatic 17) · ×1
  • McpStoreSection.McpStoreSection (cyclomatic 17) web/components/space/McpStoreSection.tsx:28 — McpStoreSection.McpStoreSection has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · CreateTopicWizard.CreateTopicWizard (cyclomatic 17) · ×1
  • CreateTopicWizard.CreateTopicWizard (cyclomatic 17) web/components/space/learning/CreateTopicWizard.tsx:45 — CreateTopicWizard.CreateTopicWizard has cyclomatic complexity 17 (threshold 15). Of this number, 9 points are the body's own statements and 8 belong to 3 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · VisualizationViewer.VisualizationViewer (cyclomatic 17) · ×1
  • VisualizationViewer.VisualizationViewer (cyclomatic 17) REDACTED:511 — VisualizationViewer.VisualizationViewer has cyclomatic complexity 17 (threshold 15). Of this number, 14 points are the body's own statements and 3 belong to 3 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · WhisperMessageList.WhisperMessageList (cyclomatic 17) · ×1
  • WhisperMessageList.WhisperMessageList (cyclomatic 17) web/components/whisper/WhisperMessageList.tsx:40 — WhisperMessageList.WhisperMessageList has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 3 of the 17 points are its own statements and the rest belongs to one function literal inside it that branches (line 87). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · model.validatePrimitive (cyclomatic 17) · ×1
  • model.validatePrimitive (cyclomatic 17) web/features/capabilities/model.ts:85 — model.validatePrimitive has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · blocks.inlineText (cyclomatic 17) · ×1
  • blocks.inlineText (cyclomatic 17) web/features/notes/model/blocks.ts:3 — blocks.inlineText has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 3 of the 17 points are its own statements and the rest belongs to one function literal inside it that branches (line 7). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · concept-map.noteConceptMap (cyclomatic 17) · ×1
  • concept-map.noteConceptMap (cyclomatic 17) web/features/notes/model/concept-map.ts:2 — concept-map.noteConceptMap has cyclomatic complexity 17 (threshold 15). Of this number, 14 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · NoteResult.NoteResult (cyclomatic 17) · ×1
  • NoteResult.NoteResult (cyclomatic 17) web/features/notes/components/NoteResult.tsx:10 — NoteResult.NoteResult has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 7 of the 17 points are its own statements and the rest belongs to one function literal inside it that branches (line 33). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · AddToNote.AddToNote (cyclomatic 17) · ×1
  • AddToNote.AddToNote (cyclomatic 17) web/features/notes/components/AddToNote.tsx:16 — AddToNote.AddToNote has cyclomatic complexity 17 (threshold 15). Of this number, 9 points are the body's own statements and 8 belong to 2 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · results.resultLearningBlock (cyclomatic 17) · ×1
  • results.resultLearningBlock (cyclomatic 17) web/features/notes/model/results.ts:3 — results.resultLearningBlock has cyclomatic complexity 17 (threshold 15). Of this number, 14 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · chat-resend.decideFailedTurnReplay (cyclomatic 17) · ×1
  • chat-resend.decideFailedTurnReplay (cyclomatic 17) web/lib/chat-resend.ts:73 — chat-resend.decideFailedTurnReplay has cyclomatic complexity 17 (threshold 15). Of this number, 15 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · provider-registry.providerServiceSupport (cyclomatic 17) · ×1
  • provider-registry.providerServiceSupport (cyclomatic 17) web/lib/provider-registry.ts:167 — provider-registry.providerServiceSupport has cyclomatic complexity 17 (threshold 15). Of this number, 15 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · validateConfig (cyclomatic 17) · ×1
  • validateConfig (cyclomatic 17) apps/desktop/src/config.mjs:22 — validateConfig has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · tool_runtime.bind_workspace_tool_runtime (cyclomatic 16) · ×1
  • tool_runtime.bind_workspace_tool_runtime (cyclomatic 16) deeptutor/agents/_shared/tool_runtime.py:44 — tool_runtime.bind_workspace_tool_runtime has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DeepQuestionCapability._run_mimic_mode (cyclomatic 16) · ×1
  • DeepQuestionCapability._run_mimic_mode (cyclomatic 16) deeptutor/agents/question/capability.py:176 — DeepQuestionCapability._run_mimic_mode has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · knowledge._assert_provider_ready (cyclomatic 16) · ×1
  • knowledge._assert_provider_ready (cyclomatic 16) deeptutor/api/routers/knowledge.py:752 — knowledge._assert_provider_ready has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · multi_user._admin_catalog_summary (cyclomatic 16) · ×1
  • multi_user._admin_catalog_summary (cyclomatic 16) deeptutor/api/routers/multi_user.py:150 — multi_user._admin_catalog_summary has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · partners._request_partner_control (cyclomatic 16) · ×1
  • partners._request_partner_control (cyclomatic 16) deeptutor/api/routers/partners.py:137 — partners._request_partner_control has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · question_notebook.upsert_single_entry (cyclomatic 16) · ×1
  • question_notebook.upsert_single_entry (cyclomatic 16) deeptutor/api/routers/question_notebook.py:276 — question_notebook.upsert_single_entry has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · quiz_judge._build_multimodal_user_content (cyclomatic 16) · ×1
  • quiz_judge._build_multimodal_user_content (cyclomatic 16) deeptutor/api/routers/quiz_judge.py:240 — quiz_judge._build_multimodal_user_content has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · TurnApplicationService.replace_submission (cyclomatic 16) · ×1
  • TurnApplicationService.replace_submission (cyclomatic 16) deeptutor/app/service.py:34 — TurnApplicationService.replace_submission has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SpineAgent._coerce_chapters (cyclomatic 16) · ×1
  • SpineAgent._coerce_chapters (cyclomatic 16) deeptutor/book/agents/spine_agent.py:114 — SpineAgent._coerce_chapters has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · base._classify_failure (cyclomatic 16) · ×1
  • base._classify_failure (cyclomatic 16) deeptutor/book/blocks/base.py:38 — base._classify_failure has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · CodeGenerator._generate (cyclomatic 16) · ×1
  • CodeGenerator._generate (cyclomatic 16) deeptutor/book/blocks/code.py:64 — CodeGenerator._generate has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · context._serialize_page (cyclomatic 16) · ×1
  • context._serialize_page (cyclomatic 16) deeptutor/book/context.py:145 — context._serialize_page has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · BookEngine._worker_loop_active (cyclomatic 16) · ×1
  • BookEngine._worker_loop_active (cyclomatic 16) deeptutor/book/engine.py:1431 — BookEngine._worker_loop_active has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AudioOverviewPipeline.publish (cyclomatic 16) · ×1
  • AudioOverviewPipeline.publish (cyclomatic 16) deeptutor/capabilities/audio_overview/pipeline.py:399 — AudioOverviewPipeline.publish has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ContextExplorer._run_loop (cyclomatic 16) · ×1
  • ContextExplorer._run_loop (cyclomatic 16) deeptutor/capabilities/explore_context/explorer.py:221 — ContextExplorer._run_loop has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PartnerGroupCapability.tool_round_output_policy (cyclomatic 16) · ×1
  • PartnerGroupCapability.tool_round_output_policy (cyclomatic 16) deeptutor/capabilities/partner_group/capability.py:122 — PartnerGroupCapability.tool_round_output_policy has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · KnowledgeBaseManager._list_knowledge_bases (cyclomatic 16) · ×1
  • KnowledgeBaseManager._list_knowledge_bases (cyclomatic 16) deeptutor/knowledge/manager.py:658 — KnowledgeBaseManager._list_knowledge_bases has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · lesson_evidence._selection_excerpt (cyclomatic 16) · ×1
  • lesson_evidence._selection_excerpt (cyclomatic 16) deeptutor/learning/lesson_evidence.py:41 — lesson_evidence._selection_excerpt has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · lesson_evidence.validate_evidence (cyclomatic 16) · ×1
  • lesson_evidence.validate_evidence (cyclomatic 16) deeptutor/learning/lesson_evidence.py:351 — lesson_evidence.validate_evidence has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · lesson_evidence._repair_page (cyclomatic 16) · ×1
  • lesson_evidence._repair_page (cyclomatic 16) deeptutor/learning/lesson_evidence.py:513 — lesson_evidence._repair_page has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · models._validate_review_intervals (cyclomatic 16) · ×1
  • models._validate_review_intervals (cyclomatic 16) deeptutor/learning/models.py:249 — models._validate_review_intervals has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LearningService.record_qualitative_in_memory (cyclomatic 16) · ×1
  • LearningService.record_qualitative_in_memory (cyclomatic 16) deeptutor/learning/service.py:2898 — LearningService.record_qualitative_in_memory has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · service.assign_objective_identities (cyclomatic 16) · ×1
  • service.assign_objective_identities (cyclomatic 16) deeptutor/learning/service.py:240 — service.assign_objective_identities has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · guardians._canonical_record (cyclomatic 16) · ×1
  • guardians._canonical_record (cyclomatic 16) deeptutor/multi_user/guardians.py:29 — guardians._canonical_record has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · threads.thread_anchor_context (cyclomatic 16) · ×1
  • threads.thread_anchor_context (cyclomatic 16) deeptutor/notes/threads.py:135 — threads.thread_anchor_context has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ChannelManager._dispatch_outbound (cyclomatic 16) · ×1
  • ChannelManager._dispatch_outbound (cyclomatic 16) deeptutor/partners/channels/manager.py:415 — ChannelManager._dispatch_outbound has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MSTeamsChannel._prune_conversation_refs (cyclomatic 16) · ×1
  • MSTeamsChannel._prune_conversation_refs (cyclomatic 16) deeptutor/partners/channels/msteams.py:699 — MSTeamsChannel._prune_conversation_refs has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · NapcatChannel._on_message (cyclomatic 16) · ×1
  • NapcatChannel._on_message (cyclomatic 16) deeptutor/partners/channels/napcat.py:247 — NapcatChannel._on_message has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · loader._coerce_manifest (cyclomatic 16) · ×1
  • loader._coerce_manifest (cyclomatic 16) deeptutor/plugins/loader.py:63 — loader._coerce_manifest has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PluginRegistry._managed_records (cyclomatic 16) · ×1
  • PluginRegistry._managed_records (cyclomatic 16) deeptutor/plugins/registry.py:372 — PluginRegistry._managed_records has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _ProviderOpenAIAdapter._create_completion (cyclomatic 16) · ×1
  • _ProviderOpenAIAdapter._create_completion (cyclomatic 16) deeptutor/runtime/agentic/client.py:430 — _ProviderOpenAIAdapter._create_completion has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · client._build_openai_client (cyclomatic 16) · ×1
  • client._build_openai_client (cyclomatic 16) deeptutor/runtime/agentic/client.py:136 — client._build_openai_client has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · deferred_tools.render_deferred_tools_manifest (cyclomatic 16) · ×1
  • deferred_tools.render_deferred_tools_manifest (cyclomatic 16) deeptutor/runtime/registry/deferred_tools.py:57 — deferred_tools.render_deferred_tools_manifest has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · EngineClient.run_native (cyclomatic 16) · ×1
  • EngineClient.run_native (cyclomatic 16) deeptutor/runtime/ts_engine/client.py:179 — EngineClient.run_native has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · auth.decode_token (cyclomatic 16) · ×1
  • auth.decode_token (cyclomatic 16) deeptutor/services/auth.py:286 — auth.decode_token has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · chat_hints._sanitize (cyclomatic 16) · ×1
  • chat_hints._sanitize (cyclomatic 16) deeptutor/services/chat_hints.py:206 — chat_hints._sanitize has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · codebuddy_credentials.probe_account (cyclomatic 16) · ×1
  • codebuddy_credentials.probe_account (cyclomatic 16) deeptutor/services/codebuddy_credentials.py:317 — codebuddy_credentials.probe_account has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · provider_runtime.resolve_videogen_runtime_config (cyclomatic 16) · ×1
  • provider_runtime.resolve_videogen_runtime_config (cyclomatic 16) deeptutor/services/config/provider_runtime.py:1429 — provider_runtime.resolve_videogen_runtime_config has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · JinaEmbeddingAdapter.embed (cyclomatic 16) · ×1
  • JinaEmbeddingAdapter.embed (cyclomatic 16) deeptutor/services/embedding/adapters/jina.py:66 — JinaEmbeddingAdapter.embed has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · OpenAICompatProvider.__init__ (cyclomatic 16) · ×1
  • OpenAICompatProvider.__init__ (cyclomatic 16) deeptutor/services/llm/provider_core/openai_compat_provider.py:195 — OpenAICompatProvider.__init__ has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · OpenAICompatProvider._sanitize_messages (cyclomatic 16) · ×1
  • OpenAICompatProvider._sanitize_messages (cyclomatic 16) deeptutor/services/llm/provider_core/openai_compat_provider.py:400 — OpenAICompatProvider._sanitize_messages has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · utils.extract_response_content (cyclomatic 16) · ×1
  • utils.extract_response_content (cyclomatic 16) deeptutor/services/llm/utils.py:267 — utils.extract_response_content has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · mastery_hints._render (cyclomatic 16) · ×1
  • mastery_hints._render (cyclomatic 16) deeptutor/services/mastery_hints.py:238 — mastery_hints._render has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MCPConnectionManager.call_tool (cyclomatic 16) · ×1
  • MCPConnectionManager.call_tool (cyclomatic 16) deeptutor/services/mcp/manager.py:423 — MCPConnectionManager.call_tool has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · line_doc._apply_insert (cyclomatic 16) · ×1
  • line_doc._apply_insert (cyclomatic 16) deeptutor/services/memory/consolidator/line_doc.py:260 — line_doc._apply_insert has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · PartnerGroupManager.approve_invocation (cyclomatic 16) · ×1
  • PartnerGroupManager.approve_invocation (cyclomatic 16) deeptutor/services/partner_groups/manager.py:631 — PartnerGroupManager.approve_invocation has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · PartnerCommandHandler.dispatch (cyclomatic 16) · ×1
  • PartnerCommandHandler.dispatch (cyclomatic 16) deeptutor/services/partners/commands.py:91 — PartnerCommandHandler.dispatch has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · workspace.list_assets (cyclomatic 16) · ×1
  • workspace.list_assets (cyclomatic 16) deeptutor/services/partners/workspace.py:332 — workspace.list_assets has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · factory._build_pipeline (cyclomatic 16) · ×1
  • factory._build_pipeline (cyclomatic 16) deeptutor/services/rag/factory.py:136 — factory._build_pipeline has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · exercise_lookup._parse_for (cyclomatic 16) · ×1
  • exercise_lookup._parse_for (cyclomatic 16) deeptutor/services/rag/pipelines/llamaindex/exercise_lookup.py:242 — exercise_lookup._parse_for has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · tools.pageindex_sources_from_text (cyclomatic 16) · ×1
  • tools.pageindex_sources_from_text (cyclomatic 16) deeptutor/services/rag/pipelines/pageindex/tools.py:23 — tools.pageindex_sources_from_text has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · VisualAssetStore.publish (cyclomatic 16) · ×1
  • VisualAssetStore.publish (cyclomatic 16) deeptutor/services/rag/visual_assets.py:288 — VisualAssetStore.publish has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · visual_coverage.coverage_overview (cyclomatic 16) · ×1
  • visual_coverage.coverage_overview (cyclomatic 16) deeptutor/services/rag/visual_coverage.py:104 — visual_coverage.coverage_overview has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · JinaProvider.search (cyclomatic 16) · ×1
  • JinaProvider.search (cyclomatic 16) deeptutor/services/search/providers/jina.py:37 — JinaProvider.search has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · _turn_runtime_shared._repair_chinese_emphasis_line (cyclomatic 16) · ×1
  • _turn_runtime_shared._repair_chinese_emphasis_line (cyclomatic 16) deeptutor/services/session/_turn_runtime_shared.py:195 — _turn_runtime_shared._repair_chinese_emphasis_line has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · source_inventory.collect_prior_image_attachments (cyclomatic 16) · ×1
  • source_inventory.collect_prior_image_attachments (cyclomatic 16) deeptutor/services/session/source_inventory.py:711 — source_inventory.collect_prior_image_attachments has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · SQLiteSessionStore._append_turn_events_sync (cyclomatic 16) · ×1
  • SQLiteSessionStore._append_turn_events_sync (cyclomatic 16) deeptutor/services/session/sqlite_store.py:1786 — SQLiteSessionStore._append_turn_events_sync has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ClawHubProvider.detail (cyclomatic 16) · ×1
  • ClawHubProvider.detail (cyclomatic 16) deeptutor/services/skill/hub.py:473 — ClawHubProvider.detail has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · AntigravityBackend._handle_event (cyclomatic 16) · ×1
  • AntigravityBackend._handle_event (cyclomatic 16) deeptutor/services/subagent/antigravity.py:242 — AntigravityBackend._handle_event has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · dashscope._tts_url (cyclomatic 16) · ×1
  • dashscope._tts_url (cyclomatic 16) deeptutor/services/voice/adapters/dashscope.py:67 — dashscope._tts_url has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · dashscope._tts_input (cyclomatic 16) · ×1
  • dashscope._tts_input (cyclomatic 16) deeptutor/services/voice/adapters/dashscope.py:108 — dashscope._tts_input has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · OpenRouterTTSAdapter._collect_audio_line (cyclomatic 16) · ×1
  • OpenRouterTTSAdapter._collect_audio_line (cyclomatic 16) deeptutor/services/voice/adapters/openai_compat.py:267 — OpenRouterTTSAdapter._collect_audio_line has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · robots.parse_robots_txt (cyclomatic 16) · ×1
  • robots.parse_robots_txt (cyclomatic 16) deeptutor/services/web_source/robots.py:70 — robots.parse_robots_txt has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ask_user.build_ask_user_preview (cyclomatic 16) · ×1
  • ask_user.build_ask_user_preview (cyclomatic 16) deeptutor/tools/ask_user.py:160 — ask_user.build_ask_user_preview has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ZoteroSearchToolWrapper.execute (cyclomatic 16) · ×1
  • ZoteroSearchToolWrapper.execute (cyclomatic 16) deeptutor/tools/builtin/__init__.py:858 — ZoteroSearchToolWrapper.execute has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ExecTool._render_result (cyclomatic 16) · ×1
  • ExecTool._render_result (cyclomatic 16) deeptutor/tools/exec_tool.py:301 — ExecTool._render_result has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · question_bank._list (cyclomatic 16) · ×1
  • question_bank._list (cyclomatic 16) deeptutor/tools/question_bank.py:184 — question_bank._list has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · coord_transform.suggest_coord_system (cyclomatic 16) · ×1
  • coord_transform.suggest_coord_system (cyclomatic 16) deeptutor/tools/vision/coord_transform.py:329 — coord_transform.suggest_coord_system has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · write_note._format_transcript (cyclomatic 16) · ×1
  • write_note._format_transcript (cyclomatic 16) deeptutor/tools/write_note.py:398 — write_note._format_transcript has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ZoteroSearchClient.search (cyclomatic 16) · ×1
  • ZoteroSearchClient.search (cyclomatic 16) deeptutor/tools/zotero_search.py:44 — ZoteroSearchClient.search has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · document_extractor._extract_docx (cyclomatic 16) · ×1
  • document_extractor._extract_docx (cyclomatic 16) deeptutor/utils/document_extractor.py:446 — document_extractor._extract_docx has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · WatchingToReadingMigration.migrate (cyclomatic 16) · ×1
  • WatchingToReadingMigration.migrate (cyclomatic 16) deeptutor/video_learning/reading_migration.py:81 — WatchingToReadingMigration.migrate has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · init_cmd.run_init (cyclomatic 16) · ×1
  • init_cmd.run_init (cyclomatic 16) deeptutor_cli/init_cmd.py:474 — init_cmd.run_init has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · ToolDispatcher.run (cyclomatic 16) · ×1
  • ToolDispatcher.run (cyclomatic 16) packages/chat-engine/src/tools/dispatcher.ts:40 — ToolDispatcher.run has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (ToolDispatcher.run::execute) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · ComposerTray.ComposerTray (cyclomatic 16) · ×1
  • ComposerTray.ComposerTray (cyclomatic 16) web/components/chat/home/ComposerTray.tsx:130 — ComposerTray.ComposerTray has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · SelectedResources.SelectedResources (cyclomatic 16) · ×1
  • SelectedResources.SelectedResources (cyclomatic 16) web/components/chat/home/SelectedResources.tsx:24 — SelectedResources.SelectedResources has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 7 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 40). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · SessionActivityPanel.useResolvedTitles (cyclomatic 16) · ×1
  • SessionActivityPanel.useResolvedTitles (cyclomatic 16) web/components/chat/home/SessionActivityPanel.tsx:65 — SessionActivityPanel.useResolvedTitles has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to 9 function literals inside it that branch (lines 77, 93, 109, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · AssistantResponse.AssistantResponseImpl (cyclomatic 16) · ×1
  • AssistantResponse.AssistantResponseImpl (cyclomatic 16) web/components/common/AssistantResponse.tsx:41 — AssistantResponse.AssistantResponseImpl has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 65, 123, 103). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · MemorySection.StreamPanel (cyclomatic 16) · ×1
  • MemorySection.StreamPanel (cyclomatic 16) web/components/memory/MemorySection.tsx:1466 — MemorySection.StreamPanel has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to one function literal inside it that branches (line 1481). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · useGroupSession.useGroupSession.rounds (cyclomatic 16) · ×1
  • useGroupSession.useGroupSession.rounds (cyclomatic 16) web/components/partners/group/useGroupSession.ts:333 — useGroupSession.useGroupSession.rounds has cyclomatic complexity 16 (threshold 15). Of this number, 9 points are the body's own statements and 7 belong to 5 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · AnnotationList.AnnotationList (cyclomatic 16) · ×1
  • AnnotationList.AnnotationList (cyclomatic 16) web/components/reading/AnnotationList.tsx:37 — AnnotationList.AnnotationList has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 4 of the 16 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 112, 118, 49, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · ReadingExtensionBar.QuizQuestions (cyclomatic 16) · ×1
  • ReadingExtensionBar.QuizQuestions (cyclomatic 16) web/components/reading/ReadingExtensionBar.tsx:465 — ReadingExtensionBar.QuizQuestions has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to 2 function items inside it that branch (persistAnswer, a function literal at line 514). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · useReadingPanelLayout.useReadingPanelLayout (cyclomatic 16) · ×1
  • useReadingPanelLayout.useReadingPanelLayout (cyclomatic 16) web/components/reading/workspace/useReadingPanelLayout.ts:49 — useReadingPanelLayout.useReadingPanelLayout has cyclomatic complexity 16 (threshold 15). Of this number, 12 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · SessionActionsMenu.SessionActionsMenuItems (cyclomatic 16) · ×1
  • SessionActionsMenu.SessionActionsMenuItems (cyclomatic 16) web/components/sessions/SessionActionsMenu.tsx:92 — SessionActionsMenu.SessionActionsMenuItems has cyclomatic complexity 16 (threshold 15). Of this number, 11 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · MemoryUsageItem.MemoryUsageItem (cyclomatic 16) · ×1
  • MemoryUsageItem.MemoryUsageItem (cyclomatic 16) web/components/settings/MemoryUsageItem.tsx:62 — MemoryUsageItem.MemoryUsageItem has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 7 of the 16 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 85, 100, 67, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · EduHubImportModal.EduHubImportModal (cyclomatic 16) · ×1
  • EduHubImportModal.EduHubImportModal (cyclomatic 16) web/components/space/EduHubImportModal.tsx:52 — EduHubImportModal.EduHubImportModal has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 86, 106, 115, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · TaskLinkSelector.TaskLinkSelector (cyclomatic 16) · ×1
  • TaskLinkSelector.TaskLinkSelector (cyclomatic 16) web/components/tasks/TaskLinkSelector.tsx:8 — TaskLinkSelector.TaskLinkSelector has cyclomatic complexity 16 (threshold 15). Of this number, 10 points are the body's own statements and 6 belong to 2 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · WatchingMarksPanel.WatchingMarksPanel (cyclomatic 16) · ×1
  • WatchingMarksPanel.WatchingMarksPanel (cyclomatic 16) web/components/watching/WatchingMarksPanel.tsx:26 — WatchingMarksPanel.WatchingMarksPanel has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 6 of the 16 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 136, 121, 69). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · items.buildItems (cyclomatic 16) · ×1
  • items.buildItems (cyclomatic 16) web/features/calendar/model/items.ts:97 — items.buildItems has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ChatMessageList.buildMessageBlocks (cyclomatic 16) · ×1
  • ChatMessageList.buildMessageBlocks (cyclomatic 16) web/features/chat/messages/ChatMessageList.tsx:447 — ChatMessageList.buildMessageBlocks has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to 4 function items inside it that branch (preserveTeachingBefore, a function literal at line 479, a function literal at line 466, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · EngineDetail.LightRagModelsForm (cyclomatic 16) · ×1
  • EngineDetail.LightRagModelsForm (cyclomatic 16) web/features/knowledge/components/engines/EngineDetail.tsx:1176 — EngineDetail.LightRagModelsForm has cyclomatic complexity 16 (threshold 15). Of this number, 12 points are the body's own statements and 4 belong to 2 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · BookPermissionEditor.BookPermissionEditor (cyclomatic 16) · ×1
  • BookPermissionEditor.BookPermissionEditor (cyclomatic 16) web/features/multi-user/components/BookPermissionEditor.tsx:21 — BookPermissionEditor.BookPermissionEditor has cyclomatic complexity 16 (threshold 15). Of this number, 8 points are the body's own statements and 8 belong to 7 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · NoteSourcePicker.NoteSourcePicker (cyclomatic 16) · ×1
  • NoteSourcePicker.NoteSourcePicker (cyclomatic 16) web/features/notes/components/NoteSourcePicker.tsx:13 — NoteSourcePicker.NoteSourcePicker has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 3 of the 16 points are its own statements and the rest belongs to 5 function items inside it that branch (select, a function literal at line 92, a function literal at line 24, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · model.validateTurnCoordination (cyclomatic 16) · ×1
  • model.validateTurnCoordination (cyclomatic 16) web/features/runtime-status/model.ts:161 — model.validateTurnCoordination has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · useEmbeddingModels.useEmbeddingModels (cyclomatic 16) · ×1
  • useEmbeddingModels.useEmbeddingModels (cyclomatic 16) web/hooks/useEmbeddingModels.ts:10 — useEmbeddingModels.useEmbeddingModels has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 32, 52, 22, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · useSmoothStreamText.useSmoothStreamText (cyclomatic 16) · ×1
  • useSmoothStreamText.useSmoothStreamText (cyclomatic 16) web/hooks/useSmoothStreamText.ts:107 — useSmoothStreamText.useSmoothStreamText has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to 3 function literals inside it that branch (lines 128, 165, 195). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · useTopicSourceLibrary.hydrateSource (cyclomatic 16) · ×1
  • useTopicSourceLibrary.hydrateSource (cyclomatic 16) web/hooks/useTopicSourceLibrary.ts:373 — useTopicSourceLibrary.hydrateSource has cyclomatic complexity 16 (threshold 15). Of this number, 13 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · reading-citations.verifiedReadingLocators (cyclomatic 16) · ×1
  • reading-citations.verifiedReadingLocators (cyclomatic 16) web/lib/reading-citations.ts:391 — reading-citations.verifiedReadingLocators has cyclomatic complexity 16 (threshold 15). Of this number, 12 points are the body's own statements and 4 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · client.normalizedHttpError (cyclomatic 16) · ×1
  • client.normalizedHttpError (cyclomatic 16) web/shared/api/client.ts:74 — client.normalizedHttpError has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · ChatStateAdapter.ChatStateAdapterProvider (cognitive 522) · ×1
  • ChatStateAdapter.ChatStateAdapterProvider (cognitive 522) web/features/chat/ChatStateAdapter.tsx:2031 — ChatStateAdapter.ChatStateAdapterProvider has cognitive complexity 522 (threshold 15). Drivers by points: if/else 163 (222 pts), ternaries 107 (154 pts), boolean chains 120, error handling 8 (13 pts), loops 11 (13 pts) (nesting depth added 113). Most of this is not in the body itself: 1 of the 522 points is its own statement and the rest belongs to 53 function literals inside it that branch (lines 3014, 2215, 2714, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · SettingsStore.SettingsProvider (cognitive 352) · ×1
  • SettingsStore.SettingsProvider (cognitive 352) web/features/settings/store/SettingsStore.tsx:644 — SettingsStore.SettingsProvider has cognitive complexity 352 (threshold 15). Drivers by points: if/else 147 (193 pts), ternaries 52 (80 pts), boolean chains 48, error handling 15 (16 pts), loops 11 (15 pts) (nesting depth added 79). Most of this is not in the body itself: 5 of the 352 points are its own statements and the rest belongs to 67 function literals inside it that branch (lines 1928, 800, 2205, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · ChatWorkspace.ChatWorkspace (cognitive 336) · ×1
  • ChatWorkspace.ChatWorkspace (cognitive 336) web/features/chat/components/ChatWorkspace.tsx:274 — ChatWorkspace.ChatWorkspace has cognitive complexity 336 (threshold 15). Drivers by points: if/else 148 (163 pts), ternaries 54 (86 pts), boolean chains 75, error handling 7 (8 pts), loops 3 (4 pts) (nesting depth added 49). Of this number, 63 points are the body's own statements and 273 belong to 95 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · TurnExecutor._run_turn (cognitive 323) · ×1
  • TurnExecutor._run_turn (cognitive 323) deeptutor/services/session/turns/executor.py:142 — TurnExecutor._run_turn has cognitive complexity 323 (threshold 15). Drivers by points: if/else 91 (169 pts), boolean chains 84, ternaries 18 (33 pts), error handling 11 (20 pts), loops 9 (17 pts) (nesting depth added 110). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CoWriterWorkspace.CoWriterWorkspace (cognitive 281) · ×1
  • CoWriterWorkspace.CoWriterWorkspace (cognitive 281) web/features/co-writer/components/CoWriterWorkspace.tsx:182 — CoWriterWorkspace.CoWriterWorkspace has cognitive complexity 281 (threshold 15). Drivers by points: if/else 122 (141 pts), boolean chains 85, ternaries 27 (37 pts), loops 10 (11 pts), error handling 7 (nesting depth added 30). Of this number, 39 points are the body's own statements and 242 belong to 71 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ChatStateAdapter.reduce (cognitive 236) · ×1
  • ChatStateAdapter.reduce (cognitive 236) web/features/chat/ChatStateAdapter.tsx:802 — ChatStateAdapter.reduce has cognitive complexity 236 (threshold 15). Drivers by points: if/else 52 (107 pts), ternaries 40 (82 pts), boolean chains 42, loops 2 (4 pts), match/switch 1 (nesting depth added 99). Of this number, 206 points are the body's own statements and 30 belong to 8 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TurnRequestPreparer.start_turn (cognitive 235) · ×1
  • TurnRequestPreparer.start_turn (cognitive 235) deeptutor/services/session/turns/request_preparer.py:180 — TurnRequestPreparer.start_turn has cognitive complexity 235 (threshold 15). Drivers by points: if/else 89 (130 pts), boolean chains 65, error handling 14 (23 pts), ternaries 11 (17 pts) (nesting depth added 56). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PartnerChat.PartnerChat (cognitive 227) · ×1
  • PartnerChat.PartnerChat (cognitive 227) web/components/partners/PartnerChat.tsx:296 — PartnerChat.PartnerChat has cognitive complexity 227 (threshold 15). Drivers by points: if/else 82 (118 pts), ternaries 23 (50 pts), boolean chains 44, error handling 8 (13 pts), loops 1, match/switch 1 (nesting depth added 68). Most of this is not in the body itself: 14 of the 227 points are its own statements and the rest belongs to 32 function literals inside it that branch (lines 956, 602, 512, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · QuizViewer.QuizViewer (cognitive 218) · ×1
  • QuizViewer.QuizViewer (cognitive 218) web/components/quiz/QuizViewer.tsx:191 — QuizViewer.QuizViewer has cognitive complexity 218 (threshold 15). Drivers by points: ternaries 37 (80 pts), if/else 46 (65 pts), boolean chains 60, error handling 7 (11 pts), loops 2 (nesting depth added 66). Of this number, 61 points are the body's own statements and 157 belong to 33 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AgentLoop._call_llm (cognitive 215) · ×1
  • AgentLoop._call_llm (cognitive 215) deeptutor/agents/loop/agent_loop.py:639 — AgentLoop._call_llm has cognitive complexity 215 (threshold 15). Drivers by points: if/else 51 (139 pts), boolean chains 43, loops 6 (15 pts), ternaries 8 (14 pts), error handling 2 (4 pts) (nesting depth added 105). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BooksRoute.BookPageInner (cognitive 208) · ×1
  • BooksRoute.BookPageInner (cognitive 208) web/app/(workspace)/learning/books/BooksRoute.tsx:104 — BooksRoute.BookPageInner has cognitive complexity 208 (threshold 15). Drivers by points: boolean chains 91, if/else 72 (79 pts), ternaries 17 (24 pts), error handling 12 (14 pts) (nesting depth added 16). Of this number, 39 points are the body's own statements and 169 belong to 55 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · ChatComposer.ChatComposer (cognitive 204) · ×1
  • ChatComposer.ChatComposer (cognitive 204) web/components/chat/home/ChatComposer.tsx:200 — ChatComposer.ChatComposer has cognitive complexity 204 (threshold 15). Drivers by points: ternaries 51 (73 pts), if/else 57 (68 pts), boolean chains 61, error handling 2 (nesting depth added 33). Of this number, 111 points are the body's own statements and 93 belong to 37 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · AskUserOptions.extractMessageSegments (cognitive 192) · ×1
  • AskUserOptions.extractMessageSegments (cognitive 192) web/components/chat/home/AskUserOptions.tsx:348 — AskUserOptions.extractMessageSegments has cognitive complexity 192 (threshold 15). Drivers by points: if/else 48 (124 pts), ternaries 13 (39 pts), boolean chains 21, loops 4 (8 pts) (nesting depth added 106). Of this number, 162 points are the body's own statements and 30 belong to 6 function items inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · registry_edit.merge_registry_edit (cognitive 174) · ×1
  • registry_edit.merge_registry_edit (cognitive 174) deeptutor/services/settings/registry_edit.py:67 — registry_edit.merge_registry_edit has cognitive complexity 174 (threshold 15). Drivers by points: if/else 47 (132 pts), boolean chains 25, loops 2 (10 pts), ternaries 2 (5 pts), error handling 1 (2 pts) (nesting depth added 97). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ChatMessageList.AssistantMessage (cognitive 166) · ×1
  • ChatMessageList.AssistantMessage (cognitive 166) web/features/chat/messages/ChatMessageList.tsx:732 — ChatMessageList.AssistantMessage has cognitive complexity 166 (threshold 15). Drivers by points: ternaries 33 (119 pts), boolean chains 29, if/else 12 (15 pts), loops 3 (nesting depth added 89). Of this number, 66 points are the body's own statements and 100 belong to 17 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · MediaReadingStage.MediaReadingStage (cognitive 161) · ×1
  • MediaReadingStage.MediaReadingStage (cognitive 161) web/components/reading/workspace/MediaReadingStage.tsx:57 — MediaReadingStage.MediaReadingStage has cognitive complexity 161 (threshold 15). Drivers by points: ternaries 38 (69 pts), if/else 44 (46 pts), boolean chains 44, error handling 1, loops 1 (nesting depth added 33). Of this number, 62 points are the body's own statements and 99 belong to 29 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ReaderPane.ReaderPane (cognitive 158) · ×1
  • ReaderPane.ReaderPane (cognitive 158) web/components/reading/ReaderPane.tsx:180 — ReaderPane.ReaderPane has cognitive complexity 158 (threshold 15). Drivers by points: if/else 63 (70 pts), boolean chains 52, ternaries 20 (31 pts), error handling 4 (5 pts) (nesting depth added 19). Of this number, 40 points are the body's own statements and 118 belong to 37 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · page.PartnerDetail (cognitive 154) · ×1
  • page.PartnerDetail (cognitive 154) web/app/(workspace)/partners/[partnerId]/page.tsx:65 — page.PartnerDetail has cognitive complexity 154 (threshold 15). Drivers by points: if/else 53 (66 pts), ternaries 30 (52 pts), boolean chains 28, error handling 7 (8 pts) (nesting depth added 36). Of this number, 50 points are the body's own statements and 104 belong to 27 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NoteWorkspace.NoteWorkspace (cognitive 151) · ×1
  • NoteWorkspace.NoteWorkspace (cognitive 151) web/features/notes/components/NoteWorkspace.tsx:46 — NoteWorkspace.NoteWorkspace has cognitive complexity 151 (threshold 15). Drivers by points: if/else 49 (58 pts), boolean chains 47, ternaries 23 (33 pts), error handling 9 (11 pts), loops 2 (nesting depth added 21). Of this number, 29 points are the body's own statements and 122 belong to 50 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · WeixinChannel._process_message (cognitive 145) · ×1
  • WeixinChannel._process_message (cognitive 145) deeptutor/partners/channels/weixin.py:489 — WeixinChannel._process_message has cognitive complexity 145 (threshold 15). Drivers by points: if/else 45 (123 pts), boolean chains 18, loops 3 (4 pts) (nesting depth added 79). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · knowledge.websocket_progress (cognitive 143) · ×1
  • knowledge.websocket_progress (cognitive 143) deeptutor/api/routers/knowledge.py:4437 — knowledge.websocket_progress has cognitive complexity 143 (threshold 15). Drivers by points: if/else 28 (63 pts), ternaries 13 (47 pts), boolean chains 19, error handling 8 (13 pts), loops 1 (nesting depth added 74). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · page.AdminUsersPage (cognitive 141) · ×1
  • page.AdminUsersPage (cognitive 141) web/app/(admin)/admin/users/page.tsx:56 — page.AdminUsersPage has cognitive complexity 141 (threshold 15). Drivers by points: ternaries 34 (96 pts), boolean chains 21, if/else 18 (19 pts), error handling 5 (nesting depth added 63). Of this number, 33 points are the body's own statements and 108 belong to 20 function items inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · SessionViewerPanel.SessionViewerPanelInner (cognitive 138) · ×1
  • SessionViewerPanel.SessionViewerPanelInner (cognitive 138) web/components/chat/home/SessionViewerPanel.tsx:387 — SessionViewerPanel.SessionViewerPanelInner has cognitive complexity 138 (threshold 15). Drivers by points: ternaries 30 (72 pts), if/else 30 (42 pts), boolean chains 21, loops 1 (3 pts) (nesting depth added 56). Of this number, 51 points are the body's own statements and 87 belong to 36 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · dependencies._forward_closure (cognitive 136) · ×1
  • dependencies._forward_closure (cognitive 136) deeptutor/services/workspace/dependencies.py:115 — dependencies._forward_closure has cognitive complexity 136 (threshold 15). Drivers by points: if/else 31 (97 pts), loops 7 (17 pts), boolean chains 15, error handling 2 (6 pts), ternaries 1 (nesting depth added 80). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · SkillsSection.SkillsSection (cognitive 130) · ×1
  • SkillsSection.SkillsSection (cognitive 130) web/components/space/SkillsSection.tsx:78 — SkillsSection.SkillsSection has cognitive complexity 130 (threshold 15). Drivers by points: ternaries 29 (75 pts), if/else 20 (26 pts), boolean chains 17, error handling 9, loops 2 (3 pts) (nesting depth added 53). Of this number, 20 points are the body's own statements and 110 belong to 25 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · source_visuals.retrieve_visual (cognitive 125) · ×1
  • source_visuals.retrieve_visual (cognitive 125) deeptutor/services/rag/source_visuals.py:203 — source_visuals.retrieve_visual has cognitive complexity 125 (threshold 15). Drivers by points: if/else 27 (78 pts), boolean chains 28, loops 3 (8 pts), error handling 2 (6 pts), ternaries 3 (5 pts) (nesting depth added 62). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · unified_ws.unified_websocket (cognitive 115) · ×1
  • unified_ws.unified_websocket (cognitive 115) deeptutor/api/routers/unified_ws.py:44 — unified_ws.unified_websocket has cognitive complexity 115 (threshold 15). Drivers by points: if/else 31 (69 pts), boolean chains 21, error handling 6 (12 pts), ternaries 4 (11 pts), loops 2 (nesting depth added 51). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TimeGrid.TimeGrid (cognitive 114) · ×1
  • TimeGrid.TimeGrid (cognitive 114) web/features/calendar/components/TimeGrid.tsx:70 — TimeGrid.TimeGrid has cognitive complexity 114 (threshold 15). Drivers by points: if/else 55 (65 pts), boolean chains 29, ternaries 13 (19 pts), loops 1 (nesting depth added 16). Most of this is not in the body itself: 1 of the 114 points is its own statement and the rest belongs to 40 function items inside it that branch (a function literal at line 162, a function literal at line 238, a function literal at line 325, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · ServiceConfigEditor.ServiceConfigEditor (cognitive 113) · ×1
  • ServiceConfigEditor.ServiceConfigEditor (cognitive 113) web/components/settings/ServiceConfigEditor.tsx:102 — ServiceConfigEditor.ServiceConfigEditor has cognitive complexity 113 (threshold 15). Drivers by points: boolean chains 77, if/else 19 (22 pts), ternaries 9 (13 pts), error handling 1 (nesting depth added 7). Of this number, 34 points are the body's own statements and 79 belong to 21 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · EpubDocumentView.EpubDocumentView (cognitive 108) · ×1
  • EpubDocumentView.EpubDocumentView (cognitive 108) web/components/reading/EpubDocumentView.tsx:167 — EpubDocumentView.EpubDocumentView has cognitive complexity 108 (threshold 15). Drivers by points: if/else 47 (55 pts), boolean chains 29, ternaries 12 (15 pts), error handling 4 (7 pts), loops 2 (nesting depth added 14). Most of this is not in the body itself: 7 of the 108 points are its own statements and the rest belongs to 23 function literals inside it that branch (lines 565, 412, 285, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · ModelCatalogService._normalize (cognitive 105) · ×1
  • ModelCatalogService._normalize (cognitive 105) deeptutor/services/config/model_catalog.py:472 — ModelCatalogService._normalize has cognitive complexity 105 (threshold 15). Drivers by points: if/else 20 (68 pts), boolean chains 13, ternaries 3 (10 pts), loops 4 (8 pts), error handling 1 (6 pts) (nesting depth added 64). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · book.book_websocket (cognitive 104) · ×1
  • book.book_websocket (cognitive 104) deeptutor/api/routers/book.py:1530 — book.book_websocket has cognitive complexity 104 (threshold 15). Drivers by points: if/else 19 (45 pts), boolean chains 26, error handling 11 (22 pts), ternaries 3 (10 pts), loops 1 (nesting depth added 44). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KnowledgeBaseManager._get_info (cognitive 104) · ×1
  • KnowledgeBaseManager._get_info (cognitive 104) deeptutor/knowledge/manager.py:1465 — KnowledgeBaseManager._get_info has cognitive complexity 104 (threshold 15). Drivers by points: if/else 38 (51 pts), ternaries 16 (26 pts), boolean chains 16, error handling 4 (9 pts), loops 1 (2 pts) (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PageReader.PageReader (cognitive 102) · ×1
  • PageReader.PageReader (cognitive 102) web/app/(workspace)/learning/books/components/PageReader.tsx:122 — PageReader.PageReader has cognitive complexity 102 (threshold 15). Drivers by points: boolean chains 49, if/else 26 (29 pts), ternaries 18 (23 pts), loops 1 (nesting depth added 8). Of this number, 40 points are the body's own statements and 62 belong to 11 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · manager._reconcile_embedding_flags (cognitive 100) · ×1
  • manager._reconcile_embedding_flags (cognitive 100) deeptutor/knowledge/manager.py:161 — manager._reconcile_embedding_flags has cognitive complexity 100 (threshold 15). Drivers by points: if/else 26 (71 pts), boolean chains 15, ternaries 4 (9 pts), error handling 1 (4 pts), loops 1 (nesting depth added 53). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ChatMessageList.ChatMessageList (cognitive 97) · ×1
  • ChatMessageList.ChatMessageList (cognitive 97) web/features/chat/messages/ChatMessageList.tsx:2130 — ChatMessageList.ChatMessageList has cognitive complexity 97 (threshold 15). Drivers by points: boolean chains 41, if/else 21 (30 pts), ternaries 15 (23 pts), loops 3 (nesting depth added 17). Most of this is not in the body itself: 5 of the 97 points are its own statements and the rest belongs to 13 function items inside it that branch (a function literal at line 2457, a function literal at line 2301, a function literal at line 2349, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · NoteEditor.NoteEditor (cognitive 97) · ×1
  • NoteEditor.NoteEditor (cognitive 97) web/features/notes/components/NoteEditor.tsx:697 — NoteEditor.NoteEditor has cognitive complexity 97 (threshold 15). Drivers by points: if/else 34 (39 pts), boolean chains 35, ternaries 15 (20 pts), error handling 3 (nesting depth added 10). Most of this is not in the body itself: 2 of the 97 points are its own statements and the rest belongs to 38 function items inside it that branch (a function literal at line 1484, getItems::insert, a function literal at line 845, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · ModelsWorkspace.ModelEditor (cognitive 96) · ×1
  • ModelsWorkspace.ModelEditor (cognitive 96) web/components/settings/ModelsWorkspace.tsx:703 — ModelsWorkspace.ModelEditor has cognitive complexity 96 (threshold 15). Drivers by points: boolean chains 55, if/else 14 (23 pts), ternaries 15 (18 pts) (nesting depth added 12). Of this number, 61 points are the body's own statements and 35 belong to 7 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · ModelsWorkspace.ModelsWorkspace (cognitive 95) · ×1
  • ModelsWorkspace.ModelsWorkspace (cognitive 95) web/components/settings/ModelsWorkspace.tsx:63 — ModelsWorkspace.ModelsWorkspace has cognitive complexity 95 (threshold 15). Drivers by points: ternaries 29 (40 pts), boolean chains 32, if/else 17 (22 pts), loops 1 (nesting depth added 16). Of this number, 25 points are the body's own statements and 70 belong to 15 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RichMarkdownRenderer.RichMarkdownRenderer (cognitive 93) · ×1
  • RichMarkdownRenderer.RichMarkdownRenderer (cognitive 93) web/components/common/RichMarkdownRenderer.tsx:106 — RichMarkdownRenderer.RichMarkdownRenderer has cognitive complexity 93 (threshold 15). Drivers by points: ternaries 33 (40 pts), boolean chains 29, if/else 22 (24 pts) (nesting depth added 9). Most of this is not in the body itself: 14 of the 93 points are its own statements and the rest belongs to 27 function items inside it that branch (a function literal at line 425, a function literal at line 552, a function literal at line 528, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · KnowledgePage.KnowledgePage (cognitive 93) · ×1
  • KnowledgePage.KnowledgePage (cognitive 93) web/components/knowledge/KnowledgePage.tsx:50 — KnowledgePage.KnowledgePage has cognitive complexity 93 (threshold 15). Drivers by points: ternaries 28 (54 pts), if/else 18, error handling 11, boolean chains 10 (nesting depth added 26). Of this number, 33 points are the body's own statements and 60 belong to 18 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LearningService._replace_module_set (cognitive 91) · ×1
  • LearningService._replace_module_set (cognitive 91) deeptutor/learning/service.py:1734 — LearningService._replace_module_set has cognitive complexity 91 (threshold 15). Drivers by points: if/else 21 (43 pts), loops 7 (22 pts), ternaries 8 (14 pts), boolean chains 12 (nesting depth added 43). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StandaloneComposer.StandaloneComposerImpl (cognitive 91) · ×1
  • StandaloneComposer.StandaloneComposerImpl (cognitive 91) web/components/chat/home/StandaloneComposer.tsx:233 — StandaloneComposer.StandaloneComposerImpl has cognitive complexity 91 (threshold 15). Drivers by points: if/else 47 (53 pts), ternaries 16 (21 pts), boolean chains 15, error handling 2 (nesting depth added 11). Most of this is not in the body itself: 15 of the 91 points are its own statements and the rest belongs to 28 function literals inside it that branch (lines 741, 397, 447, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · PartnerCommandHandler._model (cognitive 89) · ×1
  • PartnerCommandHandler._model (cognitive 89) deeptutor/services/partners/commands.py:236 — PartnerCommandHandler._model has cognitive complexity 89 (threshold 15). Drivers by points: if/else 30 (54 pts), boolean chains 17, ternaries 6 (10 pts), loops 3 (5 pts), error handling 3 (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BookChatPanel.BookChatPanel (cognitive 89) · ×1
  • BookChatPanel.BookChatPanel (cognitive 89) web/app/(workspace)/learning/books/components/BookChatPanel.tsx:103 — BookChatPanel.BookChatPanel has cognitive complexity 89 (threshold 15). Drivers by points: boolean chains 36, if/else 29 (34 pts), ternaries 10 (18 pts), loops 1 (nesting depth added 13). Most of this is not in the body itself: 8 of the 89 points are its own statements and the rest belongs to 26 function items inside it that branch (handleEvent, a function literal at line 252, filterFiles, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · quiz_judge.websocket_quiz_judge (cognitive 88) · ×1
  • quiz_judge.websocket_quiz_judge (cognitive 88) deeptutor/api/routers/quiz_judge.py:309 — quiz_judge.websocket_quiz_judge has cognitive complexity 88 (threshold 15). Drivers by points: if/else 21 (36 pts), error handling 15 (30 pts), boolean chains 18, loops 2 (3 pts), ternaries 1 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CalendarPage.CalendarPage (cognitive 88) · ×1
  • CalendarPage.CalendarPage (cognitive 88) web/features/calendar/components/CalendarPage.tsx:77 — CalendarPage.CalendarPage has cognitive complexity 88 (threshold 15). Drivers by points: ternaries 24 (36 pts), if/else 23 (27 pts), boolean chains 22, error handling 3 (nesting depth added 16). Of this number, 41 points are the body's own statements and 47 belong to 28 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CalendarStore.update (cognitive 86) · ×1
  • CalendarStore.update (cognitive 86) deeptutor/services/calendar/store.py:240 — CalendarStore.update has cognitive complexity 86 (threshold 15). Drivers by points: if/else 23 (58 pts), ternaries 4 (12 pts), boolean chains 9, loops 2 (7 pts) (nesting depth added 48). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · sidecar.build_ir (cognitive 86) · ×1
  • sidecar.build_ir (cognitive 86) deeptutor/services/rag/pipelines/lightrag/sidecar.py:118 — sidecar.build_ir has cognitive complexity 86 (threshold 15). Drivers by points: if/else 19 (45 pts), boolean chains 22, ternaries 6 (18 pts), loops 1 (nesting depth added 38). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MyAgentsPicker.MyAgentsPicker (cognitive 86) · ×1
  • MyAgentsPicker.MyAgentsPicker (cognitive 86) web/components/chat/MyAgentsPicker.tsx:85 — MyAgentsPicker.MyAgentsPicker has cognitive complexity 86 (threshold 15). Drivers by points: ternaries 15 (38 pts), if/else 15 (23 pts), boolean chains 18, loops 5, error handling 2 (nesting depth added 31). Most of this is not in the body itself: 8 of the 86 points are its own statements and the rest belongs to 21 function items inside it that branch (a function literal at line 166, a function literal at line 231, a function literal at line 397, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · exercise_lookup.collect_exercises (cognitive 84) · ×1
  • exercise_lookup.collect_exercises (cognitive 84) deeptutor/services/rag/pipelines/llamaindex/exercise_lookup.py:137 — exercise_lookup.collect_exercises has cognitive complexity 84 (threshold 15). Drivers by points: if/else 20 (53 pts), boolean chains 16, ternaries 4 (12 pts), loops 2 (3 pts) (nesting depth added 42). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · parsing.consume_sdk_stream (cognitive 83) · ×1
  • parsing.consume_sdk_stream (cognitive 83) deeptutor/services/llm/provider_core/openai_responses/parsing.py:549 — parsing.consume_sdk_stream has cognitive complexity 83 (threshold 15). Drivers by points: if/else 14 (44 pts), boolean chains 23, ternaries 4 (15 pts), loops 1 (nesting depth added 41). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · exercise_lookup.lookup_exercises (cognitive 83) · ×1
  • exercise_lookup.lookup_exercises (cognitive 83) deeptutor/services/rag/pipelines/llamaindex/exercise_lookup.py:313 — exercise_lookup.lookup_exercises has cognitive complexity 83 (threshold 15). Drivers by points: if/else 22 (50 pts), loops 5 (10 pts), ternaries 5 (10 pts), boolean chains 9, error handling 2 (4 pts) (nesting depth added 40). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FeishuChannel.send (cognitive 82) · ×1
  • FeishuChannel.send (cognitive 82) deeptutor/partners/channels/feishu.py:2115 — FeishuChannel.send has cognitive complexity 82 (threshold 15). Drivers by points: if/else 28 (52 pts), boolean chains 19, loops 3 (6 pts), ternaries 3 (4 pts), error handling 1 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TurnRequestPreparer.regenerate_last_turn (cognitive 82) · ×1
  • TurnRequestPreparer.regenerate_last_turn (cognitive 82) deeptutor/services/session/turns/request_preparer.py:1002 — TurnRequestPreparer.regenerate_last_turn has cognitive complexity 82 (threshold 15). Drivers by points: boolean chains 34, ternaries 22 (23 pts), if/else 15 (20 pts), loops 3 (5 pts) (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · MasteryStudy.MasteryStudy (cognitive 82) · ×1
  • MasteryStudy.MasteryStudy (cognitive 82) web/components/space/learning/MasteryStudy.tsx:165 — MasteryStudy.MasteryStudy has cognitive complexity 82 (threshold 15). Drivers by points: if/else 22 (30 pts), ternaries 15 (29 pts), boolean chains 15, loops 4 (6 pts), error handling 2 (nesting depth added 24). Of this number, 30 points are the body's own statements and 52 belong to 21 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GrantEditor.GrantEditor (cognitive 82) · ×1
  • GrantEditor.GrantEditor (cognitive 82) web/features/multi-user/components/GrantEditor.tsx:161 — GrantEditor.GrantEditor has cognitive complexity 82 (threshold 15). Drivers by points: ternaries 25 (40 pts), boolean chains 32, if/else 9, error handling 1 (nesting depth added 15). Of this number, 54 points are the body's own statements and 28 belong to 27 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PdfDocumentView.PdfDocumentView (cognitive 81) · ×1
  • PdfDocumentView.PdfDocumentView (cognitive 81) web/components/reading/PdfDocumentView.tsx:83 — PdfDocumentView.PdfDocumentView has cognitive complexity 81 (threshold 15). Drivers by points: if/else 36 (48 pts), boolean chains 15, ternaries 11 (14 pts), loops 2 (3 pts), error handling 1 (nesting depth added 16). Most of this is not in the body itself: 7 of the 81 points are its own statements and the rest belongs to 17 function literals inside it that branch (lines 218, 428, 376, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · TurnLifecycle.subscribe_turn (cognitive 80) · ×1
  • TurnLifecycle.subscribe_turn (cognitive 80) deeptutor/services/session/turns/lifecycle.py:380 — TurnLifecycle.subscribe_turn has cognitive complexity 80 (threshold 15). Drivers by points: if/else 21 (55 pts), boolean chains 16, loops 5 (7 pts), error handling 1 (2 pts) (nesting depth added 37). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · sessions.update_session_organization (cognitive 79) · ×1
  • sessions.update_session_organization (cognitive 79) deeptutor/api/routers/sessions.py:574 — sessions.update_session_organization has cognitive complexity 79 (threshold 15). Drivers by points: if/else 26 (51 pts), boolean chains 13, error handling 4 (12 pts), loops 1 (3 pts) (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · labeled_step.run_labeled_step (cognitive 79) · ×1
  • labeled_step.run_labeled_step (cognitive 79) deeptutor/runtime/agentic/labeled_step.py:139 — labeled_step.run_labeled_step has cognitive complexity 79 (threshold 15). Drivers by points: if/else 32 (60 pts), boolean chains 12, error handling 2 (4 pts), loops 2 (3 pts) (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · kb_health.detect_kb_drift (cognitive 78) · ×1
  • kb_health.detect_kb_drift (cognitive 78) deeptutor/book/kb_health.py:177 — kb_health.detect_kb_drift has cognitive complexity 78 (threshold 15). Drivers by points: if/else 16 (42 pts), boolean chains 22, loops 6 (13 pts), ternaries 1 (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PracticeSession.PracticeTurn (cognitive 78) · ×1
  • PracticeSession.PracticeTurn (cognitive 78) web/components/learning/practice/PracticeSession.tsx:126 — PracticeSession.PracticeTurn has cognitive complexity 78 (threshold 15). Drivers by points: ternaries 17 (50 pts), boolean chains 20, if/else 5 (6 pts), error handling 2 (nesting depth added 34). Of this number, 40 points are the body's own statements and 38 belong to 8 function items inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · PartnerRunner._execute_turn (cognitive 76) · ×1
  • PartnerRunner._execute_turn (cognitive 76) deeptutor/services/partners/runtime.py:437 — PartnerRunner._execute_turn has cognitive complexity 76 (threshold 15). Drivers by points: if/else 21 (43 pts), boolean chains 26, loops 3 (4 pts), ternaries 2, error handling 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TextUnitView.TextUnitView (cognitive 76) · ×1
  • TextUnitView.TextUnitView (cognitive 76) web/components/reading/TextUnitView.tsx:87 — TextUnitView.TextUnitView has cognitive complexity 76 (threshold 15). Drivers by points: ternaries 16 (35 pts), if/else 27 (28 pts), boolean chains 12, error handling 1 (nesting depth added 20). Of this number, 29 points are the body's own statements and 47 belong to 17 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SourceNavigator.SourceNavigator (cognitive 76) · ×1
  • SourceNavigator.SourceNavigator (cognitive 76) web/components/reading/workspace/SourceNavigator.tsx:40 — SourceNavigator.SourceNavigator has cognitive complexity 76 (threshold 15). Drivers by points: ternaries 24 (49 pts), boolean chains 26, if/else 1 (nesting depth added 25). Of this number, 46 points are the body's own statements and 30 belong to 14 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WatchingBrowser.WatchingBrowser (cognitive 76) · ×1
  • WatchingBrowser.WatchingBrowser (cognitive 76) web/components/watching/WatchingBrowser.tsx:30 — WatchingBrowser.WatchingBrowser has cognitive complexity 76 (threshold 15). Drivers by points: boolean chains 30, ternaries 12 (24 pts), if/else 14 (16 pts), error handling 6 (nesting depth added 14). Of this number, 17 points are the body's own statements and 59 belong to 19 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · QuizFollowupContext.QuizFollowupProvider (cognitive 76) · ×1
  • QuizFollowupContext.QuizFollowupProvider (cognitive 76) web/context/QuizFollowupContext.tsx:241 — QuizFollowupContext.QuizFollowupProvider has cognitive complexity 76 (threshold 15). Drivers by points: if/else 35 (46 pts), boolean chains 18, ternaries 9, error handling 2 (3 pts) (nesting depth added 12). None of this is in the body itself: all 76 points belong to 14 function literals inside it that branch (lines 475, 311, 354, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · MasteryQuizTool.execute (cognitive 75) · ×1
  • MasteryQuizTool.execute (cognitive 75) deeptutor/capabilities/mastery/tools.py:1253 — MasteryQuizTool.execute has cognitive complexity 75 (threshold 15). Drivers by points: if/else 27 (41 pts), boolean chains 16, error handling 4 (7 pts), loops 3 (6 pts), ternaries 3 (5 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · topic_generation.materialize_modules (cognitive 75) · ×1
  • topic_generation.materialize_modules (cognitive 75) deeptutor/learning/topic_generation.py:308 — topic_generation.materialize_modules has cognitive complexity 75 (threshold 15). Drivers by points: if/else 24 (55 pts), boolean chains 15, loops 3 (5 pts) (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OpenAICompatProvider.chat_stream (cognitive 75) · ×1
  • OpenAICompatProvider.chat_stream (cognitive 75) deeptutor/services/llm/provider_core/openai_compat_provider.py:1138 — OpenAICompatProvider.chat_stream has cognitive complexity 75 (threshold 15). Drivers by points: if/else 18 (46 pts), boolean chains 12, error handling 5 (7 pts), loops 2 (5 pts), ternaries 2 (5 pts) (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KbFilePreview.KbFilePreview (cognitive 75) · ×1
  • KbFilePreview.KbFilePreview (cognitive 75) web/components/knowledge/KbFilePreview.tsx:112 — KbFilePreview.KbFilePreview has cognitive complexity 75 (threshold 15). Drivers by points: ternaries 19 (64 pts), boolean chains 5, if/else 5, error handling 1 (nesting depth added 45). Of this number, 67 points are the body's own statements and 8 belong to 6 function items inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · lesson_evidence.prepare_lesson (cognitive 74) · ×1
  • lesson_evidence.prepare_lesson (cognitive 74) deeptutor/learning/lesson_evidence.py:590 — lesson_evidence.prepare_lesson has cognitive complexity 74 (threshold 15). Drivers by points: if/else 26 (55 pts), boolean chains 9, error handling 3 (6 pts), ternaries 3, loops 1 (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MasteryQuestionCard.SingleMasteryQuestionCard (cognitive 74) · ×1
  • MasteryQuestionCard.SingleMasteryQuestionCard (cognitive 74) web/components/chat/home/MasteryQuestionCard.tsx:125 — MasteryQuestionCard.SingleMasteryQuestionCard has cognitive complexity 74 (threshold 15). Drivers by points: ternaries 23 (40 pts), boolean chains 22, if/else 9 (12 pts) (nesting depth added 20). Of this number, 52 points are the body's own statements and 22 belong to 8 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parsing.consume_sse (cognitive 73) · ×1
  • parsing.consume_sse (cognitive 73) deeptutor/services/llm/provider_core/openai_responses/parsing.py:358 — parsing.consume_sse has cognitive complexity 73 (threshold 15). Drivers by points: if/else 12 (40 pts), boolean chains 17, ternaries 4 (15 pts), loops 1 (nesting depth added 39). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · page.MasteryTopicPage (cognitive 73) · ×1
  • page.MasteryTopicPage (cognitive 73) web/app/(workspace)/learning/mastery/[pathId]/page.tsx:70 — page.MasteryTopicPage has cognitive complexity 73 (threshold 15). Drivers by points: ternaries 24 (45 pts), boolean chains 12, error handling 8, if/else 7 (8 pts) (nesting depth added 22). Of this number, 44 points are the body's own statements and 29 belong to 16 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PartnerComposer.PartnerComposer (cognitive 73) · ×1
  • PartnerComposer.PartnerComposer (cognitive 73) web/components/partners/PartnerComposer.tsx:42 — PartnerComposer.PartnerComposer has cognitive complexity 73 (threshold 15). Drivers by points: if/else 31 (39 pts), boolean chains 26, ternaries 7, loops 1 (nesting depth added 8). Of this number, 17 points are the body's own statements and 56 belong to 20 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · blocks.blocks_to_markdown (cognitive 72) · ×1
  • blocks.blocks_to_markdown (cognitive 72) deeptutor/notes/blocks.py:222 — blocks.blocks_to_markdown has cognitive complexity 72 (threshold 15). Drivers by points: if/else 10 (32 pts), ternaries 5 (18 pts), boolean chains 12, loops 3 (10 pts) (nesting depth added 42). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · source_inventory._collect_from_user_message (cognitive 71) · ×1
  • source_inventory._collect_from_user_message (cognitive 71) deeptutor/services/session/source_inventory.py:467 — source_inventory._collect_from_user_message has cognitive complexity 71 (threshold 15). Drivers by points: if/else 20 (41 pts), boolean chains 19, loops 6 (7 pts), error handling 2 (4 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · page.ProfilePage (cognitive 71) · ×1
  • page.ProfilePage (cognitive 71) web/app/(utility)/profile/page.tsx:100 — page.ProfilePage has cognitive complexity 71 (threshold 15). Drivers by points: ternaries 21 (36 pts), if/else 13 (17 pts), boolean chains 13, error handling 5 (nesting depth added 19). Of this number, 28 points are the body's own statements and 43 belong to 12 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · python_scheduler.run_loop (cognitive 70) · ×1
  • python_scheduler.run_loop (cognitive 70) deeptutor/agents/loop/python_scheduler.py:15 — python_scheduler.run_loop has cognitive complexity 70 (threshold 15). Drivers by points: if/else 20 (62 pts), boolean chains 3, error handling 1 (2 pts), ternaries 1 (2 pts), loops 1 (nesting depth added 44). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · local.parse_document_with_mineru_result (cognitive 70) · ×1
  • local.parse_document_with_mineru_result (cognitive 70) deeptutor/services/parsing/engines/mineru/local.py:125 — local.parse_document_with_mineru_result has cognitive complexity 70 (threshold 15). Drivers by points: if/else 28 (41 pts), error handling 7 (15 pts), boolean chains 9, loops 3 (4 pts), ternaries 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · discovery.discover_voices (cognitive 70) · ×1
  • discovery.discover_voices (cognitive 70) deeptutor/services/voice/discovery.py:62 — discovery.discover_voices has cognitive complexity 70 (threshold 15). Drivers by points: if/else 16 (41 pts), loops 4 (10 pts), boolean chains 8, error handling 4 (6 pts), ternaries 2 (5 pts) (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · run-loop.runLoop (cognitive 70) · ×1
  • run-loop.runLoop (cognitive 70) packages/chat-engine/src/core/run-loop.ts:5 — run-loop.runLoop has cognitive complexity 70 (threshold 15). Drivers by points: if/else 22 (65 pts), boolean chains 2, error handling 1 (2 pts), loops 1 (nesting depth added 44). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · readiness.catalog_service_rows (cognitive 69) · ×1
  • readiness.catalog_service_rows (cognitive 69) deeptutor/services/config/readiness.py:230 — readiness.catalog_service_rows has cognitive complexity 69 (threshold 15). Drivers by points: if/else 15 (33 pts), ternaries 7 (16 pts), boolean chains 12, error handling 2 (7 pts), loops 1 (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ReadingReferencePicker.ReadingReferencePicker (cognitive 69) · ×1
  • ReadingReferencePicker.ReadingReferencePicker (cognitive 69) web/components/chat/ReadingReferencePicker.tsx:56 — ReadingReferencePicker.ReadingReferencePicker has cognitive complexity 69 (threshold 15). Drivers by points: ternaries 18 (36 pts), if/else 20 (21 pts), boolean chains 12 (nesting depth added 19). Of this number, 19 points are the body's own statements and 50 belong to 20 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · useMemoryRun.useMemoryRun.attach (cognitive 69) · ×1
  • useMemoryRun.useMemoryRun.attach (cognitive 69) web/components/memory/useMemoryRun.ts:164 — useMemoryRun.useMemoryRun.attach has cognitive complexity 69 (threshold 15). Drivers by points: if/else 15 (27 pts), ternaries 7 (26 pts), error handling 4 (7 pts), boolean chains 6, loops 2 (3 pts) (nesting depth added 35). Of this number, 38 points are the body's own statements and 31 belong to 5 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PartnerArchives.PartnerArchives (cognitive 69) · ×1
  • PartnerArchives.PartnerArchives (cognitive 69) web/components/partners/PartnerArchives.tsx:144 — PartnerArchives.PartnerArchives has cognitive complexity 69 (threshold 15). Drivers by points: ternaries 24 (43 pts), if/else 13, boolean chains 9, error handling 4 (nesting depth added 19). Most of this is not in the body itself: 15 of the 69 points are its own statements and the rest belongs to 16 function literals inside it that branch (lines 345, 275, 215, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · provider_probe.probe_provider (cognitive 68) · ×1
  • provider_probe.probe_provider (cognitive 68) deeptutor/services/settings/provider_probe.py:193 — provider_probe.probe_provider has cognitive complexity 68 (threshold 15). Drivers by points: if/else 17 (32 pts), boolean chains 13, ternaries 6 (13 pts), error handling 4 (5 pts), loops 4 (5 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AskUserOptions.InteractiveAskUserCard (cognitive 68) · ×1
  • AskUserOptions.InteractiveAskUserCard (cognitive 68) web/components/chat/home/AskUserOptions.tsx:1033 — AskUserOptions.InteractiveAskUserCard has cognitive complexity 68 (threshold 15). Drivers by points: ternaries 17 (28 pts), if/else 15 (23 pts), boolean chains 13, loops 3 (4 pts) (nesting depth added 20). Of this number, 28 points are the body's own statements and 40 belong to 9 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CodeRetryManager.render_with_retries (cognitive 67) · ×1
  • CodeRetryManager.render_with_retries (cognitive 67) deeptutor/agents/math_animator/retry_manager.py:44 — CodeRetryManager.render_with_retries has cognitive complexity 67 (threshold 15). Drivers by points: if/else 14 (46 pts), error handling 4 (12 pts), boolean chains 4, ternaries 1 (4 pts), loops 1 (nesting depth added 43). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · PartnerManager._outbound_router (cognitive 67) · ×1
  • PartnerManager._outbound_router (cognitive 67) deeptutor/services/partners/manager.py:770 — PartnerManager._outbound_router has cognitive complexity 67 (threshold 15). Drivers by points: if/else 10 (24 pts), ternaries 5 (23 pts), boolean chains 13, error handling 4 (6 pts), loops 1 (nesting depth added 34). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ProvidersWorkspace.ProvidersWorkspace (cognitive 67) · ×1
  • ProvidersWorkspace.ProvidersWorkspace (cognitive 67) web/components/settings/ProvidersWorkspace.tsx:48 — ProvidersWorkspace.ProvidersWorkspace has cognitive complexity 67 (threshold 15). Drivers by points: boolean chains 31, ternaries 11 (20 pts), if/else 13 (15 pts), loops 1 (nesting depth added 11). Of this number, 35 points are the body's own statements and 32 belong to 13 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · provider-registry.reconcileRegistrySave (cognitive 67) · ×1
  • provider-registry.reconcileRegistrySave (cognitive 67) web/lib/provider-registry.ts:259 — provider-registry.reconcileRegistrySave has cognitive complexity 67 (threshold 15). Drivers by points: if/else 22 (56 pts), boolean chains 6, loops 2 (5 pts) (nesting depth added 37). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · HistorySessionPicker.HistorySessionPicker (cognitive 66) · ×1
  • HistorySessionPicker.HistorySessionPicker (cognitive 66) web/components/chat/HistorySessionPicker.tsx:53 — HistorySessionPicker.HistorySessionPicker has cognitive complexity 66 (threshold 15). Drivers by points: ternaries 18 (33 pts), if/else 16 (17 pts), boolean chains 15, error handling 1 (nesting depth added 16). Of this number, 24 points are the body's own statements and 42 belong to 16 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SidebarNav.SidebarNav (cognitive 66) · ×1
  • SidebarNav.SidebarNav (cognitive 66) web/components/sidebar/SidebarNav.tsx:89 — SidebarNav.SidebarNav has cognitive complexity 66 (threshold 15). Drivers by points: ternaries 23 (40 pts), if/else 13 (20 pts), boolean chains 6 (nesting depth added 24). Of this number, 28 points are the body's own statements and 38 belong to 13 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KbIndexVersionsSection.KbIndexVersionsSection (cognitive 65) · ×1
  • KbIndexVersionsSection.KbIndexVersionsSection (cognitive 65) web/components/knowledge/KbIndexVersionsSection.tsx:50 — KbIndexVersionsSection.KbIndexVersionsSection has cognitive complexity 65 (threshold 15). Drivers by points: boolean chains 39, ternaries 11 (16 pts), if/else 7 (8 pts), error handling 2 (nesting depth added 6). Of this number, 40 points are the body's own statements and 25 belong to 10 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · CodexOAuthCard.CodexOAuthCard (cognitive 65) · ×1
  • CodexOAuthCard.CodexOAuthCard (cognitive 65) web/components/settings/CodexOAuthCard.tsx:32 — CodexOAuthCard.CodexOAuthCard has cognitive complexity 65 (threshold 15). Drivers by points: boolean chains 25, ternaries 11 (18 pts), if/else 13 (14 pts), error handling 8 (nesting depth added 8). Of this number, 20 points are the body's own statements and 45 belong to 18 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PersonasSection.PersonasSection (cognitive 65) · ×1
  • PersonasSection.PersonasSection (cognitive 65) web/components/space/PersonasSection.tsx:63 — PersonasSection.PersonasSection has cognitive complexity 65 (threshold 15). Drivers by points: ternaries 16 (41 pts), if/else 8 (12 pts), boolean chains 7, error handling 5 (nesting depth added 29). Most of this is not in the body itself: 9 of the 65 points are its own statements and the rest belongs to 10 function literals inside it that branch (lines 173, 298, 221, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · ChatMessageList.UserMessage (cognitive 65) · ×1
  • ChatMessageList.UserMessage (cognitive 65) web/features/chat/messages/ChatMessageList.tsx:1709 — ChatMessageList.UserMessage has cognitive complexity 65 (threshold 15). Drivers by points: boolean chains 27, ternaries 14 (20 pts), if/else 15 (16 pts), error handling 2 (nesting depth added 7). Of this number, 39 points are the body's own statements and 26 belong to 11 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · book-activity.preparationRows (cognitive 65) · ×1
  • book-activity.preparationRows (cognitive 65) web/lib/book-activity.ts:165 — book-activity.preparationRows has cognitive complexity 65 (threshold 15). Drivers by points: ternaries 21 (47 pts), boolean chains 15, if/else 3 (nesting depth added 26). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · TurnApplicationService.subscribe_turn (cognitive 64) · ×1
  • TurnApplicationService.subscribe_turn (cognitive 64) deeptutor/app/service.py:248 — TurnApplicationService.subscribe_turn has cognitive complexity 64 (threshold 15). Drivers by points: if/else 20 (49 pts), boolean chains 10, loops 3 (4 pts), ternaries 1 (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NativeSession.operate (cognitive 64) · ×1
  • NativeSession.operate (cognitive 64) packages/chat-engine/src/native/session.ts:169 — NativeSession.operate has cognitive complexity 64 (threshold 15). Drivers by points: if/else 20 (42 pts), boolean chains 16, ternaries 2 (5 pts), match/switch 1 (nesting depth added 25). Of this number, 63 points are the body's own statements and 1 belongs to one function literal inside it that branches. The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · BookReferencePicker.BookReferencePicker (cognitive 64) · ×1
  • BookReferencePicker.BookReferencePicker (cognitive 64) web/components/chat/BookReferencePicker.tsx:54 — BookReferencePicker.BookReferencePicker has cognitive complexity 64 (threshold 15). Drivers by points: boolean chains 28, ternaries 14 (26 pts), if/else 10 (nesting depth added 12). Most of this is not in the body itself: 13 of the 64 points are its own statements and the rest belongs to 18 function items inside it that branch (a function literal at line 319, a function literal at line 256, togglePage, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · TurnNavigator.TurnNavigator (cognitive 64) · ×1
  • TurnNavigator.TurnNavigator (cognitive 64) web/components/chat/home/TurnNavigator.tsx:90 — TurnNavigator.TurnNavigator has cognitive complexity 64 (threshold 15). Drivers by points: ternaries 18 (33 pts), if/else 18 (20 pts), boolean chains 10, loops 1 (nesting depth added 17). Of this number, 17 points are the body's own statements and 47 belong to 11 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · data_migration.migrate_data (cognitive 63) · ×1
  • data_migration.migrate_data (cognitive 63) deeptutor/services/workspace/data_migration.py:561 — data_migration.migrate_data has cognitive complexity 63 (threshold 15). Drivers by points: if/else 20 (37 pts), error handling 3 (8 pts), loops 4 (7 pts), ternaries 3 (7 pts), boolean chains 4 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · knowledge._save_uploaded_files (cognitive 62) · ×1
  • knowledge._save_uploaded_files (cognitive 62) deeptutor/api/routers/knowledge.py:417 — knowledge._save_uploaded_files has cognitive complexity 62 (threshold 15). Drivers by points: if/else 8 (21 pts), error handling 6 (19 pts), loops 4 (8 pts), ternaries 4 (8 pts), boolean chains 6 (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · model_history.replay_group (cognitive 62) · ×1
  • model_history.replay_group (cognitive 62) deeptutor/services/session/model_history.py:165 — model_history.replay_group has cognitive complexity 62 (threshold 15). Drivers by points: if/else 9 (30 pts), loops 5 (18 pts), boolean chains 8, error handling 1 (6 pts) (nesting depth added 39). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · pipeline._citation_source_preview (cognitive 61) · ×1
  • pipeline._citation_source_preview (cognitive 61) deeptutor/agents/research/pipeline.py:2508 — pipeline._citation_source_preview has cognitive complexity 61 (threshold 15). Drivers by points: if/else 13 (34 pts), ternaries 2 (10 pts), loops 3 (9 pts), boolean chains 8 (nesting depth added 35). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · partner_groups.partner_group_ws (cognitive 61) · ×1
  • partner_groups.partner_group_ws (cognitive 61) deeptutor/api/routers/partner_groups.py:339 — partner_groups.partner_group_ws has cognitive complexity 61 (threshold 15). Drivers by points: error handling 11 (30 pts), if/else 9 (13 pts), boolean chains 12, loops 4 (6 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · parsing.parse_response_output (cognitive 61) · ×1
  • parsing.parse_response_output (cognitive 61) deeptutor/services/llm/provider_core/openai_responses/parsing.py:456 — parsing.parse_response_output has cognitive complexity 61 (threshold 15). Drivers by points: if/else 12 (33 pts), boolean chains 15, loops 4 (10 pts), ternaries 2 (3 pts) (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MemoryRunPanel.MemoryRunPanel (cognitive 61) · ×1
  • MemoryRunPanel.MemoryRunPanel (cognitive 61) web/components/memory/MemoryRunPanel.tsx:59 — MemoryRunPanel.MemoryRunPanel has cognitive complexity 61 (threshold 15). Drivers by points: ternaries 13 (21 pts), if/else 17 (20 pts), boolean chains 17, error handling 2, loops 1 (nesting depth added 11). Most of this is not in the body itself: 11 of the 61 points are its own statements and the rest belongs to 12 function literals inside it that branch (lines 225, 140, 118, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · useNoteThreads.useNoteThreads (cognitive 61) · ×1
  • useNoteThreads.useNoteThreads (cognitive 61) web/features/notes/components/useNoteThreads.ts:66 — useNoteThreads.useNoteThreads has cognitive complexity 61 (threshold 15). Drivers by points: boolean chains 21, if/else 15 (20 pts), ternaries 9 (19 pts), loops 1 (nesting depth added 15). Most of this is not in the body itself: 7 of the 61 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 452, 521, 196, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · llm.list_llm_options (cognitive 60) · ×1
  • llm.list_llm_options (cognitive 60) deeptutor/services/model_selection/llm.py:95 — llm.list_llm_options has cognitive complexity 60 (threshold 15). Drivers by points: if/else 10 (30 pts), boolean chains 18, loops 3 (6 pts), ternaries 3 (6 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NotebookConsole.NotebookDetail (cognitive 60) · ×1
  • NotebookConsole.NotebookDetail (cognitive 60) web/components/notebook/NotebookConsole.tsx:458 — NotebookConsole.NotebookDetail has cognitive complexity 60 (threshold 15). Drivers by points: ternaries 9 (24 pts), boolean chains 22, if/else 11 (12 pts), error handling 2 (nesting depth added 16). Of this number, 26 points are the body's own statements and 34 belong to 12 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ReadingWorkspace.ReadingWorkspacePage (cognitive 60) · ×1
  • ReadingWorkspace.ReadingWorkspacePage (cognitive 60) web/components/reading/workspace/ReadingWorkspace.tsx:129 — ReadingWorkspace.ReadingWorkspacePage has cognitive complexity 60 (threshold 15). Drivers by points: ternaries 15 (28 pts), boolean chains 20, if/else 12 (nesting depth added 13). Of this number, 46 points are the body's own statements and 14 belong to 11 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ReadingStore.ingest_units (cognitive 58) · ×1
  • ReadingStore.ingest_units (cognitive 58) deeptutor/reading/store.py:610 — ReadingStore.ingest_units has cognitive complexity 58 (threshold 15). Drivers by points: if/else 19 (32 pts), loops 6 (11 pts), boolean chains 10, ternaries 4, error handling 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OpenAICompatibleEmbeddingAdapter.embed (cognitive 58) · ×1
  • OpenAICompatibleEmbeddingAdapter.embed (cognitive 58) deeptutor/services/embedding/adapters/openai_compatible.py:171 — OpenAICompatibleEmbeddingAdapter.embed has cognitive complexity 58 (threshold 15). Drivers by points: if/else 18 (32 pts), boolean chains 10, error handling 3 (8 pts), ternaries 5 (7 pts), loops 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SessionList.SessionList (cognitive 58) · ×1
  • SessionList.SessionList (cognitive 58) web/components/SessionList.tsx:31 — SessionList.SessionList has cognitive complexity 58 (threshold 15). Drivers by points: ternaries 13 (30 pts), if/else 13 (22 pts), boolean chains 5, loops 1 (nesting depth added 26). Most of this is not in the body itself: 7 of the 58 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 249, a function literal at line 139, commitEdit, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · ServiceConfigEditor.ProfileFields (cognitive 58) · ×1
  • ServiceConfigEditor.ProfileFields (cognitive 58) web/components/settings/ServiceConfigEditor.tsx:1426 — ServiceConfigEditor.ProfileFields has cognitive complexity 58 (threshold 15). Drivers by points: boolean chains 40, if/else 10, ternaries 7 (8 pts) (nesting depth added 1). Of this number, 35 points are the body's own statements and 23 belong to 5 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · ToolsSettingsSection.ToolsSettingsPage (cognitive 58) · ×1
  • ToolsSettingsSection.ToolsSettingsPage (cognitive 58) web/features/settings/sections/ToolsSettingsSection.tsx:78 — ToolsSettingsSection.ToolsSettingsPage has cognitive complexity 58 (threshold 15). Drivers by points: boolean chains 19, ternaries 9 (19 pts), if/else 15 (17 pts), loops 2, error handling 1 (nesting depth added 12). Of this number, 20 points are the body's own statements and 38 belong to 9 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reading-citations.linkifyLocatorCitations (cognitive 58) · ×1
  • reading-citations.linkifyLocatorCitations (cognitive 58) web/lib/reading-citations.ts:236 — reading-citations.linkifyLocatorCitations has cognitive complexity 58 (threshold 15). Drivers by points: if/else 12 (32 pts), ternaries 7 (16 pts), boolean chains 6, loops 2 (4 pts) (nesting depth added 31). Of this number, 53 points are the body's own statements and 5 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ops._validate (cognitive 57) · ×1
  • ops._validate (cognitive 57) deeptutor/services/memory/ops.py:68 — ops._validate has cognitive complexity 57 (threshold 15). Drivers by points: if/else 16 (47 pts), loops 3 (7 pts), boolean chains 3 (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KbDocumentList.KbDocumentList (cognitive 57) · ×1
  • KbDocumentList.KbDocumentList (cognitive 57) web/components/knowledge/KbDocumentList.tsx:108 — KbDocumentList.KbDocumentList has cognitive complexity 57 (threshold 15). Drivers by points: ternaries 19 (31 pts), if/else 11 (12 pts), boolean chains 10, error handling 4 (nesting depth added 13). Most of this is not in the body itself: 13 of the 57 points are its own statements and the rest belongs to 12 function items inside it that branch (renderNode, handleMove, a function literal at line 130, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · SQLiteSessionStore._serialize_notebook_entry (cognitive 56) · ×1
  • SQLiteSessionStore._serialize_notebook_entry (cognitive 56) deeptutor/services/session/sqlite_store.py:4053 — SQLiteSessionStore._serialize_notebook_entry has cognitive complexity 56 (threshold 15). Drivers by points: boolean chains 24, ternaries 23 (24 pts), if/else 5 (8 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · factory.stream (cognitive 55) · ×1
  • factory.stream (cognitive 55) deeptutor/services/llm/factory.py:519 — factory.stream has cognitive complexity 55 (threshold 15). Drivers by points: if/else 16 (44 pts), boolean chains 4, error handling 1 (3 pts), loops 2 (3 pts), ternaries 1 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · source_filter.filter_web_search_response (cognitive 55) · ×1
  • source_filter.filter_web_search_response (cognitive 55) REDACTED:352 — source_filter.filter_web_search_response has cognitive complexity 55 (threshold 15). Drivers by points: if/else 19 (31 pts), boolean chains 13, loops 6 (7 pts), ternaries 2 (4 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · chat-completions.request (cognitive 55) · ×1
  • chat-completions.request (cognitive 55) packages/chat-engine/src/providers/chat-completions.ts:50 — chat-completions.request has cognitive complexity 55 (threshold 15). Drivers by points: if/else 29 (70 pts), boolean chains 12, loops 4 (8 pts), ternaries 1 (4 pts), error handling 1 (2 pts) (nesting depth added 49). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (chat-completions.request::ingest) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · loop.run_agentic_loop (cognitive 54) · ×1
  • loop.run_agentic_loop (cognitive 54) deeptutor/runtime/agentic/loop.py:178 — loop.run_agentic_loop has cognitive complexity 54 (threshold 15). Drivers by points: if/else 15 (43 pts), boolean chains 8, ternaries 1 (2 pts), loops 1 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · model_history.normalize_model_turn (cognitive 54) · ×1
  • model_history.normalize_model_turn (cognitive 54) deeptutor/services/session/model_history.py:44 — model_history.normalize_model_turn has cognitive complexity 54 (threshold 15). Drivers by points: if/else 18 (34 pts), boolean chains 13, loops 4 (6 pts), error handling 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SimpleMarkdownRenderer.SimpleMarkdownRenderer (cognitive 54) · ×1
  • SimpleMarkdownRenderer.SimpleMarkdownRenderer (cognitive 54) web/components/common/SimpleMarkdownRenderer.tsx:30 — SimpleMarkdownRenderer.SimpleMarkdownRenderer has cognitive complexity 54 (threshold 15). Drivers by points: ternaries 29 (35 pts), boolean chains 14, if/else 5 (nesting depth added 6). Most of this is not in the body itself: 14 of the 54 points are its own statements and the rest belongs to 21 function literals inside it that branch (lines 329, 305, 383, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · OutputFileActions.OutputFileActions (cognitive 54) · ×1
  • OutputFileActions.OutputFileActions (cognitive 54) web/components/files/OutputFileActions.tsx:27 — OutputFileActions.OutputFileActions has cognitive complexity 54 (threshold 15). Drivers by points: ternaries 17 (32 pts), error handling 4 (9 pts), boolean chains 8, if/else 5 (nesting depth added 20). Of this number, 31 points are the body's own statements and 23 belong to 6 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SpineSynthesizer._coerce_chapters (cognitive 53) · ×1
  • SpineSynthesizer._coerce_chapters (cognitive 53) deeptutor/book/agents/spine_synthesizer.py:422 — SpineSynthesizer._coerce_chapters has cognitive complexity 53 (threshold 15). Drivers by points: if/else 11 (25 pts), boolean chains 17, loops 3 (7 pts), error handling 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _turn_runtime_shared._format_followup_question_context (cognitive 53) · ×1
  • _turn_runtime_shared._format_followup_question_context (cognitive 53) deeptutor/services/session/_turn_runtime_shared.py:1237 — _turn_runtime_shared._format_followup_question_context has cognitive complexity 53 (threshold 15). Drivers by points: boolean chains 25, if/else 11 (17 pts), ternaries 5 (9 pts), loops 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · data_migration._selected_artifact_files (cognitive 53) · ×1
  • data_migration._selected_artifact_files (cognitive 53) deeptutor/services/workspace/data_migration.py:436 — data_migration._selected_artifact_files has cognitive complexity 53 (threshold 15). Drivers by points: if/else 11 (27 pts), loops 8 (17 pts), boolean chains 5, ternaries 1 (4 pts) (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ComposerResources.ComposerResources (cognitive 53) · ×1
  • ComposerResources.ComposerResources (cognitive 53) web/components/chat/home/ComposerResources.tsx:55 — ComposerResources.ComposerResources has cognitive complexity 53 (threshold 15). Drivers by points: boolean chains 27, ternaries 14 (15 pts), if/else 11 (nesting depth added 1). Of this number, 20 points are the body's own statements and 33 belong to 12 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · QuestionBankSection.QuestionBankSection (cognitive 53) · ×1
  • QuestionBankSection.QuestionBankSection (cognitive 53) web/components/space/question-bank/QuestionBankSection.tsx:43 — QuestionBankSection.QuestionBankSection has cognitive complexity 53 (threshold 15). Drivers by points: ternaries 7 (25 pts), if/else 5 (20 pts), boolean chains 8 (nesting depth added 33). Of this number, 33 points are the body's own statements and 20 belong to 5 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · NoteFavoritesPicker.NoteFavoritesPicker (cognitive 53) · ×1
  • NoteFavoritesPicker.NoteFavoritesPicker (cognitive 53) web/features/notes/components/NoteFavoritesPicker.tsx:35 — NoteFavoritesPicker.NoteFavoritesPicker has cognitive complexity 53 (threshold 15). Drivers by points: boolean chains 25, ternaries 16 (20 pts), if/else 7, loops 1 (nesting depth added 4). Of this number, 19 points are the body's own statements and 34 belong to 15 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · memory-graph.buildGraph (cognitive 53) · ×1
  • memory-graph.buildGraph (cognitive 53) web/lib/memory-graph.ts:322 — memory-graph.buildGraph has cognitive complexity 53 (threshold 15). Drivers by points: if/else 12 (33 pts), loops 9 (11 pts), boolean chains 9 (nesting depth added 23). Most of this is not in the body itself: 7 of the 53 points are its own statements and the rest belongs to 9 function items inside it that branch (a function literal at line 619, a function literal at line 579, pushEdge, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · quiz_judge._build_judge_user_prompt (cognitive 52) · ×1
  • quiz_judge._build_judge_user_prompt (cognitive 52) deeptutor/api/routers/quiz_judge.py:129 — quiz_judge._build_judge_user_prompt has cognitive complexity 52 (threshold 15). Drivers by points: if/else 19 (35 pts), ternaries 4 (9 pts), boolean chains 6, error handling 1 (2 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MasteryGradeTool.execute (cognitive 52) · ×1
  • MasteryGradeTool.execute (cognitive 52) deeptutor/capabilities/mastery/tools.py:1653 — MasteryGradeTool.execute has cognitive complexity 52 (threshold 15). Drivers by points: boolean chains 18, if/else 13 (17 pts), ternaries 16, error handling 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · importing.parse_rows (cognitive 52) · ×1
  • importing.parse_rows (cognitive 52) deeptutor/services/practice/importing.py:57 — importing.parse_rows has cognitive complexity 52 (threshold 15). Drivers by points: if/else 20 (36 pts), error handling 3 (6 pts), loops 2 (4 pts), boolean chains 3, ternaries 1 (3 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · attachment_parsing.parse_chat_pdf_attachments (cognitive 52) · ×1
  • attachment_parsing.parse_chat_pdf_attachments (cognitive 52) deeptutor/services/session/attachment_parsing.py:19 — attachment_parsing.parse_chat_pdf_attachments has cognitive complexity 52 (threshold 15). Drivers by points: if/else 16 (35 pts), boolean chains 9, loops 2 (5 pts), error handling 1 (3 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · QuestionCard.QuestionCard (cognitive 52) · ×1
  • QuestionCard.QuestionCard (cognitive 52) web/components/space/question-bank/QuestionCard.tsx:136 — QuestionCard.QuestionCard has cognitive complexity 52 (threshold 15). Drivers by points: boolean chains 42, ternaries 10. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · KnowledgeBaseManager.update_kb_status (cognitive 51) · ×1
  • KnowledgeBaseManager.update_kb_status (cognitive 51) deeptutor/knowledge/manager.py:503 — KnowledgeBaseManager.update_kb_status has cognitive complexity 51 (threshold 15). Drivers by points: if/else 16 (33 pts), boolean chains 7, error handling 3 (6 pts), loops 1 (3 pts), ternaries 1 (2 pts) (nesting depth added 23). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · FeishuChannel.send_delta (cognitive 51) · ×1
  • FeishuChannel.send_delta (cognitive 51) deeptutor/partners/channels/feishu.py:1615 — FeishuChannel.send_delta has cognitive complexity 51 (threshold 15). Drivers by points: if/else 18 (40 pts), boolean chains 8, loops 1 (2 pts), ternaries 1 (nesting depth added 23). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · TurnLifecycle._coordinate_execution (cognitive 51) · ×1
  • TurnLifecycle._coordinate_execution (cognitive 51) deeptutor/services/session/turns/lifecycle.py:231 — TurnLifecycle._coordinate_execution has cognitive complexity 51 (threshold 15). Drivers by points: if/else 11 (37 pts), boolean chains 9, loops 2 (3 pts), error handling 2 (nesting depth added 27). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · RAGTool._retrieve (cognitive 51) · ×1
  • RAGTool._retrieve (cognitive 51) deeptutor/tools/builtin/__init__.py:293 — RAGTool._retrieve has cognitive complexity 51 (threshold 15). Drivers by points: if/else 15 (23 pts), boolean chains 18, ternaries 3 (5 pts), loops 1 (3 pts), error handling 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · QuestionBankPicker.QuestionBankPicker (cognitive 51) · ×1
  • QuestionBankPicker.QuestionBankPicker (cognitive 51) web/components/chat/QuestionBankPicker.tsx:57 — QuestionBankPicker.QuestionBankPicker has cognitive complexity 51 (threshold 15). Drivers by points: ternaries 11 (20 pts), if/else 12 (15 pts), boolean chains 13, error handling 2, loops 1 (nesting depth added 12). Most of this is not in the body itself: 11 of the 51 points are its own statements and the rest belongs to 12 function items inside it that branch (a function literal at line 111, a function literal at line 297, a function literal at line 85, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · CodeBuddyAuthCard.CodeBuddyAuthCard (cognitive 51) · ×1
  • CodeBuddyAuthCard.CodeBuddyAuthCard (cognitive 51) web/components/settings/CodeBuddyAuthCard.tsx:25 — CodeBuddyAuthCard.CodeBuddyAuthCard has cognitive complexity 51 (threshold 15). Drivers by points: ternaries 15 (35 pts), boolean chains 7, if/else 4 (5 pts), error handling 4 (nesting depth added 21). Of this number, 33 points are the body's own statements and 18 belong to 5 function items inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · MinerUEngineSettings.MinerUEngineSettings (cognitive 51) · ×1
  • MinerUEngineSettings.MinerUEngineSettings (cognitive 51) web/components/settings/MinerUEngineSettings.tsx:86 — MinerUEngineSettings.MinerUEngineSettings has cognitive complexity 51 (threshold 15). Drivers by points: boolean chains 20, if/else 13 (14 pts), ternaries 9 (13 pts), error handling 4 (nesting depth added 5). Most of this is not in the body itself: 14 of the 51 points are its own statements and the rest belongs to 10 function items inside it that branch (a function literal at line 110, testConnection, a function literal at line 203, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · TracePresentation.TraceRowItem (cognitive 51) · ×1
  • TracePresentation.TraceRowItem (cognitive 51) web/features/chat/trace/TracePresentation.tsx:977 — TracePresentation.TraceRowItem has cognitive complexity 51 (threshold 15). Drivers by points: ternaries 13 (24 pts), boolean chains 17, if/else 8 (10 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · history.reference_history_reads (cognitive 50) · ×1
  • history.reference_history_reads (cognitive 50) deeptutor/capabilities/mastery/history.py:62 — history.reference_history_reads has cognitive complexity 50 (threshold 15). Drivers by points: if/else 8 (26 pts), error handling 2 (9 pts), boolean chains 7, loops 2 (4 pts), ternaries 1 (4 pts) (nesting depth added 30). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · lifecycle.change (cognitive 50) · ×1
  • lifecycle.change (cognitive 50) deeptutor/modules/lifecycle.py:152 — lifecycle.change has cognitive complexity 50 (threshold 15). Drivers by points: if/else 16 (34 pts), loops 3 (6 pts), boolean chains 4, ternaries 2 (4 pts), error handling 1 (2 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · feishu._extract_element_content (cognitive 50) · ×1
  • feishu._extract_element_content (cognitive 50) deeptutor/partners/channels/feishu.py:151 — feishu._extract_element_content has cognitive complexity 50 (threshold 15). Drivers by points: if/else 15 (35 pts), loops 5 (11 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 27). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · provider_runtime.resolve_llm_runtime_config (cognitive 50) · ×1
  • provider_runtime.resolve_llm_runtime_config (cognitive 50) deeptutor/services/config/provider_runtime.py:906 — provider_runtime.resolve_llm_runtime_config has cognitive complexity 50 (threshold 15). Drivers by points: boolean chains 32, if/else 10 (13 pts), ternaries 5 (nesting depth added 3). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · evaluation.load_cases (cognitive 50) · ×1
  • evaluation.load_cases (cognitive 50) deeptutor/services/memory/evaluation.py:82 — evaluation.load_cases has cognitive complexity 50 (threshold 15). Drivers by points: if/else 17 (33 pts), boolean chains 12, error handling 1 (2 pts), ternaries 1 (2 pts), loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · html_extractor._element_to_markdown (cognitive 50) · ×1
  • html_extractor._element_to_markdown (cognitive 50) deeptutor/services/web_source/html_extractor.py:420 — html_extractor._element_to_markdown has cognitive complexity 50 (threshold 15). Drivers by points: if/else 17 (41 pts), loops 2 (5 pts), boolean chains 4 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · document_images._extract_pptx_rich_ooxml (cognitive 50) · ×1
  • document_images._extract_pptx_rich_ooxml (cognitive 50) deeptutor/utils/document_images.py:711 — document_images._extract_pptx_rich_ooxml has cognitive complexity 50 (threshold 15). Drivers by points: if/else 9 (35 pts), loops 3 (6 pts), ternaries 1 (4 pts), boolean chains 3, error handling 1 (2 pts) (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · page.WhisperPage (cognitive 50) · ×1
  • page.WhisperPage (cognitive 50) web/app/(workspace)/whisper/page.tsx:39 — page.WhisperPage has cognitive complexity 50 (threshold 15). Drivers by points: if/else 18 (20 pts), boolean chains 19, ternaries 8 (11 pts) (nesting depth added 5). Most of this is not in the body itself: 13 of the 50 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 70, startTurn, sendWithRetry, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · CreationDraftCard.CreationDraftCard (cognitive 50) · ×1
  • CreationDraftCard.CreationDraftCard (cognitive 50) web/components/chat/home/CreationDraftCard.tsx:42 — CreationDraftCard.CreationDraftCard has cognitive complexity 50 (threshold 15). Drivers by points: ternaries 24 (37 pts), if/else 6 (7 pts), boolean chains 5, error handling 1 (nesting depth added 14). Of this number, 31 points are the body's own statements and 19 belong to 4 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MathAnimatorViewer.MathAnimatorViewer (cognitive 50) · ×1
  • MathAnimatorViewer.MathAnimatorViewer (cognitive 50) web/components/math-animator/MathAnimatorViewer.tsx:10 — MathAnimatorViewer.MathAnimatorViewer has cognitive complexity 50 (threshold 15). Drivers by points: if/else 8 (16 pts), ternaries 12 (16 pts), boolean chains 15, loops 2 (3 pts) (nesting depth added 13). Of this number, 21 points are the body's own statements and 29 belong to 4 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ServicePreviewPanel.Preview · ×1
  • ServicePreviewPanel.Preview::run (cognitive 50) web/components/settings/ServicePreviewPanel.tsx:86 — ServicePreviewPanel.Preview::run has cognitive complexity 50 (threshold 15). Drivers by points: if/else 14 (32 pts), ternaries 3 (9 pts), boolean chains 5, loops 2 (3 pts), error handling 1 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (ServicePreviewPanel.Preview) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · policy.next_objective (cognitive 49) · ×1
  • policy.next_objective (cognitive 49) deeptutor/learning/policy.py:281 — policy.next_objective has cognitive complexity 49 (threshold 15). Drivers by points: ternaries 9 (22 pts), if/else 10 (20 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PluginRegistry._installed_records (cognitive 49) · ×1
  • PluginRegistry._installed_records (cognitive 49) deeptutor/plugins/registry.py:276 — PluginRegistry._installed_records has cognitive complexity 49 (threshold 15). Drivers by points: if/else 10 (24 pts), ternaries 4 (12 pts), boolean chains 9, loops 3 (4 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · embedding_endpoint.normalize_embedding_endpoint_for_display (cognitive 49) · ×1
  • embedding_endpoint.normalize_embedding_endpoint_for_display (cognitive 49) deeptutor/services/config/embedding_endpoint.py:194 — embedding_endpoint.normalize_embedding_endpoint_for_display has cognitive complexity 49 (threshold 15). Drivers by points: if/else 21 (39 pts), ternaries 3 (7 pts), boolean chains 3 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DoubaoProvider.search (cognitive 49) · ×1
  • DoubaoProvider.search (cognitive 49) deeptutor/services/search/providers/doubao.py:39 — DoubaoProvider.search has cognitive complexity 49 (threshold 15). Drivers by points: boolean chains 20, if/else 10 (20 pts), loops 5 (8 pts), error handling 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ask_user_trace.extract_ask_user_clarification_blocks (cognitive 49) · ×1
  • ask_user_trace.extract_ask_user_clarification_blocks (cognitive 49) deeptutor/services/session/ask_user_trace.py:58 — ask_user_trace.extract_ask_user_clarification_blocks has cognitive complexity 49 (threshold 15). Drivers by points: if/else 11 (27 pts), boolean chains 13, loops 3 (6 pts), error handling 1 (3 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · speech_text.verbalize_latex_for_speech (cognitive 49) · ×1
  • speech_text.verbalize_latex_for_speech (cognitive 49) deeptutor/services/voice/speech_text.py:750 — speech_text.verbalize_latex_for_speech has cognitive complexity 49 (threshold 15). Drivers by points: if/else 15 (36 pts), boolean chains 5, loops 2 (4 pts), ternaries 2 (4 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · build_modules.build (cognitive 49) · ×1
  • build_modules.build (cognitive 49) scripts/build_modules.py:26 — build_modules.build has cognitive complexity 49 (threshold 15). Drivers by points: if/else 10 (23 pts), loops 7 (15 pts), ternaries 3 (7 pts), boolean chains 4 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MemorySection.MemorySection (cognitive 49) · ×1
  • MemorySection.MemorySection (cognitive 49) web/components/memory/MemorySection.tsx:264 — MemorySection.MemorySection has cognitive complexity 49 (threshold 15). Drivers by points: boolean chains 15, if/else 12 (15 pts), error handling 5 (8 pts), ternaries 4 (8 pts), loops 2 (3 pts) (nesting depth added 11). Most of this is not in the body itself: 8 of the 49 points are its own statements and the rest belongs to 10 function literals inside it that branch (lines 369, 331, 346, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · SaveToNotebookModal.SaveToNotebookModal · ×1
  • SaveToNotebookModal.SaveToNotebookModal::handleSave (cognitive 49) web/components/notebook/SaveToNotebookModal.tsx:322 — SaveToNotebookModal.SaveToNotebookModal::handleSave has cognitive complexity 49 (threshold 15). Drivers by points: if/else 15 (30 pts), boolean chains 9, ternaries 2 (6 pts), loops 2 (3 pts), error handling 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (SaveToNotebookModal.SaveToNotebookModal) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · KnowledgeBaseManager._read_and_reconcile_config (cognitive 48) · ×1
  • KnowledgeBaseManager._read_and_reconcile_config (cognitive 48) deeptutor/knowledge/manager.py:381 — KnowledgeBaseManager._read_and_reconcile_config has cognitive complexity 48 (threshold 15). Drivers by points: if/else 14 (38 pts), error handling 2 (5 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · crawler.crawl_docs_site (cognitive 48) · ×1
  • crawler.crawl_docs_site (cognitive 48) deeptutor/services/web_source/crawler.py:347 — crawler.crawl_docs_site has cognitive complexity 48 (threshold 15). Drivers by points: if/else 16 (28 pts), boolean chains 9, loops 4 (8 pts), ternaries 1 (2 pts), error handling 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · chat._apply_command (cognitive 48) · ×1
  • chat._apply_command (cognitive 48) deeptutor_cli/chat.py:192 — chat._apply_command has cognitive complexity 48 (threshold 15). Drivers by points: if/else 22 (31 pts), boolean chains 12, ternaries 2 (4 pts), error handling 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · setup_config.prepare_profiles (cognitive 48) · ×1
  • setup_config.prepare_profiles (cognitive 48) deeptutor_cli/setup_config.py:106 — setup_config.prepare_profiles has cognitive complexity 48 (threshold 15). Drivers by points: if/else 16 (32 pts), boolean chains 11, ternaries 2 (4 pts), loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BookLibrary.BookLibrary (cognitive 48) · ×1
  • BookLibrary.BookLibrary (cognitive 48) web/app/(workspace)/learning/books/components/BookLibrary.tsx:82 — BookLibrary.BookLibrary has cognitive complexity 48 (threshold 15). Drivers by points: ternaries 8 (23 pts), boolean chains 20, if/else 2 (5 pts) (nesting depth added 18). Of this number, 16 points are the body's own statements and 32 belong to 7 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · PickerShell.PickerShell (cognitive 48) · ×1
  • PickerShell.PickerShell (cognitive 48) web/components/common/PickerShell.tsx:98 — PickerShell.PickerShell has cognitive complexity 48 (threshold 15). Drivers by points: ternaries 14 (20 pts), if/else 17 (18 pts), boolean chains 10 (nesting depth added 7). Most of this is not in the body itself: 8 of the 48 points are its own statements and the rest belongs to 10 function items inside it that branch (a function literal at line 131, a function literal at line 225, cardExit, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · KbDocumentsSection.KbDocumentsSection (cognitive 48) · ×1
  • KbDocumentsSection.KbDocumentsSection (cognitive 48) web/components/knowledge/KbDocumentsSection.tsx:43 — KbDocumentsSection.KbDocumentsSection has cognitive complexity 48 (threshold 15). Drivers by points: boolean chains 22, ternaries 9 (22 pts), if/else 4 (nesting depth added 13). Of this number, 40 points are the body's own statements and 8 belong to 5 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PartnerChannels.PartnerChannels (cognitive 48) · ×1
  • PartnerChannels.PartnerChannels (cognitive 48) web/components/partners/PartnerChannels.tsx:43 — PartnerChannels.PartnerChannels has cognitive complexity 48 (threshold 15). Drivers by points: ternaries 12 (17 pts), boolean chains 14, if/else 12 (14 pts), error handling 3 (nesting depth added 7). Of this number, 19 points are the body's own statements and 29 belong to 9 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · AboutSettingsSection.AboutSettingsPage (cognitive 48) · ×1
  • AboutSettingsSection.AboutSettingsPage (cognitive 48) web/features/settings/sections/AboutSettingsSection.tsx:59 — AboutSettingsSection.AboutSettingsPage has cognitive complexity 48 (threshold 15). Drivers by points: boolean chains 18, if/else 10 (13 pts), ternaries 8 (13 pts), error handling 4 (nesting depth added 8). Of this number, 23 points are the body's own statements and 25 belong to 7 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · tools._revise_points (cognitive 47) · ×1
  • tools._revise_points (cognitive 47) deeptutor/capabilities/mastery/tools.py:3521 — tools._revise_points has cognitive complexity 47 (threshold 15). Drivers by points: if/else 17 (26 pts), boolean chains 10, ternaries 4 (8 pts), loops 3 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · catalog.module_statuses (cognitive 47) · ×1
  • catalog.module_statuses (cognitive 47) deeptutor/modules/catalog.py:197 — catalog.module_statuses has cognitive complexity 47 (threshold 15). Drivers by points: if/else 8 (27 pts), loops 6 (12 pts), boolean chains 4, error handling 1 (4 pts) (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ReadingStore._reanchor_annotations (cognitive 47) · ×1
  • ReadingStore._reanchor_annotations (cognitive 47) deeptutor/reading/store.py:1230 — ReadingStore._reanchor_annotations has cognitive complexity 47 (threshold 15). Drivers by points: if/else 13 (29 pts), loops 6 (16 pts), boolean chains 2 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · provider_links.resolve_profile_provider (cognitive 47) · ×1
  • provider_links.resolve_profile_provider (cognitive 47) deeptutor/services/config/provider_links.py:120 — provider_links.resolve_profile_provider has cognitive complexity 47 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 14, ternaries 9 (14 pts), loops 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _turn_runtime_shared._resolve_selection_tutor_context (cognitive 47) · ×1
  • _turn_runtime_shared._resolve_selection_tutor_context (cognitive 47) deeptutor/services/session/_turn_runtime_shared.py:1612 — _turn_runtime_shared._resolve_selection_tutor_context has cognitive complexity 47 (threshold 15). Drivers by points: if/else 14 (29 pts), boolean chains 10, error handling 2 (4 pts), ternaries 2 (4 pts) (nesting depth added 19). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · SQLiteSessionStore._upsert_notebook_entries_in_conn (cognitive 47) · ×1
  • SQLiteSessionStore._upsert_notebook_entries_in_conn (cognitive 47) deeptutor/services/session/sqlite_store.py:3413 — SQLiteSessionStore._upsert_notebook_entries_in_conn has cognitive complexity 47 (threshold 15). Drivers by points: boolean chains 18, ternaries 8 (18 pts), if/else 6 (10 pts), loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClaudeCodeBackend._handle_event (cognitive 47) · ×1
  • ClaudeCodeBackend._handle_event (cognitive 47) deeptutor/services/subagent/claude_code.py:181 — ClaudeCodeBackend._handle_event has cognitive complexity 47 (threshold 15). Drivers by points: if/else 15 (29 pts), boolean chains 11, loops 2 (4 pts), ternaries 1 (3 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · bilingual.detect_bilingual_pairings (cognitive 47) · ×1
  • bilingual.detect_bilingual_pairings (cognitive 47) deeptutor/services/web_source/bilingual.py:129 — bilingual.detect_bilingual_pairings has cognitive complexity 47 (threshold 15). Drivers by points: if/else 11 (30 pts), loops 6 (10 pts), boolean chains 7 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · document_extractor._epub_package_navigation (cognitive 47) · ×1
  • document_extractor._epub_package_navigation (cognitive 47) deeptutor/utils/document_extractor.py:811 — document_extractor._epub_package_navigation has cognitive complexity 47 (threshold 15). Drivers by points: if/else 15 (34 pts), boolean chains 9, ternaries 1 (3 pts), loops 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · marks.normalize_mark (cognitive 47) · ×1
  • marks.normalize_mark (cognitive 47) deeptutor/video_learning/marks.py:138 — marks.normalize_mark has cognitive complexity 47 (threshold 15). Drivers by points: boolean chains 25, if/else 18 (19 pts), ternaries 2, error handling 1 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · ReadingExtensionBar.ExtensionToolbar (cognitive 47) · ×1
  • ReadingExtensionBar.ExtensionToolbar (cognitive 47) web/components/reading/ReadingExtensionBar.tsx:90 — ReadingExtensionBar.ExtensionToolbar has cognitive complexity 47 (threshold 15). Drivers by points: ternaries 16 (25 pts), if/else 9 (11 pts), boolean chains 10, error handling 1 (nesting depth added 11). Most of this is not in the body itself: 4 of the 47 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 209, run, a function literal at line 122, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · CalendarRuntime.CalendarRuntime (cognitive 47) · ×1
  • CalendarRuntime.CalendarRuntime (cognitive 47) web/features/calendar/components/CalendarRuntime.tsx:14 — CalendarRuntime.CalendarRuntime has cognitive complexity 47 (threshold 15). Drivers by points: if/else 11 (23 pts), error handling 4 (11 pts), boolean chains 7, loops 2 (3 pts), ternaries 1 (3 pts) (nesting depth added 22). Most of this is not in the body itself: 4 of the 47 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 31, 51, 24, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · knowledge._list_knowledge_bases (cognitive 46) · ×1
  • knowledge._list_knowledge_bases (cognitive 46) deeptutor/api/routers/knowledge.py:2804 — knowledge._list_knowledge_bases has cognitive complexity 46 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 10, error handling 5 (10 pts), ternaries 3 (7 pts), loops 2 (3 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LearningService.grade_interaction_semantic (cognitive 46) · ×1
  • LearningService.grade_interaction_semantic (cognitive 46) deeptutor/learning/service.py:3118 — LearningService.grade_interaction_semantic has cognitive complexity 46 (threshold 15). Drivers by points: if/else 15 (27 pts), boolean chains 7, ternaries 5 (7 pts), error handling 2 (4 pts), loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · catalog.manifests (cognitive 46) · ×1
  • catalog.manifests (cognitive 46) deeptutor/modules/catalog.py:25 — catalog.manifests has cognitive complexity 46 (threshold 15). Drivers by points: loops 11 (23 pts), if/else 6 (20 pts), boolean chains 3 (nesting depth added 26). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · launcher._terminate_all (cognitive 46) · ×1
  • launcher._terminate_all (cognitive 46) deeptutor/runtime/launcher.py:290 — launcher._terminate_all has cognitive complexity 46 (threshold 15). Drivers by points: if/else 8 (18 pts), error handling 4 (14 pts), loops 4 (8 pts), boolean chains 5, ternaries 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ask_user._build_question (cognitive 46) · ×1
  • ask_user._build_question (cognitive 46) deeptutor/tools/ask_user.py:243 — ask_user._build_question has cognitive complexity 46 (threshold 15). Drivers by points: if/else 19 (35 pts), boolean chains 6, loops 2 (4 pts), ternaries 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PracticePage.PracticeCollectionPage (cognitive 46) · ×1
  • PracticePage.PracticeCollectionPage (cognitive 46) web/components/learning/practice/PracticePage.tsx:24 — PracticePage.PracticeCollectionPage has cognitive complexity 46 (threshold 15). Drivers by points: ternaries 13 (25 pts), boolean chains 11, if/else 6 (8 pts), error handling 2 (nesting depth added 14). Most of this is not in the body itself: 14 of the 46 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 43, startReview, a function literal at line 211, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · i18n_audit.reportUntranslatedKeys (cognitive 46) · ×1
  • i18n_audit.reportUntranslatedKeys (cognitive 46) web/scripts/i18n_audit.mjs:127 — i18n_audit.reportUntranslatedKeys has cognitive complexity 46 (threshold 15). Drivers by points: if/else 12 (25 pts), loops 8 (15 pts), ternaries 2 (4 pts), boolean chains 2 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · book.quiz_attempt (cognitive 45) · ×1
  • book.quiz_attempt (cognitive 45) deeptutor/api/routers/book.py:1103 — book.quiz_attempt has cognitive complexity 45 (threshold 15). Drivers by points: ternaries 10 (18 pts), boolean chains 15, if/else 7 (9 pts), error handling 2 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TurnApplicationService.start_turn (cognitive 45) · ×1
  • TurnApplicationService.start_turn (cognitive 45) deeptutor/app/service.py:113 — TurnApplicationService.start_turn has cognitive complexity 45 (threshold 15). Drivers by points: if/else 9 (21 pts), boolean chains 19, loops 2 (3 pts), error handling 1, ternaries 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TelegramChannel.send_delta (cognitive 45) · ×1
  • TelegramChannel.send_delta (cognitive 45) deeptutor/partners/channels/telegram.py:624 — TelegramChannel.send_delta has cognitive complexity 45 (threshold 15). Drivers by points: if/else 14 (25 pts), error handling 4 (10 pts), boolean chains 5, ternaries 1 (3 pts), loops 1 (2 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · converters.convert_messages (cognitive 45) · ×1
  • converters.convert_messages (cognitive 45) deeptutor/services/llm/provider_core/openai_responses/converters.py:16 — converters.convert_messages has cognitive complexity 45 (threshold 15). Drivers by points: if/else 8 (21 pts), ternaries 4 (13 pts), boolean chains 7, loops 2 (4 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reasoning_params.build_openai_compatible_reasoning_kwargs (cognitive 45) · ×1
  • reasoning_params.build_openai_compatible_reasoning_kwargs (cognitive 45) deeptutor/services/llm/reasoning_params.py:173 — reasoning_params.build_openai_compatible_reasoning_kwargs has cognitive complexity 45 (threshold 15). Drivers by points: if/else 21 (30 pts), boolean chains 15 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · usage_statistics.aggregate_usage (cognitive 45) · ×1
  • usage_statistics.aggregate_usage (cognitive 45) deeptutor/services/session/usage_statistics.py:160 — usage_statistics.aggregate_usage has cognitive complexity 45 (threshold 15). Drivers by points: if/else 9 (25 pts), loops 5 (12 pts), boolean chains 8 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · data_migration.recover_operation (cognitive 45) · ×1
  • data_migration.recover_operation (cognitive 45) deeptutor/services/workspace/data_migration.py:1023 — data_migration.recover_operation has cognitive complexity 45 (threshold 15). Drivers by points: if/else 13 (33 pts), loops 2 (7 pts), boolean chains 4, error handling 1 (nesting depth added 25). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · SidebarShell.SidebarShell (cognitive 45) · ×1
  • SidebarShell.SidebarShell (cognitive 45) web/components/sidebar/SidebarShell.tsx:104 — SidebarShell.SidebarShell has cognitive complexity 45 (threshold 15). Drivers by points: ternaries 18 (25 pts), boolean chains 10, if/else 8 (10 pts) (nesting depth added 9). Of this number, 34 points are the body's own statements and 11 belong to 4 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KanbanBoard.KanbanBoard (cognitive 45) · ×1
  • KanbanBoard.KanbanBoard (cognitive 45) web/features/tasks/components/KanbanBoard.tsx:45 — KanbanBoard.KanbanBoard has cognitive complexity 45 (threshold 15). Drivers by points: boolean chains 25, ternaries 9 (12 pts), if/else 6 (7 pts), error handling 1 (nesting depth added 4). Most of this is not in the body itself: 15 of the 45 points are its own statements and the rest belongs to 10 function items inside it that branch (a function literal at line 248, act, a function literal at line 209, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · latex.normalizeEditorMdInlineMathInProse (cognitive 45) · ×1
  • latex.normalizeEditorMdInlineMathInProse (cognitive 45) web/lib/latex.ts:92 — latex.normalizeEditorMdInlineMathInProse has cognitive complexity 45 (threshold 15). Drivers by points: if/else 8 (24 pts), loops 4 (12 pts), boolean chains 6, ternaries 1 (3 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · utils.validate_visualization (cognitive 44) · ×1
  • utils.validate_visualization (cognitive 44) deeptutor/agents/visualize/utils.py:112 — utils.validate_visualization has cognitive complexity 44 (threshold 15). Drivers by points: if/else 21 (36 pts), boolean chains 4, error handling 2 (4 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ReadingStore.refresh_document (cognitive 44) · ×1
  • ReadingStore.refresh_document (cognitive 44) deeptutor/reading/store.py:445 — ReadingStore.refresh_document has cognitive complexity 44 (threshold 15). Drivers by points: if/else 14 (23 pts), loops 6 (7 pts), boolean chains 6, error handling 2 (4 pts), ternaries 2 (4 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ReadingStore.save_annotation (cognitive 44) · ×1
  • ReadingStore.save_annotation (cognitive 44) deeptutor/reading/store.py:1331 — ReadingStore.save_annotation has cognitive complexity 44 (threshold 15). Drivers by points: if/else 23 (35 pts), boolean chains 5, ternaries 3 (4 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · tool_dispatch._collect_outcome (cognitive 44) · ×1
  • tool_dispatch._collect_outcome (cognitive 44) deeptutor/runtime/agentic/tool_dispatch.py:854 — tool_dispatch._collect_outcome has cognitive complexity 44 (threshold 15). Drivers by points: if/else 9 (23 pts), ternaries 5 (11 pts), boolean chains 9, loops 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ContextBuilder.build (cognitive 44) · ×1
  • ContextBuilder.build (cognitive 44) deeptutor/services/session/context_builder.py:624 — ContextBuilder.build has cognitive complexity 44 (threshold 15). Drivers by points: if/else 20 (28 pts), boolean chains 11, ternaries 3, error handling 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · data_migration.preview (cognitive 44) · ×1
  • data_migration.preview (cognitive 44) deeptutor/services/workspace/data_migration.py:315 — data_migration.preview has cognitive complexity 44 (threshold 15). Drivers by points: if/else 18 (31 pts), loops 6 (8 pts), boolean chains 5 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StarterSuggestions.StarterSuggestions (cognitive 44) · ×1
  • StarterSuggestions.StarterSuggestions (cognitive 44) web/components/chat/home/StarterSuggestions.tsx:93 — StarterSuggestions.StarterSuggestions has cognitive complexity 44 (threshold 15). Drivers by points: if/else 18 (19 pts), boolean chains 12, ternaries 9 (11 pts), error handling 2 (nesting depth added 3). Most of this is not in the body itself: 7 of the 44 points are its own statements and the rest belongs to 10 function literals inside it that branch (lines 181, 141, 157, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · QuizFollowupTabBody.QuizFollowupTabBody (cognitive 44) · ×1
  • QuizFollowupTabBody.QuizFollowupTabBody (cognitive 44) web/components/quiz/QuizFollowupTabBody.tsx:69 — QuizFollowupTabBody.QuizFollowupTabBody has cognitive complexity 44 (threshold 15). Drivers by points: ternaries 9 (23 pts), boolean chains 12, if/else 7 (8 pts), error handling 1 (nesting depth added 15). Of this number, 31 points are the body's own statements and 13 belong to 7 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TracePresentation.getDeepResearchStatusLabel (cognitive 44) · ×1
  • TracePresentation.getDeepResearchStatusLabel (cognitive 44) web/features/chat/trace/TracePresentation.tsx:1385 — TracePresentation.getDeepResearchStatusLabel has cognitive complexity 44 (threshold 15). Drivers by points: if/else 12 (26 pts), ternaries 3 (10 pts), boolean chains 7, loops 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AgenticLoopPipeline._augment_tool_kwargs (cognitive 43) · ×1
  • AgenticLoopPipeline._augment_tool_kwargs (cognitive 43) deeptutor/agents/loop/pipeline.py:1397 — AgenticLoopPipeline._augment_tool_kwargs has cognitive complexity 43 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 17, ternaries 3 (6 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · spine_synthesizer._ensure_full_coverage (cognitive 43) · ×1
  • spine_synthesizer._ensure_full_coverage (cognitive 43) deeptutor/book/agents/spine_synthesizer.py:738 — spine_synthesizer._ensure_full_coverage has cognitive complexity 43 (threshold 15). Drivers by points: if/else 9 (20 pts), loops 6 (10 pts), boolean chains 8, ternaries 1 (5 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LearningService._grade_group (cognitive 43) · ×1
  • LearningService._grade_group (cognitive 43) deeptutor/learning/service.py:1412 — LearningService._grade_group has cognitive complexity 43 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 12, ternaries 6 (9 pts), error handling 1 (3 pts), loops 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GrokBackend._handle_event (cognitive 43) · ×1
  • GrokBackend._handle_event (cognitive 43) deeptutor/services/subagent/grok.py:180 — GrokBackend._handle_event has cognitive complexity 43 (threshold 15). Drivers by points: if/else 15 (24 pts), boolean chains 11, ternaries 3 (6 pts), loops 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ChannelOnboardingPanel.ChannelOnboardingPanel (cognitive 43) · ×1
  • ChannelOnboardingPanel.ChannelOnboardingPanel (cognitive 43) web/components/partners/ChannelOnboardingPanel.tsx:25 — ChannelOnboardingPanel.ChannelOnboardingPanel has cognitive complexity 43 (threshold 15). Drivers by points: ternaries 12 (19 pts), boolean chains 13, if/else 7, error handling 4 (nesting depth added 7). Of this number, 20 points are the body's own statements and 23 belong to 9 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CitationManager.build_ref_number_map (cognitive 42) · ×1
  • CitationManager.build_ref_number_map (cognitive 42) deeptutor/agents/research/utils/citation_manager.py:758 — CitationManager.build_ref_number_map has cognitive complexity 42 (threshold 15). Drivers by points: if/else 14 (37 pts), loops 2 (5 pts) (nesting depth added 26). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · lesson_evidence.selected_scope (cognitive 42) · ×1
  • lesson_evidence.selected_scope (cognitive 42) deeptutor/learning/lesson_evidence.py:218 — lesson_evidence.selected_scope has cognitive complexity 42 (threshold 15). Drivers by points: if/else 15 (34 pts), boolean chains 3, error handling 1 (3 pts), loops 1, ternaries 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WecomChannel._process_message (cognitive 42) · ×1
  • WecomChannel._process_message (cognitive 42) deeptutor/partners/channels/wecom.py:206 — WecomChannel._process_message has cognitive complexity 42 (threshold 15). Drivers by points: if/else 20 (33 pts), loops 3 (4 pts), boolean chains 2, ternaries 2, error handling 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WeixinChannel.send (cognitive 42) · ×1
  • WeixinChannel.send (cognitive 42) deeptutor/partners/channels/weixin.py:943 — WeixinChannel.send has cognitive complexity 42 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 10, error handling 4 (7 pts), ternaries 2 (7 pts), loops 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · references.resolve_reading_sources (cognitive 42) · ×1
  • references.resolve_reading_sources (cognitive 42) deeptutor/reading/references.py:84 — references.resolve_reading_sources has cognitive complexity 42 (threshold 15). Drivers by points: if/else 10 (25 pts), error handling 2 (5 pts), loops 3 (5 pts), boolean chains 4, ternaries 1 (3 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ReadingStore.ingest (cognitive 42) · ×1
  • ReadingStore.ingest (cognitive 42) deeptutor/reading/store.py:254 — ReadingStore.ingest has cognitive complexity 42 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 11, loops 4 (5 pts), error handling 3 (4 pts), ternaries 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LlamaIndexDocumentLoader.load (cognitive 42) · ×1
  • LlamaIndexDocumentLoader.load (cognitive 42) deeptutor/services/rag/pipelines/llamaindex/document_loader.py:77 — LlamaIndexDocumentLoader.load has cognitive complexity 42 (threshold 15). Drivers by points: if/else 16 (30 pts), loops 5 (6 pts), boolean chains 4, error handling 1 (2 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · deepseek_harness._sdk_notification_events (cognitive 42) · ×1
  • deepseek_harness._sdk_notification_events (cognitive 42) deeptutor/services/subagent/deepseek_harness.py:258 — deepseek_harness._sdk_notification_events has cognitive complexity 42 (threshold 15). Drivers by points: if/else 11 (15 pts), ternaries 8 (15 pts), boolean chains 12 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · kb_move.move_kb (cognitive 42) · ×1
  • kb_move.move_kb (cognitive 42) deeptutor/services/workspace/kb_move.py:326 — kb_move.move_kb has cognitive complexity 42 (threshold 15). Drivers by points: if/else 22 (32 pts), boolean chains 6, error handling 2 (3 pts), ternaries 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · session_transfer.transfer_sessions (cognitive 42) · ×1
  • session_transfer.transfer_sessions (cognitive 42) deeptutor/services/workspace/session_transfer.py:19 — session_transfer.transfer_sessions has cognitive complexity 42 (threshold 15). Drivers by points: if/else 10 (24 pts), ternaries 2 (7 pts), loops 3 (5 pts), boolean chains 4, error handling 2 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KnowledgeBaseDetail.KnowledgeBaseDetail (cognitive 42) · ×1
  • KnowledgeBaseDetail.KnowledgeBaseDetail (cognitive 42) web/components/knowledge/KnowledgeBaseDetail.tsx:111 — KnowledgeBaseDetail.KnowledgeBaseDetail has cognitive complexity 42 (threshold 15). Drivers by points: boolean chains 26, ternaries 10 (13 pts), if/else 3 (nesting depth added 3). Of this number, 38 points are the body's own statements and 4 belong to 6 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · PartnerConfigure.PartnerConfigure (cognitive 42) · ×1
  • PartnerConfigure.PartnerConfigure (cognitive 42) web/components/partners/PartnerConfigure.tsx:67 — PartnerConfigure.PartnerConfigure has cognitive complexity 42 (threshold 15). Drivers by points: ternaries 12 (21 pts), error handling 10, boolean chains 8, if/else 3 (nesting depth added 9). Most of this is not in the body itself: 10 of the 42 points are its own statements and the rest belongs to 12 function items inside it that branch (submitAssets, a function literal at line 129, saveWorkspace, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · TracePresentation.detectStreamingMode (cognitive 42) · ×1
  • TracePresentation.detectStreamingMode (cognitive 42) web/features/chat/trace/TracePresentation.tsx:1304 — TracePresentation.detectStreamingMode has cognitive complexity 42 (threshold 15). Drivers by points: if/else 16 (36 pts), ternaries 1 (3 pts), boolean chains 2, loops 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NoteLearningContent.NoteLearningContent (cognitive 42) · ×1
  • NoteLearningContent.NoteLearningContent (cognitive 42) web/features/notes/components/NoteLearningContent.tsx:35 — NoteLearningContent.NoteLearningContent has cognitive complexity 42 (threshold 15). Drivers by points: boolean chains 35, ternaries 3 (4 pts), if/else 2, error handling 1 (nesting depth added 1). Of this number, 39 points are the body's own statements and 3 belong to 6 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · NoteCompanion.ThreadPanel (cognitive 42) · ×1
  • NoteCompanion.ThreadPanel (cognitive 42) web/features/notes/components/NoteCompanion.tsx:203 — NoteCompanion.ThreadPanel has cognitive complexity 42 (threshold 15). Drivers by points: ternaries 13 (16 pts), if/else 11 (13 pts), boolean chains 12, error handling 1 (nesting depth added 5). Of this number, 22 points are the body's own statements and 20 belong to 11 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · message-branches.buildVisiblePath (cognitive 42) · ×1
  • message-branches.buildVisiblePath (cognitive 42) web/lib/message-branches.ts:137 — message-branches.buildVisiblePath has cognitive complexity 42 (threshold 15). Drivers by points: if/else 12 (25 pts), ternaries 2 (8 pts), loops 4 (7 pts), boolean chains 2 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · latex-normalize.scanFragmentEnd (cognitive 42) · ×1
  • latex-normalize.scanFragmentEnd (cognitive 42) REDACTED:361 — latex-normalize.scanFragmentEnd has cognitive complexity 42 (threshold 15). Drivers by points: if/else 15 (37 pts), boolean chains 3, loops 2 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ResearchPipeline._parse_report_outline (cognitive 41) · ×1
  • ResearchPipeline._parse_report_outline (cognitive 41) deeptutor/agents/research/pipeline.py:1619 — ResearchPipeline._parse_report_outline has cognitive complexity 41 (threshold 15). Drivers by points: if/else 10 (23 pts), boolean chains 11, loops 3 (6 pts), ternaries 1 (nesting depth added 16). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · CohereEmbeddingAdapter.embed (cognitive 41) · ×1
  • CohereEmbeddingAdapter.embed (cognitive 41) deeptutor/services/embedding/adapters/cohere.py:55 — CohereEmbeddingAdapter.embed has cognitive complexity 41 (threshold 15). Drivers by points: if/else 16 (28 pts), boolean chains 9, loops 1 (3 pts), ternaries 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · adapters.read_notebook_entities (cognitive 41) · ×1
  • adapters.read_notebook_entities (cognitive 41) deeptutor/services/memory/snapshot/adapters.py:113 — adapters.read_notebook_entities has cognitive complexity 41 (threshold 15). Drivers by points: if/else 7 (16 pts), ternaries 4 (12 pts), boolean chains 7, error handling 2 (3 pts), loops 2 (3 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cloud._poll_for_zip (cognitive 41) · ×1
  • cloud._poll_for_zip (cognitive 41) deeptutor/services/parsing/engines/mineru/cloud.py:434 — cloud._poll_for_zip has cognitive complexity 41 (threshold 15). Drivers by points: if/else 8 (25 pts), boolean chains 10, error handling 1 (5 pts), loops 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PartnerManager.list_partners (cognitive 41) · ×1
  • PartnerManager.list_partners (cognitive 41) deeptutor/services/partners/manager.py:1063 — PartnerManager.list_partners has cognitive complexity 41 (threshold 15). Drivers by points: ternaries 16 (32 pts), if/else 3 (6 pts), loops 3 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · importing.normalize_question (cognitive 41) · ×1
  • importing.normalize_question (cognitive 41) deeptutor/services/practice/importing.py:130 — importing.normalize_question has cognitive complexity 41 (threshold 15). Drivers by points: if/else 19 (28 pts), boolean chains 7, ternaries 4 (5 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LightRagPipeline._reconcile (cognitive 41) · ×1
  • LightRagPipeline._reconcile (cognitive 41) deeptutor/services/rag/pipelines/lightrag/pipeline.py:154 — LightRagPipeline._reconcile has cognitive complexity 41 (threshold 15). Drivers by points: if/else 13 (29 pts), boolean chains 6, loops 3 (6 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · document_images.extract_pdf_images (cognitive 41) · ×1
  • document_images.extract_pdf_images (cognitive 41) deeptutor/utils/document_images.py:826 — document_images.extract_pdf_images has cognitive complexity 41 (threshold 15). Drivers by points: if/else 9 (26 pts), boolean chains 7, error handling 3 (5 pts), loops 2 (3 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ChatSpaceMenu.ChatSpaceMenu (cognitive 41) · ×1
  • ChatSpaceMenu.ChatSpaceMenu (cognitive 41) web/components/chat/space/ChatSpaceMenu.tsx:105 — ChatSpaceMenu.ChatSpaceMenu has cognitive complexity 41 (threshold 15). Drivers by points: if/else 16 (17 pts), ternaries 14 (17 pts), boolean chains 7 (nesting depth added 4). Most of this is not in the body itself: 8 of the 41 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 257, 128, 216, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · MemoryGraph.GraphView (cognitive 41) · ×1
  • MemoryGraph.GraphView (cognitive 41) web/components/memory/MemoryGraph.tsx:354 — MemoryGraph.GraphView has cognitive complexity 41 (threshold 15). Drivers by points: ternaries 17 (26 pts), boolean chains 7, if/else 7, loops 1 (nesting depth added 9). Most of this is not in the body itself: 1 of the 41 points is its own statement and the rest belongs to 9 function literals inside it that branch (lines 595, 373, 424, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · schema-form.SchemaField (cognitive 41) · ×1
  • schema-form.SchemaField (cognitive 41) web/components/partners/schema-form.tsx:151 — schema-form.SchemaField has cognitive complexity 41 (threshold 15). Drivers by points: ternaries 11 (19 pts), boolean chains 13, if/else 8 (9 pts) (nesting depth added 9). Of this number, 28 points are the body's own statements and 13 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DataMigrationSettingsSection.DataMigrationSettingsSection (cognitive 41) · ×1
  • DataMigrationSettingsSection.DataMigrationSettingsSection (cognitive 41) web/features/settings/sections/DataMigrationSettingsSection.tsx:74 — DataMigrationSettingsSection.DataMigrationSettingsSection has cognitive complexity 41 (threshold 15). Drivers by points: ternaries 18 (27 pts), if/else 7 (8 pts), boolean chains 4, error handling 2 (nesting depth added 10). Most of this is not in the body itself: 9 of the 41 points are its own statements and the rest belongs to 13 function items inside it that branch (run, a function literal at line 239, a function literal at line 365, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · QuestionPipeline._render_exploration_trace (cognitive 40) · ×1
  • QuestionPipeline._render_exploration_trace (cognitive 40) deeptutor/agents/question/pipeline.py:1176 — QuestionPipeline._render_exploration_trace has cognitive complexity 40 (threshold 15). Drivers by points: if/else 7 (20 pts), boolean chains 9, error handling 1 (5 pts), loops 2 (5 pts), ternaries 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MasteryGradeTool._grade_group (cognitive 40) · ×1
  • MasteryGradeTool._grade_group (cognitive 40) deeptutor/capabilities/mastery/tools.py:1868 — MasteryGradeTool._grade_group has cognitive complexity 40 (threshold 15). Drivers by points: ternaries 9 (24 pts), boolean chains 7, if/else 4 (7 pts), error handling 1, loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LearningService._evaluate_question (cognitive 40) · ×1
  • LearningService._evaluate_question (cognitive 40) deeptutor/learning/service.py:1568 — LearningService._evaluate_question has cognitive complexity 40 (threshold 15). Drivers by points: if/else 14 (22 pts), ternaries 4 (8 pts), boolean chains 7, error handling 1 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · launcher.start (cognitive 40) · ×1
  • launcher.start (cognitive 40) deeptutor/runtime/launcher.py:1513 — launcher.start has cognitive complexity 40 (threshold 15). Drivers by points: if/else 17 (21 pts), ternaries 6 (8 pts), boolean chains 6, loops 2 (3 pts), error handling 2 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · client.parse_catalog_xml (cognitive 40) · ×1
  • client.parse_catalog_xml (cognitive 40) deeptutor/services/rag/pipelines/kiwix/client.py:129 — client.parse_catalog_xml has cognitive complexity 40 (threshold 15). Drivers by points: if/else 9 (21 pts), boolean chains 8, ternaries 2 (5 pts), error handling 2 (3 pts), loops 2 (3 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · search.web_search (cognitive 40) · ×1
  • search.web_search (cognitive 40) deeptutor/services/search/__init__.py:131 — search.web_search has cognitive complexity 40 (threshold 15). Drivers by points: if/else 18 (27 pts), boolean chains 5, ternaries 2 (5 pts), error handling 1 (2 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · document_extractor.extract_documents_from_records (cognitive 40) · ×1
  • document_extractor.extract_documents_from_records (cognitive 40) deeptutor/utils/document_extractor.py:1306 — document_extractor.extract_documents_from_records has cognitive complexity 40 (threshold 15). Drivers by points: if/else 10 (22 pts), ternaries 2 (6 pts), boolean chains 5, error handling 2 (4 pts), loops 2 (3 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ask-user-draft.partialJson · ×1
  • ask-user-draft.partialJson::value (cognitive 40) packages/chat-engine/src/tools/ask-user-draft.ts:28 — ask-user-draft.partialJson::value has cognitive complexity 40 (threshold 15). Drivers by points: if/else 14 (35 pts), loops 1 (2 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · page.CoWriterHomePage (cognitive 40) · ×1
  • page.CoWriterHomePage (cognitive 40) web/app/(workspace)/co-writer/page.tsx:144 — page.CoWriterHomePage has cognitive complexity 40 (threshold 15). Drivers by points: ternaries 12 (18 pts), boolean chains 12, error handling 5, if/else 3 (4 pts), loops 1 (nesting depth added 7). Of this number, 16 points are the body's own statements and 24 belong to 8 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · QuizBlock.QuizQuestionCard (cognitive 40) · ×1
  • QuizBlock.QuizQuestionCard (cognitive 40) web/app/(workspace)/learning/books/components/blocks/QuizBlock.tsx:134 — QuizBlock.QuizQuestionCard has cognitive complexity 40 (threshold 15). Drivers by points: boolean chains 20, ternaries 11 (18 pts), if/else 2 (nesting depth added 7). Of this number, 23 points are the body's own statements and 17 belong to 3 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · MasteryQuestionCard.GroupedMasteryQuestionCard (cognitive 40) · ×1
  • MasteryQuestionCard.GroupedMasteryQuestionCard (cognitive 40) web/components/chat/home/MasteryQuestionCard.tsx:366 — MasteryQuestionCard.GroupedMasteryQuestionCard has cognitive complexity 40 (threshold 15). Drivers by points: ternaries 9 (19 pts), boolean chains 17, if/else 3, error handling 1 (nesting depth added 10). Of this number, 29 points are the body's own statements and 11 belong to 5 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CliAppsSection.EntryDetail (cognitive 40) · ×1
  • CliAppsSection.EntryDetail (cognitive 40) web/components/cli-apps/CliAppsSection.tsx:590 — CliAppsSection.EntryDetail has cognitive complexity 40 (threshold 15). Drivers by points: ternaries 7 (23 pts), boolean chains 14, if/else 1 (2 pts), error handling 1 (nesting depth added 17). Of this number, 36 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · NotebookRecordRow.NotebookRecordRow (cognitive 40) · ×1
  • NotebookRecordRow.NotebookRecordRow (cognitive 40) web/components/notebook/NotebookRecordRow.tsx:109 — NotebookRecordRow.NotebookRecordRow has cognitive complexity 40 (threshold 15). Drivers by points: ternaries 11 (15 pts), boolean chains 14, if/else 8, error handling 3 (nesting depth added 4). Of this number, 21 points are the body's own statements and 19 belong to 8 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · selectors.detectStreamingMode (cognitive 40) · ×1
  • selectors.detectStreamingMode (cognitive 40) web/features/chat/trace/selectors.ts:223 — selectors.detectStreamingMode has cognitive complexity 40 (threshold 15). Drivers by points: if/else 14 (32 pts), ternaries 2 (4 pts), boolean chains 3, loops 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VideoLessonCapability.run (cognitive 39) · ×1
  • VideoLessonCapability.run (cognitive 39) deeptutor/agents/video_lesson/capability.py:28 — VideoLessonCapability.run has cognitive complexity 39 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 8, ternaries 4 (8 pts), loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · question.websocket_question_generate (cognitive 39) · ×1
  • question.websocket_question_generate (cognitive 39) deeptutor/api/routers/question.py:362 — question.websocket_question_generate has cognitive complexity 39 (threshold 15). Drivers by points: error handling 13 (17 pts), if/else 7 (13 pts), ternaries 5 (7 pts), boolean chains 1, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WhatsAppChannel._handle_bridge_message (cognitive 39) · ×1
  • WhatsAppChannel._handle_bridge_message (cognitive 39) deeptutor/partners/channels/whatsapp.py:119 — WhatsAppChannel._handle_bridge_message has cognitive complexity 39 (threshold 15). Drivers by points: if/else 7 (14 pts), ternaries 5 (14 pts), loops 2 (6 pts), boolean chains 4, error handling 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · speech_text._replace_limits_once (cognitive 39) · ×1
  • speech_text._replace_limits_once (cognitive 39) deeptutor/services/voice/speech_text.py:551 — speech_text._replace_limits_once has cognitive complexity 39 (threshold 15). Drivers by points: if/else 12 (29 pts), boolean chains 5, loops 3 (5 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · StreamingBlockParser.feed (cognitive 39) · ×1
  • StreamingBlockParser.feed (cognitive 39) deeptutor/tools/vision/block_parser.py:121 — StreamingBlockParser.feed has cognitive complexity 39 (threshold 15). Drivers by points: if/else 10 (33 pts), ternaries 1 (4 pts), boolean chains 1, loops 1 (nesting depth added 26). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · BookHealthBanner.BookHealthBanner (cognitive 39) · ×1
  • BookHealthBanner.BookHealthBanner (cognitive 39) web/app/(workspace)/learning/books/components/BookHealthBanner.tsx:47 — BookHealthBanner.BookHealthBanner has cognitive complexity 39 (threshold 15). Drivers by points: boolean chains 23, if/else 10 (11 pts), ternaries 2 (3 pts), error handling 2 (nesting depth added 2). Of this number, 24 points are the body's own statements and 15 belong to 5 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · page.PartnersPage (cognitive 39) · ×1
  • page.PartnersPage (cognitive 39) web/app/(workspace)/partners/page.tsx:32 — page.PartnersPage has cognitive complexity 39 (threshold 15). Drivers by points: ternaries 14 (33 pts), boolean chains 3, if/else 3 (nesting depth added 19). Most of this is not in the body itself: 13 of the 39 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 124, 221, 65, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · KbLinkedFoldersSection.KbLinkedFoldersSection (cognitive 39) · ×1
  • KbLinkedFoldersSection.KbLinkedFoldersSection (cognitive 39) web/components/knowledge/KbLinkedFoldersSection.tsx:36 — KbLinkedFoldersSection.KbLinkedFoldersSection has cognitive complexity 39 (threshold 15). Drivers by points: boolean chains 15, if/else 10 (11 pts), ternaries 6 (10 pts), error handling 3 (nesting depth added 5). Of this number, 18 points are the body's own statements and 21 belong to 5 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · MemoryRunPanel.groupByTurn (cognitive 39) · ×1
  • MemoryRunPanel.groupByTurn (cognitive 39) web/components/memory/MemoryRunPanel.tsx:437 — MemoryRunPanel.groupByTurn has cognitive complexity 39 (threshold 15). Drivers by points: ternaries 7 (21 pts), if/else 5 (12 pts), boolean chains 5, loops 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ArchivedChatsSettingsSection.ArchivedChatsSettingsSection (cognitive 39) · ×1
  • ArchivedChatsSettingsSection.ArchivedChatsSettingsSection (cognitive 39) web/features/settings/sections/ArchivedChatsSettingsSection.tsx:36 — ArchivedChatsSettingsSection.ArchivedChatsSettingsSection has cognitive complexity 39 (threshold 15). Drivers by points: ternaries 6 (15 pts), if/else 7 (14 pts), boolean chains 6, error handling 2, loops 2 (nesting depth added 16). Of this number, 20 points are the body's own statements and 19 belong to 8 function items inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · NativeAdapter.invoke (cognitive 38) · ×1
  • NativeAdapter.invoke (cognitive 38) deeptutor/agents/loop/native_adapter.py:24 — NativeAdapter.invoke has cognitive complexity 38 (threshold 15). Drivers by points: if/else 15 (24 pts), ternaries 3 (6 pts), loops 2 (5 pts), boolean chains 3 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CoWriterStorage.update_document (cognitive 38) · ×1
  • CoWriterStorage.update_document (cognitive 38) deeptutor/co_writer/storage.py:298 — CoWriterStorage.update_document has cognitive complexity 38 (threshold 15). Drivers by points: if/else 15 (24 pts), boolean chains 11, loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · layers.read_layers (cognitive 38) · ×1
  • layers.read_layers (cognitive 38) deeptutor/services/calendar/layers.py:26 — layers.read_layers has cognitive complexity 38 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 10 (17 pts), boolean chains 3 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · readiness.build_settings_readiness (cognitive 38) · ×1
  • readiness.build_settings_readiness (cognitive 38) deeptutor/services/config/readiness.py:886 — readiness.build_settings_readiness has cognitive complexity 38 (threshold 15). Drivers by points: boolean chains 12, if/else 6 (9 pts), ternaries 7 (9 pts), error handling 3 (6 pts), loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GeminiEmbeddingAdapter._embed_native (cognitive 38) · ×1
  • GeminiEmbeddingAdapter._embed_native (cognitive 38) deeptutor/services/embedding/adapters/gemini.py:256 — GeminiEmbeddingAdapter._embed_native has cognitive complexity 38 (threshold 15). Drivers by points: if/else 14 (20 pts), boolean chains 7, error handling 3 (7 pts), ternaries 3, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HermesRemoteBackend.consult (cognitive 38) · ×1
  • HermesRemoteBackend.consult (cognitive 38) deeptutor/services/subagent/hermes_remote.py:110 — HermesRemoteBackend.consult has cognitive complexity 38 (threshold 15). Drivers by points: if/else 14 (18 pts), error handling 7 (10 pts), boolean chains 7, ternaries 2, loops 1 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · KimiBackend._handle_event (cognitive 38) · ×1
  • KimiBackend._handle_event (cognitive 38) deeptutor/services/subagent/kimi.py:176 — KimiBackend._handle_event has cognitive complexity 38 (threshold 15). Drivers by points: if/else 11 (23 pts), boolean chains 11, loops 2 (4 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · data_migration._rebind_feature_urls (cognitive 38) · ×1
  • data_migration._rebind_feature_urls (cognitive 38) deeptutor/services/workspace/data_migration.py:803 — data_migration._rebind_feature_urls has cognitive complexity 38 (threshold 15). Drivers by points: if/else 6 (20 pts), loops 4 (13 pts), error handling 1 (3 pts), boolean chains 2 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KbIndexVersionsSection.IndexVersionRow (cognitive 38) · ×1
  • KbIndexVersionsSection.IndexVersionRow (cognitive 38) web/components/knowledge/KbIndexVersionsSection.tsx:436 — KbIndexVersionsSection.IndexVersionRow has cognitive complexity 38 (threshold 15). Drivers by points: ternaries 11 (21 pts), boolean chains 17 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · useQuestionBank.useQuestionBank (cognitive 38) · ×1
  • useQuestionBank.useQuestionBank (cognitive 38) web/components/space/question-bank/useQuestionBank.ts:142 — useQuestionBank.useQuestionBank has cognitive complexity 38 (threshold 15). Drivers by points: if/else 22 (24 pts), ternaries 7 (9 pts), boolean chains 3, error handling 2 (nesting depth added 4). None of this is in the body itself: all 38 points belong to 15 function literals inside it that branch (lines 176, 372, 214, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · EngineDetail.ModelsSection (cognitive 38) · ×1
  • EngineDetail.ModelsSection (cognitive 38) web/features/knowledge/components/engines/EngineDetail.tsx:1454 — EngineDetail.ModelsSection has cognitive complexity 38 (threshold 15). Drivers by points: ternaries 8 (18 pts), boolean chains 12, if/else 3 (6 pts), error handling 2 (nesting depth added 13). Most of this is not in the body itself: 5 of the 38 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 1549, 1496, 1511, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · provider-registry.stageRegistryAction (cognitive 38) · ×1
  • provider-registry.stageRegistryAction (cognitive 38) web/lib/provider-registry.ts:360 — provider-registry.stageRegistryAction has cognitive complexity 38 (threshold 15). Drivers by points: if/else 20 (33 pts), boolean chains 5 (nesting depth added 13). Of this number, 36 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · QuestionPipeline._normalize_quiz_payload (cognitive 37) · ×1
  • QuestionPipeline._normalize_quiz_payload (cognitive 37) deeptutor/agents/question/pipeline.py:1407 — QuestionPipeline._normalize_quiz_payload has cognitive complexity 37 (threshold 15). Drivers by points: if/else 9 (21 pts), boolean chains 9, loops 2 (7 pts) (nesting depth added 17). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · question.websocket_mimic_generate (cognitive 37) · ×1
  • question.websocket_mimic_generate (cognitive 37) deeptutor/api/routers/question.py:50 — question.websocket_mimic_generate has cognitive complexity 37 (threshold 15). Drivers by points: error handling 14 (24 pts), if/else 10 (12 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sessions._attach_orphaned_failed_turns (cognitive 37) · ×1
  • sessions._attach_orphaned_failed_turns (cognitive 37) deeptutor/api/routers/sessions.py:314 — sessions._attach_orphaned_failed_turns has cognitive complexity 37 (threshold 15). Drivers by points: boolean chains 18, if/else 9 (18 pts), loops 1 (nesting depth added 9). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · spine_synthesizer._build_chapter_map (cognitive 37) · ×1
  • spine_synthesizer._build_chapter_map (cognitive 37) deeptutor/book/agents/spine_synthesizer.py:528 — spine_synthesizer._build_chapter_map has cognitive complexity 37 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 7 (11 pts), boolean chains 8 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · topic_materials.build_topic_materials (cognitive 37) · ×1
  • topic_materials.build_topic_materials (cognitive 37) deeptutor/learning/topic_materials.py:426 — topic_materials.build_topic_materials has cognitive complexity 37 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 11, ternaries 3 (8 pts), loops 2 (3 pts), error handling 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OpenAICompatibleEmbeddingAdapter._extract_embeddings_from_response (cognitive 37) · ×1
  • OpenAICompatibleEmbeddingAdapter._extract_embeddings_from_response (cognitive 37) deeptutor/services/embedding/adapters/openai_compatible.py:70 — OpenAICompatibleEmbeddingAdapter._extract_embeddings_from_response has cognitive complexity 37 (threshold 15). Drivers by points: if/else 19 (32 pts), boolean chains 4, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · claude_code_provider._prompt_input (cognitive 37) · ×1
  • claude_code_provider._prompt_input (cognitive 37) deeptutor/services/llm/provider_core/claude_code_provider.py:421 — claude_code_provider._prompt_input has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (25 pts), ternaries 2 (5 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · source_pages.build_pdf_documents (cognitive 37) · ×1
  • source_pages.build_pdf_documents (cognitive 37) deeptutor/services/rag/source_pages.py:145 — source_pages.build_pdf_documents has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 9, ternaries 3 (6 pts), loops 3 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SQLiteSessionStore._delete_turn_by_message_sync (cognitive 37) · ×1
  • SQLiteSessionStore._delete_turn_by_message_sync (cognitive 37) deeptutor/services/session/sqlite_store.py:2398 — SQLiteSessionStore._delete_turn_by_message_sync has cognitive complexity 37 (threshold 15). Drivers by points: if/else 17 (25 pts), boolean chains 6, loops 3 (5 pts), ternaries 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · dependencies._with_historical_references (cognitive 37) · ×1
  • dependencies._with_historical_references (cognitive 37) deeptutor/services/workspace/dependencies.py:319 — dependencies._with_historical_references has cognitive complexity 37 (threshold 15). Drivers by points: if/else 7 (18 pts), error handling 2 (8 pts), loops 3 (6 pts), boolean chains 5 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · workspace.workspaceTool (cognitive 37) · ×1
  • workspace.workspaceTool (cognitive 37) packages/chat-engine/src/tools/workspace.ts:131 — workspace.workspaceTool has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (19 pts), ternaries 2 (6 pts), error handling 2 (5 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AppShellContext.AppShellProvider (cognitive 37) · ×1
  • AppShellContext.AppShellProvider (cognitive 37) web/context/AppShellContext.tsx:90 — AppShellContext.AppShellProvider has cognitive complexity 37 (threshold 15). Drivers by points: if/else 27 (28 pts), boolean chains 5, error handling 2, ternaries 1 (2 pts) (nesting depth added 2). None of this is in the body itself: all 37 points belong to 9 function literals inside it that branch (lines 203, 282, 118, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · MemoryWorkbench.MemoryWorkbench (cognitive 37) · ×1
  • MemoryWorkbench.MemoryWorkbench (cognitive 37) web/components/memory/MemoryWorkbench.tsx:183 — MemoryWorkbench.MemoryWorkbench has cognitive complexity 37 (threshold 15). Drivers by points: ternaries 10 (15 pts), boolean chains 10, if/else 9 (10 pts), error handling 1, loops 1 (nesting depth added 6). Most of this is not in the body itself: 13 of the 37 points are its own statements and the rest belongs to 12 function literals inside it that branch (lines 259, 217, 311, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · VisualizationViewer.sanitizeSvg (cognitive 37) · ×1
  • VisualizationViewer.sanitizeSvg (cognitive 37) REDACTED:274 — VisualizationViewer.sanitizeSvg has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 12, loops 2 (3 pts), ternaries 1 (3 pts) (nesting depth added 9). Most of this is not in the body itself: 5 of the 37 points are its own statements and the rest belongs to 5 function items inside it that branch (walk, rescope, a function literal at line 328, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · memory-graph.parseDoc (cognitive 37) · ×1
  • memory-graph.parseDoc (cognitive 37) web/lib/memory-graph.ts:126 — memory-graph.parseDoc has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (26 pts), loops 4 (8 pts), boolean chains 3 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · manager.main (cognitive 36) · ×1
  • manager.main (cognitive 36) deeptutor/knowledge/manager.py:2455 — manager.main has cognitive complexity 36 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 3 (9 pts), error handling 4 (8 pts), ternaries 3 (8 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · lifecycle.plan (cognitive 36) · ×1
  • lifecycle.plan (cognitive 36) deeptutor/modules/lifecycle.py:93 — lifecycle.plan has cognitive complexity 36 (threshold 15). Drivers by points: if/else 7 (16 pts), ternaries 4 (10 pts), boolean chains 5, loops 2 (5 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · book_permission.normalize_book_permission (cognitive 36) · ×1
  • book_permission.normalize_book_permission (cognitive 36) deeptutor/multi_user/book_permission.py:45 — book_permission.normalize_book_permission has cognitive complexity 36 (threshold 15). Drivers by points: if/else 9 (21 pts), boolean chains 6, loops 2 (5 pts), ternaries 3 (4 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · proposals.review (cognitive 36) · ×1
  • proposals.review (cognitive 36) deeptutor/notes/proposals.py:134 — proposals.review has cognitive complexity 36 (threshold 15). Drivers by points: if/else 14 (23 pts), ternaries 4 (9 pts), boolean chains 4 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · provider_runtime.resolve_embedding_runtime_config (cognitive 36) · ×1
  • provider_runtime.resolve_embedding_runtime_config (cognitive 36) deeptutor/services/config/provider_runtime.py:1198 — provider_runtime.resolve_embedding_runtime_config has cognitive complexity 36 (threshold 15). Drivers by points: boolean chains 25, if/else 5 (6 pts), ternaries 5 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · factory._resolve_call_config (cognitive 36) · ×1
  • factory._resolve_call_config (cognitive 36) deeptutor/services/llm/factory.py:157 — factory._resolve_call_config has cognitive complexity 36 (threshold 15). Drivers by points: ternaries 14 (21 pts), boolean chains 11, if/else 3 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reasoning.supported_reasoning_efforts (cognitive 36) · ×1
  • reasoning.supported_reasoning_efforts (cognitive 36) deeptutor/services/model_selection/reasoning.py:16 — reasoning.supported_reasoning_efforts has cognitive complexity 36 (threshold 15). Drivers by points: if/else 16 (24 pts), boolean chains 12 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · chat._chat_repl (cognitive 36) · ×1
  • chat._chat_repl (cognitive 36) deeptutor_cli/chat.py:86 — chat._chat_repl has cognitive complexity 36 (threshold 15). Drivers by points: if/else 9 (22 pts), boolean chains 7, error handling 3 (5 pts), loops 1, ternaries 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AskUserOptions.normaliseAskUserPayload (cognitive 36) · ×1
  • AskUserOptions.normaliseAskUserPayload (cognitive 36) web/components/chat/home/AskUserOptions.tsx:904 — AskUserOptions.normaliseAskUserPayload has cognitive complexity 36 (threshold 15). Drivers by points: ternaries 6 (15 pts), if/else 6 (11 pts), boolean chains 8, loops 1 (2 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FileDropZone.FileDropZone (cognitive 36) · ×1
  • FileDropZone.FileDropZone (cognitive 36) web/components/knowledge/FileDropZone.tsx:37 — FileDropZone.FileDropZone has cognitive complexity 36 (threshold 15). Drivers by points: ternaries 11 (18 pts), if/else 12, boolean chains 6 (nesting depth added 7). Of this number, 21 points are the body's own statements and 15 belong to 8 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · KbWebSourcesSection.KbWebSourcesSection (cognitive 36) · ×1
  • KbWebSourcesSection.KbWebSourcesSection (cognitive 36) web/components/knowledge/KbWebSourcesSection.tsx:33 — KbWebSourcesSection.KbWebSourcesSection has cognitive complexity 36 (threshold 15). Drivers by points: ternaries 9 (16 pts), boolean chains 9, if/else 5 (6 pts), error handling 5 (nesting depth added 8). Most of this is not in the body itself: 12 of the 36 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 52, handleAdd, handleRemove, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · MemoryRunPanel.systemEventDisplay (cognitive 36) · ×1
  • MemoryRunPanel.systemEventDisplay (cognitive 36) web/components/memory/MemoryRunPanel.tsx:539 — MemoryRunPanel.systemEventDisplay has cognitive complexity 36 (threshold 15). Drivers by points: ternaries 16 (30 pts), boolean chains 5, match/switch 1 (nesting depth added 14). Of this number, 34 points are the body's own statements and 2 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GroupComposer.GroupComposer (cognitive 36) · ×1
  • GroupComposer.GroupComposer (cognitive 36) web/components/partners/group/GroupComposer.tsx:34 — GroupComposer.GroupComposer has cognitive complexity 36 (threshold 15). Drivers by points: ternaries 13 (17 pts), if/else 10 (14 pts), boolean chains 5 (nesting depth added 8). Most of this is not in the body itself: 11 of the 36 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 198, submit, a function literal at line 67, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · VoiceDiscoveryField.VoiceLookup (cognitive 36) · ×1
  • VoiceDiscoveryField.VoiceLookup (cognitive 36) web/components/settings/VoiceDiscoveryField.tsx:63 — VoiceDiscoveryField.VoiceLookup has cognitive complexity 36 (threshold 15). Drivers by points: ternaries 8 (23 pts), if/else 6 (7 pts), boolean chains 5, error handling 1 (nesting depth added 16). Of this number, 27 points are the body's own statements and 9 belong to 3 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · MessageThreadMarker.MessageThreadMarker (cognitive 36) · ×1
  • MessageThreadMarker.MessageThreadMarker (cognitive 36) web/features/chat/messages/MessageThreadMarker.tsx:50 — MessageThreadMarker.MessageThreadMarker has cognitive complexity 36 (threshold 15). Drivers by points: ternaries 8 (16 pts), if/else 12, boolean chains 6, error handling 2 (nesting depth added 8). Most of this is not in the body itself: 8 of the 36 points are its own statements and the rest belongs to 10 function items inside it that branch (a function literal at line 205, a function literal at line 73, a function literal at line 102, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · NoteCompanion.ThreadComposer (cognitive 36) · ×1
  • NoteCompanion.ThreadComposer (cognitive 36) web/features/notes/components/NoteCompanion.tsx:627 — NoteCompanion.ThreadComposer has cognitive complexity 36 (threshold 15). Drivers by points: ternaries 8 (16 pts), boolean chains 12, if/else 8 (nesting depth added 8). Of this number, 27 points are the body's own statements and 9 belong to 6 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reasoning-effort.tableReasoningEffortOptions (cognitive 36) · ×1
  • reasoning-effort.tableReasoningEffortOptions (cognitive 36) web/lib/reasoning-effort.ts:98 — reasoning-effort.tableReasoningEffortOptions has cognitive complexity 36 (threshold 15). Drivers by points: if/else 17 (27 pts), boolean chains 7, ternaries 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · turn-reconcile.reconcileTurnIds (cognitive 36) · ×1
  • turn-reconcile.reconcileTurnIds (cognitive 36) web/lib/turn-reconcile.ts:58 — turn-reconcile.reconcileTurnIds has cognitive complexity 36 (threshold 15). Drivers by points: if/else 13 (24 pts), loops 3 (5 pts), boolean chains 4, ternaries 1 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reading_extensions.submit_quiz_answers (cognitive 35) · ×1
  • reading_extensions.submit_quiz_answers (cognitive 35) deeptutor/api/routers/reading_extensions.py:364 — reading_extensions.submit_quiz_answers has cognitive complexity 35 (threshold 15). Drivers by points: if/else 8 (11 pts), ternaries 5 (9 pts), boolean chains 8, error handling 3 (5 pts), loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SpineSynthesizer._coerce_graph (cognitive 35) · ×1
  • SpineSynthesizer._coerce_graph (cognitive 35) deeptutor/book/agents/spine_synthesizer.py:361 — SpineSynthesizer._coerce_graph has cognitive complexity 35 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 12, error handling 1 (2 pts), loops 2, ternaries 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · history.share_mastery_history (cognitive 35) · ×1
  • history.share_mastery_history (cognitive 35) deeptutor/capabilities/mastery/history.py:122 — history.share_mastery_history has cognitive complexity 35 (threshold 15). Drivers by points: if/else 9 (17 pts), ternaries 4 (8 pts), boolean chains 5, loops 2 (3 pts), error handling 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · service.assign_objective_identities (cognitive 35) · ×1
  • service.assign_objective_identities (cognitive 35) deeptutor/learning/service.py:240 — service.assign_objective_identities has cognitive complexity 35 (threshold 15). Drivers by points: if/else 8 (21 pts), loops 4 (10 pts), boolean chains 3, ternaries 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · visual_practice.prepare_visual (cognitive 35) · ×1
  • visual_practice.prepare_visual (cognitive 35) deeptutor/learning/visual_practice.py:92 — visual_practice.prepare_visual has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 15, ternaries 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FeishuChannel._on_message (cognitive 35) · ×1
  • FeishuChannel._on_message (cognitive 35) deeptutor/partners/channels/feishu.py:2333 — FeishuChannel._on_message has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (23 pts), ternaries 4, boolean chains 3, loops 2 (3 pts), error handling 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CodexBackend._handle_event (cognitive 35) · ×1
  • CodexBackend._handle_event (cognitive 35) deeptutor/services/subagent/codex.py:165 — CodexBackend._handle_event has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 9, ternaries 3 (8 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · bibtex_converter._read_fields (cognitive 35) · ×1
  • bibtex_converter._read_fields (cognitive 35) deeptutor/utils/bibtex_converter.py:174 — bibtex_converter._read_fields has cognitive complexity 35 (threshold 15). Drivers by points: if/else 9 (24 pts), loops 3 (7 pts), boolean chains 4 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · document_extractor._extract_xlsx_ooxml (cognitive 35) · ×1
  • document_extractor._extract_xlsx_ooxml (cognitive 35) deeptutor/utils/document_extractor.py:1205 — document_extractor._extract_xlsx_ooxml has cognitive complexity 35 (threshold 15). Drivers by points: if/else 9 (24 pts), loops 4 (11 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · document_images.extract_docx_rich (cognitive 35) · ×1
  • document_images.extract_docx_rich (cognitive 35) deeptutor/utils/document_images.py:516 — document_images.extract_docx_rich has cognitive complexity 35 (threshold 15). Drivers by points: if/else 8 (26 pts), boolean chains 3, loops 2 (3 pts), ternaries 1 (3 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AskUserOptions.extractAskUserPayload (cognitive 35) · ×1
  • AskUserOptions.extractAskUserPayload (cognitive 35) web/components/chat/home/AskUserOptions.tsx:138 — AskUserOptions.extractAskUserPayload has cognitive complexity 35 (threshold 15). Drivers by points: if/else 8 (15 pts), ternaries 4 (10 pts), boolean chains 9, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ReadingContext.ReadingProvider (cognitive 35) · ×1
  • ReadingContext.ReadingProvider (cognitive 35) web/context/ReadingContext.tsx:91 — ReadingContext.ReadingProvider has cognitive complexity 35 (threshold 15). Drivers by points: ternaries 10 (19 pts), if/else 10 (13 pts), error handling 3 (nesting depth added 12). None of this is in the body itself: all 35 points belong to 10 function literals inside it that branch (lines 115, 159, 183, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · ChatStateAdapter.hydrateRequestSnapshot (cognitive 35) · ×1
  • ChatStateAdapter.hydrateRequestSnapshot (cognitive 35) web/features/chat/ChatStateAdapter.tsx:1908 — ChatStateAdapter.hydrateRequestSnapshot has cognitive complexity 35 (threshold 15). Drivers by points: if/else 19 (20 pts), ternaries 10, boolean chains 5 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · reading-selection.selectionTextWithoutLineNumbers (cognitive 35) · ×1
  • reading-selection.selectionTextWithoutLineNumbers (cognitive 35) web/lib/reading-selection.ts:144 — reading-selection.selectionTextWithoutLineNumbers has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (19 pts), ternaries 4 (7 pts), boolean chains 6, loops 3 (nesting depth added 12). Of this number, 34 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · context.normalize_book_references (cognitive 34) · ×1
  • context.normalize_book_references (cognitive 34) deeptutor/book/context.py:42 — context.normalize_book_references has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (21 pts), loops 3 (7 pts), boolean chains 6 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · model_access.redacted_model_access (cognitive 34) · ×1
  • model_access.redacted_model_access (cognitive 34) deeptutor/multi_user/model_access.py:72 — model_access.redacted_model_access has cognitive complexity 34 (threshold 15). Drivers by points: boolean chains 16, if/else 6 (12 pts), error handling 1 (3 pts), loops 2 (3 pts) (nesting depth added 9). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · ingestion._load_bilibili_media (cognitive 34) · ×1
  • ingestion._load_bilibili_media (cognitive 34) deeptutor/reading/ingestion.py:820 — ingestion._load_bilibili_media has cognitive complexity 34 (threshold 15). Drivers by points: boolean chains 13, if/else 8 (12 pts), ternaries 4 (6 pts), error handling 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CodexModelCatalog._fetch (cognitive 34) · ×1
  • CodexModelCatalog._fetch (cognitive 34) deeptutor/services/codex_auth/catalog.py:182 — CodexModelCatalog._fetch has cognitive complexity 34 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 6, ternaries 3 (6 pts), error handling 4 (5 pts), loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ChatCompletionsImagegenAdapter._extract_sources (cognitive 34) · ×1
  • ChatCompletionsImagegenAdapter._extract_sources (cognitive 34) deeptutor/services/imagegen/adapters/chat_completions.py:82 — ChatCompletionsImagegenAdapter._extract_sources has cognitive complexity 34 (threshold 15). Drivers by points: if/else 6 (17 pts), boolean chains 10, loops 3 (6 pts), ternaries 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · document.parse (cognitive 34) · ×1
  • document.parse (cognitive 34) deeptutor/services/memory/document.py:105 — document.parse has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (25 pts), loops 3 (5 pts), boolean chains 4 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PartnerRunner._build_context (cognitive 34) · ×1
  • PartnerRunner._build_context (cognitive 34) deeptutor/services/partners/runtime.py:695 — PartnerRunner._build_context has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 11, ternaries 4 (6 pts), loops 2 (3 pts), error handling 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SerperProvider.search (cognitive 34) · ×1
  • SerperProvider.search (cognitive 34) deeptutor/services/search/providers/serper.py:40 — SerperProvider.search has cognitive complexity 34 (threshold 15). Drivers by points: if/else 15 (27 pts), loops 2 (4 pts), error handling 1 (2 pts), ternaries 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · interface_settings._normalize_language (cognitive 34) · ×1
  • interface_settings._normalize_language (cognitive 34) deeptutor/services/settings/interface_settings.py:100 — interface_settings._normalize_language has cognitive complexity 34 (threshold 15). Drivers by points: if/else 13 (23 pts), boolean chains 11 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · claude_models._capture_model_screen (cognitive 34) · ×1
  • claude_models._capture_model_screen (cognitive 34) deeptutor/services/subagent/claude_models.py:155 — claude_models._capture_model_screen has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (15 pts), error handling 7 (11 pts), boolean chains 5, loops 2, ternaries 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FilePreviewDrawer.FilePreviewDrawer (cognitive 34) · ×1
  • FilePreviewDrawer.FilePreviewDrawer (cognitive 34) web/components/chat/preview/FilePreviewDrawer.tsx:64 — FilePreviewDrawer.FilePreviewDrawer has cognitive complexity 34 (threshold 15). Drivers by points: boolean chains 14, if/else 9, ternaries 8 (9 pts), error handling 2 (nesting depth added 1). Most of this is not in the body itself: 15 of the 34 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 169, 101, 111, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · CreateKbModal.CreateKbModal (cognitive 34) · ×1
  • CreateKbModal.CreateKbModal (cognitive 34) web/components/knowledge/CreateKbModal.tsx:129 — CreateKbModal.CreateKbModal has cognitive complexity 34 (threshold 15). Drivers by points: if/else 44 (54 pts), ternaries 21 (40 pts), boolean chains 33, error handling 5 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (CreateKbModal.CreateKbModal::handleSubmit) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · PracticeInsights.PracticeInsights (cognitive 34) · ×1
  • PracticeInsights.PracticeInsights (cognitive 34) web/components/learning/practice/PracticeInsights.tsx:32 — PracticeInsights.PracticeInsights has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 14 (18 pts), boolean chains 10, if/else 4 (5 pts), error handling 1 (nesting depth added 5). Most of this is not in the body itself: 14 of the 34 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 55, 119, 136, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · MaterialLibrary.MaterialLibraryPage (cognitive 34) · ×1
  • MaterialLibrary.MaterialLibraryPage (cognitive 34) web/components/reading/library/MaterialLibrary.tsx:60 — MaterialLibrary.MaterialLibraryPage has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 8 (22 pts), boolean chains 9, if/else 2, error handling 1 (nesting depth added 14). Of this number, 20 points are the body's own statements and 14 belong to 5 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · useReadingWorkspace.useReadingWorkspace (cognitive 34) · ×1
  • useReadingWorkspace.useReadingWorkspace (cognitive 34) web/components/reading/workspace/useReadingWorkspace.ts:51 — useReadingWorkspace.useReadingWorkspace has cognitive complexity 34 (threshold 15). Drivers by points: if/else 20, boolean chains 8, ternaries 3 (5 pts), error handling 1 (nesting depth added 2). Most of this is not in the body itself: 1 of the 34 points is its own statement and the rest belongs to 15 function literals inside it that branch (lines 179, 191, 453, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · GuardianSettingsSection.GuardianSettingsPage (cognitive 34) · ×1
  • GuardianSettingsSection.GuardianSettingsPage (cognitive 34) web/features/settings/sections/GuardianSettingsSection.tsx:44 — GuardianSettingsSection.GuardianSettingsPage has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 9 (12 pts), boolean chains 10, if/else 9, error handling 3 (nesting depth added 3). Most of this is not in the body itself: 15 of the 34 points are its own statements and the rest belongs to 12 function items inside it that branch (selectLearner, resetCredentials, revokeRelationship, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · useDragSort.useDragSort.handlePointerDown.<returned closure> (cognitive 34) · ×1
  • useDragSort.useDragSort.handlePointerDown.<returned closure> (cognitive 34) web/hooks/useDragSort.ts:105 — useDragSort.useDragSort.handlePointerDown.<returned closure> has cognitive complexity 34 (threshold 15). Drivers by points: if/else 24 (25 pts), boolean chains 9 (nesting depth added 1). Most of this is not in the body itself: 8 of the 34 points are its own statements and the rest belongs to 10 function items inside it that branch (onMove, followEdges, activate, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · Tooltip.Tooltip (cognitive 34) · ×1
  • Tooltip.Tooltip (cognitive 34) web/shared/ui/Tooltip.tsx:41 — Tooltip.Tooltip has cognitive complexity 34 (threshold 15). Drivers by points: if/else 22, boolean chains 8, ternaries 4. Most of this is not in the body itself: 8 of the 34 points are its own statements and the rest belongs to 12 function literals inside it that branch (lines 135, 77, 119, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · knowledge._create_knowledge_base_owned (cognitive 33) · ×1
  • knowledge._create_knowledge_base_owned (cognitive 33) deeptutor/api/routers/knowledge.py:3594 — knowledge._create_knowledge_base_owned has cognitive complexity 33 (threshold 15). Drivers by points: if/else 15 (21 pts), boolean chains 7, error handling 3, ternaries 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · inputs._resolve_chat_selections (cognitive 33) · ×1
  • inputs._resolve_chat_selections (cognitive 33) deeptutor/book/inputs.py:95 — inputs._resolve_chat_selections has cognitive complexity 33 (threshold 15). Drivers by points: if/else 9 (20 pts), boolean chains 7, error handling 2 (3 pts), loops 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ContextExplorer._call_llm (cognitive 33) · ×1
  • ContextExplorer._call_llm (cognitive 33) deeptutor/capabilities/explore_context/explorer.py:366 — ContextExplorer._call_llm has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (27 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · choices.recover_options_from_turn (cognitive 33) · ×1
  • choices.recover_options_from_turn (cognitive 33) deeptutor/capabilities/mastery/choices.py:217 — choices.recover_options_from_turn has cognitive complexity 33 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 12, loops 2 (3 pts), error handling 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MasteryLoopCapability.augment_kwargs (cognitive 33) · ×1
  • MasteryLoopCapability.augment_kwargs (cognitive 33) deeptutor/capabilities/mastery/loop.py:108 — MasteryLoopCapability.augment_kwargs has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 12 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MSTeamsChannel._normalize_teams_reply_quote (cognitive 33) · ×1
  • MSTeamsChannel._normalize_teams_reply_quote (cognitive 33) deeptutor/partners/channels/msteams.py:418 — MSTeamsChannel._normalize_teams_reply_quote has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (22 pts), boolean chains 6, loops 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CallMeasurement.finish (cognitive 33) · ×1
  • CallMeasurement.finish (cognitive 33) deeptutor/services/llm/metrics.py:120 — CallMeasurement.finish has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 8 (11 pts), boolean chains 10, if/else 6 (7 pts), loops 1 (3 pts), error handling 1 (2 pts) (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · adapters.read_quiz_entities (cognitive 33) · ×1
  • adapters.read_quiz_entities (cognitive 33) deeptutor/services/memory/snapshot/adapters.py:538 — adapters.read_quiz_entities has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 4 (12 pts), boolean chains 8, if/else 3 (8 pts), loops 2 (3 pts), error handling 1 (2 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · inventory._traverse (cognitive 33) · ×1
  • inventory._traverse (cognitive 33) deeptutor/services/rag/pipelines/ima/inventory.py:132 — inventory._traverse has cognitive complexity 33 (threshold 15). Drivers by points: if/else 5 (16 pts), loops 4 (9 pts), boolean chains 4, ternaries 1 (4 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · visual_assets._block_details (cognitive 33) · ×1
  • visual_assets._block_details (cognitive 33) deeptutor/services/rag/visual_assets.py:107 — visual_assets._block_details has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 6 (12 pts), if/else 5 (10 pts), boolean chains 6, error handling 2 (4 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · visual_coverage.record_coverage (cognitive 33) · ×1
  • visual_coverage.record_coverage (cognitive 33) deeptutor/services/rag/visual_coverage.py:22 — visual_coverage.record_coverage has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 6, error handling 1 (3 pts), loops 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · artifact_attachments.artifact_attachments (cognitive 33) · ×1
  • artifact_attachments.artifact_attachments (cognitive 33) deeptutor/services/session/artifact_attachments.py:52 — artifact_attachments.artifact_attachments has cognitive complexity 33 (threshold 15). Drivers by points: boolean chains 15, if/else 7 (15 pts), ternaries 1 (2 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · page.NewPartnerGroupPage (cognitive 33) · ×1
  • page.NewPartnerGroupPage (cognitive 33) web/app/(workspace)/partners/groups/new/page.tsx:17 — page.NewPartnerGroupPage has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 15 (25 pts), boolean chains 4, if/else 3, error handling 1 (nesting depth added 10). Most of this is not in the body itself: 14 of the 33 points are its own statements and the rest belongs to 4 function items inside it that branch (submit, a function literal at line 217, a function literal at line 47, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · KbSettingsSection.KbSettingsSection (cognitive 33) · ×1
  • KbSettingsSection.KbSettingsSection (cognitive 33) web/components/knowledge/KbSettingsSection.tsx:27 — KbSettingsSection.KbSettingsSection has cognitive complexity 33 (threshold 15). Drivers by points: boolean chains 17, ternaries 10 (14 pts), error handling 2 (nesting depth added 4). Of this number, 27 points are the body's own statements and 6 belong to 3 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · SubagentSettingsEditor.SubagentSettingsEditor (cognitive 33) · ×1
  • SubagentSettingsEditor.SubagentSettingsEditor (cognitive 33) web/components/settings/SubagentSettingsEditor.tsx:324 — SubagentSettingsEditor.SubagentSettingsEditor has cognitive complexity 33 (threshold 15). Drivers by points: boolean chains 19, ternaries 5 (7 pts), if/else 4 (5 pts), error handling 2 (nesting depth added 3). Of this number, 19 points are the body's own statements and 14 belong to 5 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · EventEditor.EventEditor (cognitive 33) · ×1
  • EventEditor.EventEditor (cognitive 33) web/features/calendar/components/EventEditor.tsx:26 — EventEditor.EventEditor has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 11 (15 pts), boolean chains 13, if/else 5 (nesting depth added 4). Most of this is not in the body itself: 15 of the 33 points are its own statements and the rest belongs to 9 function items inside it that branch (a function literal at line 62, a function literal at line 94, a function literal at line 112, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · ChatMessageList.GeneratedFileCards (cognitive 33) · ×1
  • ChatMessageList.GeneratedFileCards (cognitive 33) web/features/chat/messages/ChatMessageList.tsx:588 — ChatMessageList.GeneratedFileCards has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 9 (15 pts), boolean chains 14, if/else 4 (nesting depth added 6). Most of this is not in the body itself: 1 of the 33 points is its own statement and the rest belongs to 3 function literals inside it that branch (lines 612, 601, 606). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · NoteTopBar.NoteTopBar (cognitive 33) · ×1
  • NoteTopBar.NoteTopBar (cognitive 33) web/features/notes/components/NoteTopBar.tsx:49 — NoteTopBar.NoteTopBar has cognitive complexity 33 (threshold 15). Drivers by points: boolean chains 22, ternaries 8 (9 pts), if/else 1, loops 1 (nesting depth added 1). Of this number, 25 points are the body's own statements and 8 belong to 5 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · book-activity.buildBookActivity (cognitive 33) · ×1
  • book-activity.buildBookActivity (cognitive 33) web/lib/book-activity.ts:368 — book-activity.buildBookActivity has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13, boolean chains 12, ternaries 6 (8 pts) (nesting depth added 2). Of this number, 32 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · _rag_helpers.optional_rag_lookup (cognitive 32) · ×1
  • _rag_helpers.optional_rag_lookup (cognitive 32) deeptutor/book/blocks/_rag_helpers.py:47 — _rag_helpers.optional_rag_lookup has cognitive complexity 32 (threshold 15). Drivers by points: boolean chains 14, if/else 9 (12 pts), error handling 4, loops 1, ternaries 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · service.reconcile_codex_catalog_update (cognitive 32) · ×1
  • service.reconcile_codex_catalog_update (cognitive 32) REDACTED:237 — service.reconcile_codex_catalog_update has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (16 pts), ternaries 8 (9 pts), boolean chains 6, loops 1 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · doctor._rag_check (cognitive 32) · ×1
  • doctor._rag_check (cognitive 32) deeptutor/services/doctor.py:224 — doctor._rag_check has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (17 pts), error handling 3 (7 pts), loops 3 (4 pts), boolean chains 3, ternaries 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OpenAICompatProvider._sanitize_messages (cognitive 32) · ×1
  • OpenAICompatProvider._sanitize_messages (cognitive 32) deeptutor/services/llm/provider_core/openai_compat_provider.py:400 — OpenAICompatProvider._sanitize_messages has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 3 (5 pts), ternaries 1 (3 pts), boolean chains 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · workspace.remove_asset (cognitive 32) · ×1
  • workspace.remove_asset (cognitive 32) deeptutor/services/partners/workspace.py:378 — workspace.remove_asset has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (23 pts), error handling 2 (6 pts), boolean chains 3 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ingress._freeze_asset_paths (cognitive 32) · ×1
  • ingress._freeze_asset_paths (cognitive 32) deeptutor/services/rag/pipelines/lightrag/ingress.py:140 — ingress._freeze_asset_paths has cognitive complexity 32 (threshold 15). Drivers by points: if/else 7 (18 pts), error handling 2 (9 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SQLiteSessionStore._replace_submission_sync (cognitive 32) · ×1
  • SQLiteSessionStore._replace_submission_sync (cognitive 32) deeptutor/services/session/sqlite_store.py:1238 — SQLiteSessionStore._replace_submission_sync has cognitive complexity 32 (threshold 15). Drivers by points: if/else 15 (22 pts), boolean chains 7, ternaries 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SQLiteSessionStore._question_bank_filters (cognitive 32) · ×1
  • SQLiteSessionStore._question_bank_filters (cognitive 32) deeptutor/services/session/sqlite_store.py:4122 — SQLiteSessionStore._question_bank_filters has cognitive complexity 32 (threshold 15). Drivers by points: if/else 19 (21 pts), ternaries 5 (10 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · kb_move.preview_kb_move (cognitive 32) · ×1
  • kb_move.preview_kb_move (cognitive 32) deeptutor/services/workspace/kb_move.py:86 — kb_move.preview_kb_move has cognitive complexity 32 (threshold 15). Drivers by points: if/else 15 (18 pts), boolean chains 12, error handling 1 (2 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · snapshot.build_snapshot (cognitive 32) · ×1
  • snapshot.build_snapshot (cognitive 32) deeptutor/services/workspace/snapshot.py:45 — snapshot.build_snapshot has cognitive complexity 32 (threshold 15). Drivers by points: if/else 4 (11 pts), ternaries 4 (9 pts), boolean chains 6, loops 4 (6 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · chapter_rebuild.detect_frames (cognitive 32) · ×1
  • chapter_rebuild.detect_frames (cognitive 32) deeptutor/textbook_struct/chapter_rebuild.py:149 — chapter_rebuild.detect_frames has cognitive complexity 32 (threshold 15). Drivers by points: if/else 7 (26 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · document_extractor._extract_pdf (cognitive 32) · ×1
  • document_extractor._extract_pdf (cognitive 32) deeptutor/utils/document_extractor.py:367 — document_extractor._extract_pdf has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (12 pts), error handling 7 (11 pts), boolean chains 3, loops 1 (3 pts), ternaries 1 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · document_images._collect_shape_rich (cognitive 32) · ×1
  • document_images._collect_shape_rich (cognitive 32) deeptutor/utils/document_images.py:670 — document_images._collect_shape_rich has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (24 pts), loops 2 (4 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · init_wizard.fetch_embedding_models (cognitive 32) · ×1
  • init_wizard.fetch_embedding_models (cognitive 32) deeptutor_cli/init_wizard.py:751 — init_wizard.fetch_embedding_models has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (23 pts), boolean chains 4, loops 3 (4 pts), error handling 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · history.planHistory (cognitive 32) · ×1
  • history.planHistory (cognitive 32) packages/chat-engine/src/context/history.ts:42 — history.planHistory has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 6, ternaries 2 (6 pts), error handling 1 (3 pts), loops 1 (nesting depth added 14). Of this number, 21 points are the body's own statements and 11 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PersonaPicker.PersonaPicker (cognitive 32) · ×1
  • PersonaPicker.PersonaPicker (cognitive 32) web/components/chat/PersonaPicker.tsx:17 — PersonaPicker.PersonaPicker has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 11 (22 pts), if/else 6 (7 pts), boolean chains 2, error handling 1 (nesting depth added 12). Most of this is not in the body itself: 10 of the 32 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 40, 139, 59, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · MemorySection.L1View (cognitive 32) · ×1
  • MemorySection.L1View (cognitive 32) web/components/memory/MemorySection.tsx:660 — MemorySection.L1View has cognitive complexity 32 (threshold 15). Drivers by points: boolean chains 11, ternaries 5 (9 pts), if/else 7, error handling 4, loops 1 (nesting depth added 4). Most of this is not in the body itself: 7 of the 32 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 776, 716, 756, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · TracePresentation.getTraceHeader (cognitive 32) · ×1
  • TracePresentation.getTraceHeader (cognitive 32) web/features/chat/trace/TracePresentation.tsx:372 — TracePresentation.getTraceHeader has cognitive complexity 32 (threshold 15). Drivers by points: if/else 17 (19 pts), boolean chains 7, ternaries 2 (6 pts) (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · NetworkSettingsSection.NetworkSettingsPage (cognitive 32) · ×1
  • NetworkSettingsSection.NetworkSettingsPage (cognitive 32) web/features/settings/sections/NetworkSettingsSection.tsx:95 — NetworkSettingsSection.NetworkSettingsPage has cognitive complexity 32 (threshold 15). Drivers by points: boolean chains 11, ternaries 6 (11 pts), if/else 7 (8 pts), error handling 2 (nesting depth added 6). Most of this is not in the body itself: 6 of the 32 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 110, 164, 146, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · DeepQuestionCapability.run (cognitive 31) · ×1
  • DeepQuestionCapability.run (cognitive 31) deeptutor/agents/question/capability.py:32 — DeepQuestionCapability.run has cognitive complexity 31 (threshold 15). Drivers by points: boolean chains 18, if/else 8 (10 pts), ternaries 3 (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · ResearchPipeline._render_section_evidence (cognitive 31) · ×1
  • ResearchPipeline._render_section_evidence (cognitive 31) deeptutor/agents/research/pipeline.py:2008 — ResearchPipeline._render_section_evidence has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (22 pts), boolean chains 6, loops 2 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CitationManager._extract_web_citation (cognitive 31) · ×1
  • CitationManager._extract_web_citation (cognitive 31) deeptutor/agents/research/utils/citation_manager.py:385 — CitationManager._extract_web_citation has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 4 (8 pts), boolean chains 4, error handling 1 (2 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProgressTracker.update (cognitive 31) · ×1
  • ProgressTracker.update (cognitive 31) deeptutor/knowledge/progress_tracker.py:176 — ProgressTracker.update has cognitive complexity 31 (threshold 15). Drivers by points: if/else 17 (20 pts), ternaries 4 (6 pts), error handling 2 (3 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · LearningService._apply_grade (cognitive 31) · ×1
  • LearningService._apply_grade (cognitive 31) deeptutor/learning/service.py:574 — LearningService._apply_grade has cognitive complexity 31 (threshold 15). Drivers by points: boolean chains 15, if/else 5 (10 pts), ternaries 5 (6 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OpenAICompatProvider._parse_chunks (cognitive 31) · ×1
  • OpenAICompatProvider._parse_chunks (cognitive 31) deeptutor/services/llm/provider_core/openai_compat_provider.py:948 — OpenAICompatProvider._parse_chunks has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 7, loops 2 (3 pts), ternaries 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · office_preview._render_sync (cognitive 31) · ×1
  • office_preview._render_sync (cognitive 31) deeptutor/services/office_preview.py:83 — office_preview._render_sync has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (16 pts), error handling 7 (12 pts), boolean chains 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PartnerRunner._attachments_from_media (cognitive 31) · ×1
  • PartnerRunner._attachments_from_media (cognitive 31) deeptutor/services/partners/runtime.py:983 — PartnerRunner._attachments_from_media has cognitive complexity 31 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 9, error handling 2 (4 pts), loops 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PerplexityProvider.search (cognitive 31) · ×1
  • PerplexityProvider.search (cognitive 31) deeptutor/services/search/providers/perplexity.py:50 — PerplexityProvider.search has cognitive complexity 31 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 9, loops 3 (7 pts), ternaries 2 (4 pts), error handling 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OpencodeFamilyBackend._handle_bus_event (cognitive 31) · ×1
  • OpencodeFamilyBackend._handle_bus_event (cognitive 31) deeptutor/services/subagent/opencode_family.py:252 — OpencodeFamilyBackend._handle_bus_event has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 8, ternaries 4 (7 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BookSidebar.BookSidebar (cognitive 31) · ×1
  • BookSidebar.BookSidebar (cognitive 31) web/app/(workspace)/learning/books/components/BookSidebar.tsx:67 — BookSidebar.BookSidebar has cognitive complexity 31 (threshold 15). Drivers by points: boolean chains 16, ternaries 7 (13 pts), if/else 2 (nesting depth added 6). Most of this is not in the body itself: 9 of the 31 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 241, 113, 84, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · ModelSelector.ModelSelector (cognitive 31) · ×1
  • ModelSelector.ModelSelector (cognitive 31) web/components/chat/home/ModelSelector.tsx:107 — ModelSelector.ModelSelector has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 12 (18 pts), boolean chains 12, if/else 1 (nesting depth added 6). Of this number, 30 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PartnerSeat.PartnerSeat (cognitive 31) · ×1
  • PartnerSeat.PartnerSeat (cognitive 31) web/components/partners/group/PartnerSeat.tsx:39 — PartnerSeat.PartnerSeat has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 14 (24 pts), boolean chains 6, error handling 1 (nesting depth added 10). Of this number, 30 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AddMaterialsDialog.AddMaterialsDialog · ×1
  • AddMaterialsDialog.AddMaterialsDialog::submit (cognitive 31) web/components/reading/library/AddMaterialsDialog.tsx:267 — AddMaterialsDialog.AddMaterialsDialog::submit has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (17 pts), loops 3 (6 pts), boolean chains 5, ternaries 1 (2 pts), error handling 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (AddMaterialsDialog.AddMaterialsDialog) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · turn-event.parseTurnEvent (cognitive 31) · ×1
  • turn-event.parseTurnEvent (cognitive 31) web/contracts/parse/turn-event.ts:78 — turn-event.parseTurnEvent has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 14 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · recurrence.parseRule (cognitive 31) · ×1
  • recurrence.parseRule (cognitive 31) web/features/calendar/model/recurrence.ts:45 — recurrence.parseRule has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (24 pts), boolean chains 5, loops 1, ternaries 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TracePresentation.describeToolCall (cognitive 31) · ×1
  • TracePresentation.describeToolCall (cognitive 31) web/features/chat/trace/TracePresentation.tsx:148 — TracePresentation.describeToolCall has cognitive complexity 31 (threshold 15). Drivers by points: boolean chains 18, ternaries 5 (9 pts), if/else 2, error handling 1, match/switch 1 (nesting depth added 4). Of this number, 28 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · TracePresentation.TraceRowBody (cognitive 31) · ×1
  • TracePresentation.TraceRowBody (cognitive 31) web/features/chat/trace/TracePresentation.tsx:741 — TracePresentation.TraceRowBody has cognitive complexity 31 (threshold 15). Drivers by points: boolean chains 16, ternaries 7 (13 pts), if/else 2 (nesting depth added 6). Of this number, 23 points are the body's own statements and 8 belong to 7 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · ask-user-state.pendingCards (cognitive 31) · ×1
  • ask-user-state.pendingCards (cognitive 31) web/lib/ask-user-state.ts:82 — ask-user-state.pendingCards has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (20 pts), ternaries 2 (7 pts), boolean chains 3, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · QuestionPipeline._collect_quiz_issues (cognitive 30) · ×1
  • QuestionPipeline._collect_quiz_issues (cognitive 30) deeptutor/agents/question/pipeline.py:1451 — QuestionPipeline._collect_quiz_issues has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 9 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · knowledge.reindex_knowledge_base (cognitive 30) · ×1
  • knowledge.reindex_knowledge_base (cognitive 30) deeptutor/api/routers/knowledge.py:4107 — knowledge.reindex_knowledge_base has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 6, ternaries 3 (4 pts), error handling 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BookEngine._worker_loop_active (cognitive 30) · ×1
  • BookEngine._worker_loop_active (cognitive 30) deeptutor/book/engine.py:1431 — BookEngine._worker_loop_active has cognitive complexity 30 (threshold 15). Drivers by points: if/else 6 (15 pts), error handling 5 (11 pts), boolean chains 3, loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · inputs._resolve_question_notebook (cognitive 30) · ×1
  • inputs._resolve_question_notebook (cognitive 30) deeptutor/book/inputs.py:232 — inputs._resolve_question_notebook has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (15 pts), error handling 3 (6 pts), loops 3 (5 pts), boolean chains 4 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LearningService.replace_modules (cognitive 30) · ×1
  • LearningService.replace_modules (cognitive 30) deeptutor/learning/service.py:393 — LearningService.replace_modules has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (20 pts), loops 9 (10 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EmailChannel._fetch_messages (cognitive 30) · ×1
  • EmailChannel._fetch_messages (cognitive 30) deeptutor/partners/channels/email.py:281 — EmailChannel._fetch_messages has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 6, error handling 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · extract.split_markdown_by_headings (cognitive 30) · ×1
  • extract.split_markdown_by_headings (cognitive 30) deeptutor/reading/extract.py:441 — extract.split_markdown_by_headings has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 3 (4 pts), ternaries 2 (4 pts), boolean chains 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · tool_dispatch.execute_tool_call (cognitive 30) · ×1
  • tool_dispatch.execute_tool_call (cognitive 30) deeptutor/runtime/agentic/tool_dispatch.py:666 — tool_dispatch.execute_tool_call has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 8 (19 pts), if/else 4 (6 pts), boolean chains 4, error handling 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · launcher._resolve_port_conflicts (cognitive 30) · ×1
  • launcher._resolve_port_conflicts (cognitive 30) deeptutor/runtime/launcher.py:723 — launcher._resolve_port_conflicts has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 3 (6 pts), boolean chains 3 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · provider_runtime._choose_resolved_provider (cognitive 30) · ×1
  • provider_runtime._choose_resolved_provider (cognitive 30) deeptutor/services/config/provider_runtime.py:856 — provider_runtime._choose_resolved_provider has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 10, loops 2, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AnthropicProvider.chat_stream (cognitive 30) · ×1
  • AnthropicProvider.chat_stream (cognitive 30) deeptutor/services/llm/provider_core/anthropic_provider.py:551 — AnthropicProvider.chat_stream has cognitive complexity 30 (threshold 15). Drivers by points: if/else 6 (16 pts), boolean chains 6, error handling 3 (5 pts), loops 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · evaluation.evaluate (cognitive 30) · ×1
  • evaluation.evaluate (cognitive 30) deeptutor/services/memory/evaluation.py:242 — evaluation.evaluate has cognitive complexity 30 (threshold 15). Drivers by points: if/else 6 (14 pts), ternaries 3 (5 pts), boolean chains 4, loops 3 (4 pts), error handling 1 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PartnerManager._migrate_legacy_tutorbot (cognitive 30) · ×1
  • PartnerManager._migrate_legacy_tutorbot (cognitive 30) deeptutor/services/partners/manager.py:1520 — PartnerManager._migrate_legacy_tutorbot has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 5, error handling 2 (4 pts), loops 2 (4 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · thread_attribution.backfill_thread_sources (cognitive 30) · ×1
  • thread_attribution.backfill_thread_sources (cognitive 30) deeptutor/services/session/thread_attribution.py:429 — thread_attribution.backfill_thread_sources has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (23 pts), boolean chains 4, error handling 1 (2 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SessionTitleService._maybe_generate_session_title (cognitive 30) · ×1
  • SessionTitleService._maybe_generate_session_title (cognitive 30) deeptutor/services/session/turns/title_service.py:35 — SessionTitleService._maybe_generate_session_title has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 9, error handling 3, ternaries 1 (2 pts), loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · usage_recovery.model_evidence (cognitive 30) · ×1
  • usage_recovery.model_evidence (cognitive 30) deeptutor/services/session/usage_recovery.py:12 — usage_recovery.model_evidence has cognitive complexity 30 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 11, loops 2 (4 pts), ternaries 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PartnerBackend.consult (cognitive 30) · ×1
  • PartnerBackend.consult (cognitive 30) deeptutor/services/subagent/partner.py:72 — PartnerBackend.consult has cognitive complexity 30 (threshold 15). Drivers by points: boolean chains 12, if/else 8 (11 pts), error handling 3 (4 pts), loops 2, ternaries 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VolcengineTTSAdapter.synthesize (cognitive 30) · ×1
  • VolcengineTTSAdapter.synthesize (cognitive 30) deeptutor/services/voice/adapters/volcengine.py:62 — VolcengineTTSAdapter.synthesize has cognitive complexity 30 (threshold 15). Drivers by points: if/else 17 (23 pts), boolean chains 3, error handling 2, loops 1, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · crawler._fetch_page (cognitive 30) · ×1
  • crawler._fetch_page (cognitive 30) deeptutor/services/web_source/crawler.py:193 — crawler._fetch_page has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (20 pts), boolean chains 7, error handling 1 (2 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · document_images._render_omml (cognitive 30) · ×1
  • document_images._render_omml (cognitive 30) deeptutor/utils/document_images.py:341 — document_images._render_omml has cognitive complexity 30 (threshold 15). Drivers by points: if/else 15 (18 pts), boolean chains 6, ternaries 3 (6 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Geogebra.Geogebra (cognitive 30) · ×1
  • Geogebra.Geogebra (cognitive 30) web/components/Geogebra.tsx:98 — Geogebra.Geogebra has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (13 pts), ternaries 6 (10 pts), boolean chains 3, error handling 2 (3 pts), loops 1 (nesting depth added 7). Most of this is not in the body itself: 6 of the 30 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 157, 124, 204). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · SubagentTabBody.SubagentTabBody (cognitive 30) · ×1
  • SubagentTabBody.SubagentTabBody (cognitive 30) web/components/chat/home/SubagentTabBody.tsx:22 — SubagentTabBody.SubagentTabBody has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (13 pts), ternaries 6 (8 pts), boolean chains 6, loops 2, error handling 1 (nesting depth added 6). Most of this is not in the body itself: 8 of the 30 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 81, 46, 148, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · KbStatusBadge.KbStatusBadge (cognitive 30) · ×1
  • KbStatusBadge.KbStatusBadge (cognitive 30) web/components/knowledge/KbStatusBadge.tsx:18 — KbStatusBadge.KbStatusBadge has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 11 (26 pts), boolean chains 4 (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · ReadingCompanion.ReadingCompanion (cognitive 30) · ×1
  • ReadingCompanion.ReadingCompanion (cognitive 30) web/components/reading/workspace/ReadingCompanion.tsx:78 — ReadingCompanion.ReadingCompanion has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (15 pts), ternaries 5 (8 pts), boolean chains 7 (nesting depth added 4). Most of this is not in the body itself: 6 of the 30 points are its own statements and the rest belongs to 13 function literals inside it that branch (lines 303, 233, 412, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · ChatHistorySection.ChatHistorySection (cognitive 30) · ×1
  • ChatHistorySection.ChatHistorySection (cognitive 30) web/components/space/ChatHistorySection.tsx:56 — ChatHistorySection.ChatHistorySection has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13, ternaries 6 (9 pts), boolean chains 8 (nesting depth added 3). Most of this is not in the body itself: 10 of the 30 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 158, 137, 84, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · LevelUpCelebration.LevelUpCelebration (cognitive 30) · ×1
  • LevelUpCelebration.LevelUpCelebration (cognitive 30) web/components/space/learning/LevelUpCelebration.tsx:145 — LevelUpCelebration.LevelUpCelebration has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 9, loops 2 (3 pts), ternaries 2 (3 pts) (nesting depth added 6). Most of this is not in the body itself: 3 of the 30 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 224, 154, 231). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · ChatMessageList.PlayAudioButton (cognitive 30) · ×1
  • ChatMessageList.PlayAudioButton (cognitive 30) web/features/chat/messages/ChatMessageList.tsx:1464 — ChatMessageList.PlayAudioButton has cognitive complexity 30 (threshold 15). Drivers by points: if/else 16 (19 pts), ternaries 5 (6 pts), boolean chains 4, error handling 1 (nesting depth added 4). Most of this is not in the body itself: 6 of the 30 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 1503, 1587, 1483, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · main.lifespan (cognitive 29) · ×1
  • main.lifespan (cognitive 29) deeptutor/api/main.py:109 — main.lifespan has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (13 pts), error handling 12, boolean chains 4 (nesting depth added 2). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · multi_user._admin_catalog_summary (cognitive 29) · ×1
  • multi_user._admin_catalog_summary (cognitive 29) deeptutor/api/routers/multi_user.py:150 — multi_user._admin_catalog_summary has cognitive complexity 29 (threshold 15). Drivers by points: if/else 4 (12 pts), boolean chains 7, loops 3 (6 pts), error handling 1 (4 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · semantic_assessment._attach_support (cognitive 29) · ×1
  • semantic_assessment._attach_support (cognitive 29) deeptutor/learning/semantic_assessment.py:363 — semantic_assessment._attach_support has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 10, loops 1, ternaries 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ChannelManager._dispatch_outbound (cognitive 29) · ×1
  • ChannelManager._dispatch_outbound (cognitive 29) deeptutor/partners/channels/manager.py:415 — ChannelManager._dispatch_outbound has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (20 pts), boolean chains 4, error handling 2 (4 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MSTeamsChannel._handle_activity (cognitive 29) · ×1
  • MSTeamsChannel._handle_activity (cognitive 29) deeptutor/partners/channels/msteams.py:303 — MSTeamsChannel._handle_activity has cognitive complexity 29 (threshold 15). Drivers by points: boolean chains 20, if/else 8 (9 pts) (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · manifest._extensions (cognitive 29) · ×1
  • manifest._extensions (cognitive 29) deeptutor/plugins/manifest.py:324 — manifest._extensions has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (27 pts), boolean chains 1, loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · references.normalize_reading_references (cognitive 29) · ×1
  • references.normalize_reading_references (cognitive 29) deeptutor/reading/references.py:33 — references.normalize_reading_references has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (21 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · mastery_hints._render (cognitive 29) · ×1
  • mastery_hints._render (cognitive 29) deeptutor/services/mastery_hints.py:238 — mastery_hints._render has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (20 pts), ternaries 5 (9 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LightRagPipeline._add_documents_owned (cognitive 29) · ×1
  • LightRagPipeline._add_documents_owned (cognitive 29) deeptutor/services/rag/pipelines/lightrag/pipeline.py:505 — LightRagPipeline._add_documents_owned has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 7, error handling 3 (4 pts), ternaries 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · usage_recovery.recover_summary (cognitive 29) · ×1
  • usage_recovery.recover_summary (cognitive 29) deeptutor/services/session/usage_recovery.py:44 — usage_recovery.recover_summary has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (14 pts), ternaries 3 (6 pts), boolean chains 3, error handling 1 (3 pts), loops 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PartnerGroupBackend.consult (cognitive 29) · ×1
  • PartnerGroupBackend.consult (cognitive 29) deeptutor/services/subagent/partner_group.py:17 — PartnerGroupBackend.consult has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 8, ternaries 4 (6 pts), loops 2 (3 pts), error handling 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · folders.browse_folders (cognitive 29) · ×1
  • folders.browse_folders (cognitive 29) deeptutor/services/workspace/folders.py:12 — folders.browse_folders has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (13 pts), error handling 4 (6 pts), boolean chains 5, ternaries 3, loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TexChunker._split_by_paragraphs (cognitive 29) · ×1
  • TexChunker._split_by_paragraphs (cognitive 29) deeptutor/tools/tex_chunker.py:203 — TexChunker._split_by_paragraphs has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (24 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · web_fetch.fetch_url_as_markdown (cognitive 29) · ×1
  • web_fetch.fetch_url_as_markdown (cognitive 29) deeptutor/tools/web_fetch.py:74 — web_fetch.fetch_url_as_markdown has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 9, ternaries 1 (3 pts), error handling 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CreateKbModal.LinkModeFields (cognitive 29) · ×1
  • CreateKbModal.LinkModeFields (cognitive 29) web/components/knowledge/CreateKbModal.tsx:1403 — CreateKbModal.LinkModeFields has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 12 (22 pts), boolean chains 7 (nesting depth added 10). Of this number, 19 points are the body's own statements and 10 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · McpCatalogBrowser.EntryDetail (cognitive 29) · ×1
  • McpCatalogBrowser.EntryDetail (cognitive 29) web/components/mcp/McpCatalogBrowser.tsx:420 — McpCatalogBrowser.EntryDetail has cognitive complexity 29 (threshold 15). Drivers by points: boolean chains 22, ternaries 4 (5 pts), error handling 1, if/else 1 (nesting depth added 1). Of this number, 24 points are the body's own statements and 5 belong to 3 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · McpServerForm.McpServerForm (cognitive 29) · ×1
  • McpServerForm.McpServerForm (cognitive 29) web/components/mcp/McpServerForm.tsx:27 — McpServerForm.McpServerForm has cognitive complexity 29 (threshold 15). Drivers by points: boolean chains 17, if/else 8, ternaries 3, error handling 1. Of this number, 16 points are the body's own statements and 13 belong to 5 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · MyAgentsSection.MyAgentsSection (cognitive 29) · ×1
  • MyAgentsSection.MyAgentsSection (cognitive 29) web/components/space/MyAgentsSection.tsx:89 — MyAgentsSection.MyAgentsSection has cognitive complexity 29 (threshold 15). Drivers by points: boolean chains 11, if/else 8 (9 pts), ternaries 6 (7 pts), error handling 1, loops 1 (nesting depth added 2). Most of this is not in the body itself: 6 of the 29 points are its own statements and the rest belongs to 10 function literals inside it that branch (lines 122, 207, 124, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · ChatSessionMenu.ChatSessionMenu (cognitive 29) · ×1
  • ChatSessionMenu.ChatSessionMenu (cognitive 29) web/features/chat/components/ChatSessionMenu.tsx:60 — ChatSessionMenu.ChatSessionMenu has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12, ternaries 9 (12 pts), boolean chains 5 (nesting depth added 3). Most of this is not in the body itself: 12 of the 29 points are its own statements and the rest belongs to 11 function items inside it that branch (a function literal at line 88, a function literal at line 103, toggle, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · markdown.parseNoteMarkdown (cognitive 29) · ×1
  • markdown.parseNoteMarkdown (cognitive 29) REDACTED:4 — markdown.parseNoteMarkdown has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 5, loops 2 (4 pts), ternaries 1 (4 pts) (nesting depth added 12). Of this number, 23 points are the body's own statements and 6 belong to 4 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClassicLearningDashboard.ClassicLearningDashboard (cognitive 29) · ×1
  • ClassicLearningDashboard.ClassicLearningDashboard (cognitive 29) web/features/ui-layout/classic/ClassicLearningDashboard.tsx:36 — ClassicLearningDashboard.ClassicLearningDashboard has cognitive complexity 29 (threshold 15). Drivers by points: boolean chains 16, ternaries 5 (9 pts), if/else 3, error handling 1 (nesting depth added 4). Most of this is not in the body itself: 12 of the 29 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 66, 51, 142). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · reading-references.normalizeReadingReferences (cognitive 29) · ×1
  • reading-references.normalizeReadingReferences (cognitive 29) web/lib/reading-references.ts:48 — reading-references.normalizeReadingReferences has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (20 pts), boolean chains 4, loops 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · native_tools.tool_runtime (cognitive 28) · ×1
  • native_tools.tool_runtime (cognitive 28) deeptutor/agents/loop/native_tools.py:11 — native_tools.tool_runtime has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 6 (12 pts), if/else 5 (11 pts), boolean chains 4, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · QuestionPipeline._build_llm_tool_schemas (cognitive 28) · ×1
  • QuestionPipeline._build_llm_tool_schemas (cognitive 28) deeptutor/agents/question/pipeline.py:1631 — QuestionPipeline._build_llm_tool_schemas has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 7, ternaries 2 (3 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CodeGeneratorAgent.process (cognitive 28) · ×1
  • CodeGeneratorAgent.process (cognitive 28) deeptutor/agents/visualize/agents/code_generator_agent.py:31 — CodeGeneratorAgent.process has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 9 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MasteryContextBuilder._summarize (cognitive 28) · ×1
  • MasteryContextBuilder._summarize (cognitive 28) deeptutor/capabilities/mastery/memory.py:182 — MasteryContextBuilder._summarize has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 7, loops 2 (3 pts), ternaries 2 (3 pts), error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KnowledgeBaseManager._auto_register_kb (cognitive 28) · ×1
  • KnowledgeBaseManager._auto_register_kb (cognitive 28) deeptutor/knowledge/manager.py:745 — KnowledgeBaseManager._auto_register_kb has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (24 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KnowledgeBaseManager.update_folder_sync_state (cognitive 28) · ×1
  • KnowledgeBaseManager.update_folder_sync_state (cognitive 28) deeptutor/knowledge/manager.py:2171 — KnowledgeBaseManager.update_folder_sync_state has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (19 pts), error handling 2 (5 pts), loops 2 (4 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · objective_relations.resolve_relation_refs (cognitive 28) · ×1
  • objective_relations.resolve_relation_refs (cognitive 28) deeptutor/learning/objective_relations.py:131 — objective_relations.resolve_relation_refs has cognitive complexity 28 (threshold 15). Drivers by points: if/else 5 (19 pts), loops 4 (9 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FeishuChannel._on_card_action_sync (cognitive 28) · ×1
  • FeishuChannel._on_card_action_sync (cognitive 28) deeptutor/partners/channels/feishu.py:1991 — FeishuChannel._on_card_action_sync has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (16 pts), boolean chains 10, error handling 1, ternaries 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · launcher._kill_port_listeners (cognitive 28) · ×1
  • launcher._kill_port_listeners (cognitive 28) deeptutor/runtime/launcher.py:635 — launcher._kill_port_listeners has cognitive complexity 28 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 5 (11 pts), boolean chains 5 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · provider_runtime._resolve_embedding_provider (cognitive 28) · ×1
  • provider_runtime._resolve_embedding_provider (cognitive 28) deeptutor/services/config/provider_runtime.py:1148 — provider_runtime._resolve_embedding_provider has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 7, ternaries 2 (3 pts), error handling 1 (2 pts), loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · provider_runtime.resolve_tts_runtime_config (cognitive 28) · ×1
  • provider_runtime.resolve_tts_runtime_config (cognitive 28) deeptutor/services/config/provider_runtime.py:1298 — provider_runtime.resolve_tts_runtime_config has cognitive complexity 28 (threshold 15). Drivers by points: boolean chains 24, if/else 4. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · OpenAICompatProvider.chat (cognitive 28) · ×1
  • OpenAICompatProvider.chat (cognitive 28) deeptutor/services/llm/provider_core/openai_compat_provider.py:1043 — OpenAICompatProvider.chat has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 4, error handling 3 (4 pts), ternaries 1 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · usage_frame.usage_breakdown (cognitive 28) · ×1
  • usage_frame.usage_breakdown (cognitive 28) deeptutor/services/llm/usage_frame.py:80 — usage_frame.usage_breakdown has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (19 pts), loops 3 (5 pts), boolean chains 4 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · adapters.read_book_entities (cognitive 28) · ×1
  • adapters.read_book_entities (cognitive 28) deeptutor/services/memory/snapshot/adapters.py:209 — adapters.read_book_entities has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 6, error handling 2 (5 pts), ternaries 1 (2 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _turn_runtime_shared._request_snapshot_metadata (cognitive 28) · ×1
  • _turn_runtime_shared._request_snapshot_metadata (cognitive 28) deeptutor/services/session/_turn_runtime_shared.py:788 — _turn_runtime_shared._request_snapshot_metadata has cognitive complexity 28 (threshold 15). Drivers by points: if/else 15 (19 pts), boolean chains 6, loops 3 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · SQLiteSessionStore._record_assessment_sync (cognitive 28) · ×1
  • SQLiteSessionStore._record_assessment_sync (cognitive 28) deeptutor/services/session/sqlite_store.py:3633 — SQLiteSessionStore._record_assessment_sync has cognitive complexity 28 (threshold 15). Drivers by points: boolean chains 13, if/else 7 (9 pts), ternaries 3 (6 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SkillService.list_skills (cognitive 28) · ×1
  • SkillService.list_skills (cognitive 28) deeptutor/services/skill/service.py:413 — SkillService.list_skills has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (20 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PartnerSearchTool.execute (cognitive 28) · ×1
  • PartnerSearchTool.execute (cognitive 28) deeptutor/tools/partner_memory.py:250 — PartnerSearchTool.execute has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 9, loops 2 (3 pts), error handling 1, ternaries 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiscordHistoryExporter._request_json (cognitive 28) · ×1
  • DiscordHistoryExporter._request_json (cognitive 28) scripts/export_discord_history.py:227 — DiscordHistoryExporter._request_json has cognitive complexity 28 (threshold 15). Drivers by points: error handling 5 (14 pts), if/else 4 (9 pts), boolean chains 4, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KbIndexingRun.KbIndexingRun (cognitive 28) · ×1
  • KbIndexingRun.KbIndexingRun (cognitive 28) web/components/knowledge/KbIndexingRun.tsx:26 — KbIndexingRun.KbIndexingRun has cognitive complexity 28 (threshold 15). Drivers by points: boolean chains 15, if/else 7 (8 pts), ternaries 3, error handling 2 (nesting depth added 1). Most of this is not in the body itself: 12 of the 28 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 39, a function literal at line 45, cancel, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · useNotebookLibrary.useNotebookLibrary (cognitive 28) · ×1
  • useNotebookLibrary.useNotebookLibrary (cognitive 28) web/components/notebook/useNotebookLibrary.ts:63 — useNotebookLibrary.useNotebookLibrary has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 10 (12 pts), if/else 10 (11 pts), boolean chains 3, error handling 2 (nesting depth added 3). None of this is in the body itself: all 28 points belong to 17 function literals inside it that branch (lines 82, 105, 153, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · SoulPicker.SoulPicker (cognitive 28) · ×1
  • SoulPicker.SoulPicker (cognitive 28) web/components/partners/SoulPicker.tsx:47 — SoulPicker.SoulPicker has cognitive complexity 28 (threshold 15). Drivers by points: boolean chains 16, ternaries 4 (6 pts), if/else 4, error handling 2 (nesting depth added 2). Of this number, 18 points are the body's own statements and 10 belong to 7 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · AnnotationPopover.AnnotationPopover (cognitive 28) · ×1
  • AnnotationPopover.AnnotationPopover (cognitive 28) web/components/reading/AnnotationPopover.tsx:74 — AnnotationPopover.AnnotationPopover has cognitive complexity 28 (threshold 15). Drivers by points: boolean chains 10, if/else 9, ternaries 5 (8 pts), error handling 1 (nesting depth added 3). Of this number, 16 points are the body's own statements and 12 belong to 8 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · ResearchOutlineEditor.ResearchOutlineEditor (cognitive 28) · ×1
  • ResearchOutlineEditor.ResearchOutlineEditor (cognitive 28) web/components/research/ResearchOutlineEditor.tsx:25 — ResearchOutlineEditor.ResearchOutlineEditor has cognitive complexity 28 (threshold 15). Drivers by points: boolean chains 15, ternaries 8 (9 pts), if/else 4 (nesting depth added 1). Of this number, 20 points are the body's own statements and 8 belong to 6 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · auth.admin_import_users (cognitive 27) · ×1
  • auth.admin_import_users (cognitive 27) deeptutor/api/routers/auth.py:1831 — auth.admin_import_users has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (8 pts), error handling 4 (7 pts), boolean chains 6, ternaries 2 (4 pts), loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · co_writer._run_react_edit (cognitive 27) · ×1
  • co_writer._run_react_edit (cognitive 27) deeptutor/api/routers/co_writer.py:331 — co_writer._run_react_edit has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (13 pts), ternaries 4 (9 pts), boolean chains 4, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MasteryReviseTool.execute (cognitive 27) · ×1
  • MasteryReviseTool.execute (cognitive 27) deeptutor/capabilities/mastery/tools.py:2950 — MasteryReviseTool.execute has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 6, error handling 4 (6 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · ViewFigureTool.execute (cognitive 27) · ×1
  • ViewFigureTool.execute (cognitive 27) deeptutor/capabilities/reading/figure_view.py:75 — ViewFigureTool.execute has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 14, if/else 10 (12 pts), error handling 1 (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · TelegramChannel._on_message (cognitive 27) · ×1
  • TelegramChannel._on_message (cognitive 27) deeptutor/partners/channels/telegram.py:981 — TelegramChannel._on_message has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (21 pts), boolean chains 3, ternaries 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WeixinChannel._download_media_item (cognitive 27) · ×1
  • WeixinChannel._download_media_item (cognitive 27) deeptutor/partners/channels/weixin.py:688 — WeixinChannel._download_media_item has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 11, error handling 2 (3 pts), loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · export._export_markdown (cognitive 27) · ×1
  • export._export_markdown (cognitive 27) deeptutor/reading/export.py:208 — export._export_markdown has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 2 (6 pts), boolean chains 4 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · tool_dispatch.dispatch_tool_calls (cognitive 27) · ×1
  • tool_dispatch.dispatch_tool_calls (cognitive 27) deeptutor/runtime/agentic/tool_dispatch.py:127 — tool_dispatch.dispatch_tool_calls has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · launcher._owned_orphan_started_at (cognitive 27) · ×1
  • launcher._owned_orphan_started_at (cognitive 27) deeptutor/runtime/launcher.py:672 — launcher._owned_orphan_started_at has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 7, loops 1 (2 pts), error handling 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · deferred_tools.render_deferred_tools_manifest (cognitive 27) · ×1
  • deferred_tools.render_deferred_tools_manifest (cognitive 27) deeptutor/runtime/registry/deferred_tools.py:57 — deferred_tools.render_deferred_tools_manifest has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 5 (15 pts), if/else 5 (6 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · workspace.list_assets (cognitive 27) · ×1
  • workspace.list_assets (cognitive 27) deeptutor/services/partners/workspace.py:332 — workspace.list_assets has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 4 (7 pts), boolean chains 3, error handling 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · primitives.audit_checks (cognitive 27) · ×1
  • primitives.audit_checks (cognitive 27) deeptutor/services/research/primitives.py:409 — primitives.audit_checks has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 4, error handling 1 (4 pts), ternaries 1 (4 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · source_filter._web_risk_rejections (cognitive 27) · ×1
  • source_filter._web_risk_rejections (cognitive 27) REDACTED:282 — source_filter._web_risk_rejections has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 5, loops 3 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · codex._render_item (cognitive 27) · ×1
  • codex._render_item (cognitive 27) deeptutor/services/subagent/codex.py:262 — codex._render_item has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 9, ternaries 3 (7 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · GeminiTTSAdapter.synthesize (cognitive 27) · ×1
  • GeminiTTSAdapter.synthesize (cognitive 27) deeptutor/services/voice/adapters/gemini.py:55 — GeminiTTSAdapter.synthesize has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 5, error handling 2, loops 1, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · html_extractor.extract_page_language_and_alternates (cognitive 27) · ×1
  • html_extractor.extract_page_language_and_alternates (cognitive 27) deeptutor/services/web_source/html_extractor.py:584 — html_extractor.extract_page_language_and_alternates has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 6, loops 2 (3 pts), error handling 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · robots.parse_robots_txt (cognitive 27) · ×1
  • robots.parse_robots_txt (cognitive 27) deeptutor/services/web_source/robots.py:70 — robots.parse_robots_txt has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (19 pts), error handling 1 (4 pts), boolean chains 3, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · chapter_rebuild.rebuild_from_headers_level (cognitive 27) · ×1
  • chapter_rebuild.rebuild_from_headers_level (cognitive 27) deeptutor/textbook_struct/chapter_rebuild.py:216 — chapter_rebuild.rebuild_from_headers_level has cognitive complexity 27 (threshold 15). Drivers by points: if/else 5 (16 pts), loops 4 (8 pts), ternaries 1 (3 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · archive_extractor.safe_extract_zip (cognitive 27) · ×1
  • archive_extractor.safe_extract_zip (cognitive 27) deeptutor/utils/archive_extractor.py:86 — archive_extractor.safe_extract_zip has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 2, error handling 1 (2 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · init_cmd._search_step (cognitive 27) · ×1
  • init_cmd._search_step (cognitive 27) deeptutor_cli/init_cmd.py:382 — init_cmd._search_step has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 6 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · chat-completions.request · ×1
  • chat-completions.request::ingest (cognitive 27) packages/chat-engine/src/providers/chat-completions.ts:159 — chat-completions.request::ingest has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 4, loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (chat-completions.request) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · model-round.modelRound (cognitive 27) · ×1
  • model-round.modelRound (cognitive 27) packages/chat-engine/src/native/model-round.ts:14 — model-round.modelRound has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 7, ternaries 4, loops 2, error handling 1 (nesting depth added 2). Of this number, 17 points are the body's own statements and 10 belong to 2 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · PageOutlineNav.PageOutlineNav (cognitive 27) · ×1
  • PageOutlineNav.PageOutlineNav (cognitive 27) web/app/(workspace)/learning/books/components/PageOutlineNav.tsx:99 — PageOutlineNav.PageOutlineNav has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 17 (18 pts), if/else 5, boolean chains 4 (nesting depth added 1). Of this number, 14 points are the body's own statements and 13 belong to 4 function items inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · SpineEditor.SpineEditor (cognitive 27) · ×1
  • SpineEditor.SpineEditor (cognitive 27) web/app/(workspace)/learning/books/components/SpineEditor.tsx:120 — SpineEditor.SpineEditor has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 11, if/else 10 (11 pts), ternaries 4, loops 1 (nesting depth added 1). Most of this is not in the body itself: 8 of the 27 points are its own statements and the rest belongs to 14 function items inside it that branch (a function literal at line 213, a function literal at line 156, a function literal at line 237, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · ComposerTrayMenu.TrayMenu (cognitive 27) · ×1
  • ComposerTrayMenu.TrayMenu (cognitive 27) web/components/chat/home/ComposerTrayMenu.tsx:59 — ComposerTrayMenu.TrayMenu has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 9 (15 pts), boolean chains 7, if/else 5 (nesting depth added 6). Most of this is not in the body itself: 12 of the 27 points are its own statements and the rest belongs to 3 function items inside it that branch (onKeyDown, a function literal at line 121, a function literal at line 189). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · IndexingModelSelector.IndexingModelSelector (cognitive 27) · ×1
  • IndexingModelSelector.IndexingModelSelector (cognitive 27) web/components/knowledge/IndexingModelSelector.tsx:81 — IndexingModelSelector.IndexingModelSelector has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 20, ternaries 3 (4 pts), if/else 3 (nesting depth added 1). Of this number, 25 points are the body's own statements and 2 belong to 4 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · MemoryGraph.MemoryGraph (cognitive 27) · ×1
  • MemoryGraph.MemoryGraph (cognitive 27) web/components/memory/MemoryGraph.tsx:70 — MemoryGraph.MemoryGraph has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 8, loops 3 (6 pts) (nesting depth added 6). Most of this is not in the body itself: 5 of the 27 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 108, 165, 189, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · PartnerArchives.conversationPreview (cognitive 27) · ×1
  • PartnerArchives.conversationPreview (cognitive 27) web/components/partners/PartnerArchives.tsx:59 — PartnerArchives.conversationPreview has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (16 pts), loops 3 (5 pts), boolean chains 4, ternaries 2 (nesting depth added 6). Most of this is not in the body itself: 12 of the 27 points are its own statements and the rest belongs to 3 function items inside it that branch (tableCells, a function literal at line 84, a function literal at line 123). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · QuizConfigPanel.QuizConfigPanel (cognitive 27) · ×1
  • QuizConfigPanel.QuizConfigPanel (cognitive 27) web/components/quiz/QuizConfigPanel.tsx:102 — QuizConfigPanel.QuizConfigPanel has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (13 pts), ternaries 5 (8 pts), boolean chains 6 (nesting depth added 8). Most of this is not in the body itself: 9 of the 27 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 124, 171, 196, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · ReviewTrail.ReviewTrail (cognitive 27) · ×1
  • ReviewTrail.ReviewTrail (cognitive 27) web/components/space/learning/ReviewTrail.tsx:81 — ReviewTrail.ReviewTrail has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 15, ternaries 8 (10 pts), if/else 2 (nesting depth added 2). Of this number, 18 points are the body's own statements and 9 belong to 4 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · NoteInlineReviews.NoteInlineReviews (cognitive 27) · ×1
  • NoteInlineReviews.NoteInlineReviews (cognitive 27) web/features/notes/components/NoteInlineReviews.tsx:22 — NoteInlineReviews.NoteInlineReviews has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 10, ternaries 7 (10 pts), if/else 3 (5 pts), loops 2 (nesting depth added 5). Most of this is not in the body itself: 1 of the 27 points is its own statement and the rest belongs to 4 function literals inside it that branch (lines 112, 62, 53, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · AttachmentsSettingsSection.AttachmentSettingsPage (cognitive 27) · ×1
  • AttachmentsSettingsSection.AttachmentSettingsPage (cognitive 27) web/features/settings/sections/AttachmentsSettingsSection.tsx:47 — AttachmentsSettingsSection.AttachmentSettingsPage has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 5 (10 pts), if/else 7 (8 pts), boolean chains 7, error handling 2 (nesting depth added 6). Most of this is not in the body itself: 3 of the 27 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 60, 112, 98, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · DocumentParsingSettingsSection.DocumentParsingSettingsPage (cognitive 27) · ×1
  • DocumentParsingSettingsSection.DocumentParsingSettingsPage (cognitive 27) web/features/settings/sections/DocumentParsingSettingsSection.tsx:66 — DocumentParsingSettingsSection.DocumentParsingSettingsPage has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 19, ternaries 2 (4 pts), if/else 2, error handling 1, loops 1 (nesting depth added 2). Of this number, 18 points are the body's own statements and 9 belong to 3 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · StartersSettingsSection.StarterSettingsPage (cognitive 27) · ×1
  • StartersSettingsSection.StarterSettingsPage (cognitive 27) web/features/settings/sections/StartersSettingsSection.tsx:27 — StartersSettingsSection.StarterSettingsPage has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 9, ternaries 4 (9 pts), if/else 6 (7 pts), error handling 2 (nesting depth added 6). Most of this is not in the body itself: 5 of the 27 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 38, 91, 78, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · useMasteryStudySession.useMasteryStudySession (cognitive 27) · ×1
  • useMasteryStudySession.useMasteryStudySession (cognitive 27) web/hooks/useMasteryStudySession.ts:37 — useMasteryStudySession.useMasteryStudySession has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12, boolean chains 11, ternaries 4. Most of this is not in the body itself: 11 of the 27 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 150, 178, 83, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · failed-submissions.pruneExpiredEntries (cognitive 27) · ×1
  • failed-submissions.pruneExpiredEntries (cognitive 27) web/lib/failed-submissions.ts:140 — failed-submissions.pruneExpiredEntries has cognitive complexity 27 (threshold 15). Drivers by points: if/else 5 (17 pts), loops 3 (5 pts), error handling 1 (3 pts), boolean chains 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reading-citations.verifiedReadingLocators (cognitive 27) · ×1
  • reading-citations.verifiedReadingLocators (cognitive 27) web/lib/reading-citations.ts:391 — reading-citations.verifiedReadingLocators has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (23 pts), boolean chains 3, loops 1 (nesting depth added 12). Of this number, 20 points are the body's own statements and 7 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ResearchPipeline.__init__ (cognitive 26) · ×1
  • ResearchPipeline.__init__ (cognitive 26) deeptutor/agents/research/pipeline.py:350 — ResearchPipeline.__init__ has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 12, if/else 3 (6 pts), ternaries 5, error handling 2 (3 pts) (nesting depth added 4). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · KnowledgeBaseManager._list_knowledge_bases (cognitive 26) · ×1
  • KnowledgeBaseManager._list_knowledge_bases (cognitive 26) deeptutor/knowledge/manager.py:658 — KnowledgeBaseManager._list_knowledge_bases has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · models._validate_review_intervals (cognitive 26) · ×1
  • models._validate_review_intervals (cognitive 26) deeptutor/learning/models.py:249 — models._validate_review_intervals has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LearningService.repair_question_semantic (cognitive 26) · ×1
  • LearningService.repair_question_semantic (cognitive 26) deeptutor/learning/service.py:3253 — LearningService.repair_question_semantic has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15 (18 pts), boolean chains 6, error handling 1, ternaries 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · EmailChannel._extract_text_body (cognitive 26) · ×1
  • EmailChannel._extract_text_body (cognitive 26) deeptutor/partners/channels/email.py:419 — EmailChannel._extract_text_body has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 4, error handling 2 (4 pts), loops 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · feishu._extract_interactive_content (cognitive 26) · ×1
  • feishu._extract_interactive_content (cognitive 26) deeptutor/partners/channels/feishu.py:108 — feishu._extract_interactive_content has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (15 pts), ternaries 2 (4 pts), loops 2 (3 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ZulipChannel._run_listener (cognitive 26) · ×1
  • ZulipChannel._run_listener (cognitive 26) deeptutor/partners/channels/zulip.py:234 — ZulipChannel._run_listener has cognitive complexity 26 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 3 (6 pts), error handling 2 (5 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ModelCatalogService._apply_connection (cognitive 26) · ×1
  • ModelCatalogService._apply_connection (cognitive 26) deeptutor/services/config/model_catalog.py:410 — ModelCatalogService._apply_connection has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 5, ternaries 3 (4 pts), loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cache_reuse.inherit_index_cache (cognitive 26) · ×1
  • cache_reuse.inherit_index_cache (cognitive 26) deeptutor/services/rag/pipelines/lightrag/cache_reuse.py:81 — cache_reuse.inherit_index_cache has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 5, loops 3 (4 pts), error handling 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LlamaIndexPipeline.search (cognitive 26) · ×1
  • LlamaIndexPipeline.search (cognitive 26) deeptutor/services/rag/pipelines/llamaindex/pipeline.py:314 — LlamaIndexPipeline.search has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 7, error handling 3 (5 pts), ternaries 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · event_preview.compact_trace_preview (cognitive 26) · ×1
  • event_preview.compact_trace_preview (cognitive 26) deeptutor/services/session/event_preview.py:95 — event_preview.compact_trace_preview has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 7, loops 3 (4 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · partner._to_subagent_events (cognitive 26) · ×1
  • partner._to_subagent_events (cognitive 26) deeptutor/services/subagent/partner.py:211 — partner._to_subagent_events has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (15 pts), ternaries 3 (6 pts), boolean chains 5 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · speech_text._drop_unknown_commands (cognitive 26) · ×1
  • speech_text._drop_unknown_commands (cognitive 26) deeptutor/services/voice/speech_text.py:647 — speech_text._drop_unknown_commands has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (23 pts), boolean chains 2, loops 1 (nesting depth added 16). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · migration.migrate_locations (cognitive 26) · ×1
  • migration.migrate_locations (cognitive 26) deeptutor/services/workspace/migration.py:35 — migration.migrate_locations has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 3 (4 pts), boolean chains 3, ternaries 1 (2 pts), error handling 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ContentWorkspaceService.search_page (cognitive 26) · ×1
  • ContentWorkspaceService.search_page (cognitive 26) deeptutor/services/workspace/service.py:554 — ContentWorkspaceService.search_page has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (13 pts), error handling 2 (5 pts), loops 2 (4 pts), boolean chains 3, ternaries 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ThinkFilter.feed (cognitive 26) · ×1
  • ThinkFilter.feed (cognitive 26) packages/chat-engine/src/providers/think-filter.ts:5 — ThinkFilter.feed has cognitive complexity 26 (threshold 15). Drivers by points: if/else 5 (13 pts), ternaries 3 (9 pts), loops 2 (4 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · InlineFileCard.makeFileLinkRemarkPlugin (cognitive 26) · ×1
  • InlineFileCard.makeFileLinkRemarkPlugin (cognitive 26) web/components/common/InlineFileCard.tsx:173 — InlineFileCard.makeFileLinkRemarkPlugin has cognitive complexity 26 (threshold 15). Drivers by points: if/else 31 (55 pts), boolean chains 13, ternaries 6 (13 pts), loops 8 (10 pts) (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 2 other methods here (InlineFileCard.makeFileLinkRemarkPlugin::splitText, InlineFileCard.makeFileLinkRemarkPlugin::visit) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · KbMarginNoteDevicesSection.KbMarginNoteDevicesSection (cognitive 26) · ×1
  • KbMarginNoteDevicesSection.KbMarginNoteDevicesSection (cognitive 26) web/components/knowledge/KbMarginNoteDevicesSection.tsx:36 — KbMarginNoteDevicesSection.KbMarginNoteDevicesSection has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 8 (12 pts), boolean chains 7, error handling 4, if/else 3 (nesting depth added 4). Most of this is not in the body itself: 9 of the 26 points are its own statements and the rest belongs to 5 function items inside it that branch (handlePair, handleRevoke, a function literal at line 222, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · KbWebSourcesSection.WebSourceCard (cognitive 26) · ×1
  • KbWebSourcesSection.WebSourceCard (cognitive 26) web/components/knowledge/KbWebSourcesSection.tsx:321 — KbWebSourcesSection.WebSourceCard has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 15, ternaries 7 (11 pts) (nesting depth added 4). Of this number, 24 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · ChannelRuntimeStatus.ChannelRuntimeStatus (cognitive 26) · ×1
  • ChannelRuntimeStatus.ChannelRuntimeStatus (cognitive 26) web/components/partners/ChannelRuntimeStatus.tsx:13 — ChannelRuntimeStatus.ChannelRuntimeStatus has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 7 (12 pts), if/else 6 (7 pts), boolean chains 5, error handling 1, match/switch 1 (nesting depth added 6). Of this number, 16 points are the body's own statements and 10 belong to 4 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProviderModelDiscovery.DiscoveryForm (cognitive 26) · ×1
  • ProviderModelDiscovery.DiscoveryForm (cognitive 26) web/components/settings/ProviderModelDiscovery.tsx:50 — ProviderModelDiscovery.DiscoveryForm has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 13, ternaries 4 (7 pts), if/else 4 (5 pts), error handling 1 (nesting depth added 4). Of this number, 15 points are the body's own statements and 11 belong to 3 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · GuardianRelationshipsEditor.GuardianRelationshipsEditor (cognitive 26) · ×1
  • GuardianRelationshipsEditor.GuardianRelationshipsEditor (cognitive 26) web/features/multi-user/components/GuardianRelationshipsEditor.tsx:33 — GuardianRelationshipsEditor.GuardianRelationshipsEditor has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 8 (10 pts), if/else 7, boolean chains 6, error handling 3 (nesting depth added 2). Most of this is not in the body itself: 12 of the 26 points are its own statements and the rest belongs to 9 function items inside it that branch (addRelationship, resetCredentials, a function literal at line 325, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · NoteEditor.Handles (cognitive 26) · ×1
  • NoteEditor.Handles (cognitive 26) web/features/notes/components/NoteEditor.tsx:386 — NoteEditor.Handles has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 13, if/else 12, ternaries 1. Most of this is not in the body itself: 9 of the 26 points are its own statements and the rest belongs to 15 function literals inside it that branch (lines 399, 426, 467, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · auth._install_request_workspace (cognitive 25) · ×1
  • auth._install_request_workspace (cognitive 25) deeptutor/api/routers/auth.py:508 — auth._install_request_workspace has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 13, if/else 5 (6 pts), ternaries 5, error handling 1 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · knowledge.run_upload_processing_task (cognitive 25) · ×1
  • knowledge.run_upload_processing_task (cognitive 25) deeptutor/api/routers/knowledge.py:1121 — knowledge.run_upload_processing_task has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (10 pts), error handling 4 (9 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · partners._request_partner_control (cognitive 25) · ×1
  • partners._request_partner_control (cognitive 25) deeptutor/api/routers/partners.py:137 — partners._request_partner_control has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 6, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reading_extensions.run_extension_action (cognitive 25) · ×1
  • reading_extensions.run_extension_action (cognitive 25) deeptutor/api/routers/reading_extensions.py:196 — reading_extensions.run_extension_action has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12, error handling 7, boolean chains 4, ternaries 2. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · settings.fetch_models_from_provider (cognitive 25) · ×1
  • settings.fetch_models_from_provider (cognitive 25) deeptutor/api/routers/settings.py:2040 — settings.fetch_models_from_provider has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 10, ternaries 1 (3 pts), error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SectionArchitect.plan_blocks_async (cognitive 25) · ×1
  • SectionArchitect.plan_blocks_async (cognitive 25) deeptutor/book/agents/page_planner.py:317 — SectionArchitect.plan_blocks_async has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 4, error handling 2 (3 pts), loops 1, ternaries 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · tools._parse_modules_with_refs (cognitive 25) · ×1
  • tools._parse_modules_with_refs (cognitive 25) deeptutor/capabilities/mastery/tools.py:3678 — tools._parse_modules_with_refs has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 5, loops 2 (3 pts), ternaries 1 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · binding._resolve (cognitive 25) · ×1
  • binding._resolve (cognitive 25) deeptutor/capabilities/subagent/binding.py:34 — binding._resolve has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 9, ternaries 2 (4 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · device_credentials._canonical_record (cognitive 25) · ×1
  • device_credentials._canonical_record (cognitive 25) deeptutor/multi_user/device_credentials.py:57 — device_credentials._canonical_record has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 15, if/else 6, ternaries 4. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · DiscordChannel._handle_message_create (cognitive 25) · ×1
  • DiscordChannel._handle_message_create (cognitive 25) deeptutor/partners/channels/discord.py:406 — DiscordChannel._handle_message_create has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 10, error handling 1 (2 pts), loops 1, ternaries 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NapcatChannel._parse_segments (cognitive 25) · ×1
  • NapcatChannel._parse_segments (cognitive 25) deeptutor/partners/channels/napcat.py:320 — NapcatChannel._parse_segments has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (14 pts), ternaries 2 (4 pts), boolean chains 3, error handling 1 (3 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TelegramChannel.send (cognitive 25) · ×1
  • TelegramChannel.send (cognitive 25) deeptutor/partners/channels/telegram.py:455 — TelegramChannel.send has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (12 pts), ternaries 2 (4 pts), boolean chains 3, error handling 2 (3 pts), loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · service.parse_locators (cognitive 25) · ×1
  • service.parse_locators (cognitive 25) deeptutor/reading/service.py:63 — service.parse_locators has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 2 (4 pts), error handling 1 (3 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · messages.image_content_hashes (cognitive 25) · ×1
  • messages.image_content_hashes (cognitive 25) deeptutor/runtime/agentic/messages.py:8 — messages.image_content_hashes has cognitive complexity 25 (threshold 15). Drivers by points: if/else 4 (12 pts), ternaries 2 (5 pts), error handling 1 (3 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · launcher._port_listeners_windows (cognitive 25) · ×1
  • launcher._port_listeners_windows (cognitive 25) deeptutor/runtime/launcher.py:502 — launcher._port_listeners_windows has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (12 pts), error handling 3 (6 pts), boolean chains 5, loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · recurrence.parse_rule (cognitive 25) · ×1
  • recurrence.parse_rule (cognitive 25) deeptutor/services/calendar/recurrence.py:98 — recurrence.parse_rule has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 7, error handling 1, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CalendarStore.delete (cognitive 25) · ×1
  • CalendarStore.delete (cognitive 25) deeptutor/services/calendar/store.py:388 — CalendarStore.delete has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 7, loops 2 (4 pts), ternaries 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · multimodal._inject_images (cognitive 25) · ×1
  • multimodal._inject_images (cognitive 25) deeptutor/services/llm/multimodal.py:188 — multimodal._inject_images has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 7, ternaries 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LLMProvider._sanitize_empty_content (cognitive 25) · ×1
  • LLMProvider._sanitize_empty_content (cognitive 25) deeptutor/services/llm/provider_core/base.py:158 — LLMProvider._sanitize_empty_content has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 4, ternaries 1 (3 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OpenAICompatProvider._parse (cognitive 25) · ×1
  • OpenAICompatProvider._parse (cognitive 25) deeptutor/services/llm/provider_core/openai_compat_provider.py:888 — OpenAICompatProvider._parse has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 8, loops 2, ternaries 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · merge._migrate_l3_legacy_refs (cognitive 25) · ×1
  • merge._migrate_l3_legacy_refs (cognitive 25) deeptutor/services/memory/consolidator/modes/merge.py:157 — merge._migrate_l3_legacy_refs has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 4 (6 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PartnerRunner.process_message (cognitive 25) · ×1
  • PartnerRunner.process_message (cognitive 25) deeptutor/services/partners/runtime.py:317 — PartnerRunner.process_message has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 11, if/else 5 (9 pts), ternaries 2 (5 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · embedding_binding.migrate_binding (cognitive 25) · ×1
  • embedding_binding.migrate_binding (cognitive 25) deeptutor/services/rag/embedding_binding.py:68 — embedding_binding.migrate_binding has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 6, error handling 1 (3 pts), loops 2 (3 pts), ternaries 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · exercise_lookup.requested_exercises (cognitive 25) · ×1
  • exercise_lookup.requested_exercises (cognitive 25) deeptutor/services/rag/pipelines/llamaindex/exercise_lookup.py:49 — exercise_lookup.requested_exercises has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 6, loops 3 (4 pts), ternaries 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · source_pages.legacy_page_index (cognitive 25) · ×1
  • source_pages.legacy_page_index (cognitive 25) deeptutor/services/rag/source_pages.py:265 — source_pages.legacy_page_index has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (10 pts), ternaries 5 (8 pts), boolean chains 3, error handling 2, loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · source_inventory._add_fresh (cognitive 25) · ×1
  • source_inventory._add_fresh (cognitive 25) deeptutor/services/session/source_inventory.py:261 — source_inventory._add_fresh has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 10, loops 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · usage_statistics.summaries_from_events (cognitive 25) · ×1
  • usage_statistics.summaries_from_events (cognitive 25) deeptutor/services/session/usage_statistics.py:56 — usage_statistics.summaries_from_events has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (20 pts), boolean chains 3, loops 1, ternaries 1 (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · OpencodeFamilyBackend._handle_part (cognitive 25) · ×1
  • OpencodeFamilyBackend._handle_part (cognitive 25) deeptutor/services/subagent/opencode_family.py:304 — OpencodeFamilyBackend._handle_part has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 4 (10 pts), if/else 5 (8 pts), boolean chains 7 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · error_utils.format_exception_message (cognitive 25) · ×1
  • error_utils.format_exception_message (cognitive 25) deeptutor/utils/error_utils.py:46 — error_utils.format_exception_message has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (22 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 16). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · init_cmd._embedding_step (cognitive 25) · ×1
  • init_cmd._embedding_step (cognitive 25) deeptutor_cli/init_cmd.py:269 — init_cmd._embedding_step has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 10, ternaries 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · reading_refresh_figures.main (cognitive 25) · ×1
  • reading_refresh_figures.main (cognitive 25) scripts/reading_refresh_figures.py:129 — reading_refresh_figures.main has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 4, ternaries 3 (4 pts), error handling 1 (2 pts), loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sse.sse (cognitive 25) · ×1
  • sse.sse (cognitive 25) packages/chat-engine/src/providers/sse.ts:2 — sse.sse has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (22 pts), loops 2 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KbGitHubSourcesSection.KbGitHubSourcesSection (cognitive 25) · ×1
  • KbGitHubSourcesSection.KbGitHubSourcesSection (cognitive 25) web/components/knowledge/KbGitHubSourcesSection.tsx:21 — KbGitHubSourcesSection.KbGitHubSourcesSection has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 7 (11 pts), boolean chains 7, error handling 4, if/else 3 (nesting depth added 4). Most of this is not in the body itself: 9 of the 25 points are its own statements and the rest belongs to 4 function items inside it that branch (handleAdd, handleSync, a function literal at line 38, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · PartnerModelSelect.PartnerModelSelect (cognitive 25) · ×1
  • PartnerModelSelect.PartnerModelSelect (cognitive 25) web/components/partners/PartnerModelSelect.tsx:27 — PartnerModelSelect.PartnerModelSelect has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 11, ternaries 8 (10 pts), if/else 4 (nesting depth added 2). Of this number, 22 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · QuizConfigPanel.TypeMultiSelect (cognitive 25) · ×1
  • QuizConfigPanel.TypeMultiSelect (cognitive 25) web/components/quiz/QuizConfigPanel.tsx:383 — QuizConfigPanel.TypeMultiSelect has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (13 pts), ternaries 7 (9 pts), boolean chains 3 (nesting depth added 3). Most of this is not in the body itself: 7 of the 25 points are its own statements and the rest belongs to 9 function items inside it that branch (a function literal at line 403, toggle, a function literal at line 452, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · ReadingExtensionBar.ExtensionResult (cognitive 25) · ×1
  • ReadingExtensionBar.ExtensionResult (cognitive 25) web/components/reading/ReadingExtensionBar.tsx:335 — ReadingExtensionBar.ExtensionResult has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 16, boolean chains 7, if/else 1 (2 pts) (nesting depth added 1). Of this number, 19 points are the body's own statements and 6 belong to one function literal inside it that branches. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · RegistryControls.ProbeForm (cognitive 25) · ×1
  • RegistryControls.ProbeForm (cognitive 25) REDACTED:141 — RegistryControls.ProbeForm has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 10, ternaries 7 (10 pts), if/else 3 (4 pts), error handling 1 (nesting depth added 4). Of this number, 16 points are the body's own statements and 9 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ServicePreviewPanel.Preview (cognitive 25) · ×1
  • ServicePreviewPanel.Preview (cognitive 25) web/components/settings/ServicePreviewPanel.tsx:52 — ServicePreviewPanel.Preview has cognitive complexity 25 (threshold 15). Drivers by points: if/else 18 (37 pts), boolean chains 25, ternaries 9 (18 pts), loops 2 (3 pts), error handling 1 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (ServicePreviewPanel.Preview::run) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · ModelsWorkspace.ModelParameters (cognitive 25) · ×1
  • ModelsWorkspace.ModelParameters (cognitive 25) web/components/settings/ModelsWorkspace.tsx:1004 — ModelsWorkspace.ModelParameters has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 5 (15 pts), boolean chains 10 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · SettingsReadinessPanel.SettingsReadinessPanel (cognitive 25) · ×1
  • SettingsReadinessPanel.SettingsReadinessPanel (cognitive 25) web/components/settings/SettingsReadinessPanel.tsx:119 — SettingsReadinessPanel.SettingsReadinessPanel has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 6 (9 pts), boolean chains 8, if/else 3 (5 pts), loops 2, error handling 1 (nesting depth added 5). Most of this is not in the body itself: 10 of the 25 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 167, 186, 140, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · SettingsTourOverlay.SettingsTourOverlay (cognitive 25) · ×1
  • SettingsTourOverlay.SettingsTourOverlay (cognitive 25) web/components/settings/SettingsTourOverlay.tsx:33 — SettingsTourOverlay.SettingsTourOverlay has cognitive complexity 25 (threshold 15). Drivers by points: if/else 15 (17 pts), boolean chains 4, ternaries 4 (nesting depth added 2). Most of this is not in the body itself: 10 of the 25 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 112, 70, 65, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · ImportWizard.ImportWizard (cognitive 25) · ×1
  • ImportWizard.ImportWizard (cognitive 25) web/components/space/ImportWizard.tsx:59 — ImportWizard.ImportWizard has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 9, if/else 5 (6 pts), ternaries 4 (6 pts), error handling 4 (nesting depth added 3). Most of this is not in the body itself: 7 of the 25 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 93, 160, 114, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · MonthView.MonthWeek (cognitive 25) · ×1
  • MonthView.MonthWeek (cognitive 25) web/features/calendar/components/MonthView.tsx:244 — MonthView.MonthWeek has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 12, if/else 7 (8 pts), ternaries 4, loops 1 (nesting depth added 1). Most of this is not in the body itself: 3 of the 25 points are its own statements and the rest belongs to 10 function literals inside it that branch (lines 338, 318, 398, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · start (cognitive 25) · ×1
  • start (cognitive 25) apps/desktop/src/runtime.mjs:69 — start has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 4, ternaries 3, error handling 2, loops 2, other 2 (nesting depth added 3). Of this number, 16 points are the body's own statements and 9 belong to 4 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · AgenticLoopPipeline._build_llm_tool_schemas (cognitive 24) · ×1
  • AgenticLoopPipeline._build_llm_tool_schemas (cognitive 24) deeptutor/agents/loop/pipeline.py:1080 — AgenticLoopPipeline._build_llm_tool_schemas has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (18 pts), boolean chains 3, ternaries 1 (2 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ResearchPipeline._stream_report_step (cognitive 24) · ×1
  • ResearchPipeline._stream_report_step (cognitive 24) deeptutor/agents/research/pipeline.py:1864 — ResearchPipeline._stream_report_step has cognitive complexity 24 (threshold 15). Drivers by points: if/else 4 (9 pts), ternaries 3 (9 pts), boolean chains 3, error handling 1 (2 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _BlockLoopHost._summarise_and_record (cognitive 24) · ×1
  • _BlockLoopHost._summarise_and_record (cognitive 24) deeptutor/agents/research/pipeline.py:2829 — _BlockLoopHost._summarise_and_record has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 7, ternaries 1 (3 pts), error handling 1 (2 pts), loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · auth._create_admin_user (cognitive 24) · ×1
  • auth._create_admin_user (cognitive 24) deeptutor/api/routers/auth.py:1723 — auth._create_admin_user has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (12 pts), error handling 2 (5 pts), ternaries 4, boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MasteryRepairQuestionTool.execute (cognitive 24) · ×1
  • MasteryRepairQuestionTool.execute (cognitive 24) deeptutor/capabilities/mastery/tools.py:2156 — MasteryRepairQuestionTool.execute has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 7 (11 pts), boolean chains 8, if/else 4, error handling 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · jobs.run_job (cognitive 24) · ×1
  • jobs.run_job (cognitive 24) deeptutor/capabilities/setup/jobs.py:194 — jobs.run_job has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 8, loops 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · lesson_evidence._selection_excerpt (cognitive 24) · ×1
  • lesson_evidence._selection_excerpt (cognitive 24) deeptutor/learning/lesson_evidence.py:41 — lesson_evidence._selection_excerpt has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 3 (4 pts), ternaries 2 (4 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · migration._prepare_mastery_v2_root (cognitive 24) · ×1
  • migration._prepare_mastery_v2_root (cognitive 24) deeptutor/learning/migration.py:185 — migration._prepare_mastery_v2_root has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11, boolean chains 5, ternaries 3 (5 pts), loops 2 (3 pts) (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · DiscordChannel.send_delta (cognitive 24) · ×1
  • DiscordChannel.send_delta (cognitive 24) deeptutor/partners/channels/discord.py:186 — DiscordChannel.send_delta has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 9, loops 2 (4 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · feishu._extract_post_content (cognitive 24) · ×1
  • feishu._extract_post_content (cognitive 24) deeptutor/partners/channels/feishu.py:224 — feishu._extract_post_content has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 7, loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SlackChannel._on_socket_request (cognitive 24) · ×1
  • SlackChannel._on_socket_request (cognitive 24) deeptutor/partners/channels/slack.py:175 — SlackChannel._on_socket_request has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 11, if/else 10, error handling 2, ternaries 1. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · ZulipChannel._extract_upload_links (cognitive 24) · ×1
  • ZulipChannel._extract_upload_links (cognitive 24) deeptutor/partners/channels/zulip.py:602 — ZulipChannel._extract_upload_links has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (6 pts), ternaries 1 (4 pts), boolean chains 3 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · loader._coerce_manifest (cognitive 24) · ×1
  • loader._coerce_manifest (cognitive 24) deeptutor/plugins/loader.py:63 — loader._coerce_manifest has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (23 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PluginRegistry._managed_records (cognitive 24) · ×1
  • PluginRegistry._managed_records (cognitive 24) deeptutor/plugins/registry.py:372 — PluginRegistry._managed_records has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 6, ternaries 1 (2 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · registry._validate_state (cognitive 24) · ×1
  • registry._validate_state (cognitive 24) deeptutor/plugins/registry.py:487 — registry._validate_state has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 6, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ReadingExtensionResult.validate_payload (cognitive 24) · ×1
  • ReadingExtensionResult.validate_payload (cognitive 24) deeptutor/reading/extensions.py:60 — ReadingExtensionResult.validate_payload has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · tool_arg_guard.required_args (cognitive 24) · ×1
  • tool_arg_guard.required_args (cognitive 24) deeptutor/runtime/agentic/tool_arg_guard.py:95 — tool_arg_guard.required_args has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (10 pts), ternaries 4 (9 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · view._build (cognitive 24) · ×1
  • view._build (cognitive 24) deeptutor/runtime/providers/view.py:96 — view._build has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 5, ternaries 3 (5 pts), loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · validation.validate_embedding_batch (cognitive 24) · ×1
  • validation.validate_embedding_batch (cognitive 24) deeptutor/services/embedding/validation.py:37 — validation.validate_embedding_batch has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · github_copilot_auth.login_github_copilot (cognitive 24) · ×1
  • github_copilot_auth.login_github_copilot (cognitive 24) deeptutor/services/github_copilot_auth.py:59 — github_copilot_auth.login_github_copilot has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 9, loops 1, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AnthropicProvider._convert_messages (cognitive 24) · ×1
  • AnthropicProvider._convert_messages (cognitive 24) deeptutor/services/llm/provider_core/anthropic_provider.py:104 — AnthropicProvider._convert_messages has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 3, ternaries 1 (3 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OpenAICodexProvider._call_codex (cognitive 24) · ×1
  • OpenAICodexProvider._call_codex (cognitive 24) deeptutor/services/llm/provider_core/openai_codex_provider.py:46 — OpenAICodexProvider._call_codex has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (13 pts), error handling 5 (7 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ChannelOnboardingManager.apply (cognitive 24) · ×1
  • ChannelOnboardingManager.apply (cognitive 24) deeptutor/services/partners/channel_onboarding.py:200 — ChannelOnboardingManager.apply has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 5, error handling 3 (4 pts), ternaries 4 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · PathService.resolve_public_output_path (cognitive 24) · ×1
  • PathService.resolve_public_output_path (cognitive 24) deeptutor/services/path_service.py:143 — PathService.resolve_public_output_path has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14, boolean chains 9, error handling 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · GoogleBrowserScraperProvider.search (cognitive 24) · ×1
  • GoogleBrowserScraperProvider.search (cognitive 24) deeptutor/services/search/providers/google_browser_scraper.py:51 — GoogleBrowserScraperProvider.search has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 7, ternaries 1 (2 pts), error handling 1, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · JinaProvider.search (cognitive 24) · ×1
  • JinaProvider.search (cognitive 24) deeptutor/services/search/providers/jina.py:37 — JinaProvider.search has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (20 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · serply._parse_row (cognitive 24) · ×1
  • serply._parse_row (cognitive 24) deeptutor/services/search/providers/serply.py:123 — serply._parse_row has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 12, if/else 6 (10 pts), ternaries 1 (2 pts) (nesting depth added 5). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · SQLiteSessionStore._begin_turn_sync (cognitive 24) · ×1
  • SQLiteSessionStore._begin_turn_sync (cognitive 24) deeptutor/services/session/sqlite_store.py:1460 — SQLiteSessionStore._begin_turn_sync has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 7, error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · provider_edit.merge_provider_edit (cognitive 24) · ×1
  • provider_edit.merge_provider_edit (cognitive 24) deeptutor/services/settings/provider_edit.py:9 — provider_edit.merge_provider_edit has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (20 pts), boolean chains 4 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · hub.preflight_skill_dir (cognitive 24) · ×1
  • hub.preflight_skill_dir (cognitive 24) deeptutor/services/skill/hub.py:833 — hub.preflight_skill_dir has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 3, error handling 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AntigravityBackend.consult (cognitive 24) · ×1
  • AntigravityBackend.consult (cognitive 24) deeptutor/services/subagent/antigravity.py:181 — AntigravityBackend.consult has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 3, error handling 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KimiBackend.consult (cognitive 24) · ×1
  • KimiBackend.consult (cognitive 24) deeptutor/services/subagent/kimi.py:122 — KimiBackend.consult has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (15 pts), ternaries 1 (4 pts), boolean chains 3, error handling 1, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · suggestions._render_l3 (cognitive 24) · ×1
  • suggestions._render_l3 (cognitive 24) deeptutor/services/suggestions.py:321 — suggestions._render_l3 has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 3 (6 pts), error handling 2 (3 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · dashscope._tts_input (cognitive 24) · ×1
  • dashscope._tts_input (cognitive 24) deeptutor/services/voice/adapters/dashscope.py:108 — dashscope._tts_input has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MiniMaxTTSAdapter.synthesize (cognitive 24) · ×1
  • MiniMaxTTSAdapter.synthesize (cognitive 24) deeptutor/services/voice/adapters/minimax.py:17 — MiniMaxTTSAdapter.synthesize has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 7, error handling 3 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · session_move.migrate_legacy_bindings (cognitive 24) · ×1
  • session_move.migrate_legacy_bindings (cognitive 24) deeptutor/services/workspace/session_move.py:54 — session_move.migrate_legacy_bindings has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 4 (10 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cron_tool.run_cron_action (cognitive 24) · ×1
  • cron_tool.run_cron_action (cognitive 24) deeptutor/tools/cron_tool.py:76 — cron_tool.run_cron_action has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 5, error handling 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · list_notebook._render_records (cognitive 24) · ×1
  • list_notebook._render_records (cognitive 24) deeptutor/tools/list_notebook.py:113 — list_notebook._render_records has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 10, error handling 1, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · bibtex_converter._scan_entry (cognitive 24) · ×1
  • bibtex_converter._scan_entry (cognitive 24) deeptutor/utils/bibtex_converter.py:224 — bibtex_converter._scan_entry has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 8, ternaries 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiscordHistoryExporter.fetch_messages (cognitive 24) · ×1
  • DiscordHistoryExporter.fetch_messages (cognitive 24) scripts/export_discord_history.py:271 — DiscordHistoryExporter.fetch_messages has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 6, loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiscordHistoryExporter.discover_threads (cognitive 24) · ×1
  • DiscordHistoryExporter.discover_threads (cognitive 24) scripts/export_discord_history.py:370 — DiscordHistoryExporter.discover_threads has cognitive complexity 24 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 4 (6 pts), error handling 3 (5 pts), boolean chains 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · types.validateNativeInput (cognitive 24) · ×1
  • types.validateNativeInput (cognitive 24) packages/chat-engine/src/native/types.ts:190 — types.validateNativeInput has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 5, loops 4 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Conversation.project (cognitive 24) · ×1
  • Conversation.project (cognitive 24) packages/chat-engine/src/context/conversation.ts:133 — Conversation.project has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 5 (7 pts), boolean chains 5 (nesting depth added 7). Of this number, 21 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ask-user.askPayload.questions (cognitive 24) · ×1
  • ask-user.askPayload.questions (cognitive 24) packages/chat-engine/src/tools/ask-user.ts:30 — ask-user.askPayload.questions has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 7, ternaries 2 (3 pts), loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Modal.Modal (cognitive 24) · ×1
  • Modal.Modal (cognitive 24) web/components/common/Modal.tsx:40 — Modal.Modal has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13, boolean chains 9, ternaries 2. Most of this is not in the body itself: 7 of the 24 points are its own statements and the rest belongs to 6 function items inside it that branch (handleKeyDown, a function literal at line 84, handleBackdropMouseDown, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · LightRagRoleModelsEditor.LightRagRoleModelsEditor (cognitive 24) · ×1
  • LightRagRoleModelsEditor.LightRagRoleModelsEditor (cognitive 24) web/components/knowledge/LightRagRoleModelsEditor.tsx:114 — LightRagRoleModelsEditor.LightRagRoleModelsEditor has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 21, ternaries 1 (2 pts), if/else 1 (nesting depth added 1). Of this number, 20 points are the body's own statements and 4 belong to 6 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · WeixinQrLogin.WeixinQrLogin (cognitive 24) · ×1
  • WeixinQrLogin.WeixinQrLogin (cognitive 24) REDACTED:26 — WeixinQrLogin.WeixinQrLogin has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 8, ternaries 4 (7 pts), if/else 5 (6 pts), error handling 2, match/switch 1 (nesting depth added 4). Most of this is not in the body itself: 7 of the 24 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 66, a function literal at line 48, a function literal at line 63, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · MaterialLibrary.MaterialRow (cognitive 24) · ×1
  • MaterialLibrary.MaterialRow (cognitive 24) web/components/reading/library/MaterialLibrary.tsx:321 — MaterialLibrary.MaterialRow has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 12, ternaries 8 (10 pts), if/else 2 (nesting depth added 2). Of this number, 20 points are the body's own statements and 4 belong to 2 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · CommandPalette.CommandPalette (cognitive 24) · ×1
  • CommandPalette.CommandPalette (cognitive 24) web/components/sidebar/CommandPalette.tsx:42 — CommandPalette.CommandPalette has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 10, ternaries 7 (8 pts), if/else 6 (nesting depth added 1). Most of this is not in the body itself: 4 of the 24 points are its own statements and the rest belongs to 13 function items inside it that branch (a function literal at line 190, a function literal at line 79, a function literal at line 209, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · WorkspacePill.WorkspacePill (cognitive 24) · ×1
  • WorkspacePill.WorkspacePill (cognitive 24) web/components/workspaces/WorkspacePill.tsx:28 — WorkspacePill.WorkspacePill has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 10, ternaries 7 (10 pts), if/else 4 (nesting depth added 3). Of this number, 18 points are the body's own statements and 6 belong to 7 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · DocumentParsingSettingsSection.DoclingPanel (cognitive 24) · ×1
  • DocumentParsingSettingsSection.DoclingPanel (cognitive 24) web/features/settings/sections/DocumentParsingSettingsSection.tsx:358 — DocumentParsingSettingsSection.DoclingPanel has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 12, ternaries 6 (8 pts), if/else 3, error handling 1 (nesting depth added 2). Of this number, 13 points are the body's own statements and 11 belong to 3 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · ClassicSidebarShell.ClassicSidebarShell (cognitive 24) · ×1
  • ClassicSidebarShell.ClassicSidebarShell (cognitive 24) web/features/ui-layout/classic/ClassicSidebarShell.tsx:91 — ClassicSidebarShell.ClassicSidebarShell has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 8 (13 pts), boolean chains 8, if/else 3 (nesting depth added 5). Of this number, 13 points are the body's own statements and 11 belong to 5 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · mastery-question.parseQuestion (cognitive 24) · ×1
  • mastery-question.parseQuestion (cognitive 24) web/lib/mastery-question.ts:89 — mastery-question.parseQuestion has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 6 (7 pts), boolean chains 6 (nesting depth added 5). Of this number, 21 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LoopPromptAssembler.blocks (cognitive 23) · ×1
  • LoopPromptAssembler.blocks (cognitive 23) deeptutor/agents/loop/prompt_blocks.py:119 — LoopPromptAssembler.blocks has cognitive complexity 23 (threshold 15). Drivers by points: if/else 16 (18 pts), boolean chains 5 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · partners.partner_chat_ws (cognitive 23) · ×1
  • partners.partner_chat_ws (cognitive 23) deeptutor/api/routers/partners.py:1855 — partners.partner_chat_ws has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 4, error handling 3 (4 pts), ternaries 2 (3 pts), loops 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · quiz_judge._build_multimodal_user_content (cognitive 23) · ×1
  • quiz_judge._build_multimodal_user_content (cognitive 23) deeptutor/api/routers/quiz_judge.py:240 — quiz_judge._build_multimodal_user_content has cognitive complexity 23 (threshold 15). Drivers by points: if/else 4 (11 pts), boolean chains 8, error handling 1 (3 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sessions.delete_session (cognitive 23) · ×1
  • sessions.delete_session (cognitive 23) deeptutor/api/routers/sessions.py:698 — sessions.delete_session has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 6 (10 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · settings._connection_targets (cognitive 23) · ×1
  • settings._connection_targets (cognitive 23) deeptutor/api/routers/settings.py:831 — settings._connection_targets has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (12 pts), ternaries 3 (8 pts), loops 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · spine_synthesizer._topological_sort (cognitive 23) · ×1
  • spine_synthesizer._topological_sort (cognitive 23) deeptutor/book/agents/spine_synthesizer.py:689 — spine_synthesizer._topological_sort has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 5 (7 pts), boolean chains 4 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SectionGenerator._generate (cognitive 23) · ×1
  • SectionGenerator._generate (cognitive 23) deeptutor/book/blocks/section.py:73 — SectionGenerator._generate has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 17, if/else 2 (3 pts), loops 2, error handling 1 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · SectionGenerator._fill_subsection (cognitive 23) · ×1
  • SectionGenerator._fill_subsection (cognitive 23) deeptutor/book/blocks/section.py:258 — SectionGenerator._fill_subsection has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 9, ternaries 2, error handling 1, loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HandoffCapability._partner (cognitive 23) · ×1
  • HandoffCapability._partner (cognitive 23) deeptutor/capabilities/handoff/capability.py:251 — HandoffCapability._partner has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 9, if/else 7 (9 pts), error handling 3 (4 pts), loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · tools._revise_specs (cognitive 23) · ×1
  • tools._revise_specs (cognitive 23) deeptutor/capabilities/mastery/tools.py:3470 — tools._revise_specs has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · IndexingRun._start (cognitive 23) · ×1
  • IndexingRun._start (cognitive 23) deeptutor/knowledge/indexing_run.py:179 — IndexingRun._start has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 4 (6 pts), error handling 3 (4 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · lesson_evidence.scope_snapshot (cognitive 23) · ×1
  • lesson_evidence.scope_snapshot (cognitive 23) deeptutor/learning/lesson_evidence.py:269 — lesson_evidence.scope_snapshot has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (13 pts), error handling 2 (5 pts), boolean chains 3, loops 1, ternaries 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LearningService.record_learner_profile (cognitive 23) · ×1
  • LearningService.record_learner_profile (cognitive 23) deeptutor/learning/service.py:2099 — LearningService.record_learner_profile has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 11, if/else 8 (11 pts), ternaries 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · proposals.propose (cognitive 23) · ×1
  • proposals.propose (cognitive 23) deeptutor/notes/proposals.py:64 — proposals.propose has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 8 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · MattermostChannel._handle_posted (cognitive 23) · ×1
  • MattermostChannel._handle_posted (cognitive 23) deeptutor/partners/channels/mattermost.py:247 — MattermostChannel._handle_posted has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 13, if/else 8, error handling 1, ternaries 1. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · model_catalog.restore_catalog_secrets (cognitive 23) · ×1
  • model_catalog.restore_catalog_secrets (cognitive 23) deeptutor/services/config/model_catalog.py:99 — model_catalog.restore_catalog_secrets has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 4, loops 3 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RuntimeSettingsService._apply_system_process_overrides (cognitive 23) · ×1
  • RuntimeSettingsService._apply_system_process_overrides (cognitive 23) deeptutor/services/config/runtime_settings.py:901 — RuntimeSettingsService._apply_system_process_overrides has cognitive complexity 23 (threshold 15). Drivers by points: if/else 19 (20 pts), boolean chains 2, loops 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · settings_profile._diff_settings (cognitive 23) · ×1
  • settings_profile._diff_settings (cognitive 23) deeptutor/services/config/settings_profile.py:294 — settings_profile._diff_settings has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sdk_bridge._consume_messages (cognitive 23) · ×1
  • sdk_bridge._consume_messages (cognitive 23) deeptutor/services/llm/provider_core/sdk_bridge.py:20 — sdk_bridge._consume_messages has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (17 pts), error handling 1 (4 pts), boolean chains 1, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · provider_factory._build_runtime_provider (cognitive 23) · ×1
  • provider_factory._build_runtime_provider (cognitive 23) deeptutor/services/llm/provider_factory.py:59 — provider_factory._build_runtime_provider has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 15, if/else 5 (6 pts), ternaries 1 (2 pts) (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · line_doc._apply_insert (cognitive 23) · ×1
  • line_doc._apply_insert (cognitive 23) deeptutor/services/memory/consolidator/line_doc.py:260 — line_doc._apply_insert has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 4, ternaries 2 (3 pts), loops 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · readiness.mineru_models_ready (cognitive 23) · ×1
  • readiness.mineru_models_ready (cognitive 23) deeptutor/services/parsing/engines/mineru/readiness.py:45 — readiness.mineru_models_ready has cognitive complexity 23 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (6 pts), error handling 2 (3 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · VisualAssetStore.publish (cognitive 23) · ×1
  • VisualAssetStore.publish (cognitive 23) deeptutor/services/rag/visual_assets.py:288 — VisualAssetStore.publish has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 5, loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · visual_assets.collect_visual_assets (cognitive 23) · ×1
  • visual_assets.collect_visual_assets (cognitive 23) deeptutor/services/rag/visual_assets.py:176 — visual_assets.collect_visual_assets has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 13, if/else 4 (7 pts), error handling 1 (2 pts), loops 1 (nesting depth added 4). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · _turn_runtime_shared._repair_chinese_emphasis_line (cognitive 23) · ×1
  • _turn_runtime_shared._repair_chinese_emphasis_line (cognitive 23) deeptutor/services/session/_turn_runtime_shared.py:195 — _turn_runtime_shared._repair_chinese_emphasis_line has cognitive complexity 23 (threshold 15). Drivers by points: if/else 4 (9 pts), ternaries 4 (8 pts), boolean chains 4, loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · legacy_migration._normalize_session (cognitive 23) · ×1
  • legacy_migration._normalize_session (cognitive 23) deeptutor/services/session/legacy_migration.py:73 — legacy_migration._normalize_session has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 10, if/else 6 (9 pts), ternaries 3, loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · source_inventory.collect_prior_image_attachments (cognitive 23) · ×1
  • source_inventory.collect_prior_image_attachments (cognitive 23) deeptutor/services/session/source_inventory.py:711 — source_inventory.collect_prior_image_attachments has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 7, loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · hub._extract_skill_zip (cognitive 23) · ×1
  • hub._extract_skill_zip (cognitive 23) deeptutor/services/skill/hub.py:205 — hub._extract_skill_zip has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 2, error handling 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClaudeCodeBackend.consult (cognitive 23) · ×1
  • ClaudeCodeBackend.consult (cognitive 23) deeptutor/services/subagent/claude_code.py:128 — ClaudeCodeBackend.consult has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 3, error handling 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · claude_models._parse_model_screen (cognitive 23) · ×1
  • claude_models._parse_model_screen (cognitive 23) deeptutor/services/subagent/claude_models.py:114 — claude_models._parse_model_screen has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (15 pts), ternaries 2 (4 pts), boolean chains 3, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OpenClawBackend.consult (cognitive 23) · ×1
  • OpenClawBackend.consult (cognitive 23) deeptutor/services/subagent/openclaw.py:81 — OpenClawBackend.consult has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 8, ternaries 1 (2 pts), error handling 1, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · crawler.crawl_and_diff (cognitive 23) · ×1
  • crawler.crawl_and_diff (cognitive 23) deeptutor/services/web_source/crawler.py:563 — crawler.crawl_and_diff has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 4, boolean chains 2, ternaries 2, error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · dependencies.dependency_closure (cognitive 23) · ×1
  • dependencies.dependency_closure (cognitive 23) deeptutor/services/workspace/dependencies.py:41 — dependencies.dependency_closure has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · dependencies._collect_references (cognitive 23) · ×1
  • dependencies._collect_references (cognitive 23) deeptutor/services/workspace/dependencies.py:255 — dependencies._collect_references has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · coord_transform.convert_bbox_elements_to_ggb (cognitive 23) · ×1
  • coord_transform.convert_bbox_elements_to_ggb (cognitive 23) deeptutor/tools/vision/coord_transform.py:133 — coord_transform.convert_bbox_elements_to_ggb has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 5, loops 2 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · write_note._format_transcript (cognitive 23) · ×1
  • write_note._format_transcript (cognitive 23) deeptutor/tools/write_note.py:398 — write_note._format_transcript has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 2, loops 2, ternaries 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ZoteroSearchClient._normalize (cognitive 23) · ×1
  • ZoteroSearchClient._normalize (cognitive 23) deeptutor/tools/zotero_search.py:105 — ZoteroSearchClient._normalize has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 13, if/else 3 (6 pts), ternaries 3, loops 1 (nesting depth added 3). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · document_images._math_atom (cognitive 23) · ×1
  • document_images._math_atom (cognitive 23) deeptutor/utils/document_images.py:315 — document_images._math_atom has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (16 pts), ternaries 2 (3 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · json_parser.parse_json_response (cognitive 23) · ×1
  • json_parser.parse_json_response (cognitive 23) deeptutor/utils/json_parser.py:66 — json_parser.parse_json_response has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (15 pts), error handling 4 (6 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · builtin._geogebra_validator (cognitive 23) · ×1
  • builtin._geogebra_validator (cognitive 23) deeptutor/visualizers/builtin.py:105 — builtin._geogebra_validator has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14 (15 pts), boolean chains 3, error handling 2 (3 pts), loops 1, ternaries 1 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · init_wizard._derive_embedding_models_url (cognitive 23) · ×1
  • init_wizard._derive_embedding_models_url (cognitive 23) deeptutor_cli/init_wizard.py:700 — init_wizard._derive_embedding_models_url has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · export_discord_history.normalize_message (cognitive 23) · ×1
  • export_discord_history.normalize_message (cognitive 23) scripts/export_discord_history.py:100 — export_discord_history.normalize_message has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 19, loops 2, if/else 1, ternaries 1. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · limits.withProviderLimit (cognitive 23) · ×1
  • limits.withProviderLimit (cognitive 23) packages/chat-engine/src/providers/limits.ts:38 — limits.withProviderLimit has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (5 pts), boolean chains 4, ternaries 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · stdio.execute (cognitive 23) · ×1
  • stdio.execute (cognitive 23) packages/chat-engine/src/transport/stdio.ts:45 — stdio.execute has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 6 (16 pts), boolean chains 3, if/else 2 (3 pts), error handling 1 (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · stdio.lines.on("line") (cognitive 23) · ×1
  • stdio.lines.on("line") (cognitive 23) packages/chat-engine/src/transport/stdio.ts:147 — stdio.lines.on("line") has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 3, loops 1 (2 pts), error handling 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · MasteryHandoffCard.MasteryHandoff (cognitive 23) · ×1
  • MasteryHandoffCard.MasteryHandoff (cognitive 23) web/components/chat/home/MasteryHandoffCard.tsx:96 — MasteryHandoffCard.MasteryHandoff has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 12 (18 pts), boolean chains 4, if/else 1 (nesting depth added 6). Of this number, 22 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PartnerDraftCard.PartnerDraftCard (cognitive 23) · ×1
  • PartnerDraftCard.PartnerDraftCard (cognitive 23) web/components/chat/home/PartnerDraftCard.tsx:18 — PartnerDraftCard.PartnerDraftCard has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 12 (18 pts), boolean chains 4, error handling 1 (nesting depth added 6). Of this number, 20 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LocationCrumbs.InstanceCrumb (cognitive 23) · ×1
  • LocationCrumbs.InstanceCrumb (cognitive 23) web/components/layout/LocationCrumbs.tsx:81 — LocationCrumbs.InstanceCrumb has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 13, if/else 8, ternaries 2. Most of this is not in the body itself: 11 of the 23 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 160, a function literal at line 145, a function literal at line 169, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · ReviewHome.ReviewHome (cognitive 23) · ×1
  • ReviewHome.ReviewHome (cognitive 23) web/components/learning/practice/ReviewHome.tsx:19 — ReviewHome.ReviewHome has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 5 (10 pts), if/else 5 (6 pts), boolean chains 5, error handling 2 (nesting depth added 6). Most of this is not in the body itself: 10 of the 23 points are its own statements and the rest belongs to 2 function items inside it that branch (a function literal at line 30, start). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · GroupSidePanel.GroupSidePanel (cognitive 23) · ×1
  • GroupSidePanel.GroupSidePanel (cognitive 23) web/components/partners/group/GroupSidePanel.tsx:34 — GroupSidePanel.GroupSidePanel has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 7 (15 pts), boolean chains 5, if/else 3 (nesting depth added 8). Most of this is not in the body itself: 7 of the 23 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 60, 127, 157, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · VoicePreviewPanel.PreviewRequest (cognitive 23) · ×1
  • VoicePreviewPanel.PreviewRequest (cognitive 23) web/components/settings/VoicePreviewPanel.tsx:34 — VoicePreviewPanel.PreviewRequest has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (8 pts), ternaries 5 (8 pts), boolean chains 6, error handling 1 (nesting depth added 4). Most of this is not in the body itself: 6 of the 23 points are its own statements and the rest belongs to 3 function items inside it that branch (preview, a function literal at line 45, a function literal at line 57). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · PartnerRoster.PartnerRoster (cognitive 23) · ×1
  • PartnerRoster.PartnerRoster (cognitive 23) web/components/sidebar/PartnerRoster.tsx:22 — PartnerRoster.PartnerRoster has cognitive complexity 23 (threshold 15). Drivers by points: if/else 17 (18 pts), boolean chains 3, loops 1, ternaries 1 (nesting depth added 1). None of this is in the body itself: all 23 points belong to 11 function items inside it that branch (a function literal at line 34, a function literal at line 63, a function literal at line 72, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · WorkspaceSidebar.WorkspaceSidebar (cognitive 23) · ×1
  • WorkspaceSidebar.WorkspaceSidebar (cognitive 23) web/components/sidebar/WorkspaceSidebar.tsx:35 — WorkspaceSidebar.WorkspaceSidebar has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 7 (10 pts), boolean chains 6, if/else 5 (6 pts), error handling 1 (nesting depth added 4). None of this is in the body itself: all 23 points belong to 9 function literals inside it that branch (lines 180, 205, 54, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · LearningJournalPanel.LearningJournalPanel (cognitive 23) · ×1
  • LearningJournalPanel.LearningJournalPanel (cognitive 23) web/components/space/LearningJournalPanel.tsx:9 — LearningJournalPanel.LearningJournalPanel has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 6 (13 pts), boolean chains 8, if/else 2 (nesting depth added 7). Of this number, 20 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · items.buildItems (cognitive 23) · ×1
  • items.buildItems (cognitive 23) web/features/calendar/model/items.ts:97 — items.buildItems has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 4 (7 pts), boolean chains 5 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MonthView.MonthView (cognitive 23) · ×1
  • MonthView.MonthView (cognitive 23) web/features/calendar/components/MonthView.tsx:49 — MonthView.MonthView has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13, ternaries 5 (7 pts), boolean chains 3 (nesting depth added 2). None of this is in the body itself: all 23 points belong to 13 function items inside it that branch (a function literal at line 112, a function literal at line 128, a function literal at line 137, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · TracePresentation.StreamingStatus (cognitive 23) · ×1
  • TracePresentation.StreamingStatus (cognitive 23) web/features/chat/trace/TracePresentation.tsx:1498 — TracePresentation.StreamingStatus has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10, ternaries 4 (10 pts), boolean chains 3 (nesting depth added 6). Of this number, 22 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NoteInsertMenu.NoteInsertMenu (cognitive 23) · ×1
  • NoteInsertMenu.NoteInsertMenu (cognitive 23) web/features/notes/components/NoteInsertMenu.tsx:19 — NoteInsertMenu.NoteInsertMenu has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 10, ternaries 5 (8 pts), if/else 5 (nesting depth added 3). Most of this is not in the body itself: 4 of the 23 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 98, 58, 46, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · useKnowledgeProgress.useKnowledgeProgress.openTaskStream (cognitive 23) · ×1
  • useKnowledgeProgress.useKnowledgeProgress.openTaskStream (cognitive 23) web/hooks/useKnowledgeProgress.ts:274 — useKnowledgeProgress.useKnowledgeProgress.openTaskStream has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14 (16 pts), boolean chains 4, error handling 3 (nesting depth added 2). None of this is in the body itself: all 23 points belong to 9 function literals inside it that branch (lines 306, 313, 331, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · latex.collectMarkdownHeadings (cognitive 23) · ×1
  • latex.collectMarkdownHeadings (cognitive 23) web/lib/latex.ts:174 — latex.collectMarkdownHeadings has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (21 pts), boolean chains 1, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reading-location-history.normalizeEntry (cognitive 23) · ×1
  • reading-location-history.normalizeEntry (cognitive 23) web/lib/reading-location-history.ts:31 — reading-location-history.normalizeEntry has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 9 (13 pts), boolean chains 7, if/else 3 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · tool_runtime.bind_workspace_tool_runtime (cognitive 22) · ×1
  • tool_runtime.bind_workspace_tool_runtime (cognitive 22) deeptutor/agents/_shared/tool_runtime.py:44 — tool_runtime.bind_workspace_tool_runtime has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (13 pts), ternaries 3 (5 pts), boolean chains 4 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · QuestionPipeline._parse_plan (cognitive 22) · ×1
  • QuestionPipeline._parse_plan (cognitive 22) deeptutor/agents/question/pipeline.py:808 — QuestionPipeline._parse_plan has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 5, ternaries 3 (5 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · knowledge._assert_provider_ready (cognitive 22) · ×1
  • knowledge._assert_provider_ready (cognitive 22) deeptutor/api/routers/knowledge.py:752 — knowledge._assert_provider_ready has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 4 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · multi_user.put_guardian_restrictions (cognitive 22) · ×1
  • multi_user.put_guardian_restrictions (cognitive 22) deeptutor/api/routers/multi_user.py:666 — multi_user.put_guardian_restrictions has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (12 pts), error handling 4 (7 pts), ternaries 1 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · video_learning._live_stream_url (cognitive 22) · ×1
  • video_learning._live_stream_url (cognitive 22) deeptutor/api/routers/video_learning.py:452 — video_learning._live_stream_url has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 10, if/else 6 (9 pts), error handling 1, loops 1, ternaries 1 (nesting depth added 3). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · TaskIDManager.cleanup_old_tasks (cognitive 22) · ×1
  • TaskIDManager.cleanup_old_tasks (cognitive 22) deeptutor/api/utils/task_id_manager.py:85 — TaskIDManager.cleanup_old_tasks has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (14 pts), error handling 1 (4 pts), loops 3, boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SourceExplorer._collect_non_kb_chunks (cognitive 22) · ×1
  • SourceExplorer._collect_non_kb_chunks (cognitive 22) deeptutor/book/agents/source_explorer.py:581 — SourceExplorer._collect_non_kb_chunks has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 9, if/else 4 (7 pts), loops 3 (5 pts), error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AnimationGenerator._generate (cognitive 22) · ×1
  • AnimationGenerator._generate (cognitive 22) deeptutor/book/blocks/animation.py:30 — AnimationGenerator._generate has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 11, if/else 4, ternaries 4, loops 1 (2 pts), error handling 1 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · generation.propose_generated_block (cognitive 22) · ×1
  • generation.propose_generated_block (cognitive 22) deeptutor/capabilities/notes/generation.py:77 — generation.propose_generated_block has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 11, if/else 7 (8 pts), ternaries 2, error handling 1 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · InvokeOtherTool.execute (cognitive 22) · ×1
  • InvokeOtherTool.execute (cognitive 22) deeptutor/capabilities/partner_group/tools.py:43 — InvokeOtherTool.execute has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 9 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ConsultSubagentTool.execute (cognitive 22) · ×1
  • ConsultSubagentTool.execute (cognitive 22) deeptutor/capabilities/subagent/tools.py:78 — ConsultSubagentTool.execute has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 9, error handling 1, ternaries 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · docx_converter.markdown_to_docx (cognitive 22) · ×1
  • docx_converter.markdown_to_docx (cognitive 22) deeptutor/co_writer/docx_converter.py:458 — docx_converter.markdown_to_docx has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 2, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · grants.load_grant (cognitive 22) · ×1
  • grants.load_grant (cognitive 22) deeptutor/multi_user/grants.py:217 — grants.load_grant has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 6, error handling 2, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · threads.thread_anchor_context (cognitive 22) · ×1
  • threads.thread_anchor_context (cognitive 22) deeptutor/notes/threads.py:135 — threads.thread_anchor_context has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (13 pts), ternaries 4 (6 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · entry_points.load_entry_point_group (cognitive 22) · ×1
  • entry_points.load_entry_point_group (cognitive 22) deeptutor/plugins/entry_points.py:37 — entry_points.load_entry_point_group has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (16 pts), error handling 2 (3 pts), boolean chains 2, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MaterialManifest.from_dict (cognitive 22) · ×1
  • MaterialManifest.from_dict (cognitive 22) deeptutor/reading/models.py:261 — MaterialManifest.from_dict has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 17, ternaries 2 (3 pts), if/else 2 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · sdk_bridge._assistant_tool_calls (cognitive 22) · ×1
  • sdk_bridge._assistant_tool_calls (cognitive 22) deeptutor/services/llm/provider_core/sdk_bridge.py:86 — sdk_bridge._assistant_tool_calls has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 8, ternaries 1 (2 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · document.serialize (cognitive 22) · ×1
  • document.serialize (cognitive 22) deeptutor/services/memory/document.py:185 — document.serialize has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 5 (8 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · adapters.read_chat_entities (cognitive 22) · ×1
  • adapters.read_chat_entities (cognitive 22) deeptutor/services/memory/snapshot/adapters.py:480 — adapters.read_chat_entities has cognitive complexity 22 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 3 (6 pts), ternaries 1 (3 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ParseService._parse (cognitive 22) · ×1
  • ParseService._parse (cognitive 22) deeptutor/services/parsing/service.py:132 — ParseService._parse has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 5, error handling 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · factory._build_pipeline (cognitive 22) · ×1
  • factory._build_pipeline (cognitive 22) deeptutor/services/rag/factory.py:136 — factory._build_pipeline has cognitive complexity 22 (threshold 15). Drivers by points: if/else 15 (22 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · engine.build_rag (cognitive 22) · ×1
  • engine.build_rag (cognitive 22) deeptutor/services/rag/pipelines/lightrag/engine.py:217 — engine.build_rag has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (9 pts), ternaries 2 (5 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · exercise_lookup._parse_for (cognitive 22) · ×1
  • exercise_lookup._parse_for (cognitive 22) deeptutor/services/rag/pipelines/llamaindex/exercise_lookup.py:242 — exercise_lookup._parse_for has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 7, error handling 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · client.resolve_oss_sdk_config (cognitive 22) · ×1
  • client.resolve_oss_sdk_config (cognitive 22) deeptutor/services/rag/pipelines/pageindex/client.py:32 — client.resolve_oss_sdk_config has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 9 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · GrokBackend.consult (cognitive 22) · ×1
  • GrokBackend.consult (cognitive 22) deeptutor/services/subagent/grok.py:116 — GrokBackend.consult has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (17 pts), error handling 2 (3 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HermesRemoteEventMapper.handle (cognitive 22) · ×1
  • HermesRemoteEventMapper.handle (cognitive 22) deeptutor/services/subagent/hermes_remote_events.py:43 — HermesRemoteEventMapper.handle has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 8, if/else 4 (6 pts), ternaries 3 (6 pts), error handling 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · kb_move._rebase_llamaindex_paths (cognitive 22) · ×1
  • kb_move._rebase_llamaindex_paths (cognitive 22) deeptutor/services/workspace/kb_move.py:233 — kb_move._rebase_llamaindex_paths has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (14 pts), error handling 1 (3 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ArxivSearchTool.search_papers (cognitive 22) · ×1
  • ArxivSearchTool.search_papers (cognitive 22) deeptutor/tools/paper_search_tool.py:35 — ArxivSearchTool.search_papers has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (12 pts), error handling 4 (6 pts), boolean chains 3, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · coord_transform.suggest_coord_system (cognitive 22) · ×1
  • coord_transform.suggest_coord_system (cognitive 22) deeptutor/tools/vision/coord_transform.py:329 — coord_transform.suggest_coord_system has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 5, loops 2 (4 pts), ternaries 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · write_note._do_append (cognitive 22) · ×1
  • write_note._do_append (cognitive 22) deeptutor/tools/write_note.py:150 — write_note._do_append has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 10, if/else 10, error handling 1, ternaries 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · document_extractor._extract_docx (cognitive 22) · ×1
  • document_extractor._extract_docx (cognitive 22) deeptutor/utils/document_extractor.py:446 — document_extractor._extract_docx has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (13 pts), error handling 3 (5 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · workspace.walk (cognitive 22) · ×1
  • workspace.walk (cognitive 22) packages/chat-engine/src/tools/workspace.ts:54 — workspace.walk has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (12 pts), error handling 2 (5 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ToolDispatcher.run (cognitive 22) · ×1
  • ToolDispatcher.run (cognitive 22) packages/chat-engine/src/tools/dispatcher.ts:40 — ToolDispatcher.run has cognitive complexity 22 (threshold 15). Drivers by points: if/else 17 (26 pts), boolean chains 13, loops 6 (7 pts), ternaries 4 (5 pts), error handling 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (ToolDispatcher.run::execute) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · BookCreator.BookCreator (cognitive 22) · ×1
  • BookCreator.BookCreator (cognitive 22) web/app/(workspace)/learning/books/components/BookCreator.tsx:86 — BookCreator.BookCreator has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 13, ternaries 5 (6 pts), if/else 2, error handling 1 (nesting depth added 1). Of this number, 12 points are the body's own statements and 10 belong to 5 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · UserNoteBlock.UserNoteBlock (cognitive 22) · ×1
  • UserNoteBlock.UserNoteBlock (cognitive 22) web/app/(workspace)/learning/books/components/blocks/UserNoteBlock.tsx:26 — UserNoteBlock.UserNoteBlock has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 4 (8 pts), boolean chains 7, if/else 6 (7 pts) (nesting depth added 5). Of this number, 11 points are the body's own statements and 11 belong to 5 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConnectedAgents.ConnectedAgents (cognitive 22) · ×1
  • ConnectedAgents.ConnectedAgents (cognitive 22) web/components/agents/ConnectedAgents.tsx:28 — ConnectedAgents.ConnectedAgents has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 8 (20 pts), boolean chains 1, if/else 1 (nesting depth added 12). Most of this is not in the body itself: 8 of the 22 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 129, 31, 64). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · XlsxPreview.XlsxPreview (cognitive 22) · ×1
  • XlsxPreview.XlsxPreview (cognitive 22) web/components/chat/preview/previewers/XlsxPreview.tsx:25 — XlsxPreview.XlsxPreview has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (11 pts), ternaries 6 (8 pts), boolean chains 1, error handling 1, loops 1 (nesting depth added 3). Most of this is not in the body itself: 5 of the 22 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 42, 56, 32, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · InlineFileCard.extractStreamedArtifacts (cognitive 22) · ×1
  • InlineFileCard.extractStreamedArtifacts (cognitive 22) web/components/common/InlineFileCard.tsx:49 — InlineFileCard.extractStreamedArtifacts has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (10 pts), ternaries 2 (6 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ImaConnectionFields.ImaConnectionFields (cognitive 22) · ×1
  • ImaConnectionFields.ImaConnectionFields (cognitive 22) web/components/knowledge/ImaConnectionFields.tsx:9 — ImaConnectionFields.ImaConnectionFields has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 16, ternaries 4 (6 pts) (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · CreateKbModal.CreateKbModal · ×1
  • CreateKbModal.CreateKbModal::handleSubmit (cognitive 22) web/components/knowledge/CreateKbModal.tsx:535 — CreateKbModal.CreateKbModal::handleSubmit has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (10 pts), ternaries 3 (8 pts), boolean chains 3, error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (CreateKbModal.CreateKbModal) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · CreateKbModal.NewModeFields (cognitive 22) · ×1
  • CreateKbModal.NewModeFields (cognitive 22) web/components/knowledge/CreateKbModal.tsx:862 — CreateKbModal.NewModeFields has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 15, ternaries 4 (7 pts) (nesting depth added 3). Of this number, 12 points are the body's own statements and 10 belong to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · McpCatalogBrowser.McpCatalogBrowser (cognitive 22) · ×1
  • McpCatalogBrowser.McpCatalogBrowser (cognitive 22) web/components/mcp/McpCatalogBrowser.tsx:85 — McpCatalogBrowser.McpCatalogBrowser has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 7, ternaries 4 (7 pts), if/else 6, error handling 2 (nesting depth added 3). Of this number, 13 points are the body's own statements and 9 belong to 6 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · PdfPage.PdfPage (cognitive 22) · ×1
  • PdfPage.PdfPage (cognitive 22) web/components/reading/PdfPage.tsx:47 — PdfPage.PdfPage has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 6, error handling 3 (nesting depth added 1). Most of this is not in the body itself: 2 of the 22 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 75, 69, 115, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · ScopeEditorModal.ScopeEditorModal (cognitive 22) · ×1
  • ScopeEditorModal.ScopeEditorModal (cognitive 22) web/components/space/ScopeEditorModal.tsx:49 — ScopeEditorModal.ScopeEditorModal has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 6, error handling 2, ternaries 2 (nesting depth added 3). Most of this is not in the body itself: 5 of the 22 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 63, 99, 86, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · TopicWizardSteps.SourceSection (cognitive 22) · ×1
  • TopicWizardSteps.SourceSection (cognitive 22) web/components/space/learning/TopicWizardSteps.tsx:392 — TopicWizardSteps.SourceSection has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 7 (18 pts), boolean chains 4 (nesting depth added 11). Most of this is not in the body itself: 6 of the 22 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 436, 454). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · model.validatePrimitive (cognitive 22) · ×1
  • model.validatePrimitive (cognitive 22) web/features/capabilities/model.ts:85 — model.validatePrimitive has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 6, ternaries 2 (4 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · attachment-processing.selectAttachmentProcessing (cognitive 22) · ×1
  • attachment-processing.selectAttachmentProcessing (cognitive 22) web/features/chat/selectors/attachment-processing.ts:57 — attachment-processing.selectAttachmentProcessing has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 3 (5 pts), boolean chains 4, ternaries 1 (nesting depth added 7). Of this number, 21 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EngineDetail.LightRagServerForm (cognitive 22) · ×1
  • EngineDetail.LightRagServerForm (cognitive 22) web/features/knowledge/components/engines/EngineDetail.tsx:1275 — EngineDetail.LightRagServerForm has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 8, ternaries 6 (8 pts), if/else 4, error handling 2 (nesting depth added 2). Most of this is not in the body itself: 10 of the 22 points are its own statements and the rest belongs to 4 function items inside it that branch (test, save, a function literal at line 1293, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · NoteFavoriteBlock.NoteFavoriteBlock (cognitive 22) · ×1
  • NoteFavoriteBlock.NoteFavoriteBlock (cognitive 22) web/features/notes/components/NoteFavoriteBlock.tsx:23 — NoteFavoriteBlock.NoteFavoriteBlock has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 10, ternaries 8, if/else 3, error handling 1. Of this number, 19 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · book-activity.chapterRows (cognitive 22) · ×1
  • book-activity.chapterRows (cognitive 22) web/lib/book-activity.ts:294 — book-activity.chapterRows has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 5 (9 pts), boolean chains 8, if/else 5 (nesting depth added 4). None of this is in the body itself: all 22 points belong to 3 function literals inside it that branch (lines 303, 338, 300). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · DSMLStreamFilter.feed (cognitive 21) · ×1
  • DSMLStreamFilter.feed (cognitive 21) deeptutor/agents/loop/dsml_tool_calls.py:87 — DSMLStreamFilter.feed has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (20 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AgenticLoopPipeline._build_loop_messages (cognitive 21) · ×1
  • AgenticLoopPipeline._build_loop_messages (cognitive 21) deeptutor/agents/loop/pipeline.py:480 — AgenticLoopPipeline._build_loop_messages has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 5, loops 3, ternaries 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · pipeline._normalise_user_reply (cognitive 21) · ×1
  • pipeline._normalise_user_reply (cognitive 21) deeptutor/agents/loop/pipeline.py:125 — pipeline._normalise_user_reply has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 6, loops 1 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CodeGeneratorAgent._request_generated_code (cognitive 21) · ×1
  • CodeGeneratorAgent._request_generated_code (cognitive 21) deeptutor/agents/math_animator/agents/code_generator_agent.py:147 — CodeGeneratorAgent._request_generated_code has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (11 pts), boolean chains 3, loops 2 (3 pts), error handling 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FollowupAgent._render_question_context (cognitive 21) · ×1
  • FollowupAgent._render_question_context (cognitive 21) deeptutor/agents/question/agents/followup_agent.py:80 — FollowupAgent._render_question_context has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 11, if/else 4 (6 pts), loops 1 (2 pts), ternaries 2 (nesting depth added 3). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · ToolTrace._truncate_raw_answer (cognitive 21) · ×1
  • ToolTrace._truncate_raw_answer (cognitive 21) deeptutor/agents/research/data_structures.py:95 — ToolTrace._truncate_raw_answer has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (16 pts), error handling 1 (2 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · mastery_path.generate_from_notebook (cognitive 21) · ×1
  • mastery_path.generate_from_notebook (cognitive 21) deeptutor/api/routers/mastery_path.py:1427 — mastery_path.generate_from_notebook has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sessions._normalize_legacy_watching_session (cognitive 21) · ×1
  • sessions._normalize_legacy_watching_session (cognitive 21) deeptutor/api/routers/sessions.py:175 — sessions._normalize_legacy_watching_session has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 6, error handling 2, loops 1 (2 pts), ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sessions._truncate_oversized_events (cognitive 21) · ×1
  • sessions._truncate_oversized_events (cognitive 21) deeptutor/api/routers/sessions.py:388 — sessions._truncate_oversized_events has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 3 (7 pts), boolean chains 3 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · settings.test_mineru_connection (cognitive 21) · ×1
  • settings.test_mineru_connection (cognitive 21) deeptutor/api/routers/settings.py:1662 — settings.test_mineru_connection has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 4, ternaries 2 (4 pts), error handling 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SourceExplorer._design_queries (cognitive 21) · ×1
  • SourceExplorer._design_queries (cognitive 21) deeptutor/book/agents/source_explorer.py:253 — SourceExplorer._design_queries has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 9, error handling 1, loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SpineAgent._coerce_chapters (cognitive 21) · ×1
  • SpineAgent._coerce_chapters (cognitive 21) deeptutor/book/agents/spine_agent.py:114 — SpineAgent._coerce_chapters has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 7, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FlashCardsGenerator._generate (cognitive 21) · ×1
  • FlashCardsGenerator._generate (cognitive 21) deeptutor/book/blocks/flash_cards.py:22 — FlashCardsGenerator._generate has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 8, if/else 4 (8 pts), ternaries 3, loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · QuizGenerator._extract_questions (cognitive 21) · ×1
  • QuizGenerator._extract_questions (cognitive 21) deeptutor/book/blocks/quiz.py:85 — QuizGenerator._extract_questions has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 3, ternaries 1 (3 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SectionGenerator._make_outline (cognitive 21) · ×1
  • SectionGenerator._make_outline (cognitive 21) deeptutor/book/blocks/section.py:176 — SectionGenerator._make_outline has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 9, if/else 5 (7 pts), error handling 2 (3 pts), loops 1, ternaries 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BookEngine._materialize_overview_page (cognitive 21) · ×1
  • BookEngine._materialize_overview_page (cognitive 21) deeptutor/book/engine.py:753 — BookEngine._materialize_overview_page has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 7, loops 2, ternaries 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · engine._source_quality_summary (cognitive 21) · ×1
  • engine._source_quality_summary (cognitive 21) deeptutor/book/engine.py:171 — engine._source_quality_summary has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 8, if/else 6 (7 pts), ternaries 5, loops 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · inputs.build_book_inputs (cognitive 21) · ×1
  • inputs.build_book_inputs (cognitive 21) deeptutor/book/inputs.py:315 — inputs.build_book_inputs has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 8, ternaries 1 (3 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AudioOverviewCapability.run (cognitive 21) · ×1
  • AudioOverviewCapability.run (cognitive 21) deeptutor/capabilities/audio_overview/capability.py:24 — AudioOverviewCapability.run has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 10, if/else 9 (10 pts), ternaries 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ContextExplorer._run_loop (cognitive 21) · ×1
  • ContextExplorer._run_loop (cognitive 21) deeptutor/capabilities/explore_context/explorer.py:221 — ContextExplorer._run_loop has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 8, ternaries 1 (2 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PartnerGroupCapability.tool_round_output_policy (cognitive 21) · ×1
  • PartnerGroupCapability.tool_round_output_policy (cognitive 21) deeptutor/capabilities/partner_group/capability.py:122 — PartnerGroupCapability.tool_round_output_policy has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 7 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · blocks.inline_markdown (cognitive 21) · ×1
  • blocks.inline_markdown (cognitive 21) deeptutor/notes/blocks.py:191 — blocks.inline_markdown has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 2 (3 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MSTeamsChannel._prune_conversation_refs (cognitive 21) · ×1
  • MSTeamsChannel._prune_conversation_refs (cognitive 21) deeptutor/partners/channels/msteams.py:699 — MSTeamsChannel._prune_conversation_refs has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 4, ternaries 2 (3 pts), error handling 1 (2 pts), loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PluginLifecycleManager.install (cognitive 21) · ×1
  • PluginLifecycleManager.install (cognitive 21) deeptutor/plugins/lifecycle.py:72 — PluginLifecycleManager.install has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 4, error handling 1, ternaries 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · models.parse_text_selectors (cognitive 21) · ×1
  • models.parse_text_selectors (cognitive 21) deeptutor/reading/models.py:324 — models.parse_text_selectors has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 6, error handling 1 (3 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EngineClient.run_native (cognitive 21) · ×1
  • EngineClient.run_native (cognitive 21) deeptutor/runtime/ts_engine/client.py:179 — EngineClient.run_native has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 2, loops 2, error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CalendarStore.occurrences (cognitive 21) · ×1
  • CalendarStore.occurrences (cognitive 21) deeptutor/services/calendar/store.py:455 — CalendarStore.occurrences has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 3 (8 pts), if/else 3 (5 pts), boolean chains 4, loops 3 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CodexOAuthService.public_status (cognitive 21) · ×1
  • CodexOAuthService.public_status (cognitive 21) REDACTED:948 — CodexOAuthService.public_status has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 12, boolean chains 5, if/else 3, error handling 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · launch_settings._normalize_language (cognitive 21) · ×1
  • launch_settings._normalize_language (cognitive 21) deeptutor/services/config/launch_settings.py:50 — launch_settings._normalize_language has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11, boolean chains 10. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · provider_links.referenced_models (cognitive 21) · ×1
  • provider_links.referenced_models (cognitive 21) deeptutor/services/config/provider_links.py:203 — provider_links.referenced_models has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 3 (9 pts), loops 3 (6 pts), if/else 1 (4 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · provider_runtime._register_catalog_capabilities (cognitive 21) · ×1
  • provider_runtime._register_catalog_capabilities (cognitive 21) deeptutor/services/config/provider_runtime.py:799 — provider_runtime._register_catalog_capabilities has cognitive complexity 21 (threshold 15). Drivers by points: if/else 3 (11 pts), loops 3 (6 pts), boolean chains 4 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · kinds._validate_references (cognitive 21) · ×1
  • kinds._validate_references (cognitive 21) deeptutor/services/creations/kinds.py:86 — kinds._validate_references has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 3, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · utils.extract_response_content (cognitive 21) · ×1
  • utils.extract_response_content (cognitive 21) deeptutor/services/llm/utils.py:267 — utils.extract_response_content has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · network.validate_mcp_url (cognitive 21) · ×1
  • network.validate_mcp_url (cognitive 21) deeptutor/services/mcp/network.py:75 — network.validate_mcp_url has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 6, error handling 4 (5 pts), if/else 4 (5 pts), ternaries 2 (4 pts), loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WhiteboardMemory._entries_unlocked (cognitive 21) · ×1
  • WhiteboardMemory._entries_unlocked (cognitive 21) deeptutor/services/partner_groups/memory.py:143 — WhiteboardMemory._entries_unlocked has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 3, error handling 2 (3 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ingress.load_verified_bundle (cognitive 21) · ×1
  • ingress.load_verified_bundle (cognitive 21) deeptutor/services/rag/pipelines/lightrag/ingress.py:304 — ingress.load_verified_bundle has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 4, loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · source_visuals.page_image (cognitive 21) · ×1
  • source_visuals.page_image (cognitive 21) deeptutor/services/rag/source_visuals.py:70 — source_visuals.page_image has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 4, error handling 2, ternaries 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · primitives.read_pdf (cognitive 21) · ×1
  • primitives.read_pdf (cognitive 21) deeptutor/services/research/primitives.py:311 — primitives.read_pdf has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 6, ternaries 4, error handling 1, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · QianfanProvider.search (cognitive 21) · ×1
  • QianfanProvider.search (cognitive 21) deeptutor/services/search/providers/qianfan.py:41 — QianfanProvider.search has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 15, if/else 5, loops 1. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · source_filter._rejection_reason (cognitive 21) · ×1
  • source_filter._rejection_reason (cognitive 21) REDACTED:145 — source_filter._rejection_reason has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10, boolean chains 8, error handling 3. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · LegacyChatSessionMigrator._migrate_locked (cognitive 21) · ×1
  • LegacyChatSessionMigrator._migrate_locked (cognitive 21) deeptutor/services/session/legacy_migration.py:142 — LegacyChatSessionMigrator._migrate_locked has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 5, error handling 2 (3 pts), loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · TurnLifecycle._publish_live_event (cognitive 21) · ×1
  • TurnLifecycle._publish_live_event (cognitive 21) deeptutor/services/session/turns/lifecycle.py:681 — TurnLifecycle._publish_live_event has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 5, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · provider_probe.probe_search_provider (cognitive 21) · ×1
  • provider_probe.probe_search_provider (cognitive 21) deeptutor/services/settings/provider_probe.py:144 — provider_probe.probe_search_provider has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 5 (10 pts), error handling 6, boolean chains 3, if/else 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DashScopeVideogenAdapter._poll_until_complete (cognitive 21) · ×1
  • DashScopeVideogenAdapter._poll_until_complete (cognitive 21) deeptutor/services/videogen/adapters/dashscope.py:203 — DashScopeVideogenAdapter._poll_until_complete has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 5, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MistralSTTAdapter.transcribe (cognitive 21) · ×1
  • MistralSTTAdapter.transcribe (cognitive 21) deeptutor/services/voice/adapters/mistral.py:94 — MistralSTTAdapter.transcribe has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 6, ternaries 2 (3 pts), error handling 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · data_migration._pocketbase_rebind (cognitive 21) · ×1
  • data_migration._pocketbase_rebind (cognitive 21) deeptutor/services/workspace/data_migration.py:765 — data_migration._pocketbase_rebind has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 3 (4 pts), ternaries 1 (4 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · write_note._do_edit (cognitive 21) · ×1
  • write_note._do_edit (cognitive 21) deeptutor/tools/write_note.py:291 — write_note._do_edit has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10, boolean chains 8, error handling 2, ternaries 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · VisualizerPlugin.validate_payload (cognitive 21) · ×1
  • VisualizerPlugin.validate_payload (cognitive 21) deeptutor/visualizers/protocol.py:136 — VisualizerPlugin.validate_payload has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (10 pts), error handling 2 (5 pts), ternaries 1 (5 pts), boolean chains 1 (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · VisualizerStore._extract_archive (cognitive 21) · ×1
  • VisualizerStore._extract_archive (cognitive 21) deeptutor/visualizers/store.py:219 — VisualizerStore._extract_archive has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 3, error handling 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · init_wizard.select_from_options (cognitive 21) · ×1
  • init_wizard.select_from_options (cognitive 21) deeptutor_cli/init_wizard.py:349 — init_wizard.select_from_options has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 4 (6 pts), boolean chains 4 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · init_wizard.fetch_models (cognitive 21) · ×1
  • init_wizard.fetch_models (cognitive 21) deeptutor_cli/init_wizard.py:628 — init_wizard.fetch_models has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 4, loops 2, error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BlockRenderer.BlockRenderer (cognitive 21) · ×1
  • BlockRenderer.BlockRenderer (cognitive 21) web/app/(workspace)/learning/books/components/blocks/BlockRenderer.tsx:85 — BlockRenderer.BlockRenderer has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 16, if/else 4, match/switch 1. Of this number, 20 points are the body's own statements and 1 belongs to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · ActivityRow.ActivityRow (cognitive 21) · ×1
  • ActivityRow.ActivityRow (cognitive 21) web/components/activity/ActivityRow.tsx:66 — ActivityRow.ActivityRow has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 13 (20 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AskUserOptions.QuestionBody (cognitive 21) · ×1
  • AskUserOptions.QuestionBody (cognitive 21) web/components/chat/home/AskUserOptions.tsx:1432 — AskUserOptions.QuestionBody has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 9 (16 pts), boolean chains 4, if/else 1 (nesting depth added 7). Most of this is not in the body itself: 10 of the 21 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 1481, 1457, 1489, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · previewerFor.previewKindFor (cognitive 21) · ×1
  • previewerFor.previewKindFor (cognitive 21) web/components/chat/preview/previewerFor.ts:97 — previewerFor.previewKindFor has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 11, if/else 10. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · OfficePdfPreview.OfficePdfPreview (cognitive 21) · ×1
  • OfficePdfPreview.OfficePdfPreview (cognitive 21) web/components/chat/preview/previewers/OfficePdfPreview.tsx:23 — OfficePdfPreview.OfficePdfPreview has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 3, error handling 1, ternaries 1 (nesting depth added 4). Most of this is not in the body itself: 3 of the 21 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 43, 94). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · PageCustomizeDialog.PageCustomizeDialog (cognitive 21) · ×1
  • PageCustomizeDialog.PageCustomizeDialog (cognitive 21) web/components/customization/PageCustomizeDialog.tsx:65 — PageCustomizeDialog.PageCustomizeDialog has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 13, ternaries 4 (7 pts), error handling 1 (nesting depth added 3). Of this number, 15 points are the body's own statements and 6 belong to 7 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · KbVisualCoverage.KbVisualCoverage (cognitive 21) · ×1
  • KbVisualCoverage.KbVisualCoverage (cognitive 21) web/components/knowledge/KbVisualCoverage.tsx:16 — KbVisualCoverage.KbVisualCoverage has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 5 (11 pts), boolean chains 6, if/else 4 (nesting depth added 6). Of this number, 12 points are the body's own statements and 9 belong to 5 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NewLearningPage.NewLearningPage (cognitive 21) · ×1
  • NewLearningPage.NewLearningPage (cognitive 21) web/components/learning/NewLearningPage.tsx:20 — NewLearningPage.NewLearningPage has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 5 (12 pts), boolean chains 9 (nesting depth added 7). Most of this is not in the body itself: 9 of the 21 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 28, 61). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · useGroupSession.useGroupSession.handleFrame (cognitive 21) · ×1
  • useGroupSession.useGroupSession.handleFrame (cognitive 21) web/components/partners/group/useGroupSession.ts:156 — useGroupSession.useGroupSession.handleFrame has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 5 (10 pts), if/else 4 (8 pts), boolean chains 2, match/switch 1 (nesting depth added 9). Most of this is not in the body itself: 6 of the 21 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 203, 160, 181, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · PartnerGroupChat.PartnerGroupChat (cognitive 21) · ×1
  • PartnerGroupChat.PartnerGroupChat (cognitive 21) web/components/partners/group/PartnerGroupChat.tsx:34 — PartnerGroupChat.PartnerGroupChat has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9, ternaries 5 (8 pts), boolean chains 4 (nesting depth added 3). Most of this is not in the body itself: 4 of the 21 points are its own statements and the rest belongs to 10 function literals inside it that branch (lines 89, 99, 135, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · ReadingActionsProvider.ReadingActionsProvider (cognitive 21) · ×1
  • ReadingActionsProvider.ReadingActionsProvider (cognitive 21) web/components/reading/ReadingActionsProvider.tsx:38 — ReadingActionsProvider.ReadingActionsProvider has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (11 pts), ternaries 4 (5 pts), boolean chains 4, error handling 1 (nesting depth added 3). None of this is in the body itself: all 21 points belong to 8 function literals inside it that branch (lines 141, 77, 164, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · ReadingFolder.ReadingFolderPage (cognitive 21) · ×1
  • ReadingFolder.ReadingFolderPage (cognitive 21) web/components/reading/library/ReadingFolder.tsx:51 — ReadingFolder.ReadingFolderPage has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 7, ternaries 5 (7 pts), if/else 4, error handling 3 (nesting depth added 2). Most of this is not in the body itself: 10 of the 21 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 66, removeFile, openFile, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · useLearningMode.useReadingLearningMode (cognitive 21) · ×1
  • useLearningMode.useReadingLearningMode (cognitive 21) web/components/reading/workspace/useLearningMode.ts:40 — useLearningMode.useReadingLearningMode has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 4, loops 3 (4 pts), ternaries 2 (nesting depth added 6). None of this is in the body itself: all 21 points belong to 7 function literals inside it that branch (lines 110, 88, 104, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · CategoryNavigation.CategoryTabs (cognitive 21) · ×1
  • CategoryNavigation.CategoryTabs (cognitive 21) web/components/sidebar/CategoryNavigation.tsx:88 — CategoryNavigation.CategoryTabs has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 10 (12 pts), boolean chains 7, if/else 2 (nesting depth added 2). Most of this is not in the body itself: 6 of the 21 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 134, tab, select, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · VersionBadge.VersionBadge (cognitive 21) · ×1
  • VersionBadge.VersionBadge (cognitive 21) web/components/sidebar/VersionBadge.tsx:18 — VersionBadge.VersionBadge has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 6 (16 pts), if/else 3, boolean chains 2 (nesting depth added 10). Of this number, 16 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · VisualizeConfigPanel.VisualizeConfigPanel (cognitive 21) · ×1
  • VisualizeConfigPanel.VisualizeConfigPanel (cognitive 21) web/components/visualize/VisualizeConfigPanel.tsx:35 — VisualizeConfigPanel.VisualizeConfigPanel has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 9 (11 pts), boolean chains 6, error handling 2, if/else 2 (nesting depth added 2). Of this number, 11 points are the body's own statements and 10 belong to 6 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · selectors.selectTraceDisplayItems (cognitive 21) · ×1
  • selectors.selectTraceDisplayItems (cognitive 21) web/features/chat/trace/selectors.ts:173 — selectors.selectTraceDisplayItems has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 3, ternaries 1 (2 pts), loops 1 (nesting depth added 7). Of this number, 19 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NoteTaskBlock.NoteTaskBlock (cognitive 21) · ×1
  • NoteTaskBlock.NoteTaskBlock (cognitive 21) web/features/notes/components/NoteTaskBlock.tsx:12 — NoteTaskBlock.NoteTaskBlock has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 11, ternaries 3 (5 pts), if/else 3, error handling 2 (nesting depth added 2). Most of this is not in the body itself: 8 of the 21 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 39, create, a function literal at line 35, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · useChatAutoScroll.useChatAutoScroll (cognitive 21) · ×1
  • useChatAutoScroll.useChatAutoScroll (cognitive 21) web/hooks/useChatAutoScroll.ts:19 — useChatAutoScroll.useChatAutoScroll has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 5, loops 2 (nesting depth added 2). None of this is in the body itself: all 21 points belong to 10 function literals inside it that branch (lines 84, 108, 43, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · book-progress.reduceBookEvent (cognitive 21) · ×1
  • book-progress.reduceBookEvent (cognitive 21) web/lib/book-progress.ts:206 — book-progress.reduceBookEvent has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 6, match/switch 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · chat-outline.buildChatOutline (cognitive 21) · ×1
  • chat-outline.buildChatOutline (cognitive 21) web/lib/chat-outline.ts:105 — chat-outline.buildChatOutline has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 3 (5 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · json_output.extract_json_object (cognitive 20) · ×1
  • json_output.extract_json_object (cognitive 20) deeptutor/agents/_shared/json_output.py:10 — json_output.extract_json_object has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (11 pts), error handling 3 (5 pts), boolean chains 2, loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BaseAgent.call_llm (cognitive 20) · ×1
  • BaseAgent.call_llm (cognitive 20) deeptutor/agents/base_agent.py:349 — BaseAgent.call_llm has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 4, error handling 2 (3 pts), ternaries 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · BaseAgent.stream_llm (cognitive 20) · ×1
  • BaseAgent.stream_llm (cognitive 20) deeptutor/agents/base_agent.py:519 — BaseAgent.stream_llm has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 4, error handling 2 (3 pts), ternaries 2, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · AgenticLoopPipeline._resolve_workspace_export (cognitive 20) · ×1
  • AgenticLoopPipeline._resolve_workspace_export (cognitive 20) deeptutor/agents/loop/pipeline.py:1344 — AgenticLoopPipeline._resolve_workspace_export has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 13, if/else 6, error handling 1. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · ResearchPipeline._build_block_tool_schemas (cognitive 20) · ×1
  • ResearchPipeline._build_block_tool_schemas (cognitive 20) deeptutor/agents/research/pipeline.py:2163 — ResearchPipeline._build_block_tool_schemas has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (12 pts), ternaries 3 (4 pts), boolean chains 3, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · file_preview._source_path (cognitive 20) · ×1
  • file_preview._source_path (cognitive 20) deeptutor/api/routers/file_preview.py:31 — file_preview._source_path has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10, boolean chains 6, ternaries 3, error handling 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · TurnApplicationService.replace_submission (cognitive 20) · ×1
  • TurnApplicationService.replace_submission (cognitive 20) deeptutor/app/service.py:34 — TurnApplicationService.replace_submission has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 3, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _AgentRelay.__call__ (cognitive 20) · ×1
  • _AgentRelay.__call__ (cognitive 20) deeptutor/capabilities/handoff/capability.py:425 — _AgentRelay.__call__ has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 8, if/else 5 (8 pts), ternaries 2 (4 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MasteryLoopCapability._grade_seed (cognitive 20) · ×1
  • MasteryLoopCapability._grade_seed (cognitive 20) deeptutor/capabilities/mastery/loop.py:522 — MasteryLoopCapability._grade_seed has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 6, ternaries 4 (5 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · MasteryStatusTool.execute (cognitive 20) · ×1
  • MasteryStatusTool.execute (cognitive 20) deeptutor/capabilities/mastery/tools.py:795 — MasteryStatusTool.execute has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (12 pts), ternaries 5 (6 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · MasteryNoteExplainedTool.execute (cognitive 20) · ×1
  • MasteryNoteExplainedTool.execute (cognitive 20) deeptutor/capabilities/mastery/tools.py:946 — MasteryNoteExplainedTool.execute has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 7, error handling 1, loops 1, ternaries 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · DocumentAdder._process_provider_files_one_by_one (cognitive 20) · ×1
  • DocumentAdder._process_provider_files_one_by_one (cognitive 20) deeptutor/knowledge/add_documents.py:427 — DocumentAdder._process_provider_files_one_by_one has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (12 pts), error handling 3 (7 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · lesson_evidence._repair_page (cognitive 20) · ×1
  • lesson_evidence._repair_page (cognitive 20) deeptutor/learning/lesson_evidence.py:513 — lesson_evidence._repair_page has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 5, ternaries 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SpacedRepetitionScheduler.schedule_review (cognitive 20) · ×1
  • SpacedRepetitionScheduler.schedule_review (cognitive 20) deeptutor/learning/scheduler.py:282 — SpacedRepetitionScheduler.schedule_review has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 4, ternaries 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · personal_models.personal_llm_rows (cognitive 20) · ×1
  • personal_models.personal_llm_rows (cognitive 20) deeptutor/multi_user/personal_models.py:91 — personal_models.personal_llm_rows has cognitive complexity 20 (threshold 15). Drivers by points: if/else 3 (9 pts), boolean chains 8, loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NapcatChannel._on_message (cognitive 20) · ×1
  • NapcatChannel._on_message (cognitive 20) deeptutor/partners/channels/napcat.py:247 — NapcatChannel._on_message has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 6, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · knowledge_capture.organize_workspace_notes (cognitive 20) · ×1
  • knowledge_capture.organize_workspace_notes (cognitive 20) deeptutor/reading/knowledge_capture.py:31 — knowledge_capture.organize_workspace_notes has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 3, loops 2 (3 pts), ternaries 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · launcher._patch_packaged_web_placeholders (cognitive 20) · ×1
  • launcher._patch_packaged_web_placeholders (cognitive 20) deeptutor/runtime/launcher.py:888 — launcher._patch_packaged_web_placeholders has cognitive complexity 20 (threshold 15). Drivers by points: if/else 2 (6 pts), loops 3 (6 pts), ternaries 2 (4 pts), error handling 1 (3 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · codebuddy_credentials.probe_account (cognitive 20) · ×1
  • codebuddy_credentials.probe_account (cognitive 20) deeptutor/services/codebuddy_credentials.py:317 — codebuddy_credentials.probe_account has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 6, loops 2 (3 pts), error handling 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CodexOAuthService._credentials_from_payload (cognitive 20) · ×1
  • CodexOAuthService._credentials_from_payload (cognitive 20) REDACTED:1081 — CodexOAuthService._credentials_from_payload has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 6, ternaries 3, error handling 1 (2 pts), loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · EmbeddingClient.embed (cognitive 20) · ×1
  • EmbeddingClient.embed (cognitive 20) deeptutor/services/embedding/client.py:118 — EmbeddingClient.embed has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 4 (7 pts), if/else 4 (6 pts), error handling 2 (5 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · github_copilot_auth.fetch_github_copilot_models (cognitive 20) · ×1
  • github_copilot_auth.fetch_github_copilot_models (cognitive 20) deeptutor/services/github_copilot_auth.py:202 — github_copilot_auth.fetch_github_copilot_models has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 2, loops 1, ternaries 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DashScopeImagegenAdapter._poll (cognitive 20) · ×1
  • DashScopeImagegenAdapter._poll (cognitive 20) deeptutor/services/imagegen/adapters/dashscope.py:96 — DashScopeImagegenAdapter._poll has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 3, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · error_mapping.parse_retry_after_seconds (cognitive 20) · ×1
  • error_mapping.parse_retry_after_seconds (cognitive 20) deeptutor/services/llm/error_mapping.py:59 — error_mapping.parse_retry_after_seconds has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (12 pts), error handling 2 (5 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LLMProvider._call_with_retry (cognitive 20) · ×1
  • LLMProvider._call_with_retry (cognitive 20) deeptutor/services/llm/provider_core/base.py:334 — LLMProvider._call_with_retry has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (13 pts), error handling 2 (4 pts), boolean chains 2, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · McpCatalogEntry.__post_init__ (cognitive 20) · ×1
  • McpCatalogEntry.__post_init__ (cognitive 20) deeptutor/services/mcp/catalog/models.py:163 — McpCatalogEntry.__post_init__ has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 3, loops 1, ternaries 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · update._run_update_l3 (cognitive 20) · ×1
  • update._run_update_l3 (cognitive 20) deeptutor/services/memory/consolidator/modes/update.py:363 — update._run_update_l3 has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 3 (4 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · store.migrate_partner_surface_if_needed (cognitive 20) · ×1
  • store.migrate_partner_surface_if_needed (cognitive 20) deeptutor/services/memory/store.py:360 — store.migrate_partner_surface_if_needed has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 4, error handling 1 (3 pts), loops 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · trace.iter_since (cognitive 20) · ×1
  • trace.iter_since (cognitive 20) deeptutor/services/memory/trace.py:89 — trace.iter_since has cognitive complexity 20 (threshold 15). Drivers by points: if/else 3 (8 pts), error handling 2 (5 pts), loops 2 (3 pts), boolean chains 2, ternaries 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _process.cli_process (cognitive 20) · ×1
  • _process.cli_process (cognitive 20) deeptutor/services/parsing/engines/mineru/_process.py:14 — _process.cli_process has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 2 (4 pts), error handling 1 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · backend._parse_local (cognitive 20) · ×1
  • backend._parse_local (cognitive 20) deeptutor/services/parsing/engines/mineru/backend.py:188 — backend._parse_local has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 5 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · provider.resolve_persisted_completion_provider (cognitive 20) · ×1
  • provider.resolve_persisted_completion_provider (cognitive 20) deeptutor/services/rag/pipelines/graphrag/provider.py:84 — provider.resolve_persisted_completion_provider has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 7, loops 2 (3 pts), error handling 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ingress.freeze_document (cognitive 20) · ×1
  • ingress.freeze_document (cognitive 20) deeptutor/services/rag/pipelines/lightrag/ingress.py:184 — ingress.freeze_document has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 5, ternaries 5, error handling 1, loops 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · tools.pageindex_sources_from_text (cognitive 20) · ×1
  • tools.pageindex_sources_from_text (cognitive 20) deeptutor/services/rag/pipelines/pageindex/tools.py:23 — tools.pageindex_sources_from_text has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 6, error handling 1, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · visual_coverage.coverage_overview (cognitive 20) · ×1
  • visual_coverage.coverage_overview (cognitive 20) deeptutor/services/rag/visual_coverage.py:104 — visual_coverage.coverage_overview has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 5, error handling 1 (2 pts), ternaries 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reading_hints._render (cognitive 20) · ×1
  • reading_hints._render (cognitive 20) deeptutor/services/reading_hints.py:235 — reading_hints._render has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 9 (16 pts), if/else 4 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AliyunIQSProvider.search (cognitive 20) · ×1
  • AliyunIQSProvider.search (cognitive 20) deeptutor/services/search/providers/aliyun_iqs.py:49 — AliyunIQSProvider.search has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 14, if/else 5, loops 1. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · _turn_runtime_shared._mastery_action_context (cognitive 20) · ×1
  • _turn_runtime_shared._mastery_action_context (cognitive 20) deeptutor/services/session/_turn_runtime_shared.py:528 — _turn_runtime_shared._mastery_action_context has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 1, error handling 1, loops 1, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · QuestionBankQuery.normalized (cognitive 20) · ×1
  • QuestionBankQuery.normalized (cognitive 20) deeptutor/services/session/sqlite_store.py:221 — QuestionBankQuery.normalized has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 14, ternaries 6. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · SQLiteSessionStore._reserve_submission_sync (cognitive 20) · ×1
  • SQLiteSessionStore._reserve_submission_sync (cognitive 20) deeptutor/services/session/sqlite_store.py:1185 — SQLiteSessionStore._reserve_submission_sync has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 4, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SQLiteSessionStore._append_turn_events_sync (cognitive 20) · ×1
  • SQLiteSessionStore._append_turn_events_sync (cognitive 20) deeptutor/services/session/sqlite_store.py:1786 — SQLiteSessionStore._append_turn_events_sync has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 7, loops 1, ternaries 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · thread_attribution._matches (cognitive 20) · ×1
  • thread_attribution._matches (cognitive 20) deeptutor/services/session/thread_attribution.py:134 — thread_attribution._matches has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 5, loops 1, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SkillService.install_tree (cognitive 20) · ×1
  • SkillService.install_tree (cognitive 20) deeptutor/services/skill/service.py:632 — SkillService.install_tree has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 6, error handling 1, ternaries 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · DeepSeekHarnessBackend._consult_headless (cognitive 20) · ×1
  • DeepSeekHarnessBackend._consult_headless (cognitive 20) deeptutor/services/subagent/deepseek_harness.py:94 — DeepSeekHarnessBackend._consult_headless has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 3, error handling 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HermesRemoteClient.stream_events (cognitive 20) · ×1
  • HermesRemoteClient.stream_events (cognitive 20) deeptutor/services/subagent/hermes_remote_client.py:123 — HermesRemoteClient.stream_events has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 2, error handling 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DashScopeVideogenAdapter._size (cognitive 20) · ×1
  • DashScopeVideogenAdapter._size (cognitive 20) deeptutor/services/videogen/adapters/dashscope.py:135 — DashScopeVideogenAdapter._size has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 6, ternaries 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · speech_text._replace_sqrt_once (cognitive 20) · ×1
  • speech_text._replace_sqrt_once (cognitive 20) deeptutor/services/voice/speech_text.py:491 — speech_text._replace_sqrt_once has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 4, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · resources.resource_usage (cognitive 20) · ×1
  • resources.resource_usage (cognitive 20) deeptutor/services/workspace/resources.py:164 — resources.resource_usage has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 7, ternaries 1 (3 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ContentWorkspaceService._walk_workspace (cognitive 20) · ×1
  • ContentWorkspaceService._walk_workspace (cognitive 20) deeptutor/services/workspace/service.py:402 — ContentWorkspaceService._walk_workspace has cognitive complexity 20 (threshold 15). Drivers by points: if/else 3 (9 pts), error handling 2 (5 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ReadSourceTool.execute (cognitive 20) · ×1
  • ReadSourceTool.execute (cognitive 20) deeptutor/tools/builtin/__init__.py:1118 — ReadSourceTool.execute has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 5, ternaries 2 (4 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ListDirTool.execute (cognitive 20) · ×1
  • ListDirTool.execute (cognitive 20) deeptutor/tools/file_tools.py:230 — ListDirTool.execute has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 4, ternaries 2 (4 pts), error handling 3, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · notes._matching_records (cognitive 20) · ×1
  • notes._matching_records (cognitive 20) deeptutor/video_learning/notes.py:66 — notes._matching_records has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (10 pts), boolean chains 4, loops 3 (4 pts), error handling 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiscordHistoryExporter._list_public_archived_threads (cognitive 20) · ×1
  • DiscordHistoryExporter._list_public_archived_threads (cognitive 20) scripts/export_discord_history.py:311 — DiscordHistoryExporter._list_public_archived_threads has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · http.post (cognitive 20) · ×1
  • http.post (cognitive 20) packages/chat-engine/src/providers/http.ts:17 — http.post has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 6 (9 pts), boolean chains 7, if/else 4 (nesting depth added 3). Most of this is not in the body itself: 2 of the 20 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 46, 36). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · AnimationBlock.AnimationBlock (cognitive 20) · ×1
  • AnimationBlock.AnimationBlock (cognitive 20) web/app/(workspace)/learning/books/components/blocks/AnimationBlock.tsx:29 — AnimationBlock.AnimationBlock has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 18, if/else 1, ternaries 1. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · DeepDiveBlock.DeepDiveBlock (cognitive 20) · ×1
  • DeepDiveBlock.DeepDiveBlock (cognitive 20) web/app/(workspace)/learning/books/components/blocks/DeepDiveBlock.tsx:21 — DeepDiveBlock.DeepDiveBlock has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 12, if/else 4, ternaries 3 (4 pts) (nesting depth added 1). Most of this is not in the body itself: 3 of the 20 points are its own statements and the rest belongs to 3 function items inside it that branch (a function literal at line 58, a function literal at line 75, pageFor). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · FaceEditor.FaceEditor (cognitive 20) · ×1
  • FaceEditor.FaceEditor (cognitive 20) web/components/partners/FaceEditor.tsx:91 — FaceEditor.FaceEditor has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 8 (12 pts), boolean chains 6, error handling 1, if/else 1 (nesting depth added 4). Most of this is not in the body itself: 5 of the 20 points are its own statements and the rest belongs to 5 function items inside it that branch (handleFile, a function literal at line 138, a function literal at line 144, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · useGroupSession.useGroupSession.rounds (cognitive 20) · ×1
  • useGroupSession.useGroupSession.rounds (cognitive 20) web/components/partners/group/useGroupSession.ts:333 — useGroupSession.useGroupSession.rounds has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (12 pts), ternaries 3 (4 pts), boolean chains 3, loops 1 (nesting depth added 5). Of this number, 13 points are the body's own statements and 7 belong to 5 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AddMaterialsDialog.AddMaterialsDialog (cognitive 20) · ×1
  • AddMaterialsDialog.AddMaterialsDialog (cognitive 20) web/components/reading/library/AddMaterialsDialog.tsx:69 — AddMaterialsDialog.AddMaterialsDialog has cognitive complexity 20 (threshold 15). Drivers by points: if/else 22 (29 pts), ternaries 16 (24 pts), boolean chains 19, loops 3 (6 pts), error handling 3 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (AddMaterialsDialog.AddMaterialsDialog::submit) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · CategoryMenu.CategoryMenu (cognitive 20) · ×1
  • CategoryMenu.CategoryMenu (cognitive 20) web/components/space/question-bank/CategoryMenu.tsx:38 — CategoryMenu.CategoryMenu has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 6 (9 pts), boolean chains 5, if/else 5, error handling 1 (nesting depth added 3). Of this number, 12 points are the body's own statements and 8 belong to 9 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · buildStartTurnInput.buildStartTurnInput (cognitive 20) · ×1
  • buildStartTurnInput.buildStartTurnInput (cognitive 20) web/features/chat/controllers/buildStartTurnInput.ts:51 — buildStartTurnInput.buildStartTurnInput has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 11, boolean chains 5, if/else 4. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · TurnRuntimeClient.handleMessage (cognitive 20) · ×1
  • TurnRuntimeClient.handleMessage (cognitive 20) web/features/chat/transport/TurnRuntimeClient.ts:308 — TurnRuntimeClient.handleMessage has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BookPermissionEditor.BookPermissionEditor (cognitive 20) · ×1
  • BookPermissionEditor.BookPermissionEditor (cognitive 20) web/features/multi-user/components/BookPermissionEditor.tsx:21 — BookPermissionEditor.BookPermissionEditor has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 7 (11 pts), boolean chains 4, if/else 4, error handling 1 (nesting depth added 4). Of this number, 10 points are the body's own statements and 10 belong to 7 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NoteTaskView.NoteTaskView (cognitive 20) · ×1
  • NoteTaskView.NoteTaskView (cognitive 20) web/features/notes/components/NoteTaskView.tsx:16 — NoteTaskView.NoteTaskView has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 9, ternaries 3 (6 pts), if/else 3, error handling 2 (nesting depth added 3). Most of this is not in the body itself: 6 of the 20 points are its own statements and the rest belongs to 10 function items inside it that branch (a function literal at line 37, a function literal at line 174, a function literal at line 30, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · CapabilitiesSettingsSection.CapabilitiesSettingsPage (cognitive 20) · ×1
  • CapabilitiesSettingsSection.CapabilitiesSettingsPage (cognitive 20) web/features/settings/sections/CapabilitiesSettingsSection.tsx:88 — CapabilitiesSettingsSection.CapabilitiesSettingsPage has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16, ternaries 1 (2 pts), boolean chains 1, error handling 1 (nesting depth added 1). Most of this is not in the body itself: 3 of the 20 points are its own statements and the rest belongs to 11 function items inside it that branch (a function literal at line 99, a function literal at line 152, patchChat, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · WorkspaceSettingsSection.WorkspaceRow (cognitive 20) · ×1
  • WorkspaceSettingsSection.WorkspaceRow (cognitive 20) web/features/settings/sections/WorkspaceSettingsSection.tsx:23 — WorkspaceSettingsSection.WorkspaceRow has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 14, ternaries 4 (6 pts) (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · useMasteryPathActivity.useMasteryPathActivity (cognitive 20) · ×1
  • useMasteryPathActivity.useMasteryPathActivity (cognitive 20) web/hooks/useMasteryPathActivity.ts:138 — useMasteryPathActivity.useMasteryPathActivity has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10, ternaries 6 (7 pts), boolean chains 3 (nesting depth added 1). Most of this is not in the body itself: 4 of the 20 points are its own statements and the rest belongs to 11 function literals inside it that branch (lines 181, 155, 164, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · chat-resend.decideFailedTurnReplay (cognitive 20) · ×1
  • chat-resend.decideFailedTurnReplay (cognitive 20) web/lib/chat-resend.ts:73 — chat-resend.decideFailedTurnReplay has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (8 pts), ternaries 4 (7 pts), boolean chains 5 (nesting depth added 5). Of this number, 18 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · failed-submissions.clearFailedSubmission (cognitive 20) · ×1
  • failed-submissions.clearFailedSubmission (cognitive 20) web/lib/failed-submissions.ts:344 — failed-submissions.clearFailedSubmission has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 5, loops 1 (2 pts), ternaries 1 (nesting depth added 4). Of this number, 18 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · reading-citations.parseLocatorList (cognitive 20) · ×1
  • reading-citations.parseLocatorList (cognitive 20) web/lib/reading-citations.ts:100 — reading-citations.parseLocatorList has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 2 (4 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reading-quote-locator.project (cognitive 20) · ×1
  • reading-quote-locator.project (cognitive 20) web/lib/reading-quote-locator.ts:92 — reading-quote-locator.project has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Dialog.Dialog (cognitive 20) · ×1
  • Dialog.Dialog (cognitive 20) web/shared/ui/Dialog.tsx:41 — Dialog.Dialog has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10, boolean chains 6, ternaries 4. Most of this is not in the body itself: 6 of the 20 points are its own statements and the rest belongs to 6 function items inside it that branch (handleKeyDown, a function literal at line 74, a function literal at line 81, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · BaseAgent.get_prompt (cognitive 19) · ×1
  • BaseAgent.get_prompt (cognitive 19) deeptutor/agents/base_agent.py:699 — BaseAgent.get_prompt has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 5 (10 pts), if/else 5 (7 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · mimic_source._parse_sync (cognitive 19) · ×1
  • mimic_source._parse_sync (cognitive 19) deeptutor/agents/question/mimic_source.py:92 — mimic_source._parse_sync has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 5, ternaries 1 (2 pts), loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ResearchPipeline._drive_queue (cognitive 19) · ×1
  • ResearchPipeline._drive_queue (cognitive 19) deeptutor/agents/research/pipeline.py:1168 — ResearchPipeline._drive_queue has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 3 (4 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CitationManager._format_one_apa (cognitive 19) · ×1
  • CitationManager._format_one_apa (cognitive 19) deeptutor/agents/research/utils/citation_manager.py:641 — CitationManager._format_one_apa has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 7 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · VisualizeCapability.run (cognitive 19) · ×1
  • VisualizeCapability.run (cognitive 19) deeptutor/agents/visualize/capability.py:92 — VisualizeCapability.run has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 5, ternaries 3, error handling 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · imports.import_chat_history (cognitive 19) · ×1
  • imports.import_chat_history (cognitive 19) deeptutor/api/routers/imports.py:75 — imports.import_chat_history has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (15 pts), error handling 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · partners._create_partner (cognitive 19) · ×1
  • partners._create_partner (cognitive 19) deeptutor/api/routers/partners.py:845 — partners._create_partner has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 7, error handling 1 (3 pts) (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · question_notebook._persist_answer_images (cognitive 19) · ×1
  • question_notebook._persist_answer_images (cognitive 19) deeptutor/api/routers/question_notebook.py:221 — question_notebook._persist_answer_images has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 7, error handling 2 (6 pts), if/else 3 (5 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · settings.update_document_parsing_settings (cognitive 19) · ×1
  • settings.update_document_parsing_settings (cognitive 19) deeptutor/api/routers/settings.py:1418 — settings.update_document_parsing_settings has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (7 pts), boolean chains 5, error handling 1 (3 pts), ternaries 2 (3 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · tools._serialise_definition (cognitive 19) · ×1
  • tools._serialise_definition (cognitive 19) deeptutor/api/routers/tools.py:100 — tools._serialise_definition has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 3 (10 pts), boolean chains 3, if/else 2 (3 pts), loops 1 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BookEngine.generation_summary (cognitive 19) · ×1
  • BookEngine.generation_summary (cognitive 19) deeptutor/book/engine.py:1740 — BookEngine.generation_summary has cognitive complexity 19 (threshold 15). Drivers by points: if/else 3 (8 pts), loops 3 (5 pts), ternaries 3 (4 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AudioOverviewPipeline.publish (cognitive 19) · ×1
  • AudioOverviewPipeline.publish (cognitive 19) deeptutor/capabilities/audio_overview/pipeline.py:399 — AudioOverviewPipeline.publish has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 7, ternaries 1 (2 pts), error handling 1, loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HandoffCapability._subagent (cognitive 19) · ×1
  • HandoffCapability._subagent (cognitive 19) deeptutor/capabilities/handoff/capability.py:362 — HandoffCapability._subagent has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 12, if/else 5, ternaries 2. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · docx_converter._numbering_formats (cognitive 19) · ×1
  • docx_converter._numbering_formats (cognitive 19) deeptutor/co_writer/docx_converter.py:195 — docx_converter._numbering_formats has cognitive complexity 19 (threshold 15). Drivers by points: if/else 3 (7 pts), loops 4 (6 pts), boolean chains 4, error handling 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · semantic_assessment.bind_questions (cognitive 19) · ×1
  • semantic_assessment.bind_questions (cognitive 19) deeptutor/learning/semantic_assessment.py:290 — semantic_assessment.bind_questions has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 2, ternaries 2, boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TeachingUpdate.check_semantics (cognitive 19) · ×1
  • TeachingUpdate.check_semantics (cognitive 19) deeptutor/learning/teaching.py:33 — TeachingUpdate.check_semantics has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 4 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FeishuChannel._download_and_save_media (cognitive 19) · ×1
  • FeishuChannel._download_and_save_media (cognitive 19) deeptutor/partners/channels/feishu.py:1231 — FeishuChannel._download_and_save_media has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 4 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MatrixChannel._upload_and_send_attachment (cognitive 19) · ×1
  • MatrixChannel._upload_and_send_attachment (cognitive 19) deeptutor/partners/channels/matrix.py:396 — MatrixChannel._upload_and_send_attachment has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 8, if/else 6, error handling 3, ternaries 2. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · lifecycle._manifest_from_wheel (cognitive 19) · ×1
  • lifecycle._manifest_from_wheel (cognitive 19) deeptutor/plugins/lifecycle.py:292 — lifecycle._manifest_from_wheel has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 4, error handling 1, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · ReadingStore.outline (cognitive 19) · ×1
  • ReadingStore.outline (cognitive 19) deeptutor/reading/store.py:917 — ReadingStore.outline has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (11 pts), error handling 1 (3 pts), ternaries 1 (3 pts), loops 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ProviderOpenAIAdapter._create_completion (cognitive 19) · ×1
  • _ProviderOpenAIAdapter._create_completion (cognitive 19) deeptutor/runtime/agentic/client.py:430 — _ProviderOpenAIAdapter._create_completion has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 8, if/else 5 (7 pts), ternaries 2 (4 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BackgroundLeaderSupervisor._run (cognitive 19) · ×1
  • BackgroundLeaderSupervisor._run (cognitive 19) deeptutor/runtime/background_leader.py:71 — BackgroundLeaderSupervisor._run has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (9 pts), error handling 4 (8 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · readiness.document_parser_rows (cognitive 19) · ×1
  • readiness.document_parser_rows (cognitive 19) deeptutor/services/config/readiness.py:417 — readiness.document_parser_rows has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 7, if/else 4 (6 pts), ternaries 2 (5 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AnthropicProvider._assistant_blocks (cognitive 19) · ×1
  • AnthropicProvider._assistant_blocks (cognitive 19) deeptutor/services/llm/provider_core/anthropic_provider.py:183 — AnthropicProvider._assistant_blocks has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (7 pts), boolean chains 5, loops 3 (4 pts), ternaries 1 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OpenAICompatProvider._extract_text_content (cognitive 19) · ×1
  • OpenAICompatProvider._extract_text_content (cognitive 19) deeptutor/services/llm/provider_core/openai_compat_provider.py:856 — OpenAICompatProvider._extract_text_content has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · usage_ledger.merge_records (cognitive 19) · ×1
  • usage_ledger.merge_records (cognitive 19) deeptutor/services/llm/usage_ledger.py:110 — usage_ledger.merge_records has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (12 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MCPConnectionManager.call_tool (cognitive 19) · ×1
  • MCPConnectionManager.call_tool (cognitive 19) deeptutor/services/mcp/manager.py:423 — MCPConnectionManager.call_tool has cognitive complexity 19 (threshold 15). Drivers by points: error handling 7 (9 pts), if/else 5 (7 pts), boolean chains 3 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _runtime.call_llm (cognitive 19) · ×1
  • _runtime.call_llm (cognitive 19) deeptutor/services/memory/consolidator/modes/_runtime.py:88 — _runtime.call_llm has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (14 pts), error handling 2 (3 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · adapters.read_partner_entities (cognitive 19) · ×1
  • adapters.read_partner_entities (cognitive 19) deeptutor/services/memory/snapshot/adapters.py:364 — adapters.read_partner_entities has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 2 (3 pts), ternaries 2 (3 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · normalization._plan (cognitive 19) · ×1
  • normalization._plan (cognitive 19) deeptutor/services/parsing/engines/mineru/normalization.py:24 — normalization._plan has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 4, loops 2 (3 pts), error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PartnerSessionStore.messages_page (cognitive 19) · ×1
  • PartnerSessionStore.messages_page (cognitive 19) deeptutor/services/partners/sessions.py:302 — PartnerSessionStore.messages_page has cognitive complexity 19 (threshold 15). Drivers by points: if/else 3 (7 pts), error handling 2 (5 pts), ternaries 3, boolean chains 2, loops 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · storage.resolve_resumable_rebuild_dir (cognitive 19) · ×1
  • storage.resolve_resumable_rebuild_dir (cognitive 19) deeptutor/services/rag/pipelines/llamaindex/storage.py:109 — storage.resolve_resumable_rebuild_dir has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 5, error handling 1, loops 1, ternaries 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · FirecrawlProvider.search (cognitive 19) · ×1
  • FirecrawlProvider.search (cognitive 19) deeptutor/services/search/providers/firecrawl.py:34 — FirecrawlProvider.search has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 9, if/else 7 (8 pts), loops 2 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · _turn_runtime_shared._extract_followup_question_context (cognitive 19) · ×1
  • _turn_runtime_shared._extract_followup_question_context (cognitive 19) deeptutor/services/session/_turn_runtime_shared.py:1044 — _turn_runtime_shared._extract_followup_question_context has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 13, if/else 5 (6 pts) (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · _turn_runtime_shared._extract_selection_tutor_context (cognitive 19) · ×1
  • _turn_runtime_shared._extract_selection_tutor_context (cognitive 19) deeptutor/services/session/_turn_runtime_shared.py:1451 — _turn_runtime_shared._extract_selection_tutor_context has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 5 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · ContextBuilder._build_history (cognitive 19) · ×1
  • ContextBuilder._build_history (cognitive 19) deeptutor/services/session/context_builder.py:316 — ContextBuilder._build_history has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (5 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClawHubProvider.search (cognitive 19) · ×1
  • ClawHubProvider.search (cognitive 19) deeptutor/services/skill/hub.py:318 — ClawHubProvider.search has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 5, loops 2 (3 pts), error handling 1, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · snapshot_assets.fetch_snapshot_image (cognitive 19) · ×1
  • snapshot_assets.fetch_snapshot_image (cognitive 19) deeptutor/services/web_source/snapshot_assets.py:90 — snapshot_assets.fetch_snapshot_image has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 6, error handling 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ContentWorkspaceService.publish (cognitive 19) · ×1
  • ContentWorkspaceService.publish (cognitive 19) deeptutor/services/workspace/service.py:616 — ContentWorkspaceService.publish has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 4 (5 pts), boolean chains 4 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ask_user.build_ask_user_preview (cognitive 19) · ×1
  • ask_user.build_ask_user_preview (cognitive 19) deeptutor/tools/ask_user.py:160 — ask_user.build_ask_user_preview has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 5, loops 1 (2 pts), error handling 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ZoteroSearchToolWrapper.execute (cognitive 19) · ×1
  • ZoteroSearchToolWrapper.execute (cognitive 19) deeptutor/tools/builtin/__init__.py:858 — ZoteroSearchToolWrapper.execute has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 5, error handling 2, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · list_notebook._render_index (cognitive 19) · ×1
  • list_notebook._render_index (cognitive 19) deeptutor/tools/list_notebook.py:72 — list_notebook._render_index has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 7, error handling 1 (3 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ToolPromptComposer.format_phased (cognitive 19) · ×1
  • ToolPromptComposer.format_phased (cognitive 19) deeptutor/tools/prompting/__init__.py:181 — ToolPromptComposer.format_phased has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (5 pts), boolean chains 4 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · document_extractor._extract_pptx (cognitive 19) · ×1
  • document_extractor._extract_pptx (cognitive 19) deeptutor/utils/document_extractor.py:548 — document_extractor._extract_pptx has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (11 pts), error handling 3 (4 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · document_extractor.normalize_epub_archive (cognitive 19) · ×1
  • document_extractor.normalize_epub_archive (cognitive 19) deeptutor/utils/document_extractor.py:983 — document_extractor.normalize_epub_archive has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 3, ternaries 2 (3 pts), error handling 2, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · protocol._find_remote_schema_ref (cognitive 19) · ×1
  • protocol._find_remote_schema_ref (cognitive 19) deeptutor/visualizers/protocol.py:194 — protocol._find_remote_schema_ref has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiscordHistoryExporter.export (cognitive 19) · ×1
  • DiscordHistoryExporter.export (cognitive 19) scripts/export_discord_history.py:454 — DiscordHistoryExporter.export has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 5, ternaries 3, error handling 1 (2 pts), loops 1 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · LearningCapturePanel.LearningCapturePanel (cognitive 19) · ×1
  • LearningCapturePanel.LearningCapturePanel (cognitive 19) web/app/(workspace)/learning/books/components/LearningCapturePanel.tsx:53 — LearningCapturePanel.LearningCapturePanel has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 7 (13 pts), boolean chains 5, if/else 1 (nesting depth added 6). Of this number, 13 points are the body's own statements and 6 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ChatMarkdownNoteTab.ChatMarkdownNoteTab (cognitive 19) · ×1
  • ChatMarkdownNoteTab.ChatMarkdownNoteTab (cognitive 19) web/components/chat/home/ChatMarkdownNoteTab.tsx:11 — ChatMarkdownNoteTab.ChatMarkdownNoteTab has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 9, ternaries 4 (6 pts), if/else 3, error handling 1 (nesting depth added 2). Of this number, 11 points are the body's own statements and 8 belong to 2 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · SessionActivityPanel.ActivityBody (cognitive 19) · ×1
  • SessionActivityPanel.ActivityBody (cognitive 19) web/components/chat/home/SessionActivityPanel.tsx:196 — SessionActivityPanel.ActivityBody has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 6 (11 pts), if/else 7, boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CliAppsSection.Store (cognitive 19) · ×1
  • CliAppsSection.Store (cognitive 19) web/components/cli-apps/CliAppsSection.tsx:323 — CliAppsSection.Store has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 6, if/else 6, ternaries 4 (6 pts), error handling 1 (nesting depth added 2). Most of this is not in the body itself: 9 of the 19 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 388, 368, 375, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · ConnectKiwixModal.ConnectKiwixModal (cognitive 19) · ×1
  • ConnectKiwixModal.ConnectKiwixModal (cognitive 19) web/components/knowledge/ConnectKiwixModal.tsx:15 — ConnectKiwixModal.ConnectKiwixModal has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 10, ternaries 3 (6 pts), error handling 3 (nesting depth added 3). Of this number, 10 points are the body's own statements and 9 belong to 3 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · LightRagRoleModelsEditor.roleModelsValidationError (cognitive 19) · ×1
  • LightRagRoleModelsEditor.roleModelsValidationError (cognitive 19) web/components/knowledge/LightRagRoleModelsEditor.tsx:42 — LightRagRoleModelsEditor.roleModelsValidationError has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 5, loops 1 (nesting depth added 5). Of this number, 18 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LightRagIndexingProvenance.LightRagIndexingProvenance (cognitive 19) · ×1
  • LightRagIndexingProvenance.LightRagIndexingProvenance (cognitive 19) web/components/knowledge/LightRagIndexingProvenance.tsx:17 — LightRagIndexingProvenance.LightRagIndexingProvenance has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 11 (16 pts), boolean chains 3 (nesting depth added 5). Of this number, 17 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PageIndexSettingsModal.PageIndexConfigForm (cognitive 19) · ×1
  • PageIndexSettingsModal.PageIndexConfigForm (cognitive 19) web/components/knowledge/PageIndexSettingsModal.tsx:28 — PageIndexSettingsModal.PageIndexConfigForm has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 7 (9 pts), boolean chains 5, if/else 4, error handling 1 (nesting depth added 2). Of this number, 10 points are the body's own statements and 9 belong to 5 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · AnnotationList.AnnotationList (cognitive 19) · ×1
  • AnnotationList.AnnotationList (cognitive 19) web/components/reading/AnnotationList.tsx:37 — AnnotationList.AnnotationList has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 8, ternaries 5 (8 pts), if/else 1 (2 pts), loops 1 (nesting depth added 4). Most of this is not in the body itself: 5 of the 19 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 112, 118, 49, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · ReadingLibrary.ReadingLibraryPage (cognitive 19) · ×1
  • ReadingLibrary.ReadingLibraryPage (cognitive 19) web/components/reading/library/ReadingLibrary.tsx:50 — ReadingLibrary.ReadingLibraryPage has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 6 (12 pts), boolean chains 6, error handling 1 (nesting depth added 6). Of this number, 10 points are the body's own statements and 9 belong to 6 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ConnectionsEditor.ConnectionsEditor (cognitive 19) · ×1
  • ConnectionsEditor.ConnectionsEditor (cognitive 19) web/components/settings/ConnectionsEditor.tsx:82 — ConnectionsEditor.ConnectionsEditor has cognitive complexity 19 (threshold 15). Drivers by points: if/else 3 (7 pts), boolean chains 5, ternaries 3 (4 pts), loops 2 (3 pts) (nesting depth added 6). Most of this is not in the body itself: 9 of the 19 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 108, label, a function literal at line 180, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · TaskModelsWorkspace.TaskModelsWorkspace (cognitive 19) · ×1
  • TaskModelsWorkspace.TaskModelsWorkspace (cognitive 19) web/components/settings/TaskModelsWorkspace.tsx:124 — TaskModelsWorkspace.TaskModelsWorkspace has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 5, ternaries 5, loops 1 (nesting depth added 1). Most of this is not in the body itself: 6 of the 19 points are its own statements and the rest belongs to 5 function items inside it that branch (choiceFor, modelSelect, save, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · CreateTopicWizard.CreateTopicWizard (cognitive 19) · ×1
  • CreateTopicWizard.CreateTopicWizard (cognitive 19) web/components/space/learning/CreateTopicWizard.tsx:45 — CreateTopicWizard.CreateTopicWizard has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 8 (11 pts), boolean chains 6, error handling 1, if/else 1 (nesting depth added 3). Of this number, 10 points are the body's own statements and 9 belong to 3 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RouteDraftEditor.RouteDraftEditor (cognitive 19) · ×1
  • RouteDraftEditor.RouteDraftEditor (cognitive 19) web/components/space/learning/RouteDraftEditor.tsx:31 — RouteDraftEditor.RouteDraftEditor has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 18, ternaries 1. Most of this is not in the body itself: 5 of the 19 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 137, 197, 88, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · ObjectiveDetail.ObjectiveDetail (cognitive 19) · ×1
  • ObjectiveDetail.ObjectiveDetail (cognitive 19) web/components/space/learning/ObjectiveDetail.tsx:19 — ObjectiveDetail.ObjectiveDetail has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 19. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · ServerFolderPicker.ServerFolderPicker (cognitive 19) · ×1
  • ServerFolderPicker.ServerFolderPicker (cognitive 19) web/components/workspaces/ServerFolderPicker.tsx:15 — ServerFolderPicker.ServerFolderPicker has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 11, if/else 4, ternaries 2 (3 pts), error handling 1 (nesting depth added 1). Of this number, 10 points are the body's own statements and 9 belong to 5 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · WorkspaceResourcePicker.WorkspaceResourcePicker (cognitive 19) · ×1
  • WorkspaceResourcePicker.WorkspaceResourcePicker (cognitive 19) web/components/workspaces/WorkspaceResourcePicker.tsx:12 — WorkspaceResourcePicker.WorkspaceResourcePicker has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 6 (9 pts), boolean chains 8, if/else 2 (nesting depth added 3). Most of this is not in the body itself: 1 of the 19 points is its own statement and the rest belongs to 6 function literals inside it that branch (lines 72, 117, 34, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · recurrence.describeRule (cognitive 19) · ×1
  • recurrence.describeRule (cognitive 19) web/features/calendar/model/recurrence.ts:202 — recurrence.describeRule has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (12 pts), ternaries 2 (5 pts), boolean chains 1, match/switch 1 (nesting depth added 7). Of this number, 16 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · blocks.blockPreview (cognitive 19) · ×1
  • blocks.blockPreview (cognitive 19) web/features/notes/model/blocks.ts:27 — blocks.blockPreview has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 14, if/else 1 (2 pts), ternaries 1 (2 pts), match/switch 1 (nesting depth added 2). Of this number, 18 points are the body's own statements and 1 belongs to 2 function literals inside it that branch. The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · UsageSettingsSection.UsageSettingsSection (cognitive 19) · ×1
  • UsageSettingsSection.UsageSettingsSection (cognitive 19) web/features/settings/sections/UsageSettingsSection.tsx:12 — UsageSettingsSection.UsageSettingsSection has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 6 (9 pts), boolean chains 8, if/else 2 (nesting depth added 3). Most of this is not in the body itself: 9 of the 19 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 36, a function literal at line 31, a function literal at line 34, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · languages.normalizeLanguage (cognitive 19) · ×1
  • languages.normalizeLanguage (cognitive 19) web/i18n/languages.ts:25 — languages.normalizeLanguage has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10, boolean chains 9. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · codex.parseCodexSession (cognitive 19) · ×1
  • codex.parseCodexSession (cognitive 19) web/lib/chat-import/codex.ts:209 — codex.parseCodexSession has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 2, error handling 1 (2 pts), loops 1, ternaries 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · notebook-api.listNotebookEntries (cognitive 19) · ×1
  • notebook-api.listNotebookEntries (cognitive 19) web/lib/notebook-api.ts:331 — notebook-api.listNotebookEntries has cognitive complexity 19 (threshold 15). Drivers by points: if/else 18, ternaries 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · geogebra-commands.runGeoGebraCommand (cognitive 19) · ×1
  • geogebra-commands.runGeoGebraCommand (cognitive 19) REDACTED:9 — geogebra-commands.runGeoGebraCommand has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 7 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · latex.convertFlowFenceToMermaid (cognitive 19) · ×1
  • latex.convertFlowFenceToMermaid (cognitive 19) web/lib/latex.ts:239 — latex.convertFlowFenceToMermaid has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 3, loops 2 (3 pts), ternaries 1 (3 pts), match/switch 1 (nesting depth added 7). Of this number, 18 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reading-quote-locator.segmentTextByQuotes (cognitive 19) · ×1
  • reading-quote-locator.segmentTextByQuotes (cognitive 19) web/lib/reading-quote-locator.ts:239 — reading-quote-locator.segmentTextByQuotes has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 3, loops 3 (nesting depth added 6). Of this number, 18 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · session-organization.organizeSessionTree (cognitive 19) · ×1
  • session-organization.organizeSessionTree (cognitive 19) web/lib/session-organization.ts:35 — session-organization.organizeSessionTree has cognitive complexity 19 (threshold 15). Drivers by points: if/else 3 (8 pts), loops 3 (5 pts), boolean chains 4, ternaries 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · tool_composition.compose_enabled_tools (cognitive 18) · ×1
  • tool_composition.compose_enabled_tools (cognitive 18) deeptutor/agents/_shared/tool_composition.py:177 — tool_composition.compose_enabled_tools has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 3, loops 2, ternaries 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AgentLoopHost.finish (cognitive 18) · ×1
  • AgentLoopHost.finish (cognitive 18) deeptutor/agents/loop/loop_host.py:284 — AgentLoopHost.finish has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (17 pts), boolean chains 1 (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · QuestionPipeline.__init__ (cognitive 18) · ×1
  • QuestionPipeline.__init__ (cognitive 18) deeptutor/agents/question/pipeline.py:372 — QuestionPipeline.__init__ has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 11, if/else 4, ternaries 2, error handling 1. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · auth.auth_status (cognitive 18) · ×1
  • auth.auth_status (cognitive 18) deeptutor/api/routers/auth.py:852 — auth.auth_status has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 5, boolean chains 3 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · file_preview._resolve_authorized_file (cognitive 18) · ×1
  • file_preview._resolve_authorized_file (cognitive 18) deeptutor/api/routers/file_preview.py:82 — file_preview._resolve_authorized_file has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), error handling 2 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · mastery_path._cancel_active_learning_turn (cognitive 18) · ×1
  • mastery_path._cancel_active_learning_turn (cognitive 18) deeptutor/api/routers/mastery_path.py:108 — mastery_path._cancel_active_learning_turn has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · partners._validate_channels_payload (cognitive 18) · ×1
  • partners._validate_channels_payload (cognitive 18) deeptutor/api/routers/partners.py:342 — partners._validate_channels_payload has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (9 pts), error handling 3 (4 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · question_notebook.upsert_single_entry (cognitive 18) · ×1
  • question_notebook.upsert_single_entry (cognitive 18) deeptutor/api/routers/question_notebook.py:276 — question_notebook.upsert_single_entry has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 9, if/else 4 (6 pts), loops 1 (2 pts), error handling 1 (nesting depth added 3). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · tool_options.build_tool_options (cognitive 18) · ×1
  • tool_options.build_tool_options (cognitive 18) deeptutor/api/utils/tool_options.py:27 — tool_options.build_tool_options has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 9, if/else 3 (4 pts), error handling 2 (3 pts), loops 1, ternaries 1 (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · SpineSynthesizer.synthesize (cognitive 18) · ×1
  • SpineSynthesizer.synthesize (cognitive 18) deeptutor/book/agents/spine_synthesizer.py:119 — SpineSynthesizer.synthesize has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 5, ternaries 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · context.build_book_context (cognitive 18) · ×1
  • context.build_book_context (cognitive 18) deeptutor/book/context.py:85 — context.build_book_context has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (3 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CreatorCapability.system_block (cognitive 18) · ×1
  • CreatorCapability.system_block (cognitive 18) deeptutor/capabilities/creator/capability.py:36 — CreatorCapability.system_block has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 4 (9 pts), if/else 6 (7 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · native.investigate_native (cognitive 18) · ×1
  • native.investigate_native (cognitive 18) deeptutor/capabilities/explore_context/native.py:19 — native.investigate_native has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 7, ternaries 7, if/else 2, loops 1 (2 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · LearningStore.transaction (cognitive 18) · ×1
  • LearningStore.transaction (cognitive 18) deeptutor/learning/storage.py:1154 — LearningStore.transaction has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 2 (5 pts), loops 1 (2 pts), error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · knowledge_access._list_visible_knowledge_bases (cognitive 18) · ×1
  • knowledge_access._list_visible_knowledge_bases (cognitive 18) deeptutor/multi_user/knowledge_access.py:296 — knowledge_access._list_visible_knowledge_bases has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (7 pts), ternaries 3 (6 pts), boolean chains 3, loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MochatChannel._refresh_sessions_directory (cognitive 18) · ×1
  • MochatChannel._refresh_sessions_directory (cognitive 18) deeptutor/partners/channels/mochat.py:606 — MochatChannel._refresh_sessions_directory has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 1, error handling 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MochatChannel._panel_poll_worker (cognitive 18) · ×1
  • MochatChannel._panel_poll_worker (cognitive 18) deeptutor/partners/channels/mochat.py:716 — MochatChannel._panel_poll_worker has cognitive complexity 18 (threshold 15). Drivers by points: if/else 2 (6 pts), boolean chains 4, error handling 2 (4 pts), loops 2 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CatalogArtifactDownloader.download (cognitive 18) · ×1
  • CatalogArtifactDownloader.download (cognitive 18) deeptutor/plugins/distribution.py:65 — CatalogArtifactDownloader.download has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (13 pts), error handling 3 (4 pts), loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · client._build_openai_client (cognitive 18) · ×1
  • client._build_openai_client (cognitive 18) deeptutor/runtime/agentic/client.py:136 — client._build_openai_client has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 8, if/else 6 (8 pts), ternaries 1 (2 pts) (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CliAppTool.execute (cognitive 18) · ×1
  • CliAppTool.execute (cognitive 18) deeptutor/services/cli_apps/provider.py:194 — CliAppTool.execute has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 7, if/else 6 (7 pts), ternaries 2 (4 pts) (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · capabilities_settings._apply_chat_into_agents_yaml (cognitive 18) · ×1
  • capabilities_settings._apply_chat_into_agents_yaml (cognitive 18) deeptutor/services/config/capabilities_settings.py:327 — capabilities_settings._apply_chat_into_agents_yaml has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (9 pts), ternaries 2 (5 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · context_window_detection._iter_model_records (cognitive 18) · ×1
  • context_window_detection._iter_model_records (cognitive 18) deeptutor/services/config/context_window_detection.py:84 — context_window_detection._iter_model_records has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 3 (6 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · provider_runtime._resolve_search_max_results (cognitive 18) · ×1
  • provider_runtime._resolve_search_max_results (cognitive 18) deeptutor/services/config/provider_runtime.py:1469 — provider_runtime._resolve_search_max_results has cognitive complexity 18 (threshold 15). Drivers by points: error handling 4 (7 pts), if/else 4 (5 pts), ternaries 5, boolean chains 1 (nesting depth added 4). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · doctor._credentials_check (cognitive 18) · ×1
  • doctor._credentials_check (cognitive 18) deeptutor/services/doctor.py:99 — doctor._credentials_check has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 14, if/else 4. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · JinaEmbeddingAdapter.embed (cognitive 18) · ×1
  • JinaEmbeddingAdapter.embed (cognitive 18) deeptutor/services/embedding/adapters/jina.py:66 — JinaEmbeddingAdapter.embed has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 6, ternaries 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · OllamaEmbeddingAdapter.embed (cognitive 18) · ×1
  • OllamaEmbeddingAdapter.embed (cognitive 18) deeptutor/services/embedding/adapters/ollama.py:38 — OllamaEmbeddingAdapter.embed has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (7 pts), boolean chains 5, error handling 4 (5 pts), ternaries 1 (nesting depth added 2). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · config.get_embedding_config (cognitive 18) · ×1
  • config.get_embedding_config (cognitive 18) deeptutor/services/embedding/config.py:50 — config.get_embedding_config has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 4, ternaries 2 (3 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · sync.sync_source (cognitive 18) · ×1
  • sync.sync_source (cognitive 18) deeptutor/services/github_source/sync.py:168 — sync.sync_source has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 6, error handling 5 (6 pts), if/else 5, ternaries 1 (nesting depth added 1). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _ClaudeCodeSession._owner_loop (cognitive 18) · ×1
  • _ClaudeCodeSession._owner_loop (cognitive 18) deeptutor/services/llm/provider_core/claude_code_provider.py:92 — _ClaudeCodeSession._owner_loop has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), error handling 2 (3 pts), loops 2, boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · adapters.read_kb_entities (cognitive 18) · ×1
  • adapters.read_kb_entities (cognitive 18) deeptutor/services/memory/snapshot/adapters.py:420 — adapters.read_kb_entities has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 4, error handling 1, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NotebookManager.update_record (cognitive 18) · ×1
  • NotebookManager.update_record (cognitive 18) deeptutor/services/notebook/service.py:476 — NotebookManager.update_record has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NotebookManager.export_markdown (cognitive 18) · ×1
  • NotebookManager.export_markdown (cognitive 18) deeptutor/services/notebook/service.py:661 — NotebookManager.export_markdown has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 5, ternaries 1 (2 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · worker.run_in_worker_loop (cognitive 18) · ×1
  • worker.run_in_worker_loop (cognitive 18) deeptutor/services/rag/pipelines/lightrag/worker.py:173 — worker.run_in_worker_loop has cognitive complexity 18 (threshold 15). Drivers by points: error handling 4 (10 pts), loops 2 (5 pts), if/else 1 (2 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reading_hints._sanitize (cognitive 18) · ×1
  • reading_hints._sanitize (cognitive 18) deeptutor/services/reading_hints.py:360 — reading_hints._sanitize has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11, boolean chains 4, ternaries 3. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ResearchClient.fetch (cognitive 18) · ×1
  • ResearchClient.fetch (cognitive 18) deeptutor/services/research/primitives.py:117 — ResearchClient.fetch has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _turn_runtime_shared._format_question_bank_entry (cognitive 18) · ×1
  • _turn_runtime_shared._format_question_bank_entry (cognitive 18) deeptutor/services/session/_turn_runtime_shared.py:907 — _turn_runtime_shared._format_question_bank_entry has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 9, if/else 6, loops 1 (2 pts), ternaries 1 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · source_inventory.serialize_referenced_transcript (cognitive 18) · ×1
  • source_inventory.serialize_referenced_transcript (cognitive 18) deeptutor/services/session/source_inventory.py:881 — source_inventory.serialize_referenced_transcript has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (8 pts), ternaries 4 (6 pts), boolean chains 3, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · provider_probe.model_services (cognitive 18) · ×1
  • provider_probe.model_services (cognitive 18) deeptutor/services/settings/provider_probe.py:17 — provider_probe.model_services has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 9, if/else 7, ternaries 2. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · ClawHubProvider.catalog (cognitive 18) · ×1
  • ClawHubProvider.catalog (cognitive 18) deeptutor/services/skill/hub.py:439 — ClawHubProvider.catalog has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 2 (3 pts), boolean chains 1, error handling 1, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SkillService._replace_tag_in_skills (cognitive 18) · ×1
  • SkillService._replace_tag_in_skills (cognitive 18) deeptutor/services/skill/service.py:924 — SkillService._replace_tag_in_skills has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AntigravityBackend._handle_event (cognitive 18) · ×1
  • AntigravityBackend._handle_event (cognitive 18) deeptutor/services/subagent/antigravity.py:242 — AntigravityBackend._handle_event has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 7, ternaries 2 (3 pts) (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OpenRouterTTSAdapter._collect_audio_line (cognitive 18) · ×1
  • OpenRouterTTSAdapter._collect_audio_line (cognitive 18) deeptutor/services/voice/adapters/openai_compat.py:267 — OpenRouterTTSAdapter._collect_audio_line has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 5, error handling 1, loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · openai_compat._parse_cues (cognitive 18) · ×1
  • openai_compat._parse_cues (cognitive 18) deeptutor/services/voice/adapters/openai_compat.py:447 — openai_compat._parse_cues has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 3, error handling 2 (3 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WorkspaceCatalogMixin.update_workspace (cognitive 18) · ×1
  • WorkspaceCatalogMixin.update_workspace (cognitive 18) deeptutor/services/workspace/catalog.py:361 — WorkspaceCatalogMixin.update_workspace has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 5, ternaries 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · data_migration._snapshot (cognitive 18) · ×1
  • data_migration._snapshot (cognitive 18) deeptutor/services/workspace/data_migration.py:151 — data_migration._snapshot has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 2, ternaries 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ggb_validator.validate_text_command (cognitive 18) · ×1
  • ggb_validator.validate_text_command (cognitive 18) deeptutor/tools/vision/ggb_validator.py:250 — ggb_validator.validate_text_command has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 4, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ZoteroSearchClient.search (cognitive 18) · ×1
  • ZoteroSearchClient.search (cognitive 18) deeptutor/tools/zotero_search.py:44 — ZoteroSearchClient.search has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (11 pts), error handling 4, boolean chains 3 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · document_extractor._extract_xlsx (cognitive 18) · ×1
  • document_extractor._extract_xlsx (cognitive 18) deeptutor/utils/document_extractor.py:510 — document_extractor._extract_xlsx has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (9 pts), error handling 2 (3 pts), loops 2 (3 pts), ternaries 1 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · document_extractor._epub_content_files (cognitive 18) · ×1
  • document_extractor._epub_content_files (cognitive 18) deeptutor/utils/document_extractor.py:768 — document_extractor._epub_content_files has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 3, loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · init_cmd._llm_step (cognitive 18) · ×1
  • init_cmd._llm_step (cognitive 18) deeptutor_cli/init_cmd.py:69 — init_cmd._llm_step has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 11, if/else 7. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · DiscordHistoryExporter._channel_record (cognitive 18) · ×1
  • DiscordHistoryExporter._channel_record (cognitive 18) scripts/export_discord_history.py:410 — DiscordHistoryExporter._channel_record has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 11, if/else 4, ternaries 3. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · pb_setup._sync_existing_collection (cognitive 18) · ×1
  • pb_setup._sync_existing_collection (cognitive 18) scripts/pb_setup.py:73 — pb_setup._sync_existing_collection has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (9 pts), loops 3 (7 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · model-tool.modelTool (cognitive 18) · ×1
  • model-tool.modelTool (cognitive 18) packages/chat-engine/src/tools/model-tool.ts:13 — model-tool.modelTool has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 7 (9 pts), boolean chains 5, if/else 4 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · BookGenerationActivity.BookGenerationActivity (cognitive 18) · ×1
  • BookGenerationActivity.BookGenerationActivity (cognitive 18) web/app/(workspace)/learning/books/components/BookGenerationActivity.tsx:57 — BookGenerationActivity.BookGenerationActivity has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 11, if/else 6, ternaries 1. Of this number, 12 points are the body's own statements and 6 belong to 8 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · AnswerModeMenu.PartnerLinkList (cognitive 18) · ×1
  • AnswerModeMenu.PartnerLinkList (cognitive 18) web/components/chat/home/AnswerModeMenu.tsx:306 — AnswerModeMenu.PartnerLinkList has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 15, ternaries 3. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · ContextBudgetChip.ContextBudgetChip (cognitive 18) · ×1
  • ContextBudgetChip.ContextBudgetChip (cognitive 18) web/components/chat/home/ContextBudgetChip.tsx:170 — ContextBudgetChip.ContextBudgetChip has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 9, ternaries 5 (6 pts), if/else 3 (nesting depth added 1). Of this number, 13 points are the body's own statements and 5 belong to 4 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · ContextReferenceTree.ContextReferenceTree (cognitive 18) · ×1
  • ContextReferenceTree.ContextReferenceTree (cognitive 18) web/components/chat/home/ContextReferenceTree.tsx:104 — ContextReferenceTree.ContextReferenceTree has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 10 (16 pts), boolean chains 1, if/else 1 (nesting depth added 6). Of this number, 12 points are the body's own statements and 6 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SideChatResponderMenu.SideChatResponderMenu (cognitive 18) · ×1
  • SideChatResponderMenu.SideChatResponderMenu (cognitive 18) web/components/chat/home/SideChatResponderMenu.tsx:30 — SideChatResponderMenu.SideChatResponderMenu has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 8 (11 pts), boolean chains 6, if/else 1 (nesting depth added 3). Of this number, 9 points are the body's own statements and 9 belong to 4 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LearningDashboard.LearningDashboard (cognitive 18) · ×1
  • LearningDashboard.LearningDashboard (cognitive 18) web/components/learning/LearningDashboard.tsx:33 — LearningDashboard.LearningDashboard has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 16, ternaries 2. Of this number, 14 points are the body's own statements and 4 belong to 3 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · PartnerChat.normalizeHistoryAttachments (cognitive 18) · ×1
  • PartnerChat.normalizeHistoryAttachments (cognitive 18) web/components/partners/PartnerChat.tsx:120 — PartnerChat.normalizeHistoryAttachments has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 10 (11 pts), boolean chains 4, if/else 3 (nesting depth added 1). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to one function literal inside it that branches (line 125). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · ReadingExtensionBar.QuizQuestions (cognitive 18) · ×1
  • ReadingExtensionBar.QuizQuestions (cognitive 18) web/components/reading/ReadingExtensionBar.tsx:465 — ReadingExtensionBar.QuizQuestions has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 7 (10 pts), boolean chains 5, if/else 2, error handling 1 (nesting depth added 3). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to 2 function items inside it that branch (a function literal at line 514, persistAnswer). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · AddProviderPanel.AddProviderPanel (cognitive 18) · ×1
  • AddProviderPanel.AddProviderPanel (cognitive 18) web/components/settings/AddProviderPanel.tsx:60 — AddProviderPanel.AddProviderPanel has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 11, ternaries 6, error handling 1. Most of this is not in the body itself: 8 of the 18 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 85, 146, 126, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · ConnectionsEditor.AddConnectionPanel (cognitive 18) · ×1
  • ConnectionsEditor.AddConnectionPanel (cognitive 18) web/components/settings/ConnectionsEditor.tsx:506 — ConnectionsEditor.AddConnectionPanel has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 10, ternaries 6, if/else 2. Of this number, 14 points are the body's own statements and 4 belong to 4 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · EduHubImportModal.EduHubImportModal (cognitive 18) · ×1
  • EduHubImportModal.EduHubImportModal (cognitive 18) web/components/space/EduHubImportModal.tsx:52 — EduHubImportModal.EduHubImportModal has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 5 (8 pts), if/else 6, error handling 3, boolean chains 1 (nesting depth added 3). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to 8 function literals inside it that branch (lines 86, 106, 127, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · CategoryManager.CategoryManager (cognitive 18) · ×1
  • CategoryManager.CategoryManager (cognitive 18) web/components/space/question-bank/CategoryManager.tsx:23 — CategoryManager.CategoryManager has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 3, ternaries 1 (nesting depth added 4). Most of this is not in the body itself: 2 of the 18 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 71, 160, 45, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · recurrence.detectPreset (cognitive 18) · ×1
  • recurrence.detectPreset (cognitive 18) web/features/calendar/model/recurrence.ts:157 — recurrence.detectPreset has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (9 pts), ternaries 2 (5 pts), boolean chains 4 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · UsageFooter.UsageFooter (cognitive 18) · ×1
  • UsageFooter.UsageFooter (cognitive 18) web/features/chat/messages/UsageFooter.tsx:9 — UsageFooter.UsageFooter has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 10, if/else 5, boolean chains 3. Most of this is not in the body itself: 7 of the 18 points are its own statements and the rest belongs to 9 function items inside it that branch (a function literal at line 41, a function literal at line 65, number, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · EngineDetail.LlamaIndexForm (cognitive 18) · ×1
  • EngineDetail.LlamaIndexForm (cognitive 18) web/features/knowledge/components/engines/EngineDetail.tsx:399 — EngineDetail.LlamaIndexForm has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 7 (8 pts), boolean chains 6, if/else 3, error handling 1 (nesting depth added 1). Most of this is not in the body itself: 6 of the 18 points are its own statements and the rest belongs to 7 function items inside it that branch (save, a function literal at line 514, a function literal at line 614, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · NoteResult.NoteResult (cognitive 18) · ×1
  • NoteResult.NoteResult (cognitive 18) web/features/notes/components/NoteResult.tsx:10 — NoteResult.NoteResult has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 4 (7 pts), boolean chains 6, if/else 4 (5 pts) (nesting depth added 4). Most of this is not in the body itself: 7 of the 18 points are its own statements and the rest belongs to one function literal inside it that branches (line 33). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · RuntimeHealthCard.RuntimeHealthCard (cognitive 18) · ×1
  • RuntimeHealthCard.RuntimeHealthCard (cognitive 18) web/features/runtime-status/RuntimeHealthCard.tsx:28 — RuntimeHealthCard.RuntimeHealthCard has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 8 (13 pts), boolean chains 3, if/else 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · useKnowledgeProgress.useKnowledgeProgress.subscribeWs (cognitive 18) · ×1
  • useKnowledgeProgress.useKnowledgeProgress.subscribeWs (cognitive 18) web/hooks/useKnowledgeProgress.ts:149 — useKnowledgeProgress.useKnowledgeProgress.subscribeWs has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 13, if/else 4, ternaries 1. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · useSmoothStreamText.useSmoothStreamText (cognitive 18) · ×1
  • useSmoothStreamText.useSmoothStreamText (cognitive 18) web/hooks/useSmoothStreamText.ts:107 — useSmoothStreamText.useSmoothStreamText has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 3 (nesting depth added 3). None of this is in the body itself: all 18 points belong to 3 function literals inside it that branch (lines 128, 165, 195). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · useWorkspaceChatActions.useWorkspaceChatActions (cognitive 18) · ×1
  • useWorkspaceChatActions.useWorkspaceChatActions (cognitive 18) web/hooks/useWorkspaceChatActions.ts:20 — useWorkspaceChatActions.useWorkspaceChatActions has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8, boolean chains 6, ternaries 3 (4 pts) (nesting depth added 1). Most of this is not in the body itself: 6 of the 18 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 60, 95, 51, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · latex-normalize.escapeStrayDollars (cognitive 18) · ×1
  • latex-normalize.escapeStrayDollars (cognitive 18) REDACTED:512 — latex-normalize.escapeStrayDollars has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 2, ternaries 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · latex.convertSequenceFenceToMermaid (cognitive 18) · ×1
  • latex.convertSequenceFenceToMermaid (cognitive 18) web/lib/latex.ts:309 — latex.convertSequenceFenceToMermaid has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (5 pts), ternaries 2 (5 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 6). Most of this is not in the body itself: 8 of the 18 points are its own statements and the rest belongs to 2 function items inside it that branch (a function literal at line 349, isSequenceDirective). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · learning-dashboard.allLearningActivity (cognitive 18) · ×1
  • learning-dashboard.allLearningActivity (cognitive 18) web/lib/learning-dashboard.ts:40 — learning-dashboard.allLearningActivity has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 17, ternaries 1. None of this is in the body itself: all 18 points belong to 6 function literals inside it that branch (lines 64, 42, 53, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · settings-extensions.applyExtensionPayload (cognitive 18) · ×1
  • settings-extensions.applyExtensionPayload (cognitive 18) web/lib/settings-extensions.ts:40 — settings-extensions.applyExtensionPayload has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (10 pts), ternaries 4 (6 pts), loops 1 (2 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · visualize-types.extractVisualizeResult (cognitive 18) · ×1
  • visualize-types.extractVisualizeResult (cognitive 18) web/lib/visualize-types.ts:143 — visualize-types.extractVisualizeResult has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 9 (11 pts), if/else 5 (6 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · native_seed.native_seed (cognitive 17) · ×1
  • native_seed.native_seed (cognitive 17) deeptutor/agents/loop/native_seed.py:55 — native_seed.native_seed has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 3 (5 pts), boolean chains 2, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AgenticLoopPipeline.run (cognitive 17) · ×1
  • AgenticLoopPipeline.run (cognitive 17) deeptutor/agents/loop/pipeline.py:397 — AgenticLoopPipeline.run has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 9, if/else 4, ternaries 3 (4 pts) (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · pipeline._format_user_reply_body (cognitive 17) · ×1
  • pipeline._format_user_reply_body (cognitive 17) deeptutor/agents/loop/pipeline.py:144 — pipeline._format_user_reply_body has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 9, if/else 2 (4 pts), loops 2 (4 pts) (nesting depth added 4). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · DeepQuestionCapability._run_mimic_mode (cognitive 17) · ×1
  • DeepQuestionCapability._run_mimic_mode (cognitive 17) deeptutor/agents/question/capability.py:176 — DeepQuestionCapability._run_mimic_mode has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 8, if/else 5, error handling 2 (4 pts) (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · history.load_session_quiz_history (cognitive 17) · ×1
  • history.load_session_quiz_history (cognitive 17) deeptutor/agents/question/history.py:34 — history.load_session_quiz_history has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 7, error handling 1, loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ResearchPipeline._write_report (cognitive 17) · ×1
  • ResearchPipeline._write_report (cognitive 17) deeptutor/agents/research/pipeline.py:1286 — ResearchPipeline._write_report has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (12 pts), error handling 3 (4 pts), loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · auth.complete_session_handoff (cognitive 17) · ×1
  • auth.complete_session_handoff (cognitive 17) deeptutor/api/routers/auth.py:1115 — auth.complete_session_handoff has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 7, if/else 6 (7 pts), error handling 3 (nesting depth added 1). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · knowledge._model_options_payload (cognitive 17) · ×1
  • knowledge._model_options_payload (cognitive 17) deeptutor/api/routers/knowledge.py:1850 — knowledge._model_options_payload has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 7, loops 3 (6 pts), if/else 1 (4 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · knowledge.connect_lightrag_server_route (cognitive 17) · ×1
  • knowledge.connect_lightrag_server_route (cognitive 17) deeptutor/api/routers/knowledge.py:2382 — knowledge.connect_lightrag_server_route has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 8, if/else 5 (6 pts), error handling 3 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · mastery_path.mastery_topic_websocket (cognitive 17) · ×1
  • mastery_path.mastery_topic_websocket (cognitive 17) deeptutor/api/routers/mastery_path.py:1027 — mastery_path.mastery_topic_websocket has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (7 pts), error handling 2 (4 pts), boolean chains 3, ternaries 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · partners.partner_navigation (cognitive 17) · ×1
  • partners.partner_navigation (cognitive 17) deeptutor/api/routers/partners.py:675 — partners.partner_navigation has cognitive complexity 17 (threshold 15). Drivers by points: loops 3 (6 pts), if/else 1 (4 pts), error handling 1 (3 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · space_mcp._extract_credentials (cognitive 17) · ×1
  • space_mcp._extract_credentials (cognitive 17) deeptutor/api/routers/space_mcp.py:402 — space_mcp._extract_credentials has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 2 (3 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · context._format_section (cognitive 17) · ×1
  • context._format_section (cognitive 17) deeptutor/book/context.py:242 — context._format_section has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MasteryLoopPipeline.prepare_model_request (cognitive 17) · ×1
  • MasteryLoopPipeline.prepare_model_request (cognitive 17) deeptutor/capabilities/mastery/pipeline.py:79 — MasteryLoopPipeline.prepare_model_request has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 5, error handling 1, ternaries 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · generation.result_learning_block (cognitive 17) · ×1
  • generation.result_learning_block (cognitive 17) deeptutor/capabilities/notes/generation.py:23 — generation.result_learning_block has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 9, if/else 5 (6 pts), ternaries 2 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · DocumentAdder.add_documents (cognitive 17) · ×1
  • DocumentAdder.add_documents (cognitive 17) deeptutor/knowledge/add_documents.py:266 — DocumentAdder.add_documents has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 3, loops 1, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · lesson_evidence.validate_evidence (cognitive 17) · ×1
  • lesson_evidence.validate_evidence (cognitive 17) deeptutor/learning/lesson_evidence.py:351 — lesson_evidence.validate_evidence has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 5, error handling 1, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · objective_relations.validate_objective_relations (cognitive 17) · ×1
  • objective_relations.validate_objective_relations (cognitive 17) deeptutor/learning/objective_relations.py:72 — objective_relations.validate_objective_relations has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 4 (5 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LearningService.record_quiz_attempt (cognitive 17) · ×1
  • LearningService.record_quiz_attempt (cognitive 17) deeptutor/learning/service.py:468 — LearningService.record_quiz_attempt has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · teaching.apply_teaching_updates (cognitive 17) · ×1
  • teaching.apply_teaching_updates (cognitive 17) deeptutor/learning/teaching.py:68 — teaching.apply_teaching_updates has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 3, ternaries 1 (2 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · book_access.accessible_books (cognitive 17) · ×1
  • book_access.accessible_books (cognitive 17) deeptutor/multi_user/book_access.py:119 — book_access.accessible_books has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · grants.validate_grant (cognitive 17) · ×1
  • grants.validate_grant (cognitive 17) deeptutor/multi_user/grants.py:316 — grants.validate_grant has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13, boolean chains 4. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · learner_profile.normalize_profile (cognitive 17) · ×1
  • learner_profile.normalize_profile (cognitive 17) deeptutor/multi_user/learner_profile.py:13 — learner_profile.normalize_profile has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · manager.coalesce_stream_deltas (cognitive 17) · ×1
  • manager.coalesce_stream_deltas (cognitive 17) deeptutor/partners/channels/manager.py:48 — manager.coalesce_stream_deltas has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 4, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MatrixChannel.send (cognitive 17) · ×1
  • MatrixChannel.send (cognitive 17) deeptutor/partners/channels/matrix.py:460 — MatrixChannel.send has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 3, loops 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ingestion.normalize_transcript_segments (cognitive 17) · ×1
  • ingestion.normalize_transcript_segments (cognitive 17) deeptutor/reading/ingestion.py:736 — ingestion.normalize_transcript_segments has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 5, error handling 1 (2 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Annotation.from_dict (cognitive 17) · ×1
  • Annotation.from_dict (cognitive 17) deeptutor/reading/models.py:415 — Annotation.from_dict has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 13, ternaries 3, if/else 1. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · labels.classify_label (cognitive 17) · ×1
  • labels.classify_label (cognitive 17) deeptutor/runtime/agentic/labels.py:45 — labels.classify_label has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (13 pts), boolean chains 3, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · EngineClient.run (cognitive 17) · ×1
  • EngineClient.run (cognitive 17) deeptutor/runtime/ts_engine/client.py:123 — EngineClient.run has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), error handling 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · update_worker.run_update_worker (cognitive 17) · ×1
  • update_worker.run_update_worker (cognitive 17) deeptutor/runtime/update_worker.py:123 — update_worker.run_update_worker has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 6, if/else 4 (6 pts), error handling 3 (5 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · auth.decode_token (cognitive 17) · ×1
  • auth.decode_token (cognitive 17) deeptutor/services/auth.py:286 — auth.decode_token has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 6, error handling 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · service.validate_schedule (cognitive 17) · ×1
  • service.validate_schedule (cognitive 17) deeptutor/services/cron/service.py:154 — service.validate_schedule has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), error handling 1 (3 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DashScopeMultiModalEmbeddingAdapter._parse_response (cognitive 17) · ×1
  • DashScopeMultiModalEmbeddingAdapter._parse_response (cognitive 17) deeptutor/services/embedding/adapters/dashscope_native.py:181 — DashScopeMultiModalEmbeddingAdapter._parse_response has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 3, loops 1, ternaries 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · sync._incremental_sync (cognitive 17) · ×1
  • sync._incremental_sync (cognitive 17) deeptutor/services/github_source/sync.py:308 — sync._incremental_sync has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (8 pts), error handling 1 (3 pts), loops 3, ternaries 1 (2 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · claude_sdk.parse_models (cognitive 17) · ×1
  • claude_sdk.parse_models (cognitive 17) deeptutor/services/llm/claude_sdk.py:11 — claude_sdk.parse_models has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 6, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · image_replay.deduplicate_user_images (cognitive 17) · ×1
  • image_replay.deduplicate_user_images (cognitive 17) deeptutor/services/llm/image_replay.py:52 — image_replay.deduplicate_user_images has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OpenAICompatProvider._build_kwargs (cognitive 17) · ×1
  • OpenAICompatProvider._build_kwargs (cognitive 17) deeptutor/services/llm/provider_core/openai_compat_provider.py:485 — OpenAICompatProvider._build_kwargs has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 5, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · converters.convert_user_message (cognitive 17) · ×1
  • converters.convert_user_message (cognitive 17) deeptutor/services/llm/provider_core/openai_responses/converters.py:82 — converters.convert_user_message has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _runtime._strip_thinking_delta (cognitive 17) · ×1
  • _runtime._strip_thinking_delta (cognitive 17) deeptutor/services/memory/consolidator/modes/_runtime.py:269 — _runtime._strip_thinking_delta has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 4, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · update._run_update_l2 (cognitive 17) · ×1
  • update._run_update_l2 (cognitive 17) deeptutor/services/memory/consolidator/modes/update.py:140 — update._run_update_l2 has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 2 (3 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · engine._build_impl (cognitive 17) · ×1
  • engine._build_impl (cognitive 17) deeptutor/services/rag/pipelines/graphrag/engine.py:342 — engine._build_impl has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), ternaries 1 (4 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · models.parse_knowledge_page (cognitive 17) · ×1
  • models.parse_knowledge_page (cognitive 17) deeptutor/services/rag/pipelines/ima/models.py:127 — models.parse_knowledge_page has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 4, loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · indexing_policy.snapshot_from_persisted (cognitive 17) · ×1
  • indexing_policy.snapshot_from_persisted (cognitive 17) deeptutor/services/rag/pipelines/lightrag/indexing_policy.py:366 — indexing_policy.snapshot_from_persisted has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (7 pts), ternaries 3 (6 pts), boolean chains 4 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · storage.create_resumable_index (cognitive 17) · ×1
  • storage.create_resumable_index (cognitive 17) deeptutor/services/rag/pipelines/llamaindex/storage.py:335 — storage.create_resumable_index has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 2 (3 pts), ternaries 2, boolean chains 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · BochaProvider.search (cognitive 17) · ×1
  • BochaProvider.search (cognitive 17) deeptutor/services/search/providers/bocha.py:33 — BochaProvider.search has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 12, if/else 4, loops 1. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · ContextBuilder._select_recent_messages (cognitive 17) · ×1
  • ContextBuilder._select_recent_messages (cognitive 17) deeptutor/services/session/context_builder.py:350 — ContextBuilder._select_recent_messages has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (7 pts), loops 3 (5 pts), ternaries 1 (3 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SQLiteSessionStore._initialize (cognitive 17) · ×1
  • SQLiteSessionStore._initialize (cognitive 17) deeptutor/services/session/sqlite_store.py:284 — SQLiteSessionStore._initialize has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 2 (5 pts), error handling 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SkillService._copy_support_tree (cognitive 17) · ×1
  • SkillService._copy_support_tree (cognitive 17) deeptutor/services/skill/service.py:776 — SkillService._copy_support_tree has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OpenAICompatSTTAdapter._parse_text (cognitive 17) · ×1
  • OpenAICompatSTTAdapter._parse_text (cognitive 17) deeptutor/services/voice/adapters/openai_compat.py:428 — OpenAICompatSTTAdapter._parse_text has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (13 pts), boolean chains 4 (nesting depth added 8). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · WebSourceSyncScheduler._run_job (cognitive 17) · ×1
  • WebSourceSyncScheduler._run_job (cognitive 17) deeptutor/services/web_source/scheduler.py:189 — WebSourceSyncScheduler._run_job has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 4, error handling 2, ternaries 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · render_storage._inventory (cognitive 17) · ×1
  • render_storage._inventory (cognitive 17) deeptutor/services/workspace/render_storage.py:113 — render_storage._inventory has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (5 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · chapter_rebuild.rebuild (cognitive 17) · ×1
  • chapter_rebuild.rebuild (cognitive 17) deeptutor/textbook_struct/chapter_rebuild.py:82 — chapter_rebuild.rebuild has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ReadSkillTool.execute (cognitive 17) · ×1
  • ReadSkillTool.execute (cognitive 17) deeptutor/tools/builtin/__init__.py:1976 — ReadSkillTool.execute has cognitive complexity 17 (threshold 15). Drivers by points: error handling 3 (6 pts), boolean chains 4, if/else 2 (4 pts), ternaries 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ExecTool._command_for_platform (cognitive 17) · ×1
  • ExecTool._command_for_platform (cognitive 17) deeptutor/tools/exec_tool.py:107 — ExecTool._command_for_platform has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 8 (11 pts), if/else 4 (5 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TexChunker.split_tex_into_chunks (cognitive 17) · ×1
  • TexChunker.split_tex_into_chunks (cognitive 17) deeptutor/tools/tex_chunker.py:90 — TexChunker.split_tex_into_chunks has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · write_note.write_note (cognitive 17) · ×1
  • write_note.write_note (cognitive 17) deeptutor/tools/write_note.py:61 — write_note.write_note has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 8 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · error_utils._find_json_block (cognitive 17) · ×1
  • error_utils._find_json_block (cognitive 17) deeptutor/utils/error_utils.py:10 — error_utils._find_json_block has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · service.normalize_cues (cognitive 17) · ×1
  • service.normalize_cues (cognitive 17) deeptutor/video_learning/service.py:197 — service.normalize_cues has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 4, error handling 1 (2 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · service.parse_webvtt (cognitive 17) · ×1
  • service.parse_webvtt (cognitive 17) deeptutor/video_learning/service.py:256 — service.parse_webvtt has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · provider_cmd._login_codebuddy (cognitive 17) · ×1
  • provider_cmd._login_codebuddy (cognitive 17) deeptutor_cli/provider_cmd.py:119 — provider_cmd._login_codebuddy has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (8 pts), error handling 4 (7 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · check_architecture.collect_import_edges (cognitive 17) · ×1
  • check_architecture.collect_import_edges (cognitive 17) scripts/check_architecture.py:56 — check_architecture.collect_import_edges has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · check_architecture.architecture_violations (cognitive 17) · ×1
  • check_architecture.architecture_violations (cognitive 17) scripts/check_architecture.py:136 — check_architecture.architecture_violations has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 4, loops 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiscordHistoryExporter._list_joined_private_archived_threads (cognitive 17) · ×1
  • DiscordHistoryExporter._list_joined_private_archived_threads (cognitive 17) scripts/export_discord_history.py:344 — DiscordHistoryExporter._list_joined_private_archived_threads has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (9 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ToolDispatcher.run · ×1
  • ToolDispatcher.run::execute (cognitive 17) packages/chat-engine/src/tools/dispatcher.ts:106 — ToolDispatcher.run::execute has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 3, loops 1 (2 pts), error handling 1 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This shape REPEATS in the file: one other method here (ToolDispatcher.run) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · page.LearningProgressPage (cognitive 17) · ×1
  • page.LearningProgressPage (cognitive 17) web/app/(utility)/settings/progress/page.tsx:17 — page.LearningProgressPage has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 5 (14 pts), boolean chains 3 (nesting depth added 9). Of this number, 15 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · page.PartnerGroupPage (cognitive 17) · ×1
  • page.PartnerGroupPage (cognitive 17) web/app/(workspace)/partners/groups/[groupId]/page.tsx:38 — page.PartnerGroupPage has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7, boolean chains 5, ternaries 4, error handling 1. Of this number, 10 points are the body's own statements and 7 belong to 5 function literals inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · useTextSource.useTextSource (cognitive 17) · ×1
  • useTextSource.useTextSource (cognitive 17) web/components/chat/preview/previewers/useTextSource.ts:21 — useTextSource.useTextSource has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (11 pts), ternaries 2 (3 pts), boolean chains 2, error handling 1 (nesting depth added 4). None of this is in the body itself: all 17 points belong to 3 function literals inside it that branch (lines 50, 32, 25). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · KnowledgeHome.KnowledgeHome (cognitive 17) · ×1
  • KnowledgeHome.KnowledgeHome (cognitive 17) web/components/knowledge/KnowledgeHome.tsx:97 — KnowledgeHome.KnowledgeHome has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 8, ternaries 4 (7 pts), if/else 1, loops 1 (nesting depth added 3). Most of this is not in the body itself: 7 of the 17 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 361, renderProvider, a function literal at line 271, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · NotebookFavoriteContent.NotebookFavoriteContent (cognitive 17) · ×1
  • NotebookFavoriteContent.NotebookFavoriteContent (cognitive 17) web/components/notebook/NotebookFavoriteContent.tsx:26 — NotebookFavoriteContent.NotebookFavoriteContent has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 7 (9 pts), boolean chains 8 (nesting depth added 2). Of this number, 13 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · SaveToNotebookModal.SaveToNotebookModal (cognitive 17) · ×1
  • SaveToNotebookModal.SaveToNotebookModal (cognitive 17) web/components/notebook/SaveToNotebookModal.tsx:149 — SaveToNotebookModal.SaveToNotebookModal has cognitive complexity 17 (threshold 15). Drivers by points: if/else 28 (43 pts), boolean chains 35, ternaries 9 (19 pts), error handling 3, loops 2 (3 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (SaveToNotebookModal.SaveToNotebookModal::handleSave) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · mentions.resolveMentions (cognitive 17) · ×1
  • mentions.resolveMentions (cognitive 17) web/components/partners/group/mentions.ts:47 — mentions.resolveMentions has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 1, loops 1, ternaries 1 (nesting depth added 8). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FollowupChatComposer.FollowupChatComposerImpl (cognitive 17) · ×1
  • FollowupChatComposer.FollowupChatComposerImpl (cognitive 17) web/components/quiz/FollowupChatComposer.tsx:72 — FollowupChatComposer.FollowupChatComposerImpl has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), ternaries 5, boolean chains 3 (nesting depth added 3). Most of this is not in the body itself: 3 of the 17 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 91, 194, 108). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · DimensionField.DimensionField (cognitive 17) · ×1
  • DimensionField.DimensionField (cognitive 17) web/components/settings/DimensionField.tsx:35 — DimensionField.DimensionField has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 10, ternaries 5 (6 pts), if/else 1 (nesting depth added 1). Of this number, 16 points are the body's own statements and 1 belongs to 3 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · ModelCards.CardShell (cognitive 17) · ×1
  • ModelCards.CardShell (cognitive 17) web/components/settings/ModelCards.tsx:99 — ModelCards.CardShell has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 8 (11 pts), if/else 2 (4 pts), boolean chains 2 (nesting depth added 5). Of this number, 12 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SessionCamp.SessionCamp (cognitive 17) · ×1
  • SessionCamp.SessionCamp (cognitive 17) web/components/space/learning/SessionCamp.tsx:13 — SessionCamp.SessionCamp has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 6 (13 pts), boolean chains 4 (nesting depth added 7). Most of this is not in the body itself: 4 of the 17 points are its own statements and the rest belongs to 2 function items inside it that branch (a function literal at line 95, openStudy). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · blocks.inlineText (cognitive 17) · ×1
  • blocks.inlineText (cognitive 17) web/features/notes/model/blocks.ts:3 — blocks.inlineText has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 6, loops 1, ternaries 1 (nesting depth added 1). Most of this is not in the body itself: 2 of the 17 points are its own statements and the rest belongs to one function literal inside it that branches (line 7). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · AddToNote.AddToNote (cognitive 17) · ×1
  • AddToNote.AddToNote (cognitive 17) web/features/notes/components/AddToNote.tsx:16 — AddToNote.AddToNote has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 8, ternaries 3 (6 pts), if/else 2, error handling 1 (nesting depth added 3). Of this number, 9 points are the body's own statements and 8 belong to 2 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · NotePageTree.NotePageTree (cognitive 17) · ×1
  • NotePageTree.NotePageTree (cognitive 17) web/features/notes/components/NotePageTree.tsx:10 — NotePageTree.NotePageTree has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 7 (9 pts), boolean chains 4, if/else 3 (4 pts) (nesting depth added 3). Most of this is not in the body itself: 1 of the 17 points is its own statement and the rest belongs to 4 function items inside it that branch (a function literal at line 35, rows, a function literal at line 51, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · NoteSourcePicker.NoteSourcePicker (cognitive 17) · ×1
  • NoteSourcePicker.NoteSourcePicker (cognitive 17) web/features/notes/components/NoteSourcePicker.tsx:13 — NoteSourcePicker.NoteSourcePicker has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 5 (8 pts), boolean chains 5, if/else 3, error handling 1 (nesting depth added 3). Most of this is not in the body itself: 2 of the 17 points are its own statements and the rest belongs to 5 function items inside it that branch (select, a function literal at line 92, a function literal at line 24, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · favorite-content.favoriteTranscript (cognitive 17) · ×1
  • favorite-content.favoriteTranscript (cognitive 17) web/lib/favorite-content.ts:54 — favorite-content.favoriteTranscript has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 3, loops 1, ternaries 1 (nesting depth added 6). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · markdown-display.pairedEmphasisDelimiters (cognitive 17) · ×1
  • markdown-display.pairedEmphasisDelimiters (cognitive 17) REDACTED:671 — markdown-display.pairedEmphasisDelimiters has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · mastery-question.collectMasteryGrades (cognitive 17) · ×1
  • mastery-question.collectMasteryGrades (cognitive 17) web/lib/mastery-question.ts:228 — mastery-question.collectMasteryGrades has cognitive complexity 17 (threshold 15). Drivers by points: loops 4 (11 pts), if/else 2 (6 pts) (nesting depth added 11). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · setup-signals.collectAppliedSettingIds (cognitive 17) · ×1
  • setup-signals.collectAppliedSettingIds (cognitive 17) web/lib/setup-signals.ts:66 — setup-signals.collectAppliedSettingIds has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · video-learning-marks.cueIndexesFromSelection (cognitive 17) · ×1
  • video-learning-marks.cueIndexesFromSelection (cognitive 17) web/lib/video-learning-marks.ts:78 — video-learning-marks.cueIndexesFromSelection has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (9 pts), boolean chains 3, loops 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AgentLoop._create_response_stream (cognitive 16) · ×1
  • AgentLoop._create_response_stream (cognitive 16) deeptutor/agents/loop/agent_loop.py:1335 — AgentLoop._create_response_stream has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 6, error handling 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ResearchPipeline._repair_report_section_coverage (cognitive 16) · ×1
  • ResearchPipeline._repair_report_section_coverage (cognitive 16) deeptutor/agents/research/pipeline.py:1678 — ResearchPipeline._repair_report_section_coverage has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 2, boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CitationManager._restore_counters_from_citations (cognitive 16) · ×1
  • CitationManager._restore_counters_from_citations (cognitive 16) deeptutor/agents/research/utils/citation_manager.py:179 — CitationManager._restore_counters_from_citations has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (9 pts), error handling 2 (6 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · co_writer.note_threads (cognitive 16) · ×1
  • co_writer.note_threads (cognitive 16) deeptutor/api/routers/co_writer.py:1157 — co_writer.note_threads has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 5 (7 pts), loops 1 (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · knowledge.run_reindex_task (cognitive 16) · ×1
  • knowledge.run_reindex_task (cognitive 16) deeptutor/api/routers/knowledge.py:3806 — knowledge.run_reindex_task has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (9 pts), error handling 2 (3 pts), boolean chains 2, ternaries 2 (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · reading.duplicate_check (cognitive 16) · ×1
  • reading.duplicate_check (cognitive 16) deeptutor/api/routers/reading.py:486 — reading.duplicate_check has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (6 pts), boolean chains 3, error handling 2 (3 pts), loops 2, ternaries 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DeepDiveGenerator._generate (cognitive 16) · ×1
  • DeepDiveGenerator._generate (cognitive 16) deeptutor/book/blocks/deep_dive.py:24 — DeepDiveGenerator._generate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), boolean chains 3, ternaries 3, loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BookCompiler.compile_page (cognitive 16) · ×1
  • BookCompiler.compile_page (cognitive 16) deeptutor/book/compiler.py:152 — BookCompiler.compile_page has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 2 (4 pts), error handling 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · context._serialize_page (cognitive 16) · ×1
  • context._serialize_page (cognitive 16) deeptutor/book/context.py:145 — context._serialize_page has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 4, ternaries 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · context._format_quiz (cognitive 16) · ×1
  • context._format_quiz (cognitive 16) deeptutor/book/context.py:265 — context._format_quiz has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BookEngine._compile_page_now (cognitive 16) · ×1
  • BookEngine._compile_page_now (cognitive 16) deeptutor/book/engine.py:1280 — BookEngine._compile_page_now has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 5, error handling 2 (3 pts) (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · export._render_section (cognitive 16) · ×1
  • export._render_section (cognitive 16) deeptutor/book/export.py:119 — export._render_section has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · kb_health.scan_log_health (cognitive 16) · ×1
  • kb_health.scan_log_health (cognitive 16) deeptutor/book/kb_health.py:451 — kb_health.scan_log_health has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 4, error handling 1, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · tools._plan_module_revision (cognitive 16) · ×1
  • tools._plan_module_revision (cognitive 16) deeptutor/capabilities/mastery/tools.py:3381 — tools._plan_module_revision has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (7 pts), loops 4 (5 pts), boolean chains 3, ternaries 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NoteReadTool.execute (cognitive 16) · ×1
  • NoteReadTool.execute (cognitive 16) deeptutor/capabilities/notes/tools.py:24 — NoteReadTool.execute has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 1 (2 pts), boolean chains 1, error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · assessment.record_assessment (cognitive 16) · ×1
  • assessment.record_assessment (cognitive 16) REDACTED:427 — assessment.record_assessment has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (7 pts), boolean chains 6, error handling 2 (3 pts) (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · navigation.resolve_module (cognitive 16) · ×1
  • navigation.resolve_module (cognitive 16) deeptutor/learning/navigation.py:217 — navigation.resolve_module has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 5, loops 3 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LearningService._resolve_final_relations (cognitive 16) · ×1
  • LearningService._resolve_final_relations (cognitive 16) deeptutor/learning/service.py:348 — LearningService._resolve_final_relations has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LearningService.record_qualitative_in_memory (cognitive 16) · ×1
  • LearningService.record_qualitative_in_memory (cognitive 16) deeptutor/learning/service.py:2898 — LearningService.record_qualitative_in_memory has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 8, if/else 4 (5 pts), boolean chains 3 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · LearningService.assess_qualitative_semantic (cognitive 16) · ×1
  • LearningService.assess_qualitative_semantic (cognitive 16) deeptutor/learning/service.py:3045 — LearningService.assess_qualitative_semantic has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 4, ternaries 1 (3 pts), error handling 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LearningStore.import_legacy_json (cognitive 16) · ×1
  • LearningStore.import_legacy_json (cognitive 16) deeptutor/learning/storage.py:864 — LearningStore.import_legacy_json has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), error handling 5, boolean chains 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · LearningStore.detach_session (cognitive 16) · ×1
  • LearningStore.detach_session (cognitive 16) deeptutor/learning/storage.py:1958 — LearningStore.detach_session has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 2 (3 pts), error handling 2, boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · identity.load_users (cognitive 16) · ×1
  • identity.load_users (cognitive 16) deeptutor/multi_user/identity.py:178 — identity.load_users has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 4, ternaries 1 (2 pts), loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DingTalkChannel._send_media_ref (cognitive 16) · ×1
  • DingTalkChannel._send_media_ref (cognitive 16) deeptutor/partners/channels/dingtalk.py:437 — DingTalkChannel._send_media_ref has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 5 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · DiscordChannel.send (cognitive 16) · ×1
  • DiscordChannel.send (cognitive 16) deeptutor/partners/channels/discord.py:122 — DiscordChannel.send has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 4, loops 2 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · DiscordChannel._should_respond_in_group (cognitive 16) · ×1
  • DiscordChannel._should_respond_in_group (cognitive 16) deeptutor/partners/channels/discord.py:471 — DiscordChannel._should_respond_in_group has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 1 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MochatChannel._handle_watch_payload (cognitive 16) · ×1
  • MochatChannel._handle_watch_payload (cognitive 16) deeptutor/partners/channels/mochat.py:751 — MochatChannel._handle_watch_payload has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 3, loops 1, ternaries 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MochatChannel._process_inbound_event (cognitive 16) · ×1
  • MochatChannel._process_inbound_event (cognitive 16) deeptutor/partners/channels/mochat.py:785 — MochatChannel._process_inbound_event has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 7 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · WeixinChannel.start (cognitive 16) · ×1
  • WeixinChannel.start (cognitive 16) deeptutor/partners/channels/weixin.py:343 — WeixinChannel.start has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), error handling 2 (4 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WeixinChannel._send_media_file (cognitive 16) · ×1
  • WeixinChannel._send_media_file (cognitive 16) deeptutor/partners/channels/weixin.py:1180 — WeixinChannel._send_media_file has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, boolean chains 6. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · ZulipChannel._on_message (cognitive 16) · ×1
  • ZulipChannel._on_message (cognitive 16) deeptutor/partners/channels/zulip.py:417 — ZulipChannel._on_message has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (13 pts), ternaries 2, boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · catalog.resolve_catalog_entry (cognitive 16) · ×1
  • catalog.resolve_catalog_entry (cognitive 16) deeptutor/plugins/catalog.py:177 — catalog.resolve_catalog_entry has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 4 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CapabilityRegistry.get (cognitive 16) · ×1
  • CapabilityRegistry.get (cognitive 16) deeptutor/runtime/registry/capability_registry.py:147 — CapabilityRegistry.get has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 3, loops 1 (2 pts), ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · catalog._parse (cognitive 16) · ×1
  • catalog._parse (cognitive 16) deeptutor/services/cli_apps/catalog.py:154 — catalog._parse has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 13, error handling 1, if/else 1, ternaries 1. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · catalog.parse_models_response (cognitive 16) · ×1
  • catalog.parse_models_response (cognitive 16) deeptutor/services/codex_auth/catalog.py:33 — catalog.parse_models_response has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 3, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CodexOAuthService._reasoning_effort_models (cognitive 16) · ×1
  • CodexOAuthService._reasoning_effort_models (cognitive 16) REDACTED:1038 — CodexOAuthService._reasoning_effort_models has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), ternaries 2 (4 pts), boolean chains 3, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · context_window_detection._recursive_context_window (cognitive 16) · ×1
  • context_window_detection._recursive_context_window (cognitive 16) deeptutor/services/config/context_window_detection.py:65 — context_window_detection._recursive_context_window has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (6 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · provider_runtime.resolve_stt_runtime_config (cognitive 16) · ×1
  • provider_runtime.resolve_stt_runtime_config (cognitive 16) deeptutor/services/config/provider_runtime.py:1352 — provider_runtime.resolve_stt_runtime_config has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 14, if/else 2. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This shape REPEATS in the file: one other method here (provider_runtime.resolve_imagegen_runtime_config) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · provider_runtime.resolve_imagegen_runtime_config (cognitive 16) · ×1
  • provider_runtime.resolve_imagegen_runtime_config (cognitive 16) deeptutor/services/config/provider_runtime.py:1388 — provider_runtime.resolve_imagegen_runtime_config has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 14, if/else 2. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This shape REPEATS in the file: one other method here (provider_runtime.resolve_stt_runtime_config) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · service.compute_next_run (cognitive 16) · ×1
  • service.compute_next_run (cognitive 16) deeptutor/services/cron/service.py:119 — service.compute_next_run has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (7 pts), error handling 2 (4 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OpenAISDKEmbeddingAdapter.embed (cognitive 16) · ×1
  • OpenAISDKEmbeddingAdapter.embed (cognitive 16) deeptutor/services/embedding/adapters/openai_sdk.py:60 — OpenAISDKEmbeddingAdapter.embed has cognitive complexity 16 (threshold 15). Drivers by points: error handling 5 (6 pts), boolean chains 5, if/else 5 (nesting depth added 1). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · OpenAICompatProvider._responses_body_without_input_message_status (cognitive 16) · ×1
  • OpenAICompatProvider._responses_body_without_input_message_status (cognitive 16) deeptutor/services/llm/provider_core/openai_compat_provider.py:648 — OpenAICompatProvider._responses_body_without_input_message_status has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 2, loops 1, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · reasoning_params.minimax_reasoning_kwargs (cognitive 16) · ×1
  • reasoning_params.minimax_reasoning_kwargs (cognitive 16) deeptutor/services/llm/reasoning_params.py:71 — reasoning_params.minimax_reasoning_kwargs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), ternaries 4 (7 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · references.validate_fact_refs (cognitive 16) · ×1
  • references.validate_fact_refs (cognitive 16) deeptutor/services/memory/consolidator/references.py:125 — references.validate_fact_refs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 3, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · adapters._partner_session_entity (cognitive 16) · ×1
  • adapters._partner_session_entity (cognitive 16) deeptutor/services/memory/snapshot/adapters.py:292 — adapters._partner_session_entity has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (7 pts), boolean chains 3, error handling 2 (3 pts), loops 2, ternaries 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · cache.find_content_dir (cognitive 16) · ×1
  • cache.find_content_dir (cognitive 16) deeptutor/services/parsing/cache.py:104 — cache.find_content_dir has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 4, ternaries 3, boolean chains 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PathService.migrate_legacy_memory_markdown (cognitive 16) · ×1
  • PathService.migrate_legacy_memory_markdown (cognitive 16) deeptutor/services/path_service.py:323 — PathService.migrate_legacy_memory_markdown has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · pipeline._context_to_sources (cognitive 16) · ×1
  • pipeline._context_to_sources (cognitive 16) deeptutor/services/rag/pipelines/graphrag/pipeline.py:254 — pipeline._context_to_sources has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · KiwixClient.search (cognitive 16) · ×1
  • KiwixClient.search (cognitive 16) deeptutor/services/rag/pipelines/kiwix/client.py:303 — KiwixClient.search has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 2 (6 pts), if/else 2 (4 pts), error handling 1 (3 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · client.parse_search_xml (cognitive 16) · ×1
  • client.parse_search_xml (cognitive 16) deeptutor/services/rag/pipelines/kiwix/client.py:183 — client.parse_search_xml has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 5, if/else 3 (5 pts), error handling 2 (3 pts), ternaries 1 (2 pts), loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · indexing_policy.freeze_roles (cognitive 16) · ×1
  • indexing_policy.freeze_roles (cognitive 16) deeptutor/services/rag/pipelines/lightrag/indexing_policy.py:306 — indexing_policy.freeze_roles has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 4 (7 pts), if/else 4 (5 pts), boolean chains 4 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · storage._resume_candidate (cognitive 16) · ×1
  • storage._resume_candidate (cognitive 16) deeptutor/services/rag/pipelines/llamaindex/storage.py:194 — storage._resume_candidate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 2, loops 2, error handling 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _turn_runtime_shared._resolve_turn_outcome (cognitive 16) · ×1
  • _turn_runtime_shared._resolve_turn_outcome (cognitive 16) deeptutor/services/session/_turn_runtime_shared.py:62 — _turn_runtime_shared._resolve_turn_outcome has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 5, if/else 3 (5 pts), ternaries 3 (5 pts), loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _turn_runtime_shared._sanitize_session_title (cognitive 16) · ×1
  • _turn_runtime_shared._sanitize_session_title (cognitive 16) deeptutor/services/session/_turn_runtime_shared.py:371 — _turn_runtime_shared._sanitize_session_title has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · _turn_runtime_shared._format_side_chat_context (cognitive 16) · ×1
  • _turn_runtime_shared._format_side_chat_context (cognitive 16) deeptutor/services/session/_turn_runtime_shared.py:1375 — _turn_runtime_shared._format_side_chat_context has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 6, if/else 5 (6 pts), ternaries 2 (3 pts), loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · TurnLifecycle.close (cognitive 16) · ×1
  • TurnLifecycle.close (cognitive 16) deeptutor/services/session/turns/lifecycle.py:73 — TurnLifecycle.close has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 4 (6 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TurnLifecycle._flush_buffered_events_once (cognitive 16) · ×1
  • TurnLifecycle._flush_buffered_events_once (cognitive 16) deeptutor/services/session/turns/lifecycle.py:754 — TurnLifecycle._flush_buffered_events_once has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), error handling 3 (5 pts), ternaries 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ClawHubProvider.detail (cognitive 16) · ×1
  • ClawHubProvider.detail (cognitive 16) deeptutor/services/skill/hub.py:473 — ClawHubProvider.detail has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 7, if/else 4, ternaries 3 (4 pts), error handling 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · SkillService._availability (cognitive 16) · ×1
  • SkillService._availability (cognitive 16) deeptutor/services/skill/service.py:372 — SkillService._availability has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (7 pts), boolean chains 5, loops 2, ternaries 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · models._codex_options (cognitive 16) · ×1
  • models._codex_options (cognitive 16) deeptutor/services/subagent/models.py:182 — models._codex_options has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 6, if/else 2 (4 pts), ternaries 3, error handling 2, loops 1 (nesting depth added 2). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · suggestions._sanitize (cognitive 16) · ×1
  • suggestions._sanitize (cognitive 16) deeptutor/services/suggestions.py:508 — suggestions._sanitize has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 4, loops 1, ternaries 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · suggestions._generate (cognitive 16) · ×1
  • suggestions._generate (cognitive 16) deeptutor/services/suggestions.py:547 — suggestions._generate has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 7 (10 pts), if/else 4, error handling 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · dashscope._tts_url (cognitive 16) · ×1
  • dashscope._tts_url (cognitive 16) deeptutor/services/voice/adapters/dashscope.py:67 — dashscope._tts_url has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 7, if/else 6 (7 pts), ternaries 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · html_extractor.extract_article_markdown (cognitive 16) · ×1
  • html_extractor.extract_article_markdown (cognitive 16) deeptutor/services/web_source/html_extractor.py:320 — html_extractor.extract_article_markdown has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 4 (5 pts), boolean chains 1, error handling 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CrawlAccess._fetch_policy (cognitive 16) · ×1
  • CrawlAccess._fetch_policy (cognitive 16) deeptutor/services/web_source/robots.py:135 — CrawlAccess._fetch_policy has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 2, error handling 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WorkspaceCatalogMixin._ensure_builtin_workspaces (cognitive 16) · ×1
  • WorkspaceCatalogMixin._ensure_builtin_workspaces (cognitive 16) deeptutor/services/workspace/catalog.py:176 — WorkspaceCatalogMixin._ensure_builtin_workspaces has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WorkspaceCatalogMixin.create_workspace (cognitive 16) · ×1
  • WorkspaceCatalogMixin.create_workspace (cognitive 16) deeptutor/services/workspace/catalog.py:303 — WorkspaceCatalogMixin.create_workspace has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 3, loops 1, ternaries 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · data_migration._feature_path (cognitive 16) · ×1
  • data_migration._feature_path (cognitive 16) deeptutor/services/workspace/data_migration.py:55 — data_migration._feature_path has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (14 pts), ternaries 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · knowledge.knowledge_catalog (cognitive 16) · ×1
  • knowledge.knowledge_catalog (cognitive 16) deeptutor/services/workspace/knowledge.py:112 — knowledge.knowledge_catalog has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 2 (6 pts), if/else 2 (4 pts), loops 2 (3 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ContentWorkspaceService.current_binding (cognitive 16) · ×1
  • ContentWorkspaceService.current_binding (cognitive 16) deeptutor/services/workspace/service.py:147 — ContentWorkspaceService.current_binding has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 5, loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RAGTool.execute (cognitive 16) · ×1
  • RAGTool.execute (cognitive 16) deeptutor/tools/builtin/__init__.py:244 — RAGTool.execute has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), error handling 1 (4 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · question_bank._list (cognitive 16) · ×1
  • question_bank._list (cognitive 16) deeptutor/tools/question_bank.py:184 — question_bank._list has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 6, ternaries 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · WorkspaceExportTool.execute (cognitive 16) · ×1
  • WorkspaceExportTool.execute (cognitive 16) deeptutor/tools/workspace.py:256 — WorkspaceExportTool.execute has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 8, boolean chains 6, error handling 1, if/else 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · document_images.ordered_pptx_slide_members (cognitive 16) · ×1
  • document_images.ordered_pptx_slide_members (cognitive 16) deeptutor/utils/document_images.py:774 — document_images.ordered_pptx_slide_members has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), error handling 2 (3 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · WatchingToReadingMigration.migrate (cognitive 16) · ×1
  • WatchingToReadingMigration.migrate (cognitive 16) deeptutor/video_learning/reading_migration.py:81 — WatchingToReadingMigration.migrate has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 5, ternaries 3. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · TimedMediaStore._repair_transcript_text (cognitive 16) · ×1
  • TimedMediaStore._repair_transcript_text (cognitive 16) deeptutor/video_learning/service.py:335 — TimedMediaStore._repair_transcript_text has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 2 (3 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · SubmitVisualizationTool.execute (cognitive 16) · ×1
  • SubmitVisualizationTool.execute (cognitive 16) deeptutor/visualizers/tool.py:64 — SubmitVisualizationTool.execute has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 6, ternaries 2. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · TurnStreamRenderer._prompt_one_question (cognitive 16) · ×1
  • TurnStreamRenderer._prompt_one_question (cognitive 16) deeptutor_cli/common.py:562 — TurnStreamRenderer._prompt_one_question has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 6, if/else 3 (5 pts), ternaries 3 (4 pts), loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · init_cmd.run_init (cognitive 16) · ×1
  • init_cmd.run_init (cognitive 16) deeptutor_cli/init_cmd.py:474 — init_cmd.run_init has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 4, ternaries 3, error handling 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · types.validateToolRuntime (cognitive 16) · ×1
  • types.validateToolRuntime (cognitive 16) packages/chat-engine/src/native/types.ts:164 — types.validateToolRuntime has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · page.ManageGroupDialog (cognitive 16) · ×1
  • page.ManageGroupDialog (cognitive 16) web/app/(workspace)/partners/groups/[groupId]/page.tsx:245 — page.ManageGroupDialog has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 6 (8 pts), if/else 4, boolean chains 2, error handling 2 (nesting depth added 2). Most of this is not in the body itself: 4 of the 16 points are its own statements and the rest belongs to 5 function items inside it that branch (save, remove, a function literal at line 275, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · page.NewPartnerPage · ×1
  • page.NewPartnerPage::submit (cognitive 16) web/app/(workspace)/partners/new/page.tsx:126 — page.NewPartnerPage::submit has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 6 (9 pts), boolean chains 5, error handling 1, if/else 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · AnswerModeMenu.AnswerList (cognitive 16) · ×1
  • AnswerModeMenu.AnswerList (cognitive 16) web/components/chat/home/AnswerModeMenu.tsx:136 — AnswerModeMenu.AnswerList has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 13, if/else 2, ternaries 1. Of this number, 13 points are the body's own statements and 3 belong to 3 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D2 · Cognitive Complexity · useBinarySource.useBinarySource (cognitive 16) · ×1
  • useBinarySource.useBinarySource (cognitive 16) web/components/chat/preview/previewers/useBinarySource.ts:22 — useBinarySource.useBinarySource has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), ternaries 2 (3 pts), boolean chains 2, error handling 1 (nesting depth added 3). None of this is in the body itself: all 16 points belong to 3 function literals inside it that branch (lines 37, 26, 60). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · DocxPreview.DocxPreview (cognitive 16) · ×1
  • DocxPreview.DocxPreview (cognitive 16) web/components/chat/preview/previewers/DocxPreview.tsx:41 — DocxPreview.DocxPreview has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 2, error handling 1, ternaries 1 (nesting depth added 1). Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 75, 49, 62, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · CliAppsSection.Installed (cognitive 16) · ×1
  • CliAppsSection.Installed (cognitive 16) web/components/cli-apps/CliAppsSection.tsx:144 — CliAppsSection.Installed has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 9, ternaries 4 (5 pts), error handling 1, if/else 1 (nesting depth added 1). Most of this is not in the body itself: 6 of the 16 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 213, 162, 282). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · KbDocumentList.buildTree (cognitive 16) · ×1
  • KbDocumentList.buildTree (cognitive 16) web/components/knowledge/KbDocumentList.tsx:53 — KbDocumentList.buildTree has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 2, ternaries 1 (2 pts), boolean chains 1 (nesting depth added 4). Of this number, 9 points are the body's own statements and 7 belong to 3 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PracticeInsights.DailyChart (cognitive 16) · ×1
  • PracticeInsights.DailyChart (cognitive 16) web/components/learning/practice/PracticeInsights.tsx:286 — PracticeInsights.DailyChart has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 9 (12 pts), boolean chains 2, if/else 2 (nesting depth added 3). Most of this is not in the body itself: 3 of the 16 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 441, 345, 304, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · NotebookSelector.NotebookSelector (cognitive 16) · ×1
  • NotebookSelector.NotebookSelector (cognitive 16) web/components/notebook/NotebookSelector.tsx:39 — NotebookSelector.NotebookSelector has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 9, ternaries 4 (7 pts) (nesting depth added 3). Most of this is not in the body itself: 7 of the 16 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 89, 166). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · PartnerLinkModal.PartnerLinkModal (cognitive 16) · ×1
  • PartnerLinkModal.PartnerLinkModal (cognitive 16) web/components/partners/PartnerLinkModal.tsx:25 — PartnerLinkModal.PartnerLinkModal has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 7 (11 pts), error handling 4, if/else 1 (nesting depth added 4). Of this number, 11 points are the body's own statements and 5 belong to 4 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · useReadingPanelLayout.useReadingPanelLayout (cognitive 16) · ×1
  • useReadingPanelLayout.useReadingPanelLayout (cognitive 16) web/components/reading/workspace/useReadingPanelLayout.ts:49 — useReadingPanelLayout.useReadingPanelLayout has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 7 (9 pts), boolean chains 4, if/else 3 (nesting depth added 2). Of this number, 12 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · RegistryControls.RegistryModelIdField · ×1
  • RegistryControls.RegistryModelIdField::onKeyDown (cognitive 16) REDACTED:382 — RegistryControls.RegistryModelIdField::onKeyDown has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), ternaries 2 (5 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ChatResponseTimeoutSection.ChatResponseTimeoutSection (cognitive 16) · ×1
  • ChatResponseTimeoutSection.ChatResponseTimeoutSection (cognitive 16) web/components/settings/ChatResponseTimeoutSection.tsx:21 — ChatResponseTimeoutSection.ChatResponseTimeoutSection has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 3 (6 pts), if/else 4 (5 pts), boolean chains 3, error handling 2 (nesting depth added 4). Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 36, 69, 91). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · MemoryUsageItem.MemoryUsageItem (cognitive 16) · ×1
  • MemoryUsageItem.MemoryUsageItem (cognitive 16) web/components/settings/MemoryUsageItem.tsx:62 — MemoryUsageItem.MemoryUsageItem has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (9 pts), ternaries 4, boolean chains 2, error handling 1 (nesting depth added 1). Most of this is not in the body itself: 6 of the 16 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 85, 100, 67, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · ModelCapabilityFields.ModelCapabilityFields (cognitive 16) · ×1
  • ModelCapabilityFields.ModelCapabilityFields (cognitive 16) web/components/settings/ModelCapabilityFields.tsx:32 — ModelCapabilityFields.ModelCapabilityFields has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 7 (9 pts), if/else 4, boolean chains 2, error handling 1 (nesting depth added 2). Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 92, a function literal at line 56, autoValue, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · ModelCards.ModelCard (cognitive 16) · ×1
  • ModelCards.ModelCard (cognitive 16) web/components/settings/ModelCards.tsx:368 — ModelCards.ModelCard has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 6 (12 pts), boolean chains 4 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ChatWorkspace.SubagentTabWatcher (cognitive 16) · ×1
  • ChatWorkspace.SubagentTabWatcher (cognitive 16) web/features/chat/components/ChatWorkspace.tsx:3178 — ChatWorkspace.SubagentTabWatcher has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 7). None of this is in the body itself: all 16 points belong to one function literal inside it that branches (line 3185). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · usage-summary.messageUsage (cognitive 16) · ×1
  • usage-summary.messageUsage (cognitive 16) web/features/chat/messages/usage-summary.ts:71 — usage-summary.messageUsage has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 3, loops 1, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · memory.compactTracePreview (cognitive 16) · ×1
  • memory.compactTracePreview (cognitive 16) web/features/chat/trace/memory.ts:99 — memory.compactTracePreview has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 3, loops 2 (nesting depth added 4). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LearnerProfileEditor.LearnerProfileEditor (cognitive 16) · ×1
  • LearnerProfileEditor.LearnerProfileEditor (cognitive 16) web/features/multi-user/components/LearnerProfileEditor.tsx:30 — LearnerProfileEditor.LearnerProfileEditor has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 7 (9 pts), boolean chains 3, if/else 3, error handling 1 (nesting depth added 2). Most of this is not in the body itself: 3 of the 16 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 104, save, a function literal at line 98, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · concept-map.noteConceptMap (cognitive 16) · ×1
  • concept-map.noteConceptMap (cognitive 16) web/features/notes/model/concept-map.ts:2 — concept-map.noteConceptMap has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 5 (7 pts), boolean chains 6, if/else 1 (2 pts), loops 1 (nesting depth added 3). Of this number, 14 points are the body's own statements and 2 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · NoteThreadMarkers.NoteThreadMarkers (cognitive 16) · ×1
  • NoteThreadMarkers.NoteThreadMarkers (cognitive 16) web/features/notes/components/NoteThreadMarkers.tsx:42 — NoteThreadMarkers.NoteThreadMarkers has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 7, if/else 5, ternaries 2 (3 pts), loops 1 (nesting depth added 1). Most of this is not in the body itself: 5 of the 16 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 120, 72, 111, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · NotePageHead.NotePageHead (cognitive 16) · ×1
  • NotePageHead.NotePageHead (cognitive 16) web/features/notes/components/NotePageHead.tsx:56 — NotePageHead.NotePageHead has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 7, if/else 6 (7 pts), ternaries 2 (nesting depth added 1). Most of this is not in the body itself: 6 of the 16 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 232, a function literal at line 72, openIcons, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · model-settings.firstIncompleteModel (cognitive 16) · ×1
  • model-settings.firstIncompleteModel (cognitive 16) web/lib/model-settings.ts:267 — model-settings.firstIncompleteModel has cognitive complexity 16 (threshold 15). Drivers by points: if/else 2 (7 pts), loops 3 (6 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · validateConfig (cognitive 16) · ×1
  • validateConfig (cognitive 16) apps/desktop/src/config.mjs:22 — validateConfig has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 5, loops 1, other 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · Medium vulnerability · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D4 · Code Duplication · Near-duplicate member family (3 members, 71 shared lines) · ×1
  • Near-duplicate member family (3 members, 71 shared lines) deeptutor/agents/math_animator/capability.py:223 — deeptutor/agents/math_animator/capability.py:223-302 | deeptutor/agents/question/capability.py:349-465 | deeptutor/agents/visualize/capability.py:494-573 — These 3 members are variants of one another: a block of 71 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 3 times.
D4 · Code Duplication · Near-duplicate member pair (151 shared lines) · ×1
  • Near-duplicate member pair (151 shared lines) deeptutor/agents/math_animator/capability.py:23 — deeptutor/agents/math_animator/capability.py:23-220 | deeptutor/agents/visualize/capability.py:271-491 — These two members are variants of one another: 151 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (36 shared lines) · ×1
  • Near-duplicate member pair (36 shared lines) deeptutor/reading/store.py:255 — deeptutor/reading/store.py:255-443 | deeptutor/reading/store.py:446-608 — These two members are variants of one another: 36 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Edited copy of a member (22 corresponding lines) · ×1
  • Edited copy of a member (22 corresponding lines) deeptutor/services/config/launch_settings.py:51 — deeptutor/services/config/launch_settings.py:51-75 | deeptutor/services/settings/interface_settings.py:101-146 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Members sharing a duplicated core (7 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (7 members, 50+ identical tokens) deeptutor/knowledge/manager.py:864 — deeptutor/knowledge/manager.py:864-894 | deeptutor/knowledge/manager.py:905-947 | deeptutor/knowledge/manager.py:957-990 | deeptutor/knowledge/manager.py:1001-1040 | deeptutor/knowledge/manager.py:1124-1171 | deeptutor/knowledge/manager.py:1182-1214 | deeptutor/knowledge/manager.py:1224-1254 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
D4 · Code Duplication · Duplicated block (110 lines × 2) · ×1
  • Duplicated block (110 lines × 2) deeptutor/services/memory/consolidator/modes/audit.py:149 — deeptutor/services/memory/consolidator/modes/audit.py:149-258 | deeptutor/services/memory/consolidator/modes/audit.py:289-398 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (74–108 lines × 2) · ×1
  • Duplicated block (74–108 lines × 2) deeptutor/services/session/sqlite_store.py:891 — deeptutor/services/session/sqlite_store.py:891-998 | deeptutor/services/session/sqlite_store.py:1023-1096 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/services/session/sqlite_store.py:891` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (60–83 lines × 2) · ×1
  • Duplicated block (60–83 lines × 2) deeptutor/agents/math_animator/capability.py:138 — deeptutor/agents/math_animator/capability.py:138-220 | deeptutor/agents/visualize/capability.py:408-467 — `deeptutor/agents/math_animator/capability.py` and `deeptutor/agents/visualize/capability.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 6 separate duplicated blocks between them, totalling at least 246 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/agents/math_animator/capability.py:138` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (74 lines × 2) · ×1
  • Duplicated block (74 lines × 2) deeptutor/agents/math_animator/capability.py:63 — deeptutor/agents/math_animator/capability.py:63-136 | deeptutor/agents/visualize/capability.py:330-403 — `deeptutor/agents/math_animator/capability.py` and `deeptutor/agents/visualize/capability.py` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 6 separate duplicated blocks between them, totalling at least 246 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/agents/math_animator/capability.py:63` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (58 lines × 2) · ×1
  • Duplicated block (58 lines × 2) deeptutor/services/memory/consolidator/modes/update.py:253 — deeptutor/services/memory/consolidator/modes/update.py:253-310 | deeptutor/services/memory/consolidator/modes/update.py:484-541 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/services/memory/consolidator/modes/update.py:253` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (43–44 lines × 2) · ×1
  • Duplicated block (43–44 lines × 2) deeptutor/services/memory/consolidator/modes/update.py:314 — deeptutor/services/memory/consolidator/modes/update.py:314-357 | deeptutor/services/memory/consolidator/modes/update.py:544-586 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (39 lines × 3) · ×1
  • Duplicated block (39 lines × 3) deeptutor/agents/math_animator/capability.py:238 — deeptutor/agents/math_animator/capability.py:238-276 | deeptutor/agents/question/capability.py:362-400 | deeptutor/agents/visualize/capability.py:509-547 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/agents/math_animator/capability.py:238` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (39 lines × 2) · ×1
  • Duplicated block (39 lines × 2) deeptutor/visualizers/builtin.py:158 — deeptutor/visualizers/builtin.py:158-196 | deeptutor/visualizers/builtin.py:206-244 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/visualizers/builtin.py:158` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (38 lines × 2) · ×1
  • Duplicated block (38 lines × 2) deeptutor/services/session/turns/learning_adapter.py:178 — deeptutor/services/session/turns/learning_adapter.py:178-215 | deeptutor/services/session/turns/learning_adapter.py:314-351 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (22–37 lines × 2) · ×1
  • Duplicated block (22–37 lines × 2) deeptutor/tools/brainstorm.py:54 — deeptutor/tools/brainstorm.py:54-75 | deeptutor/tools/reason.py:51-87 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (30–31 lines × 2) · ×1
  • Duplicated block (30–31 lines × 2) deeptutor/agents/base_agent.py:402 — deeptutor/agents/base_agent.py:402-432 | deeptutor/agents/base_agent.py:574-603 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (26–29 lines × 2) · ×1
  • Duplicated block (26–29 lines × 2) deeptutor/services/parsing/engines/_install.py:226 — deeptutor/services/parsing/engines/_install.py:226-251 | deeptutor/services/parsing/engines/mineru/models.py:174-202 — before extracting anything, compare `deeptutor/services/parsing/engines/_install.py` and `deeptutor/services/parsing/engines/mineru/models.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (28 lines × 2) · ×1
  • Duplicated block (28 lines × 2) deeptutor/book/agents/source_explorer.py:297 — deeptutor/book/agents/source_explorer.py:297-324 | deeptutor/book/agents/source_explorer.py:703-730 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/book/agents/source_explorer.py:297` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (26–27 lines × 2) · ×1
  • Duplicated block (26–27 lines × 2) deeptutor/knowledge/manager.py:1145 — deeptutor/knowledge/manager.py:1145-1171 | deeptutor/knowledge/manager.py:1189-1214 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (25–26 lines × 2) · ×1
  • Duplicated block (25–26 lines × 2) deeptutor/tools/brainstorm.py:80 — deeptutor/tools/brainstorm.py:80-104 | deeptutor/tools/reason.py:94-119 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (4–25 lines × 5) · ×1
  • Duplicated block (4–25 lines × 5) deeptutor/book/blocks/animation.py:44 — deeptutor/book/blocks/animation.py:44-47 | deeptutor/book/blocks/animation.py:48-70 | deeptutor/book/blocks/code.py:68-71 | deeptutor/book/blocks/figure.py:38-62 | deeptutor/book/blocks/interactive.py:38-62 — there are 5 copies across 4 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/book/blocks/animation.py:48` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `deeptutor/book/blocks/figure.py:36` calls `get`, `str` and `deeptutor/book/blocks/animation.py:44` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (25 lines × 2) · ×1
  • Duplicated block (25 lines × 2) deeptutor/book/blocks/deep_dive.py:27 — deeptutor/book/blocks/deep_dive.py:27-51 | deeptutor/book/blocks/timeline.py:25-49 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `deeptutor/book/blocks/deep_dive.py:52` calls `str`, `get`, `strip` and `deeptutor/book/blocks/timeline.py:50` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (23–24 lines × 3) · ×1
  • Duplicated block (23–24 lines × 3) deeptutor/agents/math_animator/capability.py:278 — deeptutor/agents/math_animator/capability.py:278-300 | deeptutor/agents/question/capability.py:402-425 | deeptutor/agents/visualize/capability.py:549-571 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/agents/math_animator/capability.py:278` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (23–24 lines × 2) · ×1
  • Duplicated block (23–24 lines × 2) deeptutor/services/partner_groups/manager.py:1005 — deeptutor/services/partner_groups/manager.py:1005-1028 | deeptutor/services/partner_groups/manager.py:1068-1090 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/services/partner_groups/manager.py:1005` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (22–24 lines × 2) · ×1
  • Duplicated block (22–24 lines × 2) deeptutor/services/session/sqlite_store.py:787 — deeptutor/services/session/sqlite_store.py:787-808 | deeptutor/services/session/sqlite_store.py:814-837 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (21–23 lines × 3) · ×1
  • Duplicated block (21–23 lines × 3) deeptutor/knowledge/manager.py:1014 — deeptutor/knowledge/manager.py:1014-1034 | deeptutor/knowledge/manager.py:1146-1168 | deeptutor/knowledge/manager.py:1190-1211 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `deeptutor/knowledge/manager.py:1035` calls `strip`, `lower` and `deeptutor/knowledge/manager.py:1169` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (18–23 lines × 2) · ×1
  • Duplicated block (18–23 lines × 2) deeptutor/services/llm/provider_core/base.py:452 — deeptutor/services/llm/provider_core/base.py:452-474 | deeptutor/services/llm/provider_core/base.py:503-520 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/services/llm/provider_core/base.py:452` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (19–23 lines × 2) · ×1
  • Duplicated block (19–23 lines × 2) deeptutor/services/mastery_hints.py:152 — deeptutor/services/mastery_hints.py:152-174 | deeptutor/services/reading_hints.py:145-163 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (20–22 lines × 2) · ×1
  • Duplicated block (20–22 lines × 2) deeptutor/services/llm/provider_core/claude_code_provider.py:528 — deeptutor/services/llm/provider_core/claude_code_provider.py:528-547 | deeptutor/services/llm/provider_core/codebuddy_provider.py:466-487 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (19–21 lines × 4) · ×1
  • Duplicated block (19–21 lines × 4) deeptutor/api/routers/book.py:1666 — deeptutor/api/routers/book.py:1666-1684 | deeptutor/api/routers/book.py:1692-1712 | deeptutor/api/routers/book.py:1721-1740 | deeptutor/api/routers/book.py:1748-1767 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/api/routers/book.py:1666` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `deeptutor/api/routers/book.py:1664` calls `get_book_bus`, `attach`, `send` and `deeptutor/api/routers/book.py:1692` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (18–21 lines × 3) · ×1
  • Duplicated block (18–21 lines × 3) deeptutor/knowledge/manager.py:877 — deeptutor/knowledge/manager.py:877-894 | deeptutor/knowledge/manager.py:972-990 | deeptutor/knowledge/manager.py:1234-1254 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `deeptutor/knowledge/manager.py:970` calls `str`, `resolve` and `deeptutor/knowledge/manager.py:875` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (20–21 lines × 2) · ×1
  • Duplicated block (20–21 lines × 2) deeptutor/co_writer/edit_agent.py:273 — deeptutor/co_writer/edit_agent.py:273-293 | deeptutor/co_writer/edit_agent.py:303-322 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/co_writer/edit_agent.py:273` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (18–21 lines × 2) · ×1
  • Duplicated block (18–21 lines × 2) deeptutor/learning/lesson_evidence.py:530 — deeptutor/learning/lesson_evidence.py:530-550 | deeptutor/learning/lesson_evidence.py:826-843 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (12–21 lines × 2) · ×1
  • Duplicated block (12–21 lines × 2) deeptutor/learning/pending.py:98 — deeptutor/learning/pending.py:98-109 | deeptutor/learning/pending.py:140-160 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (9–21 lines × 2) · ×1
  • Duplicated block (9–21 lines × 2) deeptutor/services/search/providers/jina.py:105 — deeptutor/services/search/providers/jina.py:105-113 | deeptutor/services/search/providers/serper.py:174-194 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (20 lines × 3) · ×1
  • Duplicated block (20 lines × 3) deeptutor/agents/math_animator/agents/concept_analysis_agent.py:75 — deeptutor/agents/math_animator/agents/concept_analysis_agent.py:75-94 | deeptutor/agents/math_animator/agents/concept_design_agent.py:54-73 | deeptutor/agents/math_animator/agents/summary_agent.py:56-75 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/agents/math_animator/agents/concept_analysis_agent.py:75` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (19–20 lines × 2) · ×1
  • Duplicated block (19–20 lines × 2) deeptutor_cli/init_cmd.py:38 — deeptutor_cli/init_cmd.py:38-57 | deeptutor_cli/init_cmd.py:452-470 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor_cli/init_cmd.py:38` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (19 lines × 3) · ×1
  • Duplicated block (19 lines × 3) deeptutor/api/routers/quiz_judge.py:148 — deeptutor/api/routers/quiz_judge.py:148-166 | deeptutor/api/routers/quiz_judge.py:175-193 | deeptutor/api/routers/quiz_judge.py:207-225 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (18–19 lines × 3) · ×1
  • Duplicated block (18–19 lines × 3) deeptutor/services/partner_groups/manager.py:947 — deeptutor/services/partner_groups/manager.py:947-964 | deeptutor/services/partner_groups/manager.py:1006-1024 | deeptutor/services/partner_groups/manager.py:1068-1086 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/services/partner_groups/manager.py:947` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (14–19 lines × 2) · ×1
  • Duplicated block (14–19 lines × 2) deeptutor/agents/loop/pipeline.py:947 — deeptutor/agents/loop/pipeline.py:947-965 | deeptutor/agents/loop/pipeline.py:1000-1013 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (15–19 lines × 2) · ×1
  • Duplicated block (15–19 lines × 2) deeptutor/services/mastery_hints.py:265 — deeptutor/services/mastery_hints.py:265-279 | deeptutor/services/reading_hints.py:253-271 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/services/reading_hints.py:253` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D4 · Code Duplication · Duplicated block (12–18 lines × 3) · ×1
  • Duplicated block (12–18 lines × 3) deeptutor/reading/store.py:426 — deeptutor/reading/store.py:426-443 | deeptutor/reading/store.py:596-607 | deeptutor/reading/store.py:759-770 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/reading/store.py:426` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `deeptutor/reading/store.py:758` calls `_reanchor_annotations` and `deeptutor/reading/store.py:426` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (18 lines × 2) · ×1
  • Duplicated block (18 lines × 2) deeptutor/partners/channels/discord.py:212 — deeptutor/partners/channels/discord.py:212-229 | deeptutor/partners/channels/telegram.py:694-711 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (17 lines × 4) · ×1
  • Duplicated block (17 lines × 4) deeptutor/knowledge/manager.py:922 — deeptutor/knowledge/manager.py:922-938 | deeptutor/knowledge/manager.py:1017-1034 | deeptutor/knowledge/manager.py:1149-1168 | deeptutor/knowledge/manager.py:1193-1211 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `deeptutor/knowledge/manager.py:1035` calls `strip`, `lower` and `deeptutor/knowledge/manager.py:1169` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (15–17 lines × 3) · ×1
  • Duplicated block (15–17 lines × 3) deeptutor/book/agents/ideation_agent.py:58 — deeptutor/book/agents/ideation_agent.py:58-72 | deeptutor/book/agents/source_explorer.py:299-315 | deeptutor/book/agents/source_explorer.py:705-721 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/book/agents/source_explorer.py:299` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (11–17 lines × 2) · ×1
  • Duplicated block (11–17 lines × 2) deeptutor/services/memory/snapshot/adapters.py:481 — deeptutor/services/memory/snapshot/adapters.py:481-497 | deeptutor/services/memory/snapshot/adapters.py:539-549 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (15–16 lines × 3) · ×1
  • Duplicated block (15–16 lines × 3) deeptutor/api/routers/knowledge.py:2313 — deeptutor/api/routers/knowledge.py:2313-2328 | deeptutor/api/routers/knowledge.py:2423-2437 | deeptutor/api/routers/knowledge.py:2492-2507 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/api/routers/knowledge.py:2313` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (16 lines × 3) · ×1
  • Duplicated block (16 lines × 3) deeptutor/services/search/providers/brave.py:62 — deeptutor/services/search/providers/brave.py:62-77 | deeptutor/services/search/providers/duckduckgo.py:50-65 | deeptutor/services/search/providers/google_browser_scraper.py:117-132 — before extracting anything, compare `deeptutor/services/search/providers/brave.py` and `deeptutor/services/search/providers/duckduckgo.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 61 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/services/search/providers/brave.py:62` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (14–16 lines × 2) · ×1
  • Duplicated block (14–16 lines × 2) deeptutor/services/llm/multimodal.py:97 — deeptutor/services/llm/multimodal.py:97-112 | deeptutor/services/subagent/images.py:73-86 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (15–16 lines × 2) · ×1
  • Duplicated block (15–16 lines × 2) deeptutor/tools/builtin/__init__.py:1272 — deeptutor/tools/builtin/__init__.py:1272-1287 | deeptutor/tools/partner_memory.py:196-210 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/tools/builtin/__init__.py:1272` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `deeptutor/tools/partner_memory.py:191` calls `get_partner_turn_context`, `get_current_path_service`, `memory_path_service_override` and `deeptutor/tools/builtin/__init__.py:1270` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (14–15 lines × 5) · ×1
  • Duplicated block (14–15 lines × 5) deeptutor/multi_user/grants.py:57 — deeptutor/multi_user/grants.py:57-70 | deeptutor/services/codex_auth/storage.py:61-75 | deeptutor/services/cron/repository.py:56-69 | deeptutor/services/partners/web_continuity.py:33-46 | deeptutor/video_learning/service.py:385-398 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 5 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 5 times. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `deeptutor/multi_user/grants.py:54` calls `mkdir` and `deeptutor/services/partners/web_continuity.py:30` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (13–15 lines × 2) · ×1
  • Duplicated block (13–15 lines × 2) deeptutor/book/blocks/callout.py:45 — deeptutor/book/blocks/callout.py:45-57 | deeptutor/book/blocks/text.py:62-76 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/book/blocks/callout.py:45` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (14–15 lines × 2) · ×1
  • Duplicated block (14–15 lines × 2) deeptutor/visualizers/builtin.py:205 — deeptutor/visualizers/builtin.py:205-218 | deeptutor/visualizers/builtin.py:253-267 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/visualizers/builtin.py:205` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (12–14 lines × 3) · ×1
  • Duplicated block (12–14 lines × 3) deeptutor/api/routers/system.py:513 — deeptutor/api/routers/system.py:513-524 | deeptutor/api/routers/system.py:568-581 | deeptutor/api/routers/system.py:620-633 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/api/routers/system.py:513` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (14 lines × 3) · ×1
  • Duplicated block (14 lines × 3) deeptutor/reading/quiz.py:98 — deeptutor/reading/quiz.py:98-111 | deeptutor/reading/study_guidance.py:77-90 | deeptutor/reading/vocabulary.py:103-116 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Note first that the copies are not typed on the same thing: the declarations holding them bind `TaskKind` to `"Reading quiz requires visible text.") from deeptutor.services.model_selection.tasks import` in one and `"Study guidance requires selected text.") from deeptutor.services.model_selection.tasks import` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (13–14 lines × 2) · ×1
  • Duplicated block (13–14 lines × 2) deeptutor/plugins/lifecycle.py:423 — deeptutor/plugins/lifecycle.py:423-435 | deeptutor/plugins/registry.py:564-577 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/plugins/lifecycle.py:423` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (13 lines × 5) · ×1
  • Duplicated block (13 lines × 5) deeptutor/multi_user/grants.py:64 — deeptutor/multi_user/grants.py:64-76 | deeptutor/services/cron/repository.py:63-75 | deeptutor/services/learning_journal/store.py:336-348 | deeptutor/services/partners/web_continuity.py:40-52 | deeptutor/video_learning/service.py:392-404 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 5 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 5 times.
D4 · Code Duplication · Duplicated block (9–13 lines × 2) · ×1
  • Duplicated block (9–13 lines × 2) deeptutor/reading/store.py:1111 — deeptutor/reading/store.py:1111-1119 | deeptutor/reading/store.py:1332-1344 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (4–12 lines × 5) · ×1
  • Duplicated block (4–12 lines × 5) deeptutor/services/search/providers/bocha.py:70 — deeptutor/services/search/providers/bocha.py:70-81 | deeptutor/services/search/providers/firecrawl.py:82-93 | deeptutor/services/search/providers/qianfan.py:83-94 | deeptutor/services/search/providers/serper.py:90-93 | deeptutor/services/search/providers/zhipu.py:85-96 — before extracting anything, compare `deeptutor/services/search/providers/bocha.py` and `deeptutor/services/search/providers/qianfan.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (12 lines × 3) · ×1
  • Duplicated block (12 lines × 3) deeptutor/agents/notebook/analysis_agent.py:84 — deeptutor/agents/notebook/analysis_agent.py:84-95 | deeptutor/agents/notebook/analysis_agent.py:130-141 | deeptutor/agents/notebook/analysis_agent.py:212-223 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/agents/notebook/analysis_agent.py:84` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8–12 lines × 2) · ×1
  • Duplicated block (8–12 lines × 2) deeptutor/services/session/_turn_runtime_shared.py:1636 — deeptutor/services/session/_turn_runtime_shared.py:1636-1643 | deeptutor/services/session/_turn_runtime_shared.py:1679-1690 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (11 lines × 3) · ×1
  • Duplicated block (11 lines × 3) deeptutor/services/subagent/antigravity.py:213 — deeptutor/services/subagent/antigravity.py:213-223 | deeptutor/services/subagent/claude_code.py:159-169 | deeptutor/services/subagent/kimi.py:156-166 — before extracting anything, compare `deeptutor/services/subagent/antigravity.py` and `deeptutor/services/subagent/claude_code.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (9–11 lines × 2) · ×1
  • Duplicated block (9–11 lines × 2) deeptutor/services/voice/adapters/mistral.py:125 — deeptutor/services/voice/adapters/mistral.py:125-135 | deeptutor/services/voice/adapters/xai.py:132-140 — before extracting anything, compare `deeptutor/services/voice/adapters/mistral.py` and `deeptutor/services/voice/adapters/xai.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/services/voice/adapters/mistral.py:125` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (9–10 lines × 6) · ×1
  • Duplicated block (9–10 lines × 6) deeptutor/services/config/runtime_settings.py:903 — deeptutor/services/config/runtime_settings.py:903-911 | deeptutor/services/config/runtime_settings.py:926-935 | deeptutor/services/config/runtime_settings.py:954-963 | deeptutor/services/config/runtime_settings.py:970-978 | deeptutor/services/config/runtime_settings.py:992-1000 | deeptutor/services/config/runtime_settings.py:1026-1034 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/services/config/runtime_settings.py:926` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `deeptutor/services/config/runtime_settings.py:980` calls `dict`, `get` and `deeptutor/services/config/runtime_settings.py:913` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (10 lines × 3) · ×1
  • Duplicated block (10 lines × 3) deeptutor/services/voice/adapters/mistral.py:37 — deeptutor/services/voice/adapters/mistral.py:37-46 | deeptutor/services/voice/adapters/openai_compat.py:79-88 | deeptutor/services/voice/adapters/xai.py:40-49 — before extracting anything, compare `deeptutor/services/voice/adapters/mistral.py` and `deeptutor/services/voice/adapters/xai.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (9–10 lines × 2) · ×1
  • Duplicated block (9–10 lines × 2) deeptutor/api/routers/settings.py:1293 — deeptutor/api/routers/settings.py:1293-1302 | deeptutor/api/routers/settings.py:1721-1729 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (4–9 lines × 5) · ×1
  • Duplicated block (4–9 lines × 5) deeptutor/services/subagent/antigravity.py:203 — deeptutor/services/subagent/antigravity.py:203-211 | deeptutor/services/subagent/claude_code.py:149-157 | deeptutor/services/subagent/codex.py:139-147 | deeptutor/services/subagent/grok.py:131-134 | deeptutor/services/subagent/kimi.py:145-153 — before extracting anything, compare `deeptutor/services/subagent/antigravity.py` and `deeptutor/services/subagent/claude_code.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/services/subagent/antigravity.py:203` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (9 lines × 4) · ×1
  • Duplicated block (9 lines × 4) deeptutor/tools/vision/coord_transform.py:164 — deeptutor/tools/vision/coord_transform.py:164-172 | deeptutor/tools/vision/coord_transform.py:175-183 | deeptutor/tools/vision/coord_transform.py:185-193 | deeptutor/tools/vision/coord_transform.py:209-217 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (8–9 lines × 2) · ×1
  • Duplicated block (8–9 lines × 2) deeptutor/api/routers/file_library.py:111 — deeptutor/api/routers/file_library.py:111-119 | deeptutor/api/routers/file_library.py:138-145 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (8 lines × 5) · ×1
  • Duplicated block (8 lines × 5) deeptutor/api/routers/book.py:947 — deeptutor/api/routers/book.py:947-954 | deeptutor/api/routers/book.py:992-999 | deeptutor/api/routers/book.py:1061-1068 | deeptutor/api/routers/book.py:1091-1098 | deeptutor/api/routers/book.py:1362-1369 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/api/routers/book.py:947` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (7 lines × 5) · ×1
  • Duplicated block (7 lines × 5) deeptutor/services/search/providers/bocha.py:95 — deeptutor/services/search/providers/bocha.py:95-101 | deeptutor/services/search/providers/doubao.py:137-143 | deeptutor/services/search/providers/firecrawl.py:102-108 | deeptutor/services/search/providers/qianfan.py:108-114 | deeptutor/services/search/providers/zhipu.py:105-111 — before extracting anything, compare `deeptutor/services/search/providers/bocha.py` and `deeptutor/services/search/providers/qianfan.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `deeptutor/services/search/providers/bocha.py:95` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `deeptutor/services/search/providers/bocha.py:91` calls `str`, `get` and `deeptutor/services/search/providers/zhipu.py:101` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (6–7 lines × 2) · ×1
  • Duplicated block (6–7 lines × 2) deeptutor/services/session/_turn_runtime_shared.py:73 — deeptutor/services/session/_turn_runtime_shared.py:73-78 | deeptutor/services/session/_turn_runtime_shared.py:91-97 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (8 lines × 8) · ×1
  • Duplicated block (8 lines × 8) deeptutor/agents/math_animator/agents/code_generator_agent.py:39 — deeptutor/agents/math_animator/agents/code_generator_agent.py:39-46 | deeptutor/agents/math_animator/agents/concept_analysis_agent.py:22-29 | deeptutor/agents/math_animator/agents/concept_design_agent.py:22-29 | deeptutor/agents/math_animator/agents/summary_agent.py:22-29 | deeptutor/agents/math_animator/agents/visual_review_agent.py:24-31 | deeptutor/agents/visualize/agents/analysis_agent.py:21-28 | deeptutor/agents/visualize/agents/code_generator_agent.py:22-29 | deeptutor/agents/visualize/agents/review_agent.py:22-29 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 8 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 8 times.
D4 · Code Duplication · Duplicated block (101 lines × 2) · ×1
  • Duplicated block (101 lines × 2) deeptutor/capabilities/mastery/tools.py:2306 — deeptutor/capabilities/mastery/tools.py:2306-2406 | deeptutor/tools/builtin/__init__.py:1810-1911 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (8 lines × 4) · ×1
  • Duplicated block (8 lines × 4) deeptutor/services/subagent/claude_code.py:307 — deeptutor/services/subagent/claude_code.py:307-314 | deeptutor/services/subagent/codex.py:236-243 | deeptutor/services/subagent/kimi.py:251-258 | deeptutor/services/subagent/opencode_family.py:491-498 — before extracting anything, compare `deeptutor/services/subagent/claude_code.py` and `deeptutor/services/subagent/kimi.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (7 lines × 3) · ×1
  • Duplicated block (7 lines × 3) deeptutor/reading/catalog_store.py:883 — deeptutor/reading/catalog_store.py:883-889 | deeptutor/services/session/sqlite_store.py:1636-1649 | deeptutor/services/session/sqlite_store.py:1655-1666 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
R10 · Code Duplication · Duplication concentrated across 8 sibling directories (249 clone groups) · ×1
  • Duplication concentrated across 8 sibling directories (249 clone groups) web/app/(workspace)/partners/new/page.tsx:76 — 249 duplicated blocks under web/ have copies in at least two of the sibling directories app, components, context, contracts, features, hooks (+2 more sibling(s) not listed) — 120 of them are reported below, and 129 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 249 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 249 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 249 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication · Duplication concentrated across 25 sibling directories (125 clone groups) · ×1
  • Duplication concentrated across 25 sibling directories (125 clone groups) web/components/reading/workspace/ReadingComposer.tsx:52 — 125 duplicated blocks under web/components/ have copies in at least two of the sibling directories activity, agents, chat, cli-apps, customization, knowledge (+19 more sibling(s) not listed) — 58 of them are reported below, and 67 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 125 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 125 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 125 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication · Duplication concentrated across 8 sibling directories (9 clone groups) · ×1
  • Duplication concentrated across 8 sibling directories (9 clone groups) web/features/multi-user/components/GuardianRelationshipsEditor.tsx:41 — 9 duplicated blocks under web/features/ have copies in at least two of the sibling directories calendar, chat, co-writer, knowledge, multi-user, notes (+2 more sibling(s) not listed) — 2 of them are reported below, and 7 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 9 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 9 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 9 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication · Duplicated block with local edits (425 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (425 matched lines × 2 locations) web/components/space/PersonasSection.tsx:36 — web/components/space/PersonasSection.tsx:36 · web/components/space/SkillsSection.tsx:47 — the two spans are one implementation copied and then locally edited — 2084 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (408 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (408 matched lines × 2 locations) web/components/common/RichMarkdownRenderer.tsx:186 — web/components/common/RichMarkdownRenderer.tsx:186 · web/components/common/SimpleMarkdownRenderer.tsx:48 — the two spans are one implementation copied and then locally edited — 2403 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (268 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (268 matched lines × 2 locations) web/components/chat/BookReferencePicker.tsx:51 — web/components/chat/BookReferencePicker.tsx:51 · web/components/chat/ReadingReferencePicker.tsx:53 — the two spans are one implementation copied and then locally edited — 1407 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (250 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (250 matched lines × 2 locations) web/features/settings/sections/CapabilitiesSettingsSection.tsx:148 — web/features/settings/sections/CapabilitiesSettingsSection.tsx:148 · web/features/settings/sections/MemorySettingsSection.tsx:79 — the two spans are one implementation copied and then locally edited — 1301 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (203 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (203 matched lines × 2 locations) web/components/knowledge/KbGitHubSourcesSection.tsx:66 — web/components/knowledge/KbGitHubSourcesSection.tsx:66 · web/components/knowledge/KbWebSourcesSection.tsx:94 — the two spans are one implementation copied and then locally edited — 955 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (131 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (131 matched lines × 2 locations) web/app/(workspace)/partners/new/page.tsx:76 — web/app/(workspace)/partners/new/page.tsx:76 · web/components/partners/PartnerConfigure.tsx:94 — the two spans are one implementation copied and then locally edited — 712 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (112 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (112 matched lines × 2 locations) web/components/sidebar/UtilitySidebar.tsx:36 — web/components/sidebar/UtilitySidebar.tsx:36 · web/components/sidebar/WorkspaceSidebar.tsx:46 — the two spans are one implementation copied and then locally edited — 733 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (97 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (97 matched lines × 2 locations) web/app/(workspace)/partners/groups/[groupId]/page.tsx:264 — web/app/(workspace)/partners/groups/[groupId]/page.tsx:264 · web/app/(workspace)/partners/groups/new/page.tsx:29 — the two spans are one implementation copied and then locally edited — 511 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (87 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (87 matched lines × 2 locations) web/components/SessionList.tsx:138 — web/components/SessionList.tsx:138 · web/components/SessionList.tsx:248 — the two spans are one implementation copied and then locally edited — 444 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (79 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (79 matched lines × 2 locations) web/components/sidebar/SidebarShell.tsx:111 — web/components/sidebar/SidebarShell.tsx:111 · web/features/ui-layout/classic/ClassicSidebarShell.tsx:92 — the two spans are one implementation copied and then locally edited — 383 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (78 lines × 2 locations) · ×1
  • Duplicated block (78 lines × 2 locations) web/components/learning/LearningDashboard.tsx:65 — web/components/learning/LearningDashboard.tsx:65 · web/features/ui-layout/classic/ClassicLearningDashboard.tsx:107 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block with local edits (78 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (78 matched lines × 2 locations) web/features/settings/sections/AttachmentsSettingsSection.tsx:53 — web/features/settings/sections/AttachmentsSettingsSection.tsx:53 · web/features/settings/sections/StartersSettingsSection.tsx:31 — the two spans are one implementation copied and then locally edited — 511 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (70 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (70 matched lines × 2 locations) web/components/chat/home/CreationDraftCard.tsx:51 — web/components/chat/home/CreationDraftCard.tsx:51 · web/components/chat/home/PartnerDraftCard.tsx:26 — the two spans are one implementation copied and then locally edited — 431 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (69 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (69 matched lines × 2 locations) web/components/chat/PersonaPicker.tsx:117 — web/components/chat/PersonaPicker.tsx:117 · web/components/chat/QuestionBankPicker.tsx:260 — the two spans are one implementation copied and then locally edited — 298 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (67 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (67 matched lines × 2 locations) web/app/(admin)/admin/users/page.tsx:796 — web/app/(admin)/admin/users/page.tsx:796 · web/app/(admin)/admin/users/page.tsx:920 — the two spans are one implementation copied and then locally edited — 261 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (64 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (64 matched lines × 2 locations) web/components/reading/workspace/ReadingComposer.tsx:52 — web/components/reading/workspace/ReadingComposer.tsx:52 · web/components/space/learning/MasteryComposer.tsx:51 — the two spans are one implementation copied and then locally edited — 395 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (63 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (63 matched lines × 2 locations) web/components/sidebar/SidebarShell.tsx:365 — web/components/sidebar/SidebarShell.tsx:365 · web/features/ui-layout/classic/ClassicSidebarShell.tsx:258 — the two spans are one implementation copied and then locally edited — 295 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (50 lines × 2 locations) · ×1
  • Duplicated block (50 lines × 2 locations) web/components/chat/home/SessionViewerPanel.tsx:1542 — web/components/chat/home/SessionViewerPanel.tsx:1542 · web/components/chat/preview/FilePreviewDrawer.tsx:374 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block with local edits (50 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (50 matched lines × 2 locations) web/components/partners/PartnerModelPicker.tsx:94 — web/components/partners/PartnerModelPicker.tsx:94 · web/components/partners/PartnerModelSelect.tsx:63 — the two spans are one implementation copied and then locally edited — 257 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (46 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (46 matched lines × 2 locations) web/hooks/useLearningIndex.ts:21 — web/hooks/useLearningIndex.ts:21 · web/hooks/usePartnerNavigation.ts:39 — the two spans are one implementation copied and then locally edited — 270 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block with local edits (45 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (45 matched lines × 2 locations) web/components/reading/ReadingActionsProvider.tsx:81 — web/components/reading/ReadingActionsProvider.tsx:81 · web/components/reading/ReadingExtensionBar.tsx:128 — the two spans are one implementation copied and then locally edited — 273 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (45 lines × 2 locations) · ×1
  • Duplicated block (45 lines × 2 locations) web/components/space/question-bank/useQuestionBank.ts:441 — web/components/space/question-bank/useQuestionBank.ts:441 · web/features/settings/store/SettingsStore.tsx:2510 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (43 lines × 2 locations) · ×1
  • Duplicated block (43 lines × 2 locations) web/app/(auth)/login/page.tsx:120 — web/app/(auth)/login/page.tsx:120 · web/app/(auth)/register/page.tsx:137 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
R10 · Code Duplication · Duplicated block (41 lines × 2 locations) · ×1
  • Duplicated block (41 lines × 2 locations) web/components/reading/library/MaterialLibrary.tsx:697 — web/components/reading/library/MaterialLibrary.tsx:697 · web/components/reading/library/ReadingLibrary.tsx:504 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (39 lines × 2 locations) · ×1
  • Duplicated block (39 lines × 2 locations) web/components/memory/MemoryL1Workbench.tsx:221 — web/components/memory/MemoryL1Workbench.tsx:221 · web/components/memory/MemoryWorkbench.tsx:523 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R2 · Cyclomatic Complexity · Complex function reduce (cyclomatic 192, cognitive 232) · ×1
  • Complex function reduce (cyclomatic 192, cognitive 232) web/features/chat/ChatStateAdapter.tsx:802 — reduce has cyclomatic complexity 192 and cognitive complexity 232; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 178, cognitive 170) · ×1
  • Complex function (anonymous) (cyclomatic 178, cognitive 170) web/features/chat/ChatStateAdapter.tsx:3014 — (anonymous) has cyclomatic complexity 178 and cognitive complexity 170; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function ChatComposer (cyclomatic 119, cognitive 102) · ×1
  • Complex function ChatComposer (cyclomatic 119, cognitive 102) web/components/chat/home/ChatComposer.tsx:200 — ChatComposer has cyclomatic complexity 119 and cognitive complexity 102; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function ModelEditor (cyclomatic 87, cognitive 62) · ×1
  • Complex function ModelEditor (cyclomatic 87, cognitive 62) web/components/settings/ModelsWorkspace.tsx:703 — ModelEditor has cyclomatic complexity 87 and cognitive complexity 62; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 80, cognitive 55) · ×1
  • Complex function (anonymous) (cyclomatic 80, cognitive 55) web/features/chat/components/ChatWorkspace.tsx:2005 — (anonymous) has cyclomatic complexity 80 and cognitive complexity 55; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function QuestionCard (cyclomatic 77, cognitive 62) · ×1
  • Complex function QuestionCard (cyclomatic 77, cognitive 62) web/components/space/question-bank/QuestionCard.tsx:136 — QuestionCard has cyclomatic complexity 77 and cognitive complexity 62; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function extractMessageSegments (cyclomatic 76, cognitive 188) · ×1
  • Complex function extractMessageSegments (cyclomatic 76, cognitive 188) web/components/chat/home/AskUserOptions.tsx:348 — extractMessageSegments has cyclomatic complexity 76 and cognitive complexity 188; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 67, cognitive 58) · ×1
  • Complex function (anonymous) (cyclomatic 67, cognitive 58) web/features/chat/messages/ChatMessageList.tsx:2457 — (anonymous) has cyclomatic complexity 67 and cognitive complexity 58; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function ProfileFields (cyclomatic 64, cognitive 56) · ×1
  • Complex function ProfileFields (cyclomatic 64, cognitive 56) web/components/settings/ServiceConfigEditor.tsx:1426 — ProfileFields has cyclomatic complexity 64 and cognitive complexity 56; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function BookPageInner (cyclomatic 63, cognitive 52) · ×1
  • Complex function BookPageInner (cyclomatic 63, cognitive 52) web/app/(workspace)/learning/books/BooksRoute.tsx:104 — BookPageInner has cyclomatic complexity 63 and cognitive complexity 52; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function KbIndexVersionsSection (cyclomatic 62, cognitive 51) · ×1
  • Complex function KbIndexVersionsSection (cyclomatic 62, cognitive 51) web/components/knowledge/KbIndexVersionsSection.tsx:50 — KbIndexVersionsSection has cyclomatic complexity 62 and cognitive complexity 51; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function operate (cyclomatic 60, cognitive 76) · ×1
  • Complex function operate (cyclomatic 60, cognitive 76) packages/chat-engine/src/native/session.ts:169 — operate has cyclomatic complexity 60 and cognitive complexity 76; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function SubagentSettingsEditor (cyclomatic 59, cognitive 55) · ×1
  • Complex function SubagentSettingsEditor (cyclomatic 59, cognitive 55) web/components/settings/SubagentSettingsEditor.tsx:324 — SubagentSettingsEditor has cyclomatic complexity 59 and cognitive complexity 55; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function SingleMasteryQuestionCard (cyclomatic 59, cognitive 51) · ×1
  • Complex function SingleMasteryQuestionCard (cyclomatic 59, cognitive 51) web/components/chat/home/MasteryQuestionCard.tsx:125 — SingleMasteryQuestionCard has cyclomatic complexity 59 and cognitive complexity 51; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function buildStartTurnInput (cyclomatic 58, cognitive 57) · ×1
  • Complex function buildStartTurnInput (cyclomatic 58, cognitive 57) web/features/chat/controllers/buildStartTurnInput.ts:51 — buildStartTurnInput has cyclomatic complexity 58 and cognitive complexity 57; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function PageReader (cyclomatic 58, cognitive 44) · ×1
  • Complex function PageReader (cyclomatic 58, cognitive 44) web/app/(workspace)/learning/books/components/PageReader.tsx:122 — PageReader has cyclomatic complexity 58 and cognitive complexity 44; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function CoWriterWorkspace (cyclomatic 56, cognitive 52) · ×1
  • Complex function CoWriterWorkspace (cyclomatic 56, cognitive 52) web/features/co-writer/components/CoWriterWorkspace.tsx:182 — CoWriterWorkspace has cyclomatic complexity 56 and cognitive complexity 52; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function UserMessage (cyclomatic 55, cognitive 46) · ×1
  • Complex function UserMessage (cyclomatic 55, cognitive 46) web/features/chat/messages/ChatMessageList.tsx:1709 — UserMessage has cyclomatic complexity 55 and cognitive complexity 46; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 54, cognitive 77) · ×1
  • Complex function (anonymous) (cyclomatic 54, cognitive 77) web/features/chat/ChatStateAdapter.tsx:2215 — (anonymous) has cyclomatic complexity 54 and cognitive complexity 77; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 54, cognitive 54) · ×1
  • Complex function (anonymous) (cyclomatic 54, cognitive 54) web/features/chat/ChatStateAdapter.tsx:2714 — (anonymous) has cyclomatic complexity 54 and cognitive complexity 54; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R3 · Large Files · web/features/chat/ChatStateAdapter.tsx · ×1
  • web/features/chat/ChatStateAdapter.tsx: 4236 lines of code web/features/chat/ChatStateAdapter.tsx:1 — web/features/chat/ChatStateAdapter.tsx has 4236 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/features/chat/components/ChatWorkspace.tsx · ×1
  • web/features/chat/components/ChatWorkspace.tsx: 3111 lines of code web/features/chat/components/ChatWorkspace.tsx:1 — web/features/chat/components/ChatWorkspace.tsx has 3111 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/features/chat/messages/ChatMessageList.tsx · ×1
  • web/features/chat/messages/ChatMessageList.tsx: 2676 lines of code web/features/chat/messages/ChatMessageList.tsx:1 — web/features/chat/messages/ChatMessageList.tsx has 2676 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/features/settings/store/SettingsStore.tsx · ×1
  • web/features/settings/store/SettingsStore.tsx: 2488 lines of code web/features/settings/store/SettingsStore.tsx:1 — web/features/settings/store/SettingsStore.tsx has 2488 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/features/co-writer/components/CoWriterWorkspace.tsx · ×1
  • web/features/co-writer/components/CoWriterWorkspace.tsx: 2407 lines of code web/features/co-writer/components/CoWriterWorkspace.tsx:1 — web/features/co-writer/components/CoWriterWorkspace.tsx has 2407 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/features/knowledge/components/engines/EngineDetail.tsx · ×1
  • web/features/knowledge/components/engines/EngineDetail.tsx: 1919 lines of code web/features/knowledge/components/engines/EngineDetail.tsx:1 — web/features/knowledge/components/engines/EngineDetail.tsx has 1919 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/features/chat/trace/TracePresentation.tsx · ×1
  • web/features/chat/trace/TracePresentation.tsx: 1899 lines of code web/features/chat/trace/TracePresentation.tsx:1 — web/features/chat/trace/TracePresentation.tsx has 1899 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/components/settings/ServiceConfigEditor.tsx · ×1
  • web/components/settings/ServiceConfigEditor.tsx: 1860 lines of code web/components/settings/ServiceConfigEditor.tsx:1 — web/components/settings/ServiceConfigEditor.tsx has 1860 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/features/knowledge/api/client.ts · ×1
  • web/features/knowledge/api/client.ts: 1769 lines of code web/features/knowledge/api/client.ts:1 — web/features/knowledge/api/client.ts has 1769 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/components/chat/home/SessionViewerPanel.tsx · ×1
  • web/components/chat/home/SessionViewerPanel.tsx: 1673 lines of code web/components/chat/home/SessionViewerPanel.tsx:1 — web/components/chat/home/SessionViewerPanel.tsx has 1673 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/components/chat/home/ChatComposer.tsx · ×1
  • web/components/chat/home/ChatComposer.tsx: 1619 lines of code web/components/chat/home/ChatComposer.tsx:1 — web/components/chat/home/ChatComposer.tsx has 1619 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/features/notes/components/NoteEditor.tsx · ×1
  • web/features/notes/components/NoteEditor.tsx: 1618 lines of code web/features/notes/components/NoteEditor.tsx:1 — web/features/notes/components/NoteEditor.tsx has 1618 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/components/chat/home/AskUserOptions.tsx · ×1
  • web/components/chat/home/AskUserOptions.tsx: 1604 lines of code web/components/chat/home/AskUserOptions.tsx:1 — web/components/chat/home/AskUserOptions.tsx has 1604 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/components/knowledge/CreateKbModal.tsx · ×1
  • web/components/knowledge/CreateKbModal.tsx: 1584 lines of code web/components/knowledge/CreateKbModal.tsx:1 — web/components/knowledge/CreateKbModal.tsx has 1584 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/components/memory/MemorySection.tsx · ×1
  • web/components/memory/MemorySection.tsx: 1443 lines of code web/components/memory/MemorySection.tsx:1 — web/components/memory/MemorySection.tsx has 1443 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/components/reading/ReaderPane.tsx · ×1
  • web/components/reading/ReaderPane.tsx: 1400 lines of code web/components/reading/ReaderPane.tsx:1 — web/components/reading/ReaderPane.tsx has 1400 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/components/quiz/QuizViewer.tsx · ×1
  • web/components/quiz/QuizViewer.tsx: 1351 lines of code web/components/quiz/QuizViewer.tsx:1 — web/components/quiz/QuizViewer.tsx has 1351 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/components/partners/PartnerChat.tsx · ×1
  • web/components/partners/PartnerChat.tsx: 1329 lines of code web/components/partners/PartnerChat.tsx:1 — web/components/partners/PartnerChat.tsx has 1329 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/features/settings/sections/DocumentParsingSettingsSection.tsx · ×1
  • web/features/settings/sections/DocumentParsingSettingsSection.tsx: 1287 lines of code web/features/settings/sections/DocumentParsingSettingsSection.tsx:1 — web/features/settings/sections/DocumentParsingSettingsSection.tsx has 1287 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/components/settings/ModelsWorkspace.tsx · ×1
  • web/components/settings/ModelsWorkspace.tsx: 1206 lines of code web/components/settings/ModelsWorkspace.tsx:1 — web/components/settings/ModelsWorkspace.tsx has 1206 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/app/(workspace)/learning/books/BooksRoute.tsx · ×1
  • web/app/(workspace)/learning/books/BooksRoute.tsx: 1166 lines of code web/app/(workspace)/learning/books/BooksRoute.tsx:1 — web/app/(workspace)/learning/books/BooksRoute.tsx has 1166 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/components/chat/home/StandaloneComposer.tsx · ×1
  • web/components/chat/home/StandaloneComposer.tsx: 1034 lines of code web/components/chat/home/StandaloneComposer.tsx:1 — web/components/chat/home/StandaloneComposer.tsx has 1034 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/components/reading/workspace/MediaReadingStage.tsx · ×1
  • web/components/reading/workspace/MediaReadingStage.tsx: 1001 lines of code web/components/reading/workspace/MediaReadingStage.tsx:1 — web/components/reading/workspace/MediaReadingStage.tsx has 1001 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/components/space/SkillsSection.tsx · ×1
  • web/components/space/SkillsSection.tsx: 990 lines of code web/components/space/SkillsSection.tsx:1 — web/components/space/SkillsSection.tsx has 990 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/app/(admin)/admin/users/page.tsx · ×1
  • web/app/(admin)/admin/users/page.tsx: 989 lines of code web/app/(admin)/admin/users/page.tsx:1 — web/app/(admin)/admin/users/page.tsx has 989 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/components/cli-apps/CliAppsSection.tsx · ×1
  • web/components/cli-apps/CliAppsSection.tsx: 969 lines of code web/components/cli-apps/CliAppsSection.tsx:1 — web/components/cli-apps/CliAppsSection.tsx has 969 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/components/notebook/NotebookConsole.tsx · ×1
  • web/components/notebook/NotebookConsole.tsx: 967 lines of code web/components/notebook/NotebookConsole.tsx:1 — web/components/notebook/NotebookConsole.tsx has 967 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/components/memory/MemoryGraph.tsx · ×1
  • web/components/memory/MemoryGraph.tsx: 937 lines of code web/components/memory/MemoryGraph.tsx:1 — web/components/memory/MemoryGraph.tsx has 937 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/components/settings/SubagentSettingsEditor.tsx · ×1
  • web/components/settings/SubagentSettingsEditor.tsx: 932 lines of code web/components/settings/SubagentSettingsEditor.tsx:1 — web/components/settings/SubagentSettingsEditor.tsx has 932 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · REDACTED · ×1
  • REDACTED: 930 lines of code REDACTED:1 — REDACTED has 930 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/components/memory/MemoryRunPanel.tsx · ×1
  • web/components/memory/MemoryRunPanel.tsx: 914 lines of code web/components/memory/MemoryRunPanel.tsx:1 — web/components/memory/MemoryRunPanel.tsx has 914 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/components/space/learning/MasteryStudy.tsx · ×1
  • web/components/space/learning/MasteryStudy.tsx: 880 lines of code web/components/space/learning/MasteryStudy.tsx:1 — web/components/space/learning/MasteryStudy.tsx has 880 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/features/notes/components/NoteCompanion.tsx · ×1
  • web/features/notes/components/NoteCompanion.tsx: 831 lines of code web/features/notes/components/NoteCompanion.tsx:1 — web/features/notes/components/NoteCompanion.tsx has 831 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/features/multi-user/components/GrantEditor.tsx · ×1
  • web/features/multi-user/components/GrantEditor.tsx: 825 lines of code web/features/multi-user/components/GrantEditor.tsx:1 — web/features/multi-user/components/GrantEditor.tsx has 825 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/app/(workspace)/partners/[partnerId]/page.tsx · ×1
  • web/app/(workspace)/partners/[partnerId]/page.tsx: 816 lines of code web/app/(workspace)/partners/[partnerId]/page.tsx:1 — web/app/(workspace)/partners/[partnerId]/page.tsx has 816 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/features/notes/components/NoteWorkspace.tsx · ×1
  • web/features/notes/components/NoteWorkspace.tsx: 803 lines of code web/features/notes/components/NoteWorkspace.tsx:1 — web/features/notes/components/NoteWorkspace.tsx has 803 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/lib/learning-api.ts · ×1
  • web/lib/learning-api.ts: 799 lines of code web/lib/learning-api.ts:1 — web/lib/learning-api.ts has 799 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/app/(workspace)/learning/books/components/PageReader.tsx · ×1
  • web/app/(workspace)/learning/books/components/PageReader.tsx: 787 lines of code web/app/(workspace)/learning/books/components/PageReader.tsx:1 — web/app/(workspace)/learning/books/components/PageReader.tsx has 787 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/components/chat/home/ComposerInput.tsx · ×1
  • web/components/chat/home/ComposerInput.tsx: 785 lines of code web/components/chat/home/ComposerInput.tsx:1 — web/components/chat/home/ComposerInput.tsx has 785 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · web/app/(workspace)/learning/mastery/[pathId]/page.tsx · ×1
  • web/app/(workspace)/learning/mastery/[pathId]/page.tsx: 774 lines of code web/app/(workspace)/learning/mastery/[pathId]/page.tsx:1 — web/app/(workspace)/learning/mastery/[pathId]/page.tsx has 774 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R5 · Dependency Freshness · Dependency Freshness · ×1
  • Dependency Freshness — 31 outdated package(s); JS/npm CVEs scored in D30
R7 · Dead Code · Dead file (~1900 LoC) · ×1
  • Dead file (~1900 LoC) web/components/settings/ServiceConfigEditor.tsx — no import path from any entry point (133 application, 15 tooling, 470 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (web/components/settings/TaskModelsEditor.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
R7 · Dead Code · Dead file (~762 LoC) · ×1
  • Dead file (~762 LoC) web/components/settings/ConnectionsEditor.tsx — no import path from any entry point (133 application, 15 tooling, 470 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~473 LoC) · ×1
  • Dead file (~473 LoC) web/components/settings/ModelCards.tsx — no import path from any entry point (133 application, 15 tooling, 470 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (web/components/settings/ServiceConfigEditor.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
R7 · Dead Code · Dead file (~216 LoC) · ×1
  • Dead file (~216 LoC) web/components/watching/WatchingMarksPanel.tsx — no import path from any entry point (133 application, 15 tooling, 470 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~181 LoC) · ×1
  • Dead file (~181 LoC) web/components/settings/SettingsPresetsPanel.tsx — no import path from any entry point (133 application, 15 tooling, 470 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~176 LoC) · ×1
  • Dead file (~176 LoC) web/components/settings/DimensionField.tsx — no import path from any entry point (133 application, 15 tooling, 470 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (web/components/settings/ServiceConfigEditor.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
R7 · Dead Code · Dead file (~151 LoC) · ×1
  • Dead file (~151 LoC) deeptutor/agents/video_lesson/remotion/build.mjs — no import path from any entry point (133 application, 15 tooling, 470 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~138 LoC) · ×1
  • Dead file (~138 LoC) web/components/settings/ModelCapabilityFields.tsx — no import path from any entry point (133 application, 15 tooling, 470 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (web/components/settings/ServiceConfigEditor.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
R7 · Dead Code · Dead file (~100 LoC) · ×1
  • Dead file (~100 LoC) web/components/settings/TaskModelsEditor.tsx — no import path from any entry point (133 application, 15 tooling, 470 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~90 LoC) · ×1
  • Dead file (~90 LoC) web/components/space/learning/CoverageNotice.tsx — no import path from any entry point (133 application, 15 tooling, 470 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~25 LoC) · ×1
  • Dead file (~25 LoC) web/lib/settings-presets.ts — no import path from any entry point (133 application, 15 tooling, 470 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (web/components/settings/SettingsPresetsPanel.tsx) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
R7 · Dead Code · Dead file (~19 LoC) · ×1
  • Dead file (~19 LoC) deeptutor/agents/video_lesson/remotion/render-platform.ts — no import path from any entry point (133 application, 15 tooling, 470 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (deeptutor/agents/video_lesson/remotion/build.mjs) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
R7 · Dead Code · Dead file (~13 LoC) · ×1
  • Dead file (~13 LoC) web/shared/api/runtime.ts — no import path from any entry point (133 application, 15 tooling, 470 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~4 LoC) · ×1
  • Dead file (~4 LoC) web/i18n/index.ts — no import path from any entry point (133 application, 15 tooling, 470 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R8 · Dependency Hygiene · Unused dependency 'html2canvas' · ×1
  • Unused dependency 'html2canvas' — Declared in REDACTED but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
R8 · Dependency Hygiene · Unused dependency 'json-schema-to-typescript' · ×1
  • Unused dependency 'json-schema-to-typescript' — Declared in REDACTED but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
R8 · Dependency Hygiene · Unused dependency 'openapi-typescript' · ×1
  • Unused dependency 'openapi-typescript' — Declared in REDACTED but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
X1 · Async correctness · Task from `worker_loop.create_task` is not kept · ×1
  • Task from `worker_loop.create_task` is not kept deeptutor/services/rag/pipelines/lightrag/worker.py:206 — The task this creates is not kept anywhere. The event loop holds only a weak reference to its tasks, so a task nobody references can be garbage-collected before it finishes (Python's documentation for `asyncio.create_task`: save a reference to the result); and nothing ever awaits it, so an exception it raises is never handled — it surfaces, if at all, as "Task exception was never retrieved" in a log. Keep the task: `await` it, gather it, start it in an `asyncio.TaskGroup` (`async with asyncio.TaskGroup() as tg: tg.create_task(…)`), or, for genuine fire-and-forget, add it to a set and `task.add_done_callback(tasks.discard)` with a callback that also reads its exception.
X1 · Async correctness · Task from `asyncio.ensure_future` is not kept · ×1
  • Task from `asyncio.ensure_future` is not kept deeptutor/logging/process_stream.py:90 — The task this creates is not kept anywhere. The event loop holds only a weak reference to its tasks, so a task nobody references can be garbage-collected before it finishes (Python's documentation for `asyncio.create_task`: save a reference to the result); and nothing ever awaits it, so an exception it raises is never handled — it surfaces, if at all, as "Task exception was never retrieved" in a log. Keep the task: `await` it, gather it, start it in an `asyncio.TaskGroup` (`async with asyncio.TaskGroup() as tg: tg.create_task(…)`), or, for genuine fire-and-forget, add it to a set and `task.add_done_callback(tasks.discard)` with a callback that also reads its exception.
Minor — 179 finding(s)
X4 · Structured logging · Interpolated log message defeats structured logging · ×40
  • Interpolated log message defeats structured logging deeptutor/utils/file_types.py:258 — `debug` at line 258 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging deeptutor/utils/json_parser.py:108 — `debug` at line 108 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging deeptutor/utils/json_parser.py:122 — `debug` at line 122 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging deeptutor/utils/json_parser.py:166 — `debug` at line 166 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging deeptutor/utils/json_parser.py:179 — `debug` at line 179 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging deeptutor/utils/json_parser.py:180 — `debug` at line 180 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging deeptutor/utils/json_parser.py:200 — `warning` at line 200 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging deeptutor/tools/vision/image_utils.py:76 — `info` at line 76 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging deeptutor/tools/vision/image_utils.py:101 — `info` at line 101 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging deeptutor/tools/vision/image_utils.py:150 — `debug` at line 150 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging deeptutor/tools/vision/image_utils.py:189 — `debug` at line 189 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging deeptutor/tools/vision/image_utils.py:206 — `debug` at line 206 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging deeptutor/services/auth.py:214 — `info` at line 214 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging deeptutor/services/auth.py:382 — `warning` at line 382 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging deeptutor/services/auth.py:406 — `warning` at line 406 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging deeptutor/services/pocketbase_client.py:91 — `info` at line 91 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging deeptutor/services/pocketbase_client.py:93 — `error` at line 93 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.error("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.error("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging deeptutor/services/pocketbase_client.py:160 — `debug` at line 160 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.debug("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.debug("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging deeptutor/services/pocketbase_client.py:183 — `info` at line 183 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.info("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.info("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging deeptutor/services/pocketbase_client.py:185 — `warning` at line 185 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging deeptutor/services/pocketbase_client.py:191 — `warning` at line 191 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging deeptutor/services/setup/init.py:282 — `warning` at line 282 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging deeptutor/services/setup/init.py:299 — `warning` at line 299 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging deeptutor/services/session/pocketbase_store.py:388 — `warning` at line 388 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog.
  • Interpolated log message defeats structured logging deeptutor/services/session/pocketbase_store.py:495 — `warning` at line 495 is handed an f-string as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, every occurrence reads as a different message, and the string is built even when the record is filtered out. Pass the values beside a constant message instead: `logger.warning("order %s moved to %s", order_id, status)` with the standard library's `logging`, which keeps the message and its arguments apart on the record, or `log.warning("order moved", order_id=order_id, status=status)` with structlog.
  • + 15 more in this group — see findings.md.
X10 · Duplicated predicate · Duplicated predicate · ×25
  • Duplicated predicate web/features/settings/sections/CapabilitiesSettingsSection.tsx:144 — `!!settings && !!serverSnapshot && JSON.stringify(settings) !== JSON.stringify(serverSnapshot)` appears character-identically in 2 files — web/features/settings/sections/CapabilitiesSettingsSection.tsx, web/features/settings/sections/MemorySettingsSection.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate web/features/capabilities/model.ts:34 — `!!value && typeof value === "object" && !Array.isArray(value)` appears character-identically in 2 files — web/features/capabilities/model.ts, web/shared/storage/schema.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate web/components/space/MyAgentsSection.tsx:211 — `!agent.handle || !(await ensureReadPermission(agent.handle))` appears character-identically in 2 files — web/components/space/MyAgentsSection.tsx, web/components/space/ScopeEditorModal.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate web/components/sidebar/LearningNavigation.tsx:196 — `!event.metaKey && !event.ctrlKey && !event.shiftKey` appears character-identically in 2 files — web/components/sidebar/LearningNavigation.tsx, web/components/sidebar/NavigationPrimitives.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate web/components/chat/home/ComposerResources.tsx:332 — `!event.shiftKey && document.activeElement === last` appears character-identically in 4 files — web/components/chat/home/ComposerResources.tsx, web/components/learning/LearningWays.tsx, web/hooks/useModalDialog.ts, web/shared/ui/Dialog.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate web/hooks/usePartnerGroups.ts:33 — `!force && loadedAt && Date.now() - loadedAt < STALE_MS` appears character-identically in 2 files — web/hooks/usePartnerGroups.ts, web/hooks/usePartnerRoster.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate web/components/sessions/OrganizedSessionList.tsx:251 — `!menuRootRef.current?.contains(target) && !menuAnchorRef.current?.contains(target)` appears character-identically in 2 files — web/components/sessions/OrganizedSessionList.tsx, web/components/sidebar/SidebarNav.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate web/features/calendar/components/TimeGrid.tsx:203 — `!moved && Math.hypot(pointer.clientX - origin.x, pointer.clientY - origin.y) < DRAG_THRESHOLD` appears character-identically in 2 files — web/features/calendar/components/TimeGrid.tsx, web/features/calendar/components/gesture.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate web/components/reading/PdfDocumentView.tsx:430 — `!selection || selection.isCollapsed || selection.rangeCount === 0` appears character-identically in 2 files — web/components/reading/PdfDocumentView.tsx, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate web/components/sidebar/CommandPalette.tsx:113 — `!session.preferences?.archived && !session.preferences?.parent_session_id && !isNoteSession(session)` appears character-identically in 2 files — web/components/sidebar/CommandPalette.tsx, web/components/sidebar/SidebarShell.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate packages/chat-engine/src/native/types.ts:124 — `!value || typeof value !== "object" || Array.isArray(value)` appears character-identically in 3 files — packages/chat-engine/src/native/types.ts, web/features/chat/ChatStateAdapter.tsx, web/features/runtime-status/model.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate web/components/sidebar/UtilitySidebar.tsx:126 — `"workspace_id" in patch && (updated.preferences?.workspace_id || "") !== activeWorkspaceId()` appears character-identically in 2 files — web/components/sidebar/UtilitySidebar.tsx, web/components/sidebar/WorkspaceSidebar.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate web/components/partners/PartnerChat.tsx:246 — `(attachment.type === "image" || isSvgFilename(attachment.filename)) && attachment.previewUrl` appears character-identically in 2 files — web/components/partners/PartnerChat.tsx, web/components/partners/PartnerComposer.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate web/components/knowledge/KbDocumentsSection.tsx:103 — `(task?.kind === "reindex" || task?.kind === "retry") && task.executing` appears character-identically in 2 files — web/components/knowledge/KbDocumentsSection.tsx, web/components/knowledge/KbIndexVersionsSection.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate web/features/calendar/model/dates.ts:86 — `Intl.DateTimeFormat().resolvedOptions().timeZone || 'UTC'` appears character-identically in 3 files — web/features/calendar/model/dates.ts, web/lib/practice-api.ts, web/lib/usage-statistics.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate web/lib/reading-citations.ts:363 — `Number.isInteger(locator) && locator >= 1` appears character-identically in 2 files — web/lib/reading-citations.ts, web/lib/reading-reader-action.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate web/components/reading/workspace/ReadingComposer.tsx:119 — `awaitingUserReply && submission.content.trim()` appears character-identically in 2 files — web/components/reading/workspace/ReadingComposer.tsx, web/components/space/learning/MasteryComposer.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate web/app/(workspace)/learning/books/components/PageReader.tsx:633 — `block.error || failure?.message || t("Unknown error")` appears character-identically in 2 files — web/app/(workspace)/learning/books/components/PageReader.tsx, web/app/(workspace)/learning/books/components/blocks/BlockRenderer.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate web/app/(workspace)/learning/books/components/PageOutlineNav.tsx:248 — `block.status === "pending" || block.status === "generating"` appears character-identically in 2 files — web/app/(workspace)/learning/books/components/PageOutlineNav.tsx, web/app/(workspace)/learning/books/components/blocks/BlockRenderer.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate web/components/learning/LearningDashboard.tsx:109 — `book.status === 'paused' && book.metadata.pause_reason` appears character-identically in 2 files — web/components/learning/LearningDashboard.tsx, web/features/ui-layout/classic/ClassicLearningDashboard.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate web/features/ui-layout/classic/ClassicLearningDashboard.tsx:52 — `busy || document.visibilityState === 'hidden'` appears character-identically in 3 files — web/features/ui-layout/classic/ClassicLearningDashboard.tsx, web/hooks/useLearningIndex.ts, web/hooks/usePartnerNavigation.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate web/components/settings/MinerUEngineSettings.tsx:167 — `data.detail || t("Connection test failed.")` appears character-identically in 2 files — web/components/settings/MinerUEngineSettings.tsx, web/features/settings/sections/DocumentParsingSettingsSection.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate web/components/space/PersonasSection.tsx:239 — `editor?.name && !isValidSkillName(editor.name)` appears character-identically in 2 files — web/components/space/PersonasSection.tsx, web/components/space/SkillsSection.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate web/components/knowledge/KbLinkedFoldersSection.tsx:74 — `err instanceof DOMException && err.name === "AbortError"` appears character-identically in 3 files — web/components/knowledge/KbLinkedFoldersSection.tsx, web/components/knowledge/KbWebSourcesSection.tsx, web/features/co-writer/components/CoWriterWorkspace.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate web/components/chat/HistorySessionPicker.tsx:147 — `error instanceof DOMException && error.name === "AbortError"` appears character-identically in 3 files — web/components/chat/HistorySessionPicker.tsx, web/components/space/ChatHistorySection.tsx, web/shared/api/client.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
X7 · Silent fallback defaults · Pending state with no failure state · ×19
  • Pending state with no failure state web/i18n/I18nProvider.tsx:60 — The view draws `<div aria-busy="true" aria-hidden="true" class="min-h-dvh bg-[var(--background)]"/>` under `! enabled || readyLanguage !== nextLang`, but `readyLanguage` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
  • Pending state with no failure state web/features/multi-user/components/LearnerProfileEditor.tsx:90 — The view draws `<Loader2 size= class="animate-spin"/>` under `saving`, but `saving` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
  • Pending state with no failure state web/components/space/question-bank/CategoryMenu.tsx:200 — The view draws `<Loader2 class="h-3.5 w-3.5 animate-spin"/>` under `busy`, but `busy` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
  • Pending state with no failure state web/components/settings/SettingsToolbar.tsx:65 — The view draws `<Loader2 size= class="animate-spin"/>` under `saving`, but `saving` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
  • Pending state with no failure state web/components/settings/SettingsToolbar.tsx:79 — The view draws `<Loader2 size= class="animate-spin"/>` under `applying`, but `applying` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
  • Pending state with no failure state web/components/memory/MemorySection.tsx:531 — The view draws `<div class="flex min-h-[300px] items-center justify-center">` under `loading`, but `loading` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
  • Pending state with no failure state web/components/memory/MemorySection.tsx:839 — The view draws `<Loader2 class="h-3 w-3 animate-spin"/>` under `refreshing`, but `refreshing` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
  • Pending state with no failure state web/components/memory/MemorySection.tsx:877 — The view draws `<Loader2 class="h-3 w-3 animate-spin"/>` under `refreshing`, but `refreshing` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
  • Pending state with no failure state web/components/memory/MemorySection.tsx:1026 — The view draws `<div class="flex items-center justify-center rounded-xl border border-[var(--border)] py-12">` under `loading && entities . length === 0`, but `loading` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
  • Pending state with no failure state web/components/memory/MemorySection.tsx:1176 — The view draws `<div class="flex items-center justify-center rounded-xl border border-[var(--border)] py-12">` under `loading && changes . length === 0 && pending . length === 0`, but `loading` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
  • Pending state with no failure state web/components/memory/MemorySection.tsx:1263 — The view draws `<div class="flex items-center justify-center rounded-xl border border-[var(--border)] py-12">` under `loading && queries . length === 0`, but `loading` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
  • Pending state with no failure state web/components/memory/MemorySection.tsx:1405 — The view draws `<Loader2 class="h-3 w-3 animate-spin"/>` under `busy`, but `busy` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
  • Pending state with no failure state web/components/memory/MemorySection.tsx:1419 — The view draws `<Loader2 class="h-3 w-3 animate-spin"/>` under `busy`, but `busy` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
  • Pending state with no failure state web/components/memory/MemoryWorkbench.tsx:414 — The view draws `<Loader2 class="h-3.5 w-3.5 animate-spin"/>` under `saving`, but `saving` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
  • Pending state with no failure state web/components/chat/MyAgentsPicker.tsx:389 — The view draws `<div class="flex min-h-[280px] items-center justify-center">` under `loading`, but `loading` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
  • Pending state with no failure state web/components/chat/MyAgentsPicker.tsx:625 — The view draws `<div class="flex min-h-[280px] items-center justify-center">` under `loading`, but `loading` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
  • Pending state with no failure state web/components/chat/QuestionBankPicker.tsx:292 — The view draws `<div class="flex min-h-[280px] items-center justify-center">` under `loading`, but `loading` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
  • Pending state with no failure state web/app/(workspace)/partners/page.tsx:97 — The view draws `<div class="flex min-h-[320px] items-center justify-center">` under `loading`, but `loading` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
  • Pending state with no failure state web/app/(workspace)/learning/books/components/blocks/BlockBodyEditor.tsx:91 — The view draws `<Loader2 class="h-3 w-3 animate-spin"/>` under `saving`, but `saving` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
X7 · Silent fallback defaults · Silent fallback default in catch · ×13
  • Silent fallback default in catch deeptutor/agents/loop/context_budget.py:120 — `detect_counter_name` swallows every exception into `return 'heuristic'` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch deeptutor/agents/loop/pipeline.py:1132 — `_notebook_choices_full` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch deeptutor/agents/loop/pipeline.py:1821 — `_current_user_id` swallows every exception into `return 'anonymous'` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch deeptutor/api/routers/reading_extensions.py:336 — `_material_title` swallows every exception into `return ''` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch deeptutor/api/utils/task_log_stream.py:160 — `_event_bytes` swallows every exception into `return 256` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch deeptutor/capabilities/reading/capability.py:181 — `_workspace_facts` swallows every exception into `return ''` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch deeptutor/capabilities/reading/capability.py:267 — `_embedded_image_count` swallows every exception into `return 0` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch deeptutor/capabilities/reading/capability.py:286 — `_figure_caption_line` swallows every exception into `return ''` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch deeptutor/capabilities/reading/media_notes.py:54 — `render_media_note` swallows every exception into `return ''` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch deeptutor/capabilities/setup/binding.py:76 — `setup_gaps` swallows every exception into `return ()` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch deeptutor/co_writer/docx_converter.py:201 — `_numbering_formats` swallows every exception into `return {}` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch deeptutor/co_writer/edit_agent.py:57 — `load_history` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch deeptutor/knowledge/add_documents.py:262 — `get_ingested_hashes` swallows every exception into `return {}` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
D10 · Test Quality · Mock-dominated test · ×10
  • Mock-dominated test: reports CFI progress inside the final chapter, including one-chapter books (#1673) web/tests/epub-display-preferences.spec.tsx:242 — This test sets up 3 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 5 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: inserts original text with its exact source link and closes the picker web/tests/favorites-flow.spec.tsx:144 — This test sets up 3 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: loads linked folders with the qualified workspace KB reference web/tests/knowledge-linked-folders.spec.tsx:42 — This test sets up 4 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: routes the %s LightRAG retry through refreshed rebuild confirmation web/tests/lightrag-lifecycle.spec.tsx:304 — This test sets up 11 test doubles (for example `vi.fn`) against 1 real object(s) of its own, and its only verification is 5 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: keeps successful saves and their callbacks working web/tests/notebook-save-cancellation.spec.tsx:44 — This test sets up 3 test doubles (for example `vi.fn`) against 1 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: rotates the selected shared key when its conversation is deleted web/tests/partner-continuity.spec.tsx:83 — This test sets up 3 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: keeps a successful preview available when import saving fails web/tests/practice-workflow.spec.tsx:172 — This test sets up 3 test doubles (for example `vi.fn`) against 2 real object(s) of its own, and its only verification is 3 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: loads later pages and selects only the visible search matches web/tests/question-bank-picker.spec.tsx:67 — This test sets up 3 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: returns a selection to Reading instead of opening the Watching route web/tests/watching-browser.spec.tsx:48 — This test sets up 3 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: allows anonymous search and guides account-only browsing web/tests/watching-browser.spec.tsx:67 — This test sets up 3 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 3 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
D34 · Knowledge Freshness · Orphaned file · ×10
  • Orphaned file deeptutor/tools/vision/coord_transform.py:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file deeptutor/tools/vision/block_parser.py:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file deeptutor/services/pocketbase_client.py:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file deeptutor/tools/vision/image_utils.py:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file deeptutor/services/llm/traffic_control.py:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file deeptutor/services/search/types.py:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file web/components/access/CapabilityAccessContext.tsx:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file deeptutor/utils/network/circuit_breaker.py:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file web/lib/avatar.ts:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file web/app/(workspace)/learning/books/components/blocks/FigureBlock.tsx:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
X7 · Silent fallback defaults · Silent fallback default on parse failure · ×8
  • Silent fallback default on parse failure deeptutor/agents/question/pipeline.py:1402 — `_parse_quiz_payload` returns `{}` when `json.JSONDecodeError` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default on parse failure deeptutor/api/routers/auth.py:152 — `_request_frontend_host` returns `''` when `ValueError` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default on parse failure deeptutor/api/routers/partners.py:670 — `_navigation_timestamp` returns `0.0` when `ValueError` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default on parse failure deeptutor/book/models.py:111 — `depth_scale` returns `1.0` when `(ValueError, KeyError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default on parse failure deeptutor/capabilities/notes/generation.py:72 — `_json` returns `{}` when `ValueError` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default on parse failure deeptutor/capabilities/reading/capability.py:462 — `_as_int` returns `0` when `(TypeError, ValueError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default on parse failure deeptutor/capabilities/reading/capability.py:470 — `_as_float` returns `-1.0` when `(TypeError, ValueError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default on parse failure deeptutor/capabilities/reading/tools.py:645 — `_as_locator` returns `0` when `(TypeError, ValueError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
X6 · Hand-rolled structured-format parsing · Hand-rolled JSON/XML parsing via regex · ×6
  • Hand-rolled JSON/XML parsing via regex REDACTED:41 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex REDACTED:424 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex deeptutor/tools/web_fetch.py:54 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Python code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex deeptutor/services/web_source/html_extractor.py:333 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Python code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex deeptutor/agents/video_lesson/layout_check.py:222 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Python code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex deeptutor/agents/_shared/json_output.py:18 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Python code already uses a real parser in the same package; use it here too.
D16 · Bus Factor · Off-boarding risk · ×5
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 222 significant file(s) lose their only recent owner: web/components/memory/MemorySection.tsx, web/components/settings/ModelsWorkspace.tsx, deeptutor/reading/catalog_store.py, deeptutor/reading/ingestion.py, deeptutor/services/suggestions.py, deeptutor/services/workspace/service.py, web/components/cli-apps/CliAppsSection.tsx, web/components/memory/MemoryGraph.tsx (+214 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 7 significant file(s) lose their only recent owner: deeptutor/services/rag/pipelines/lightrag/indexing_policy.py, deeptutor/services/rag/embedding_binding.py, web/components/knowledge/LightRagRoleModelsEditor.tsx, web/components/knowledge/IndexingModelSelector.tsx, deeptutor/services/rag/pipelines/lightrag/roles.py, deeptutor/services/config/lightrag_roles.py, web/components/knowledge/LightRagIndexingProvenance.tsx. Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #3 — If anonymized user #3 becomes unavailable, 4 significant file(s) lose their only recent owner: deeptutor/services/llm/metrics.py, deeptutor/services/parsing/engines/mineru/normalization.py, deeptutor/services/parsing/engines/mineru/checkpoints.py, deeptutor/services/llm/request_cache.py. Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #4 — If anonymized user #4 becomes unavailable, 3 significant file(s) lose their only recent owner: deeptutor/learning/navigation.py, deeptutor/services/rag/smart_retriever.py, deeptutor/services/singleflight_cache.py. Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #5 — If anonymized user #5 becomes unavailable, 3 significant file(s) lose their only recent owner: deeptutor/capabilities/solve/tools.py, deeptutor/services/session/usage_recovery.py, deeptutor/capabilities/solve/session.py. Pair on, review, or document these before any departure.
R7 · Dead Code · Unused export 'default' · ×4
  • Unused export 'default' web/app/(utility)/notebooks/NotebooksRoute.tsx:27 — Nothing ultimately consumes this binding: its only referrer is the re-export in web/app/(utility)/notebooks/[notebookId]/page.tsx, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in web/app/(utility)/notebooks/[notebookId]/page.tsx in the same commit, or the barrel will import a name that no longer exists.
  • Unused export 'default' web/components/knowledge/PageIndexSettingsModal.tsx:183 — Nothing imports this binding — it is safe to review for removal.
  • Unused export 'default' web/components/memory/MemorySection.tsx:264 — Nothing imports this binding — it is safe to review for removal.
  • Unused export 'default' web/components/settings/TaskModelsWorkspace.tsx:285 — Nothing imports this binding — it is safe to review for removal.
D24 · Comment Value · redundant comment · ×2
  • redundant comment web/components/chat/home/SessionViewerPanel.tsx:1716 — "Geogebra tab body" repeats the code it sits on: 3 of its 3 words (geogebra, tab, body) are already in `function GeogebraTabBody({`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment web/tests/settings/settings-store.test.ts:594 — "Search diagnostics match on a null model id." repeats the code it sits on: 5 of its 6 words (search, diagnostics, null, model, id) are already in `const searchResult = diagnostics({`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
D30 · Dependency Vulnerabilities · Low CVE · ×2
  • REDACTED
  • REDACTED
AX6 · Interface segregation · Fat interface · ×1
  • Fat interface: QuestionBankController (18 required operations) web/components/space/question-bank/useQuestionBank.ts:74 — `QuestionBankController` declares 18 required operations: `setScope`, `setReviewFilters`, `setSort`, `setSearchInput`, `refresh`, `setPage`, `toggleSelected`, `selectAll`, `clearSelection`, `toggleBookmark`, `toggleResolved`, `removeEntry`, `fileEntries`, `unfileEntries`, `fileIntoNewCategory`, `addCategory`, `renameExistingCategory`, `removeCategory`. Counted over its REQUIRED operations — a method signature or a function-typed property with no `?`, once per signature; optional members and data properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
D16 · Bus Factor · Further sole-owners (lower concentration) · ×1
  • Further sole-owners (lower concentration) — 17 other contributor(s) are each the sole owner of a small amount of code below the off-boarding threshold — folded into the bus-factor score and metrics (257 single-owned of 1544 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 1544 of the 2213 production source files in this repository met that bar). They are anonymized user #6 (2 file(s)), anonymized user #7 (1 file(s)), anonymized user #8 (1 file(s)), anonymized user #9 (1 file(s)), anonymized user #10 (1 file(s)), anonymized user #11 (1 file(s)) (+11 more) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: deeptutor/reading/page_render.py, deeptutor/capabilities/reading/_tool_base.py, deeptutor/capabilities/mastery/pipeline.py, deeptutor/tools/file_tools.py, deeptutor/runtime/coordination/recovery.py, deeptutor/services/workspace/execution.py, deeptutor/multi_user/audit.py, deeptutor/services/skill/credentials.py (+10 more).
D20 · ADR Quality · No ADRs found · ×1
  • No ADRs found — No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`.
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×1
  • Projects may be oversized for their cohesion — 2 of 6 project(s) overshoot their size bounds, lowering Project Cohesion to 3.3/10. The most over is `(repository root)` (278248 LoC, 2711 module-visible types across 148 directories). Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D27 · Navigability · Scattered collaborators · ×1
  • Scattered collaborators — 66 % of calls cross a namespace and only 58 % of collaborators are co-located — group each feature's code into a vertical slice so a call's collaborators sit together.
D28 · Secrets (history) · Rotate the exposed credentials · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D31 · IaC & Container Security · Low IaC · ×1
  • REDACTED
D34 · Knowledge Freshness · Orphaned files with no living knowledge · ×1
  • Orphaned files with no living knowledge — 10 of 1545 analysed file(s) have no living knowledge left — their last meaningful change has decayed away, so if one breaks, no one currently understands it (counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 1545 of the 2213 production source files in this repository met that bar). None is large enough to earn a read-through of its own, so this row stands in for the per-file rows rather than raising one each — most significant first: deeptutor/tools/vision/coord_transform.py, deeptutor/tools/vision/block_parser.py, deeptutor/services/pocketbase_client.py, deeptutor/tools/vision/image_utils.py, deeptutor/services/llm/traffic_control.py, deeptutor/services/search/types.py, deeptutor/utils/network/circuit_breaker.py, web/components/access/CapabilityAccessContext.tsx (and 2 more). Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
M2 · Architecture documentation · No ADRs · ×1
  • No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
M3 · Folder & project structure · No src/ separation · ×1
  • No src/ separation — Production code isn't grouped under a src/ folder — it's spread across several top-level directories, so there's no one place that says 'this is the product'.
P2 · Observability · Logging is not universal · ×1
  • Logging is not universal — Only 1/3 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `apps/desktop`, `web`.
P3 · Security & performance tooling · No SAST · ×1
  • No SAST REDACTED:32 — No static application security testing detected. For this repository's stack, add bandit, `semgrep --config=p/python`, or CodeQL's python pack as a CI step. What was searched, so you can tell an absence from a miss: the 43712 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.
P3 · Security & performance tooling · No dependency-update automation · ×1
  • No dependency-update automation apps/desktop/package.json:19 — `apps/desktop/package.json` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`.
P6 · Release Hygiene · No changelog · ×1
  • No changelog — No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)
R7 · Dead Code · Unused export 'readConfig' · ×1
  • Unused export 'readConfig' apps/desktop/src/config.mjs:47 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'saveConfig' · ×1
  • Unused export 'saveConfig' apps/desktop/src/config.mjs:52 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'shouldOpenSlashPopup' · ×1
  • Unused export 'shouldOpenSlashPopup' web/components/chat/home/ComposerInput.tsx:152 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'WorkspaceFieldGroup' · ×1
  • Unused export 'WorkspaceFieldGroup' web/components/settings/WorkspaceShell.tsx:273 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'formatContextWindowUpdatedAt' · ×1
  • Unused export 'formatContextWindowUpdatedAt' web/components/settings/shared.tsx:89 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'activeModelDetail' · ×1
  • Unused export 'activeModelDetail' web/components/settings/shared.tsx:112 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'labelClass' · ×1
  • Unused export 'labelClass' web/components/settings/shared.tsx:124 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'buildSubscribeSession' · ×1
  • Unused export 'buildSubscribeSession' web/contracts/parse/turn-command.ts:88 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'buildRegenerate' · ×1
  • Unused export 'buildRegenerate' web/contracts/parse/turn-command.ts:129 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'buildUserInput' · ×1
  • Unused export 'buildUserInput' web/contracts/parse/turn-command.ts:160 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'buildCheckActiveTurn' · ×1
  • Unused export 'buildCheckActiveTurn' web/contracts/parse/turn-command.ts:174 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'buildUnsubscribe' · ×1
  • Unused export 'buildUnsubscribe' web/contracts/parse/turn-command.ts:184 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'DayList' · ×1
  • Unused export 'DayList' web/features/calendar/components/ItemDetails.tsx:362 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'addDaysToKey' · ×1
  • Unused export 'addDaysToKey' web/features/calendar/model/dates.ts:44 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'isSameDay' · ×1
  • Unused export 'isSameDay' web/features/calendar/model/dates.ts:63 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'snapMinutes' · ×1
  • Unused export 'snapMinutes' web/features/calendar/model/dates.ts:119 — Nothing imports this binding — it is safe to review for removal.
R8 · Dependency Hygiene · Test-only dependency 'jspdf' in production deps · ×1
  • Test-only dependency 'jspdf' in production deps REDACTED:50 — Only test files import it (first: web/tests/e2e/pdf-reading-resize.audit.ts:4) — move it to devDependencies.
X2 · Cancellation propagation · Not all async functions that make a request accept an AbortSignal · ×1
  • Not all async functions that make a request accept an AbortSignal — Only 10/15 async functions that make a cancellable request (fetch, axios, ky, ofetch, got, undici, node:http) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
X5 · Nullable reference types · Null assertions (`!`) reduce the strict null checking score · ×1
  • Null assertions (`!`) reduce the strict null checking score — ~0.4 `!` null assertions per 1k TypeScript source lines — 102 assertion(s) across the 229829 source line(s) of the 1056 TypeScript file(s) read, which is the only code the operator asserts anything in (a `!` in a `.js` file is not this operator and was not counted, and one in a file whose null checking is off silences nothing). Densest: web/lib/memory-graph.ts (6), web/features/calendar/components/MonthView.tsx (5), web/features/calendar/components/TimeGrid.tsx (5). Each one tells the compiler to trust the author about null, suppressing the very diagnostic `strictNullChecks` exists to produce.

Appendix B — Reproduction & audit trail

Every external tool invocation behind a deep-scan dimension — the tool, its captured version, the exact command, how many findings it yielded, and a link to the retained raw output. To reproduce any finding: check out the same commit and run the command shown (repo-relative — never an absolute scratch path). The complete raw scanner output is retained verbatim under artifacts/raw/ (indexed in artifacts/raw/index.json); per-invocation exit codes and wall-clock durations are in sidecar.json — kept out of this table so the rendered report stays byte-identical across runs of the same commit.

DimensionToolVersionCommandFindingsRaw output
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-002629b643f244868e58ec41a14a5bbb/history.json --exit-code 0 --source .56artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-002629b643f244868e58ec41a14a5bbb/tree.json --exit-code 0 --source .31artifacts/raw/gitleaks-tree.json
D29 · Static Analysis (SAST)semgrep—semgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --config /opt/semgrep-rules/canine-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off --exclude *.arrow --exclude *.avro --exclude *.csv --exclude *.dat --exclude *.db --exclude *.feather --exclude *.geojson --exclude *.h5 --exclude *.hdf5 --exclude *.jsonl --exclude *.log --exclude *.ndjson --exclude *.npy --exclude *.npz --exclude *.orc --exclude *.parquet --exclude *.pickle --exclude *.pkl --exclude *.psv --exclude *.sqlite --exclude *.sqlite3 --exclude *.tfrecord --exclude *.tsv --exclude *.txt --exclude requirements/modules --exclude web/contracts/generated .76artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** . --skip-db-update37artifacts/raw/trivy-fs.json
D31 · IaC & Container Securitytrivy—trivy config --format json --quiet .19artifacts/raw/trivy-config.json
D32 · Data Compliance (PII/GDPR)semgrep—semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that. semgrep could not parse 13 file(s) — `web/app/(workspace)/learning/books/components/BookChatPanel.tsx`, `web/components/chat/MyAgentsPicker.tsx`, `web/components/chat/ReadingReferencePicker.tsx`, `web/components/chat/home/ChatComposer.tsx`, `web/components/chat/home/StandaloneComposer.tsx`, … (+8 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.0—
D37 · Vulnerability-disclosure Policydisclosure—disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.0—
D40 · Network Egress Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.0—
D41 · Kernel & Syscall Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.0—
D42 · Runtime Threat Enforcementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.0—
D43 · Malicious Dependenciestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** . --skip-db-update0artifacts/raw/trivy-fs.json

Run 01a1a292-069e-7040-833b-78486a617dff · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.

Downloadable artifacts

Machine-readable and reproducible from this commit + frozen rubric — drop them straight into a contract appendix, a CRA dossier, or a downstream SCA / VEX tool.

⬇ Findings, MITRE CWE-tagged .sarif⬇ Health changelog .md