Public report of jundot/omlx, published 17 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.4). 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, 17 November 2026, 01:28 UTC · Survey ID cd_1e424c074e8744cda487ce146d127b1b

jundot/omlx

Measured 17 November 2026, 01:26 UTC, at code version bf28cd6

CAI score 38.6out of 100 Weak
CriticalWeakAdequateStrongExemplary
Up 1.4 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: 348,289 lines of product code in 3 projects, tests not counted · Estimated rebuild effort: about 3.8 person-years · Weakest lens: Code Health, 23.9

Findings by how serious they are

77 critical 2641 serious 162 minor

16 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
17 November 2026, 01:26 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.

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 ▸

78of 78 dimensions measured by tools.
2867of 2880 findings point to an exact file and line, so you can open each one in the code. The other 13 concern the repository as a whole, such as missing documentation.
78dimensions across 8 lenses, read from 348,289 lines of product code in 3 projects.
Chapters

Executive summary

jundot/omlx falls short of our standard for a preview release, held back most by its Code Health lens, the quality of the code itself. It scores 38.6 out of 100 and is rated Weak, and nine of its 77 critical findings are security problems.

Code Health, at 23.9, is the weakest lens and counts most in the score. The best first step for the work it takes is fixing the password or key in the code, worth about 4.0 points. Adding type checking would lift Code Health itself, worth about 4.1 points. Raising Code Health to 67 would lift the score to about 49.6.

Two pipeline steps install packages that can change without warning. One automatic update takes new releases before a bad one can be spotted, and twenty-six controls can't be used without a mouse. Pinning what the pipeline installs, setting a waiting period for automatic updates and making the controls work with a keyboard would close these risks. Passing outside input through environment variables would fix the pipeline step that puts outside input straight into a shell command, and fixing the weaknesses the scanner points to would deal with the security weakness in the code. The 17 labels or groups of fields with no name need connecting to their fields or naming.

The product code is 348,289 lines, about €550,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.
Code Health 23.9 · counts for 45%Production Readiness 38.2 · counts for 25%Accessibility 43.0 · counts for 14%Maturity 70.3 · counts for 8%Security and Compliance 72.0 · counts for 4%Architecture 91.4 · counts for 2%Domain Modelling 100.0 · counts for 1%Performance 100.0 · counts for 1%

If Code Health rose from 23.9 to 67, the lowest score rated Strong, the score would rise from 38.6 to about 49.6.

Code composition: what the lines of code are
Product code 54%Tests 46%
New since the last survey: 458 findings

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

  • Cyclomatic Complexity · IntegrationsScreenVM.save (cyclomatic 57) apps/omlx-mac/Sources/AppView/ViewModels/IntegrationsScreenVM.swift
  • Cyclomatic Complexity · StageServer._run_chunks (cyclomatic 42) apps/omlx-cuda-helper/omlx_cuda_helper/worker.py
  • Cyclomatic Complexity · IntegrationsScreenVM.saveWebSearch (cyclomatic 25) apps/omlx-mac/Sources/AppView/ViewModels/IntegrationsScreenVM.swift
  • Cyclomatic Complexity · fused_batch.advance (cyclomatic 23) omlx/patches/mlx_lm_mtp/fused_batch.py
  • Cyclomatic Complexity · m5_gather_qmm_nax._launch (cyclomatic 20) omlx/patches/m5_gather_qmm_nax.py
  • Cyclomatic Complexity · loader.sanitize_weights (cyclomatic 19) omlx/patches/inkling2/loader.py
  • Cyclomatic Complexity · minimax_m3_vl.read_config (cyclomatic 18) apps/omlx-cuda-helper/omlx_cuda_helper/families/minimax_m3_vl/__init__.py
  • Cyclomatic Complexity · m5_gather_qmm_nax.sorted_gather_qmm_swiglu_oai (cyclomatic 18) omlx/patches/m5_gather_qmm_nax.py
  • Cyclomatic Complexity · agent._fastest_link (cyclomatic 18) REDACTED
  • Cyclomatic Complexity · routes._mtp_compat_for_model (cyclomatic 17) omlx/admin/routes.py
  • Cyclomatic Complexity · turboquant_attention._fused_multirow_mse_attention (cyclomatic 17) omlx/patches/turboquant_attention.py
  • Cyclomatic Complexity · routes._check (cyclomatic 17) omlx/prefill_helper/routes.py
  • Cyclomatic Complexity · ControlServer._handle (cyclomatic 16) apps/omlx-cuda-helper/omlx_cuda_helper/control.py
  • Cyclomatic Complexity · ModelStore.probe (cyclomatic 16) apps/omlx-cuda-helper/omlx_cuda_helper/files.py
  • Cyclomatic Complexity · PerformanceScreenVM.hasPendingChanges (cyclomatic 16) apps/omlx-mac/Sources/AppView/ViewModels/PerformanceScreenVM.swift
  • Cognitive Complexity · StageServer._run_chunks (cognitive 77) apps/omlx-cuda-helper/omlx_cuda_helper/worker.py
  • Cognitive Complexity · IntegrationsScreenVM.save (cognitive 52) apps/omlx-mac/Sources/AppView/ViewModels/IntegrationsScreenVM.swift
  • Cognitive Complexity · fused_batch.advance (cognitive 35) omlx/patches/mlx_lm_mtp/fused_batch.py
  • Cognitive Complexity · IntegrationsScreenVM.saveWebSearch (cognitive 27) apps/omlx-mac/Sources/AppView/ViewModels/IntegrationsScreenVM.swift
  • Cognitive Complexity · agent._fastest_link (cognitive 26) REDACTED
  • Cognitive Complexity · batch_generator._dspark_draft_jobs (cognitive 25) REDACTED
  • Cognitive Complexity · Stage._forward (cognitive 23) apps/omlx-cuda-helper/omlx_cuda_helper/families/deepseek_v41/stage.py
  • Cognitive Complexity · loader.sanitize_weights (cognitive 22) omlx/patches/inkling2/loader.py
  • Cognitive Complexity · kernels._pointwise_check (cognitive 20) apps/omlx-cuda-helper/omlx_cuda_helper/families/deepseek_v41/kernels.py
  • Cognitive Complexity · Stage.load_prefix (cognitive 20) apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen4_exp/stage.py
  • Cognitive Complexity · ModelStore.probe (cognitive 20) apps/omlx-cuda-helper/omlx_cuda_helper/files.py
  • Cognitive Complexity · m5_gather_qmm_nax.sorted_gather_qmm_swiglu_oai (cognitive 19) omlx/patches/m5_gather_qmm_nax.py
  • Cognitive Complexity · routes._check (cognitive 19) omlx/prefill_helper/routes.py
  • Cognitive Complexity · dashboard.dashboard.prefillHelperStatusText (cognitive 19) REDACTED
  • Cognitive Complexity · minimax_m3_vl.read_config (cognitive 18) apps/omlx-cuda-helper/omlx_cuda_helper/families/minimax_m3_vl/__init__.py
  • Cognitive Complexity · oq._copy_model_sidecars (cognitive 18) REDACTED
  • Cognitive Complexity · kernels._masked_attention (cognitive 18) omlx/patches/inkling2/kernels.py
  • Cognitive Complexity · Config.validate (cognitive 17) apps/omlx-cuda-helper/omlx_cuda_helper/families/deepseek_v41/config.py
  • Cognitive Complexity · OQImatrixCollector.collect_switch (cognitive 17) REDACTED
  • Cognitive Complexity · Inkling2Processor.__call__ (cognitive 17) omlx/patches/inkling2/processing.py
  • Cognitive Complexity · qwen3_5._run_layers (cognitive 17) omlx/prefill_helper/adapters/qwen3_5.py
  • Cognitive Complexity · agent.resolve_target (cognitive 17) REDACTED
  • Cognitive Complexity · Scheduler._forward_helper_chunk (cognitive 17) omlx/scheduler.py
  • Cognitive Complexity · ControlServer._handle (cognitive 16) apps/omlx-cuda-helper/omlx_cuda_helper/control.py
  • Cognitive Complexity · Stage.load_prefix (cognitive 16) apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen3_5/stage.py
  • Cognitive Complexity · Attention.__call__ (cognitive 16) apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen4_exp/attention.py
  • Cognitive Complexity · supervisor.plan_stages (cognitive 16) apps/omlx-cuda-helper/omlx_cuda_helper/supervisor.py
  • Cognitive Complexity · StageServer._accept_job (cognitive 16) apps/omlx-cuda-helper/omlx_cuda_helper/worker.py
  • Cognitive Complexity · tool_calling._copy_schema_with_template_defaults (cognitive 16) omlx/api/tool_calling.py
  • Cognitive Complexity · oq._temporary_quantize_block (cognitive 16) REDACTED
  • Cognitive Complexity · Inkling2Layer.__call__ (cognitive 16) omlx/patches/inkling2/model.py
  • God Classes · FileTooLong: deepseek_v41/kernels.py apps/omlx-cuda-helper/omlx_cuda_helper/families/deepseek_v41/kernels.py
  • God Classes · FileTooLong: qwen4_exp/kernels.py apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen4_exp/kernels.py
  • God Classes · FileTooLong: Screens/IntegrationsScreen.swift apps/omlx-mac/Sources/AppView/Screens/IntegrationsScreen.swift
  • God Classes · FileTooLong: inkling2/model.py omlx/patches/inkling2/model.py
  • God Classes · FunctionTooLong: theme_preview.drawCard apps/omlx-web/omlx_web/static/js/theme_preview.js
  • God Classes · FileTooLong: glm5_next/model.py apps/omlx-cuda-helper/omlx_cuda_helper/families/glm5_next/model.py
  • God Classes · ClassTooLong: IntegrationsScreenVM apps/omlx-mac/Sources/AppView/ViewModels/IntegrationsScreenVM.swift
  • God Classes · FileTooLong: inkling2/layers.py apps/omlx-cuda-helper/omlx_cuda_helper/families/inkling2/layers.py
  • God Classes · FileTooLong: minimax_m3_vl/stage.py apps/omlx-cuda-helper/omlx_cuda_helper/families/minimax_m3_vl/stage.py
  • God Classes · FileTooLong: inkling2/kernels.py apps/omlx-cuda-helper/omlx_cuda_helper/families/inkling2/kernels.py
  • God Classes · FileTooLong: AppView/AppView.swift apps/omlx-mac/Sources/AppView/AppView.swift
  • God Classes · MethodTooLong: IntegrationsScreenVM.save apps/omlx-mac/Sources/AppView/ViewModels/IntegrationsScreenVM.swift
  • God Classes · MethodTooLong: WebSearchSection.body apps/omlx-mac/Sources/AppView/Screens/IntegrationsScreen.swift
  • God Classes · FileTooLong: deepseek_v41/layers.py apps/omlx-cuda-helper/omlx_cuda_helper/families/deepseek_v41/layers.py
  • God Classes · FileTooLong: omlx_cuda_helper/worker.py apps/omlx-cuda-helper/omlx_cuda_helper/worker.py
  • Code Duplication · Edited copy of a member (14 corresponding lines) apps/omlx-mac/Sources/Updater/AppUpdater.swift
  • Code Duplication · Edited copy of a member (14 corresponding lines) apps/omlx-mac/Sources/AppView/ViewModels/ModelSettingsScreenVM.swift
  • Code Duplication · Members sharing a duplicated core (7 members, 50+ identical tokens) omlx/cluster/enrollment.py
  • Code Duplication · Members sharing a duplicated core (6 members, 50+ identical tokens) apps/omlx-mac/Sources/AppView/Screens/AccuracyBenchScreen.swift
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) REDACTED
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) REDACTED
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) apps/omlx-mac/Sources/AppView/ViewModels/IntegrationsScreenVM.swift
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) apps/omlx-mac/Sources/AppView/ViewModels/IntegrationsScreenVM.swift
  • Code Duplication · Edited copy of a member (162 corresponding lines) omlx/patches/mlx_vlm_mtp/qwen35_moe_vlm_runtime.py
  • Code Duplication · Edited copy of a member (105 corresponding lines) omlx/patches/qwen35_ane_prefill.py
  • Code Duplication · Edited copy of a member (43 corresponding lines) apps/omlx-cuda-helper/omlx_cuda_helper/families/inkling2/layers.py
  • Code Duplication · Edited copy of a member (156 corresponding lines) omlx/cache/paged_ssd_cache.py
  • Code Duplication · Edited copy of a member (78 corresponding lines) omlx/cache/boundary_snapshot_store.py
  • Code Duplication · Edited copy of a member (68 corresponding lines) apps/omlx-mac/Sources/AppView/Screens/QuantizationScreen.swift
  • Code Duplication · Edited copies of one member (3 members, 64+ corresponding lines) omlx/patches/mlx_lm_mtp/qwen35_model.py
  • Code Duplication · Edited copy of a member (73 corresponding lines) omlx/engine/distributed.py
  • Code Duplication · Edited copy of a member (123 corresponding lines) omlx/engine/tts.py
  • Code Duplication · Edited copy of a member (83 corresponding lines) omlx/cluster/collective.py
  • Code Duplication · Edited copy of a member (51 corresponding lines) apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen3_5/stage.py
  • Code Duplication · Edited copy of a member (33 corresponding lines) apps/omlx-cuda-helper/omlx_cuda_helper/families/deepseek_v41/ngram.py
  • Code Duplication · Edited copy of a member (96 corresponding lines) omlx/admin/routes.py
  • Code Duplication · Edited copy of a member (58 corresponding lines) omlx/patches/bailing_hybrid/bailing_hybrid_model.py
  • Code Duplication · Edited copy of a member (99 corresponding lines) REDACTED
  • Code Duplication · Edited copy of a member (63 corresponding lines) omlx/patches/qwen35_ane_prefill.py
  • Code Duplication · Edited copies of one member (3 members, 40+ corresponding lines) omlx/patches/deepseek_v4/deepseek_v4_model.py
  • Code Duplication · Edited copy of a member (67 corresponding lines) omlx/patches/qwen35_ane_prefill.py
  • Code Duplication · Edited copy of a member (22 corresponding lines) apps/omlx-cuda-helper/omlx_cuda_helper/families/deepseek_v41/ngram.py
  • Code Duplication · Edited copy of a member (63 corresponding lines) omlx/engine_pool.py
  • Code Duplication · Edited copy of a member (24 corresponding lines) apps/omlx-cuda-helper/omlx_cuda_helper/families/deepseek_v41/ops.py
  • Code Duplication · Edited copy of a member (72 corresponding lines) omlx/api/markitdown.py
  • Code Duplication · Edited copy of a member (55 corresponding lines) omlx/patches/glm_moe_dsa/deepseek_v32.py
  • Code Duplication · Edited copy of a member (51 corresponding lines) omlx/patches/deepseek_v4/moe_offload.py
  • Code Duplication · Edited copy of a member (79 corresponding lines) omlx/engine/vlm.py
  • Code Duplication · Edited copy of a member (48 corresponding lines) omlx/admin/routes.py
  • Code Duplication · Edited copy of a member (35 corresponding lines) omlx/patches/qwen35_verify_sdpa_split.py
  • Code Duplication · Edited copy of a member (44 corresponding lines) omlx/scheduler.py
  • Code Duplication · Edited copy of a member (35 corresponding lines) omlx/patches/k2_horizon/k2_horizon_model.py
  • Code Duplication · Edited copy of a member (14 corresponding lines) apps/omlx-cuda-helper/omlx_cuda_helper/families/deepseek_v41/kernels.py
  • Code Duplication · Edited copy of a member (24 corresponding lines) omlx/utils/nax_attention.py

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: 863 findings

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

  • Cognitive Complexity · repack_ternary_t5.repack_model (cognitive 22) scripts/repack_ternary_t5.py
  • Cognitive Complexity · LibrarySection.body (cognitive 22) apps/omlx-mac/Sources/AppView/Screens/ModelsScreen.swift
  • Cognitive Complexity · repack_ternary_t5.repack_shard (cognitive 20) scripts/repack_ternary_t5.py
  • Cognitive Complexity · clone_mlx_model_fp16.clone_model (cognitive 16) scripts/clone_mlx_model_fp16.py
  • Cognitive Complexity · repack_ternary_t5.verify_models (cognitive 16) scripts/repack_ternary_t5.py
  • God Classes · MethodTooLong: LibrarySection.body apps/omlx-mac/Sources/AppView/Screens/ModelsScreen.swift
  • Code Duplication · Near-duplicate member family (3 members, 18 shared lines) apps/omlx-mac/Sources/AppView/ViewModels/ModelSettingsScreenVM.swift
  • Code Duplication · Near-duplicate member pair (73 shared lines) apps/omlx-mac/Sources/AppView/Screens/ContextBenchScreen.swift
  • Code Duplication · Edited copy of a member (14 corresponding lines) apps/omlx-mac/Sources/AppView/ViewModels/ModelSettingsScreenVM.swift
  • Code Duplication · Members sharing a duplicated core (10 members, 50+ identical tokens) apps/omlx-mac/Sources/AppView/Screens/IntegrationsScreen.swift
  • Code Duplication · Members sharing a duplicated core (7 members, 50+ identical tokens) omlx/cluster/enrollment.py
  • Code Duplication · Members sharing a duplicated core (7 members, 50+ identical tokens) apps/omlx-mac/Sources/AppView/Screens/AccuracyBenchScreen.swift
  • Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) REDACTED
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) omlx/cluster/incidents.py
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) REDACTED
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) apps/omlx-mac/Sources/AppView/Screens/AccuracyBenchScreen.swift
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) apps/omlx-mac/Sources/AppView/Screens/AskAIScreen.swift
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) apps/omlx-mac/Sources/AppView/ViewModels/IntegrationsScreenVM.swift
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) apps/omlx-mac/Sources/AppView/ViewModels/IntegrationsScreenVM.swift
  • Code Duplication · Duplicated block (24–25 lines × 2) REDACTED
  • Code Duplication · Duplicated block (18–25 lines × 2) omlx/patches/qwen35_verify_qmm.py
  • Code Duplication · Duplicated block (20–21 lines × 2) omlx/admin/routes.py
  • Code Duplication · Duplicated block (21 lines × 2) omlx/cluster/minimax_decode_smoke_worker.py
  • Code Duplication · Duplicated block (17–20 lines × 2) REDACTED
  • Code Duplication · Duplicated block (20 lines × 2) omlx/eval/humaneval.py
  • Code Duplication · Duplicated block (18–19 lines × 3) omlx/patches/deepseek_v4/deepseek_v4_model.py
  • Code Duplication · Duplicated block (16–18 lines × 2) omlx/eval/hellaswag.py
  • Code Duplication · Duplicated block (16 lines × 2) omlx/patches/m5_gather_qmm_nax.py
  • Code Duplication · Duplicated block (15 lines × 2) omlx/cluster/transport.py
  • Code Duplication · Duplicated block (15 lines × 2) omlx/engine/distributed.py
  • Code Duplication · Duplicated block (13 lines × 3) REDACTED
  • Code Duplication · Duplicated block (10–12 lines × 3) omlx/cluster/incidents.py
  • Code Duplication · Duplicated block (10 lines × 2) omlx/cluster/identity.py
  • Code Duplication · Duplicated block (8–10 lines × 2) omlx/patches/deepseek_v4/moe_offload.py
  • Code Duplication · Duplicated block (9 lines × 2) omlx/cluster/ssh_keys.py
  • Code Duplication · Duplicated block (8–9 lines × 2) REDACTED
  • Code Duplication · Duplicated block (9 lines × 2) omlx/patches/glm_moe_dsa/deepseek_v32.py
  • Code Duplication · Duplicated block (8 lines × 2) omlx/model_discovery.py
  • Code Duplication · Duplicated block (4–7 lines × 3) omlx/patches/glm_moe_dsa/deepseek_v32.py
  • Code Duplication · Duplicated block (6 lines × 3) REDACTED
  • Code Duplication · Duplicated block (6 lines × 2) REDACTED
  • Code Duplication · Duplicated block (5 lines × 3) omlx/patches/bailing_hybrid/bailing_hybrid_model.py
  • Code Duplication · Duplicated block (5 lines × 2) omlx/patches/turboquant_attention.py
  • Code Duplication · Duplicated block (8 lines × 2) omlx/integrations/codex.py
  • Code Duplication · Duplicated block (5 lines × 2) omlx/prefill_helper/adapters/minimax_m3.py
  • Code Duplication · Duplicated block (35 lines × 2) apps/omlx-mac/Sources/AppView/Screens/ContextBenchScreen.swift
  • Code Duplication · Duplicated block (19–20 lines × 2) apps/omlx-mac/Sources/AppView/Screens/AccuracyBenchScreen.swift
  • Code Duplication · Duplicated block (18–19 lines × 2) apps/omlx-mac/Sources/AppView/Screens/ServerScreen.swift
  • Code Duplication · Duplicated block (16–18 lines × 2) apps/omlx-mac/Sources/AppView/Screens/AppearanceScreen.swift
  • Code Duplication · Duplicated block (7–18 lines × 2) apps/omlx-mac/Sources/AppView/Screens/AskAIScreen.swift
  • Code Duplication · Duplicated block (18 lines × 2) apps/omlx-mac/Sources/AppView/Screens/QuantizationScreen.swift
  • Code Duplication · Duplicated block (18 lines × 2) apps/omlx-mac/Sources/AppView/Screens/QuantizationScreen.swift
  • Code Duplication · Duplicated block (11–16 lines × 4) apps/omlx-mac/Sources/AppView/Screens/AppearanceScreen.swift
  • Code Duplication · Duplicated block (8–15 lines × 18) apps/omlx-mac/Sources/AppView/Screens/AppearanceScreen.swift
  • Code Duplication · Duplicated block (15 lines × 3) apps/omlx-mac/Sources/AppView/Screens/AccuracyBenchScreen.swift
  • Code Duplication · Duplicated block (10–15 lines × 3) apps/omlx-mac/Sources/AppView/Screens/AppearanceScreen.swift
  • Code Duplication · Duplicated block (15 lines × 3) apps/omlx-mac/Sources/AppView/Screens/DownloadsScreen.swift
  • Code Duplication · Duplicated block (14 lines × 2) apps/omlx-mac/Sources/AppView/Screens/ContextBenchScreen.swift
  • Code Duplication · Duplicated block (11–14 lines × 2) apps/omlx-mac/Sources/AppView/Screens/DownloadsScreen.swift
  • Code Duplication · Duplicated block (13–14 lines × 2) apps/omlx-mac/Sources/AppView/Screens/NetworkScreen.swift
  • Code Duplication · Duplicated block (12–13 lines × 9) apps/omlx-mac/Sources/AppView/Screens/IntegrationsScreen.swift
  • Code Duplication · Duplicated block (13 lines × 4) apps/omlx-mac/Sources/AppView/Screens/AccuracyBenchScreen.swift
  • Code Duplication · Duplicated block (13 lines × 3) apps/omlx-mac/Sources/AppView/Screens/AskAIScreen.swift
  • Code Duplication · Duplicated block (8–13 lines × 3) apps/omlx-mac/Sources/AppView/Screens/ModelSettingsScreen.swift
  • Code Duplication · Duplicated block (13 lines × 2) apps/omlx-mac/Sources/AppView/Screens/AskAIScreen.swift
  • Code Duplication · Duplicated block (9–12 lines × 10) apps/omlx-mac/Sources/AppView/Screens/IntegrationsScreen.swift
  • Code Duplication · Duplicated block (12 lines × 3) apps/omlx-mac/Sources/AppView/Screens/AccuracyBenchScreen.swift
  • Code Duplication · Duplicated block (12 lines × 2) apps/omlx-mac/Sources/AppView/AppView.swift
  • Code Duplication · Duplicated block (12 lines × 2) apps/omlx-mac/Sources/AppView/Screens/ModelsScreen.swift
  • Code Duplication · Duplicated block (12 lines × 2) apps/omlx-mac/Sources/AppView/Screens/ModelsScreen.swift
  • Code Duplication · Duplicated block (12 lines × 2) apps/omlx-mac/Sources/AppView/Screens/QuantizationScreen.swift
  • Code Duplication · Duplicated block (7–12 lines × 2) apps/omlx-mac/Sources/Updater/AppUpdater.swift
  • Code Duplication · Duplicated block (12 lines × 2) apps/omlx-mac/Sources/Welcome/WelcomeWindow.swift
  • Code Duplication · Duplicated block (11 lines × 5) apps/omlx-mac/Sources/AppView/Screens/AppearanceScreen.swift
  • Code Duplication · Duplicated block (9–11 lines × 2) apps/omlx-mac/Sources/AppView/Screens/AskAIScreen.swift
  • Code Duplication · Duplicated block (10–11 lines × 2) apps/omlx-mac/Sources/AppView/Screens/IntegrationsScreen.swift
  • Code Duplication · Duplicated block (10 lines × 13) apps/omlx-mac/Sources/AppView/Screens/AppearanceScreen.swift
  • Code Duplication · Duplicated block (10 lines × 9) apps/omlx-mac/Sources/AppView/Screens/ModelSettingsScreen.swift
  • Code Duplication · Duplicated block (10 lines × 4) apps/omlx-mac/Sources/AppView/Screens/NetworkScreen.swift
  • Code Duplication · Duplicated block (10 lines × 3) apps/omlx-mac/Sources/AppView/Screens/AppearanceScreen.swift
  • Code Duplication · Duplicated block (10 lines × 2) apps/omlx-mac/Sources/AppView/Screens/AskAIScreen.swift
  • Code Duplication · Duplicated block (10 lines × 2) apps/omlx-mac/Sources/AppView/Screens/ContextBenchScreen.swift
  • Code Duplication · Duplicated block (10 lines × 2) apps/omlx-mac/Sources/AppView/Screens/IntegrationsScreen.swift
  • Code Duplication · Duplicated block (9–10 lines × 2) apps/omlx-mac/Sources/AppView/Screens/PerformanceScreen.swift
  • Code Duplication · Duplicated block (10 lines × 2) apps/omlx-mac/Sources/AppView/Screens/SecurityScreen.swift
  • Code Duplication · Duplicated block (8–9 lines × 6) apps/omlx-mac/Sources/AppView/Screens/AskAIScreen.swift
  • Code Duplication · Duplicated block (9 lines × 4) apps/omlx-mac/Sources/AppView/Screens/IntegrationsScreen.swift
  • Code Duplication · Duplicated block (8–9 lines × 4) apps/omlx-mac/Sources/AppView/Screens/AboutScreen.swift
  • Code Duplication · Duplicated block (9 lines × 2) apps/omlx-mac/Sources/AppView/Screens/AskAIScreen.swift
  • Code Duplication · Duplicated block (9 lines × 2) apps/omlx-mac/Sources/AppView/Screens/AskAIScreen.swift
  • Code Duplication · Duplicated block (9 lines × 2) apps/omlx-mac/Sources/AppView/Screens/AskAIScreen.swift
  • Code Duplication · Duplicated block (9 lines × 2) apps/omlx-mac/Sources/AppView/Screens/PerformanceScreen.swift
  • Code Duplication · Duplicated block (9 lines × 2) apps/omlx-mac/Sources/AppView/Screens/StatusScreen.swift
  • Code Duplication · Duplicated block (9 lines × 2) apps/omlx-mac/Sources/AskAI/AskAIPanelView.swift
  • Code Duplication · Duplicated block (8 lines × 10) apps/omlx-mac/Sources/AppView/Screens/AppearanceScreen.swift
  • Code Duplication · Duplicated block (8 lines × 5) apps/omlx-mac/Sources/AppView/Screens/IntegrationsScreen.swift
  • Code Duplication · Duplicated block (8 lines × 5) apps/omlx-mac/Sources/AppView/ViewModels/ModelSettingsScreenVM.swift
  • Code Duplication · Duplicated block (8 lines × 3) apps/omlx-mac/Sources/AppView/Screens/AccuracyBenchScreen.swift
  • Code Duplication · Duplicated block (8 lines × 2) apps/omlx-mac/Sources/AppView/Screens/AccuracyBenchScreen.swift
  • Code Duplication · Duplicated block (8 lines × 2) apps/omlx-mac/Sources/AppView/Screens/DownloadsScreen.swift
Rebuild cost: about €550,000 · Estimate
Cost to rebuild€180,000 to €920,000, for 3,044 to 9,656 hours of work, about 3.8 person-years for 2 to 8 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 39. 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: 348,289 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 Leaked secret finding(s) in Secret Scanning — start with REDACTED.
Raises the score by about 4.0 points · Low effort · Secret Scanning
2
Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up.
Raises the score by about 4.1 points · Medium effort · Type Safety
3
Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
Raises the score by about 4.1 points · Medium effort · Large Files

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 €550,000 to build again, about 3.8 person-years of work. Its weakest lens is Code Health, at 23.9 (Critical). Code Health is about how easy the code is to read and change safely, and code that is hard to read is slow and risky to change, so every future change costs more than it should. Because the weakest lens counts most in the score, work on Code Health also moves the score most.
Based on: the rebuild estimate · the Code Health grade · how much each lens counts
What to do: Start with the Code Health actions in Top priorities.
If you do one thing first · First action
Resolve the 1 Leaked secret finding(s) in Secret Scanning. Of all the actions in this report, it raises the score most for the work it takes: about 4.0 points for low effort, because it clears the 1 Secret Scanning 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.4 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 6% to 14% on every change. The history of the code shows how much it changes: about 510,203 lines over the last 90 days, which is about 2,069,157 lines a year. At that pace, the extra work comes to an estimated 332.2 to 1993 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.

447 modules, with 324 dependencies between them. 3 loops run through 6 of the modules, marked above the diagonal.

The table shows the 40 modules with the most connections; 407 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 apps.omlx-cuda-helper.omlx_cuda_helper.families.deepseek_v41.config2 apps.omlx-cuda-helper.omlx_cuda_helper.families.inkling23 apps.omlx-cuda-helper.omlx_cuda_helper.families.minimax_m3_vl4 apps.omlx-cuda-helper.omlx_cuda_helper.state5 omlx.admin6 omlx.api.anthropic_models7 omlx.api.openai_models8 omlx.cache.stats9 omlx.cache.type_handlers10 omlx.cluster.deployment11 omlx.cluster.rdma12 omlx.engine.base13 omlx.engine.realtime_voice14 omlx.eval.base15 omlx.integrations.base16 omlx.patches.deepseek_v41_mlx_lm.model17 omlx.patches.mlx_vlm_inkling_compat.vendor.mlx_vlm.models.inkling.config18 omlx.patches.mlx_vlm_minimax_m3_compat.vendor.mlx_vlm.models.minimax_m3_vl.config19 omlx.patches.moe_expert_offload20 omlx.prefill_helper.adapter21 omlx.request22 apps.omlx-cuda-helper.omlx_cuda_helper.families23 apps~omlx-mac~Updater24 omlx.api25 omlx.cache.interface26 omlx.cluster27 omlx.engine.distributed28 omlx.engine_pool29 omlx.patches30 omlx.prefill_helper31 omlx.specprefill32 apps~omlx-mac~Net33 apps~omlx-mac~Theme34 omlx35 apps~omlx-mac~AskAI36 apps~omlx-mac~Server37 apps~omlx-mac~AppView38 apps~omlx-mac~Menubar39 apps~omlx-mac~Welcome40 apps~omlx-mac~App
1 apps.omlx-cuda-helper.omlx_cuda_helper.families.deepseek_v41.config
2 apps.omlx-cuda-helper.omlx_cuda_helper.families.inkling2
3 apps.omlx-cuda-helper.omlx_cuda_helper.families.minimax_m3_vl
4 apps.omlx-cuda-helper.omlx_cuda_helper.state
5 omlx.admin
6 omlx.api.anthropic_models
7 omlx.api.openai_models
8 omlx.cache.stats
9 omlx.cache.type_handlers
10 omlx.cluster.deployment
11 omlx.cluster.rdma
12 omlx.engine.base
13 omlx.engine.realtime_voice
14 omlx.eval.base
15 omlx.integrations.base
16 omlx.patches.deepseek_v41_mlx_lm.model
17 omlx.patches.mlx_vlm_inkling_compat.vendor.mlx_vlm.models.inkling.config
18 omlx.patches.mlx_vlm_minimax_m3_compat.vendor.mlx_vlm.models.minimax_m3_vl.config
19 omlx.patches.moe_expert_offload
20 omlx.prefill_helper.adapter
21 omlx.request
22 apps.omlx-cuda-helper.omlx_cuda_helper.families11
23 apps~omlx-mac~Updater4
24 omlx.api261
25 omlx.cache.interface1
26 omlx.cluster3
27 omlx.engine.distributed11
28 omlx.engine_pool1
29 omlx.patches2
30 omlx.prefill_helper2
31 omlx.specprefill2
32 apps~omlx-mac~Net116
33 apps~omlx-mac~Theme17
34 omlx282211
35 apps~omlx-mac~AskAI594182
36 apps~omlx-mac~Server103
37 apps~omlx-mac~AppView163153193202
38 apps~omlx-mac~Menubar284222
39 apps~omlx-mac~Welcome511522
40 apps~omlx-mac~App114111
Uses a module listed above itPart of a loopThe module itself
1 apps.omlx-cuda-helper.omlx_cuda_helper.families.deepseek_v41.config2 apps.omlx-cuda-helper.omlx_cuda_helper.families.inkling23 apps.omlx-cuda-helper.omlx_cuda_helper.families.minimax_m3_vl4 apps.omlx-cuda-helper.omlx_cuda_helper.state5 omlx.admin6 omlx.api.anthropic_models7 omlx.api.openai_models8 omlx.cache.stats9 omlx.cache.type_handlers10 omlx.cluster.deployment11 omlx.cluster.rdma12 omlx.engine.base13 omlx.engine.realtime_voice14 omlx.eval.base15 omlx.integrations.base16 omlx.patches.deepseek_v41_mlx_lm.model17 omlx.patches.mlx_vlm_inkling_compat.vendor.mlx_vlm.models.inkling.config18 omlx.patches.mlx_vlm_minimax_m3_compat.vendor.mlx_vlm.models.minimax_m3_vl.config19 omlx.patches.moe_expert_offload20 omlx.prefill_helper.adapter21 omlx.request22 apps.omlx-cuda-helper.omlx_cuda_helper.families23 apps~omlx-mac~Updater24 omlx.api25 omlx.cache.interface26 omlx.cluster27 omlx.engine.distributed28 omlx.engine_pool29 omlx.patches30 omlx.prefill_helper31 omlx.specprefill32 apps~omlx-mac~Net33 apps~omlx-mac~Theme34 omlx35 apps~omlx-mac~AskAI36 apps~omlx-mac~Server37 apps~omlx-mac~AppView38 apps~omlx-mac~Menubar39 apps~omlx-mac~Welcome40 apps~omlx-mac~Appapps.omlx-cuda-helper.omlx_cuda_helper.families.deepseek_v41.config1apps.omlx-cuda-helper.omlx_cuda_helper.families.inkling22apps.omlx-cuda-helper.omlx_cuda_helper.families.minimax_m3_vl3apps.omlx-cuda-helper.omlx_cuda_helper.state4omlx.admin5omlx.api.anthropic_models6omlx.api.openai_models7omlx.cache.stats8omlx.cache.type_handlers9omlx.cluster.deployment10omlx.cluster.rdma11omlx.engine.base12omlx.engine.realtime_voice13omlx.eval.base14omlx.integrations.base15omlx.patches.deepseek_v41_mlx_lm.model16omlx.patches.mlx_vlm_inkling_compat.vendor.mlx_vlm.models.inkling.config17omlx.patches.mlx_vlm_minimax_m3_compat.vendor.mlx_vlm.models.minimax_m3_vl.config18omlx.patches.moe_expert_offload19omlx.prefill_helper.adapter20omlx.request21apps.omlx-cuda-helper.omlx_cuda_helper.families22apps~omlx-mac~Updater23omlx.api24omlx.cache.interface25omlx.cluster26omlx.engine.distributed27omlx.engine_pool28omlx.patches29omlx.prefill_helper30omlx.specprefill31apps~omlx-mac~Net32apps~omlx-mac~Theme33omlx34apps~omlx-mac~AskAI35apps~omlx-mac~Server36apps~omlx-mac~AppView37apps~omlx-mac~Menubar38apps~omlx-mac~Welcome39apps~omlx-mac~App401142611311122211617282211594182103163153193202284222511522114111+407 more modules (most-connected shown)

At a glance — Code Health · 23.9 · Weak · gated by D1, D2, R1, R3, X5 ·

At a glance — Architecture · 91.4 · Adequate · gated by D26 ·

At a glance — Maturity · 70.3 · Adequate · gated by M2 ·

At a glance — Readiness · 38.2 · Weak · gated by D12, P3, P7 ·

At a glance — Security · 72.0 · Adequate · gated by D29 ·

At a glance — Domain Modelling · 100.0 · Exemplary ·

At a glance — Accessibility · 43.0 · Weak · gated by AC2, AC4 ·

At a glance — Performance · 100.0 · Exemplary ·

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 — Injection55High / Critical
A02:2025 — Security Misconfiguration6High / Critical
A03:2025 — Software Supply Chain Failures3Medium
A07:2025 — Authentication Failures1High / Critical

Roadmap

Top priorities: Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up; Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package; Resolve the 1 Leaked secret finding(s) in Secret Scanning — start with REDACTED.

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

Do thisHelpsEffortDimension
Resolve the 1 Leaked secret finding(s) in Secret Scanning — start with REDACTED.+4.0 ptsLowSecret Scanning
Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up.+4.1 ptsMediumType Safety
Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.+4.1 ptsMediumLarge Files
Bring the 92 bodies over 60 down to 60 or less in Cognitive Complexity — start with BlockAwarePrefixCache.reconstruct_cache (cognitive 653), routes.update_global_settings (cognitive 479), chat.html.chatApp (cognitive 459).+2.7 ptsHighCognitive Complexity
Adopt a checker and raise it file by file: with Sorbet, `srb init` (or `bundle exec tapioca init`) commits `sorbet/config`, then move each file's sigil from `# typed: false` to `# typed: true` and on to `strict` as its methods get `sig`s — `spoom bump` does the moving; with Steep, write RBS signatures and `check` the product directories in the `Steepfile` under `D::Ruby.default` or `strict`, not `lenient`. Then pay down the assertions rather than adding to them: each `T.must` is a nil the checker could not rule out — narrow it (`return unless x`, `x&.`, `if (y = x)`), make the attribute non-nilable and set it in `initialize`, or change the method so the nil cannot arrive.+2.3 ptsMediumNullable reference types
Resolve the 1 No ADRs found finding(s) in ADR Quality — start with REDACTED.+1.1 ptsLowADR Quality
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.+2.0 ptsMediumKeyboard semantics
Resolve the 122 FileTooLong finding(s) in God Classes — start with kernels.py (3), routes.py (2), deepseek_v4_model.py (2).+1.5 ptsHighGod Classes

File quality

Per-file score 0–10 — a quality signature. Of 361 files carrying findings, judged against the Preview bar: 0% slop · 8% mixed · 92% near-clean.

FileScoreBandWorst signal
REDACTED2.6SlopIaC & Container Security: High IaC: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.2MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.2MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.3MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.9MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.9MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.9MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED5.3MixedStatic Analysis (SAST): Medium: REDACTED
apps/omlx-mac/Sources/AppView/Screens/PerformanceScreen.swift5.5MixedChange Coupling: Boundary-crossing change coupling: PerformanceScreen.swift ↔ routes.py
omlx/patches/mlx_lm_mtp/qwen35_model.py5.5MixedGod Classes: FileTooLong: mlx_lm_mtp/qwen35_model.py
omlx/patches/inkling2/model.py5.6MixedCognitive Complexity: Inkling2Layer.__call__ (cognitive 16)
omlx/patches/mlx_vlm_mtp/qwen35_moe_vlm_model.py5.7MixedCode Duplication: Duplicated block (27–28 lines × 2)
REDACTED5.8MixedCyclomatic Complexity: cli.launch_command (cyclomatic 54)

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 — 77

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 — 2641

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 — 162

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

Could not be resolved — 16

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 78 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 — 78 dimensions across the health lenses
D1D2D3D4D5D6D10D11D12D13D14D15D16D17D19D20D24D26D27D28D29D31D34D35D36D37D44AC1AC2AC3AC4AC5AC6AX10AX2AX3AX4AX6AX9DM6M1M2M3M4P1P10P2P3P4P6P7PF3R1R10R2R3R4R7R9X1X12X13X14X15X17X19X2X21X23X24X25X26X27X28X3X30X4X5

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, 2867 of 2880 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 01a1e71c-af60-7036-9e30-aa7d89767b55.

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: the Python half could not be measured — the pytest suite ran, but the analyzer could not read its coverage for repository root, so a figure over the rest would be a part of the suite. Coverage is excluded from the score rather than counted as a near-zero. This is OUR limitation, not a defect in the repo.
  • 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 23 test(s) behind this row are the ones the JavaScript/TypeScript census could read, and this repository also carries at least 573 test source file(s) (.py, .swift, .rb) 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.
  • 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 naming rules read C# through Roslyn and every other language through its sidecar model; these languages are left out (PHP's reading is its own change, a Roslyn-loaded VB or F# project has no population builder yet). Their declarations carry no naming verdict this run — this says nothing about whether their 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.
  • 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 a COLLECTOR gap, not an environment fault: it declares a published package (setup.py), but no published-package marker D22 reads admitted any project here, so this ecosystem's public API has no collector, and the remedy is to write one — no change to the scan image can close it.
  • 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.
  • D28 Secrets (history) — 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 newest 3677 of 3798 commits were scanned for secrets, back to commit 79311b9c9c8c; older commits were not. The history budget was spent before the next range could start. The working tree WAS scanned in full, and every row of the scanned ranges is reported. Nothing about the unscanned commits is asserted by the absence of a result; the budget is ours to raise.
  • 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. `apps/omlx-mac/Sources/AppView/AppView.swift`, `apps/omlx-mac/Sources/AppView/Screens/AppearanceScreen.swift`, `apps/omlx-mac/Sources/AppView/Screens/ModelSettingsScreen.swift`, `apps/omlx-mac/Sources/AppView/Utils/LogRecords.swift`, `apps/omlx-mac/Sources/AppView/ViewModels/IntegrationsScreenVM.swift`, … (+21 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. 290 further occurrence(s) are not listed individually; the score already reflects all 330.
  • 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. 11 further occurrence(s) are not listed individually; the score already reflects all 51.
  • 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 REDACTED, 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.
  • AXB2 Runtime readiness — 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. Our sandbox ran out of disk space while building the image. This is a limit of our sandbox, not of your repository. (rule: disk-full). The renderer reported: docker build failed (exit 1) — -------------------- 6 | ARG CUDA=13.0.2 7 | 8 | >>> FROM nvidia/cuda:${CUDA}-cudnn-devel-ubuntu24.04 AS build 9 | ARG TARGETARCH 10 | # Empty: Ampere and newer on amd64 (the kernels need bf16 tensor cores), GB10 -------------------- ERROR: failed to solve: failed to register layer: write /usr/local/cuda-13.0/targets/x86_64-linux/lib/libcusolver.so.12.0.4.66: no space left on device; likely cause (our sandbox): our sandbox ran out of disk space while building the image. This is a limit of our sandbox, not of your repository; runtime evidence skipped.
  • 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 REDACTED (REDACTED). docker build failed (exit 1) — -------------------- 6 | ARG CUDA=13.0.2 7 | 8 | >>> FROM nvidia/cuda:${CUDA}-cudnn-devel-ubuntu24.04 AS build 9 | ARG TARGETARCH 10 | # Empty: Ampere and newer on amd64 (the kernels need bf16 tensor cores), GB10 -------------------- ERROR: failed to solve: failed to register layer: write /usr/local/cuda-13.0/targets/x86_64-linux/lib/libcusolver.so.12.0.4.66: no space left on device; likely cause (our sandbox): our sandbox ran out of disk space while building the image. This is a limit of our sandbox, not of your repository; 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.
  • C2 Access Controls — 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 authorization 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 authorization controls.
  • C3 Audit Trail — 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 audit 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 audit controls.
  • C4 Data Retention — 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 retention 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 retention controls.
  • C5 Data-Subject Rights — 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 data-subject rights 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 data-subject rights 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, Scala, Rust and Java source only, and this repository's Python, Swift, c, cpp, objectivec 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, Scala and Rust source only, and this repository's Python, Swift, c, cpp, objectivec 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.
  • P5 DR & Backup — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. No backup/snapshot/replication config, RTO/RPO or restore-procedure documentation was found — and no production persistence was detected either (no data-access packages, no data-store services, no database resources), so there is nothing in this repository whose loss a DR control would recover. If this system's data lives in a platform or ops repo we can't see, that's where the DR evidence belongs.
  • R2 Cyclomatic Complexity — 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. 18 further occurrence(s) are not listed individually; the score already reflects all 58.
  • 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.
  • X10 Duplicated predicate — 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. 115 further occurrence(s) are not listed individually; the score already reflects all 155.
  • X16 Unfloored truncation loop — 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's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X2 Cancellation propagation — 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. 60 further occurrence(s) are not listed individually; the score already reflects all 100.
  • X29 Per-element action decided by a fixed element — 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's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • 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. 287 further occurrence(s) are not listed individually; the score already reflects all 327.
  • 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. 743 further occurrence(s) are not listed individually; the score already reflects all 783.
  • 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. 14 further occurrence(s) are not listed individually; the score already reflects all 54.

Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.

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.
  • 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.
  • D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
  • D13 Secret Scanning: Secret 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").
  • 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.
  • 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.
  • 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.
  • AX9 CQS / query purity: Handlers are found by interface/name convention — a query handler using neither is not seen. Mutation is a resolved write/publish invocation (SaveChanges/repository/bus), so a write hidden behind a hand-rolled wrapper, reflection, or a string-keyed service locator resolves to a non-persistence type and isn't flagged; it detects that a query writes state, not whether the write is a legitimate read-side cache update. Clean means "no resolved write/publish in a query body", not a proof of CQS purity.
  • DM6 Domain ↔ infrastructure boundary: Infrastructure reached through a hand-rolled wrapper, a domain-named facade, reflection, or a string-keyed service locator resolves to a non-infra type and isn't seen; the body scan is symbol resolution over syntax, not full dataflow. A clean result means "no resolved infra reference in a domain body", not a proof of purity.
  • 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.4 / 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.4 / 10 · rule-coverage 100% · ceiling Prevented

512 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was chat.html.chatApp at 412. A further 5 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 ModelSettingsScreenVM.isDiffusionUnsupportedField at 27 — 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: apps/omlx-mac/Sources/AppView/AppView.swift (AppView.screen at 18), apps/omlx-mac/Sources/AppView/AppSection.swift (AppSection.title 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.

Model.sanitize (cyclomatic 40) · ×2omlx/patches/deepseek_v4/deepseek_v4_model.py:2414
chat.html.chatApp (cyclomatic 412)apps/omlx-web/omlx_web/templates/chat.html:2841
routes.update_global_settings (cyclomatic 298)omlx/admin/routes.py:5014
BlockAwarePrefixCache.reconstruct_cache (cyclomatic 252)omlx/cache/prefix_cache.py:3286
routes.update_model_settings (cyclomatic 226)omlx/admin/routes.py:2959

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

What to do

  1. Bring the 3 bodies over 240 down to 240 or less in Cyclomatic Complexity — start with chat.html.chatApp (cyclomatic 412), routes.update_global_settings (cyclomatic 298), BlockAwarePrefixCache.reconstruct_cache (cyclomatic 252). — 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 3 together lifts Cyclomatic Complexity from 2.4 to about 3.3/10, projected with the scoring formula itself and assuming each lands exactly at 240; a cleaner split scores higher.

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

800 method(s) exceeded the cognitive complexity threshold of 15; the worst was BlockAwarePrefixCache.reconstruct_cache at 653.

BlockAwarePrefixCache.reconstruct_cache (cognitive 653)omlx/cache/prefix_cache.py:3286
routes.update_global_settings (cognitive 479)omlx/admin/routes.py:5014
chat.html.chatApp (cognitive 459)apps/omlx-web/omlx_web/templates/chat.html:2841
routes.update_model_settings (cognitive 334)omlx/admin/routes.py:2959
BlockAwarePrefixCache.store_cache (cognitive 314)omlx/cache/prefix_cache.py:950

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

What to do

  1. Bring the 92 bodies over 60 down to 60 or less in Cognitive Complexity — start with BlockAwarePrefixCache.reconstruct_cache (cognitive 653), routes.update_global_settings (cognitive 479), chat.html.chatApp (cognitive 459). — 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 92 together lifts Cognitive Complexity from 2.0 to about 4.4/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.

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

D3 · God Classes8.1 / 10Strong✓ 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 8.1 / 10 · rule-coverage 100% · ceiling Prevented

174 god class(es) detected.

FileTooLong: omlx/scheduler.py · ×122omlx/scheduler.py
MethodTooLong: ExperimentalSection.body · ×22apps/omlx-mac/Sources/AppView/Screens/ModelSettingsScreen.swift:2503
TooManyMethods: Scheduler · ×19omlx/scheduler.py:2194
ClassTooLong: ModelSettingsScreenVM · ×7apps/omlx-mac/Sources/AppView/ViewModels/ModelSettingsScreenVM.swift:34
FunctionTooLong: chat.html.chatApp · ×4apps/omlx-web/omlx_web/templates/chat.html:2841

What to do

  1. Resolve the 122 FileTooLong finding(s) in God Classes — start with kernels.py (3), routes.py (2), deepseek_v4_model.py (2). — One of this dimension's main actionable groups (122 warning-level).
  2. Resolve the 22 MethodTooLong finding(s) in God Classes — start with ModelSettingsScreen.swift (3), ModelSettingsScreenVM.swift (3), ServerScreen.swift (2). — One of this dimension's main actionable groups (22 warning-level).
  3. Resolve the 19 TooManyMethods finding(s) in God Classes — start with vlm.py (2), scheduler.py, engine_pool.py. — One of this dimension's main actionable groups (19 warning-level).

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

D4 · Code Duplication7.5 / 10Strong✓ Tool-verified

What it measures: How much of the production code is copy-pasted: the share of production lines inside a reported copy (every copy of a duplicated block or of an edited member, each line once), 10 at none and 0 at a quarter of the lines.

Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), scored on the share of production lines inside a reported copy (each line once; 10 at none, 0 at a quarter). Deterministic.

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

444 duplicated block group(s) detected. 6.1 % of the production lines (21,371 of 348,289) are in a reported copy. A further 310 rows report members as variants of one another; the share counts each copied line once, however many rows cite it. 1 of the 754 are in trees this repository does not ship — vendored, example/demo, project-template, fixture and benchmark code — and are ranked below the shipped groups rather than excluded from them: the duplication there is real and is still counted in this dimension's score. The dimensions that publish a production-file census leave those trees out of theirs, so this count is deliberately drawn over the wider population.

Duplicated block (7 lines × 2) · ×28apps/omlx-cuda-helper/omlx_cuda_helper/families/deepseek_v41/__init__.py:55
Duplicated block (6 lines × 2) · ×23apps/omlx-cuda-helper/omlx_cuda_helper/families/inkling2/layers.py:224
Duplicated block (11 lines × 2) · ×22omlx/adapter/gemma4.py:144
Duplicated block (9 lines × 2) · ×22apps/omlx-cuda-helper/omlx_cuda_helper/families/inkling2/layers.py:238
Duplicated block (5 lines × 2) · ×21apps/omlx-cuda-helper/omlx_cuda_helper/checkpoint.py:47

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

What to do

  1. Resolve the 28 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with REDACTED (3), __init__.py (2), REDACTED (2). — One of this dimension's main actionable groups (28 warning-level).
  2. Resolve the 23 Duplicated block (6 lines × 2) finding(s) in Code Duplication — start with layers.py (2), raon1_mini_model.py (2), kernels.py. — One of this dimension's main actionable groups (23 warning-level).
  3. Resolve the 22 Duplicated block (11 lines × 2) finding(s) in Code Duplication — start with REDACTED (2), REDACTED (2), gemma4.py. — One of this dimension's main actionable groups (22 warning-level).

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

2 production modules (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.8 / 10Stronggated by 7 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.8 / 10 · rule-coverage 100% · ceiling Verified

7 of 366 classes have LCOM4 above 3.

Low cohesion: ModelRegistry (LCOM4 7) · ×7omlx/model_registry.py:30

What to do

  1. Resolve the 7 Low cohesion finding(s) in Cohesion (LCOM4) — start with model_registry.py, language.py, REDACTED. — One of this dimension's main actionable groups (7 warning-level).

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

D10 · Test Quality10.0 / 10Exemplary✓ 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

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

✓ On the Gold path — maintain.

Detailed fixes: d10_recommendation.md.

D11 · Test Reliability10.0 / 10Exemplary✓ 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 1 measured tier(s). Python (2 distributions): measured (0 flaky).

✓ On the Gold path — maintain.

Detailed fixes: d11_recommendation.md.

D12 · Dependency Hygiene10.0 1.0 / 10Critical✓ Tool-verified

What it measures: Whether dependencies are current, not deprecated, and not bloated. Known vulnerabilities are D30's.

Method: Manifest scan via dotnet list package across all projects; worst-signal-per-package deduction (capped-linear for deprecation, prerelease and outdated) per KLoC. Known-vulnerable packages are D30's and are not charged here (rubric-2026.11.2). Exhaustive.

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

0 outdated, 0 yanked pinned Python distributions. 3 of 31 shipped distributions were graded against pypi.org (0 not published there, 28 declared without an exact pin, which installs the newest release the declaration admits and so cannot be behind one). Only EXACT pins are graded for currency: a floor or a range already installs the newest release it admits, so reporting one would report this repository for being current. Whether a deliberate upper cap has itself gone stale is a different and weaker question, and is not asked. Whether any distribution is UNMAINTAINED is not graded — PyPI publishes no maintenance status, and release age does not stand in for one. Lockfiles are not read (poetry.lock, uv.lock, Pipfile.lock, pdm.lock), so a lock-resolved install is outside this verdict. Known CVEs in this dependency graph are D30's question.

Detailed fixes: d12_recommendation.md.

D13 · Secret Scanning5.0 / 10Adequate✓ Tool-verified

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 5.0 / 10 · rule-coverage 100% · ceiling Prevented

1 secret(s) detected.

REDACTED

What to do

  1. Resolve the 1 Leaked secret finding(s) in Secret Scanning — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).

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

D14 · License Compliance10.0 / 10Exemplary○ Nothing flagged

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 10.0 / 10 · rule-coverage 100% · ceiling Verified

0 of 82 shipped Python distribution(s) use a banned license. Licences were resolved from PyPI over the distributions a consumer installs — this repository's 31 declared runtime requirement(s) closed transitively over each distribution's published `requires_dist` (51 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. 8 of them publish no licence on PyPI this pass can read; that is missing data, not a violation, and none of them is charged. A further 4 direct requirement(s) are installed from a URL or a version-control checkout and publish no licence this pass can read; they are outside this verdict. This repository publishes itself under Apache-2.0, which is its own choice and is not judged here.

✓ On the Gold path — maintain.

Detailed fixes: d14_recommendation.md.

D15 · Churn × Complexity Hotspots7.0 / 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 7.0 / 10 · rule-coverage 100% · ceiling Documented

Top hotspots: omlx/admin/routes.py (116×298=34568); REDACTED (125×163=20375); omlx/scheduler.py (175×101=17675) Repeated repair below the complexity floor: omlx/prefill_transient_tracker.py (10 of 11 changes were fixes); omlx/patches/sdpa256_attention.py (7 of 12 changes were fixes); apps/omlx-mac/Sources/AppView/Screens/ServerScreen.swift (5 of 8 changes were fixes)

Hotspot: omlx/admin/routes.py · ×100omlx/admin/routes.py:5014
Repeated repair: omlx/prefill_transient_tracker.py · ×21omlx/prefill_transient_tracker.py:91

What to do

  1. Resolve the 100 Hotspot finding(s) in Churn × Complexity Hotspots — start with base.py (3), routes.py (2), vlm.py (2). — One of this dimension's main actionable groups (100 warning-level).
  2. Resolve the 21 Repeated repair finding(s) in Churn × Complexity Hotspots — start with prefill_transient_tracker.py, sdpa256_attention.py, ServerScreen.swift. — One of this dimension's main actionable groups (21 warning-level).

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

D16 · Bus Factor8.8 / 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.8 / 10 · rule-coverage 100% · ceiling Documented

69 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is omlx/patches/deepseek_v41/kernels.py. Counted over 600 of the 694 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

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

What to do

  1. Resolve the 2 Off-boarding risk finding(s) in Bus Factor. — One of this dimension's main actionable groups (2 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 348289 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

1 of 1 documentation facets pass in full. 25 document(s) read across 1 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 foundREDACTED:225

What to do

  1. Resolve the 1 No ADRs found finding(s) in ADR Quality — start with REDACTED. — 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 Value10.0 9.8 / 10Exemplary○ Nothing flagged

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 98% · ceiling Documented

0 of 274 judged comments only repeat the code they sit on (0.0 %). 14 comment(s) in another language or script were not judged.

✓ On the Gold path — maintain.

Detailed fixes: d24_recommendation.md.

D26 · Project Cohesion0.0 / 10Critical✓ 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 0.0 / 10 · rule-coverage 100% · ceiling Documented

3 of 3 build units (Python, Xcode) flagged as possibly oversized/incoherent.

Projects may be oversized for their cohesion · ×3REDACTED:1

What to do

  1. Resolve the 3 Projects may be oversized for their cohesion finding(s) in Project Cohesion — start with REDACTED (2), project.pbxproj. — One of this dimension's main actionable groups (3 recommendation-level).

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

D27 · Navigability10.0 / 10Exemplary✓ 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 10.0 / 10 · rule-coverage 100% · ceiling Documented

78 % of calls cross a namespace and 0 % go through an interface, but 99 % of collaborators are co-located — so a call's collaborators sit together and tracing stays easy. Baseline: small — navigation cost is tolerated.

✓ On the Gold path — maintain.

Detailed fixes: d27_recommendation.md.

D28 · Secrets (history)10.0 / 10Exemplary○ Nothing flagged

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

Method: Secret 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 10.0 / 10 · rule-coverage 100% · ceiling Documented

gitleaks scanned the current working tree and the part of the history named below, and found no secrets. History coverage: The newest 3677 of 3798 commits were scanned for secrets, back to commit 79311b9c9c8c; older commits were not. The history budget was spent before the next range could start.

✓ On the Gold path — maintain.

Detailed fixes: d28_recommendation.md.

D29 · Static Analysis (SAST)0.4 / 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.4 / 10 · rule-coverage 100% · ceiling Documented

57 finding(s): 0 critical, 7 high, 36 medium, 14 low. semgrep hit a parse error in 20 file(s) — `apps/omlx-mac/Tests/oMLXTests/MenubarControllerPortTests.swift` (line 189, line 191, line 209, …), `apps/omlx-mac/Tests/oMLXTests/MenubarMetricTests.swift` (line 55, line 65, line 73, …), `apps/omlx-web/omlx_web/static/js/cluster_v2.js`, `REDACTED`, `apps/omlx-web/omlx_web/static/js/gridstack-all.js`, … (+15 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 2 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

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

What to do

  1. 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).
  2. Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
  3. Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).

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

D31 · IaC & Container Security9.2 / 10Adequategated by 1 critical finding✓ 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 9.2 / 10 · rule-coverage 100% · ceiling Documented

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

REDACTED
REDACTED
REDACTED

What to do

  1. Resolve the 1 High IaC finding(s) in IaC & Container Security — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
  2. Resolve the 4 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (4). — One of this dimension's main actionable groups (4 warning-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

8 of 600 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is omlx/models/qwen2_embedding.py. Counted over 600 of the 694 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Orphaned file · ×8omlx/models/qwen2_embedding.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 Coupling9.7 / 10Adequategated by 2 critical 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 9.7 / 10 · rule-coverage 100% · ceiling Documented

Strongest change-coupling: REDACTED↔config.py 83%; qwen35_moe_vlm_model.py↔qwen35_moe_vlm_runtime.py 80%; PerformanceScreen.swift↔REDACTED 73%

Boundary-crossing change coupling: PerformanceScreen.swift ↔ routes.py · ×2apps/omlx-mac/Sources/AppView/Screens/PerformanceScreen.swift:1
Change coupling: qwen35_moe_vlm_model.py ↔ qwen35_moe_vlm_runtime.py · ×4omlx/patches/mlx_vlm_mtp/qwen35_moe_vlm_model.py:1
Change-coupling hub: REDACTED → ModelSettingsScreen.swift, PerformanceScreen.swift, ModelSettingsScreenVM.swift, ModelsDTO.swift, accuracy_benchmark.py, routes.py, config.py, settings.pyREDACTED

What to do

  1. Resolve the 2 Boundary-crossing change coupling finding(s) in Change Coupling — start with PerformanceScreen.swift (2). — One of this dimension's main actionable groups (2 issue-level).
  2. Resolve the 4 Change coupling finding(s) in Change Coupling — start with qwen35_moe_vlm_model.py, PerformanceScreen.swift, qwen35_model.py. — One of this dimension's main actionable groups (4 warning-level).
  3. Resolve the 1 Change-coupling hub finding(s) in Change Coupling — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).

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

D36 · Supply-chain Provenance & Signing5.0 / 10Adequate✓ 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 5.0 / 10 · rule-coverage 100% · ceiling Documented

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

REDACTED
REDACTED
REDACTED

What to do

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

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

D37 · Vulnerability-disclosure Policy10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether the repository publishes a coordinated-vulnerability-disclosure policy (SECURITY.md or security.txt) with a reporting contact, so finders know how to report a vulnerability. Presence of a policy file with a contact, not whether the policy is adequate or honoured.

Method: Vulnerability-disclosure policy read deterministically from the repo: a SECURITY.md (root/.github/docs) or .well-known/security.txt / security.txt, regex-checked for a reporting contact (email / URL / mailto). Present + contact → 10; present without a contact → 4; NotApplicable when no policy file exists (it may live off-repo). Detects the policy file's presence + contact, not its adequacy.

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

A vulnerability-disclosure policy (SECURITY.md) is published with a reporting contact.

✓ On the Gold path — maintain.

Detailed fixes: d37_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 31 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 alternatives5.9 / 10Adequate✓ 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.

  • 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. — apps/omlx-web/omlx_web/static/js/theme_preview.js:377

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 & labels3.4 / 10Weak✓ 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.

  • This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label. (×7) — apps/omlx-web/omlx_web/templates/chat.html:1220, apps/omlx-web/omlx_web/templates/chat.html:1284, apps/omlx-web/omlx_web/templates/chat.html:2051, …
  • 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). (×7) — apps/omlx-web/omlx_web/templates/chat.html:1389, apps/omlx-web/omlx_web/templates/chat.html:2303, apps/omlx-web/omlx_web/templates/chat.html:2308, …
  • This <label> has no for 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 for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id. (×17) — apps/omlx-web/omlx_web/templates/chat.html:2127, apps/omlx-web/omlx_web/templates/chat.html:2492, apps/omlx-web/omlx_web/templates/chat.html:2503, …
  • This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it. (×7) — apps/omlx-web/omlx_web/templates/chat.html:2135, apps/omlx-web/omlx_web/templates/chat.html:2566, apps/omlx-web/omlx_web/templates/chat.html:2575, …
  • This <div> carries a click handler, which makes it a control, but it has no text, aria-label or labelled child (the icon-only case), so assistive tech has no name to announce for it. Note that switching it to <button type="button"> — the right fix for its keyboard operability — does not give it a name either: an icon-only button still needs one. Add visible text or an aria-label. (×2) — apps/omlx-web/omlx_web/templates/chat.html:2711, apps/omlx-web/omlx_web/templates/dashboard.html:66

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 structure6.8 / 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.

  • No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>. — REDACTED:2
  • Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one. — apps/omlx-web/omlx_web/templates/chat.html:2719
  • 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). — apps/omlx-web/omlx_web/templates/dashboard/_bench.html:322

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 semantics1.7 / 10Critical✓ 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".

  • A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler. (×23) — apps/omlx-web/omlx_web/templates/chat.html:1924, apps/omlx-web/omlx_web/templates/chat.html:2475, apps/omlx-web/omlx_web/templates/chat.html:2711, …
  • 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. — apps/omlx-web/omlx_web/templates/chat.html:2326
  • 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. — apps/omlx-web/omlx_web/templates/chat.html:2366
  • This <i> 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. — apps/omlx-web/omlx_web/templates/dashboard/_bench.html:6
  • This <span> 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. — apps/omlx-web/omlx_web/templates/dashboard/_models.html:1400

What to do

  • Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
AC5 · ARIA correctness10.0 / 10Exemplary○ Nothing flagged

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.

AC6 · Visual & motion safety5.2 / 10Adequate✓ 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.

  • `.message-fade-in` moves (`animation: fadeIn 0.3s ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — apps/omlx-web/omlx_web/templates/chat.html:80
  • `.svg-allow-switch-knob` moves (`transition: transform 0.2s ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — apps/omlx-web/omlx_web/templates/chat.html:532
  • `.thinking-toggle` moves (`transition: transform 0.2s ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — apps/omlx-web/omlx_web/templates/chat.html:657
  • `.composer-switch::after` moves (`transition: transform 0.15s`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — apps/omlx-web/omlx_web/templates/chat.html:863
  • `.reasoning-slider-fill` moves (`transition: width 0.15s ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — apps/omlx-web/omlx_web/templates/chat.html:897
  • `.inline-edit-textarea` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — apps/omlx-web/omlx_web/templates/chat.html:603
  • <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). (×7) — apps/omlx-web/omlx_web/templates/chat.html:1220, apps/omlx-web/omlx_web/templates/chat.html:1284, apps/omlx-web/omlx_web/templates/chat.html:2566, …
  • <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). (×2) — apps/omlx-web/omlx_web/templates/chat.html:2135, apps/omlx-web/omlx_web/templates/chat.html:2727
  • <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). (×4) — apps/omlx-web/omlx_web/templates/chat.html:2494, apps/omlx-web/omlx_web/templates/dashboard/_bench.html:381, apps/omlx-web/omlx_web/templates/dashboard/_bench_accuracy.html:551, …
  • 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. (×5) — apps/omlx-web/omlx_web/templates/dashboard.html:29, apps/omlx-web/omlx_web/templates/dashboard/_bench.html:57, apps/omlx-web/omlx_web/templates/dashboard/_bench_accuracy.html:343, …
  • <svg> moves — its `animate-spin` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:. (×6) — apps/omlx-web/omlx_web/templates/dashboard.html:0, apps/omlx-web/omlx_web/templates/dashboard/_bench_accuracy.html:0, apps/omlx-web/omlx_web/templates/dashboard/_cluster_v2.html:0, …
  • <div> moves — its `animate-spin` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:. (×6) — apps/omlx-web/omlx_web/templates/dashboard/_bench.html:259, apps/omlx-web/omlx_web/templates/dashboard/_bench.html:400, apps/omlx-web/omlx_web/templates/dashboard/_models.html:494, …
  • <span> moves — its `animate-ping` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:. — apps/omlx-web/omlx_web/templates/dashboard/_cluster_v2.html:228
  • <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). — apps/omlx-web/omlx_web/templates/dashboard/_logs.html:64
  • <i> moves — its `animate-spin` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:. (×2) — apps/omlx-web/omlx_web/templates/dashboard/_settings.html:1279, apps/omlx-web/omlx_web/templates/dashboard/_settings.html:1296

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.
AX10 · Code composition9.5 / 10Exemplary✓ 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.

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.

AX4 · Dependency direction10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.

Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, 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.

AX9 · CQS / query purity10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether read (query) handlers stay side-effect-free — a query that writes persistent state or raises events breaks CQS and makes reads unsafe to retry, cache, or route to a read replica.

Method: Roslyn scan: CQRS handlers classified query-vs-command by interface (IQueryHandler/ICommandHandler/IRequestHandler<TQuery,TResult>) and name convention (*Query/Get*/Find* vs *Command); each query handler's body checked for persistent-state writes (SaveChanges/repository Add-Update) or event publishes by resolved invocation. Deterministic, type-level, exhaustive over the detected handlers.

Coverage: Population: CQRS handlers identified by IQueryHandler/ICommandHandler/IRequestHandler interface + *Query/Get*/Find*/*Command NAME convention; query purity then checked exhaustively within that set — a query handler using neither convention is invisible, and mutation is a resolved persistence/publish CALL, not full dataflow.

DM6 · Domain ↔ infrastructure boundary10.0 / 10Exemplary✓ Tool-verified

Other · Domain Modelling — Whether the domain layer stays free of infrastructure dependencies — a domain aggregate fused to a persistence ORM (Django/SQLAlchemy) on its own declaration (active-record) couples the domain to infrastructure. The clean-architecture dependency rule.

Method: Roslyn (DDD-gated): domain-layer types scanned for infrastructure usage in member SIGNATURES and inside method/accessor BODIES — resolved calls and object-creations into EF/Marten/HTTP/Mongo/Redis/message-bus types (not just a namespace allowlist). Deterministic, symbol-resolved, exhaustive over domain-layer bodies, DDD-native.

Coverage: Domain layer identified by NAMESPACE heuristic; infrastructure then resolved by symbol in member SIGNATURES and method/accessor BODIES — rename the layer and the check evaporates.

M1 · Documentation (README)10.0 / 10Exemplary✓ Tool-verified

Maturity · Maturity — Whether the repository and its projects have a README, and whether it is substantive.

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

M2 · Architecture documentation2.0 / 10Weak✓ 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 structure10.0 / 10Exemplary✓ Tool-verified

Maturity · Maturity — Whether the repository is organised deliberately: production code and tests are set apart in a way its ecosystem or the repository itself declares.

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

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 · Observability8.0 / 10Strong✓ 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.

P3 · Security & performance tooling3.0 / 10Weak✓ 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 5 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:6

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.
  • Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
P4 · Deployment & Rollback5.0 / 10Adequate✓ 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.

  • The release is automated and no gate that pauses it for a human is DECLARED IN THIS REPOSITORY'S PIPELINE FILES. What was read: every file under `.github/workflows/`, `.forgejo/workflows/`, `.gitea/workflows/`, `.azuredevops/` and `.azure-pipelines/`, plus `.gitlab-ci*` and `azure-pipelines*` — with comment text stripped, so documenting a gate is not declaring one. What would have counted: GitLab's `when: manual`, CircleCI's `type: approval`, an Azure `ManualValidation@` task or an `approvals:` block, a Jenkins `input` step, a `uses:` step naming an approval action, an `environment:` paired with `reviewers` / `required_reviewers` / `protection` / `wait-timer` / `deployment_branch_policy`, a draft-release step, a `workflow_dispatch` promotion, or a release-event gate. ★ What this cannot see, because none of it is a file: a GitHub environment whose required reviewers are configured in repo SETTINGS, a branch protection rule, or an organisation deployment policy — all of them real, enforced gates that live outside the repository. If yours is one of those, this row is wrong and nothing in the tree could have told us. Otherwise: whatever the release trigger points at is published to users unreviewed, so a mistagged or unverified commit ships and the only remedy is a follow-up release.

What to do

  • Nothing pauses a release for a human: publish as a draft release (or gate the release job on a protected tag/manual dispatch) so a bad build can be stopped before users can download it.
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.

  • `urllib.request.urlopen(` 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. (×2) — REDACTED:40, REDACTED:127
  • `requests.get(` 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. (×4) — REDACTED:452, REDACTED:865, omlx/scheduler.py:3874, …

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 hygiene10.0 / 10Exemplary✓ 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.

R1 · Type Safety0.0 / 10Critical✓ 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.

  • 0 typed · 20 plain JS — the untyped files are apps/omlx-web/omlx_web/static/js/cluster_v2.js, apps/omlx-web/omlx_web/static/js/count_format.js, apps/omlx-web/omlx_web/static/js/custom_theme.js, REDACTED, apps/omlx-web/omlx_web/static/js/dashboard_layout.js, REDACTED (+14 more).

What to do

  • Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up.
R10 · Code Duplication6.1 / 10Adequate✓ Tool-verified

React / JS · Code Health — The share of the scored frontend lines inside a near-exact copy-pasted block of substantial extent (the D4 clone algorithm over JS/TS tokens, D-386; each line once, 10 at none and 0 at a quarter of the lines, as D4): 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. Scored on the share of the scored frontend lines inside a reported copy, on the same curve as D4. Deterministic.

  • REDACTED:8181 · REDACTED:8479 — the two spans are one implementation copied and then locally edited — 607 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. — REDACTED:8181
  • REDACTED:7945 · REDACTED:9308 — all 2 copies are in the same file, 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. — REDACTED:7945
  • REDACTED:5453 · REDACTED:5607 — all 2 copies are in the same file, 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. — REDACTED:5453
  • REDACTED:5551 · REDACTED:5654 — 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. — REDACTED:5551
  • REDACTED:8067 · REDACTED:9358 — 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. — REDACTED:8067
  • REDACTED:7284 · REDACTED:7389 — all 2 copies are in the same file, 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. — REDACTED:7284
  • REDACTED:8622 · REDACTED:9056 · REDACTED:9434 · REDACTED:9499 · +1 more site(s) not listed — all 5 copies are in the same file, 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. — REDACTED:8622
  • REDACTED:8996 · REDACTED:9462 — all 2 copies are in the same file, 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. — REDACTED:8996
  • apps/omlx-web/omlx_web/static/js/cluster_v2.js:3453 · apps/omlx-web/omlx_web/static/js/cluster_v2.js:3766 · apps/omlx-web/omlx_web/static/js/cluster_v2.js:3790 — all 3 copies are in the same file, 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. — apps/omlx-web/omlx_web/static/js/cluster_v2.js:3453
  • REDACTED:8128 · REDACTED:8278 · REDACTED:8571 · REDACTED:9398 — all 4 copies are in the same file, 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. — REDACTED:8128
  • apps/omlx-web/omlx_web/static/js/cluster_v2.js:3762 · apps/omlx-web/omlx_web/static/js/cluster_v2.js:3786 — 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. — apps/omlx-web/omlx_web/static/js/cluster_v2.js:3762
  • REDACTED:1813 · REDACTED:3543 — all 2 copies are in the same file, 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. — REDACTED:1813
  • REDACTED:6971 · REDACTED:7208 — all 2 copies are in the same file, 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. — REDACTED:6971
  • apps/omlx-web/omlx_web/static/js/cluster_v2.js:647 · apps/omlx-web/omlx_web/static/js/cluster_v2.js:662 — all 2 copies are in the same file, 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. — apps/omlx-web/omlx_web/static/js/cluster_v2.js:647
  • REDACTED:1925 · REDACTED:1938 · REDACTED:7987 — all 3 copies are in the same file, 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. — REDACTED:1925
  • REDACTED:2535 · REDACTED:2662 · REDACTED:2703 · REDACTED:2729 — all 4 copies are in the same file, 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. — REDACTED:2535
  • REDACTED:3826 · REDACTED:3996 — 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. — REDACTED:3826
  • REDACTED:4300 · REDACTED:4743 — all 2 copies are in the same file, 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. — REDACTED:4300
  • REDACTED:6298 · REDACTED:8260 · REDACTED:8553 — all 3 copies are in the same file, 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. — REDACTED:6298
  • REDACTED:7922 · REDACTED:9289 — 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. — REDACTED:7922
  • REDACTED:1611 · REDACTED:1933 — 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. — REDACTED:1611
  • REDACTED:2602 · REDACTED:2748 — all 2 copies are in the same file, 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. — REDACTED:2602
  • REDACTED:6553 · REDACTED:6674 — 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. — REDACTED:6553
  • REDACTED:8443 · REDACTED:8502 — all 2 copies are in the same file, 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. — REDACTED:8443
  • REDACTED:2507 · REDACTED:2678 — 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. — REDACTED:2507
  • REDACTED:5688 · REDACTED:5971 — all 2 copies are in the same file, 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. — REDACTED:5688
  • REDACTED:5945 · REDACTED:6568 — all 2 copies are in the same file, 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. — REDACTED:5945
  • REDACTED:7253 · REDACTED:7375 — all 2 copies are in the same file, 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. — REDACTED:7253
  • REDACTED:2890 · REDACTED:2914 · REDACTED:2952 · REDACTED:3026 — all 4 copies are in the same file, 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. — REDACTED:2890
  • REDACTED:4593 · REDACTED:5760 — all 2 copies are in the same file, 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. — REDACTED:4593
  • REDACTED:5439 · REDACTED:6264 — all 2 copies are in the same file, 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. — REDACTED:5439
  • REDACTED:8703 · REDACTED:9558 — 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. — REDACTED:8703
  • REDACTED:2524 · REDACTED:2650 — all 2 copies are in the same file, 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. — REDACTED:2524
  • REDACTED:2579 · REDACTED:7949 · REDACTED:8706 · REDACTED:9312 — all 4 copies are in the same file, 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. — REDACTED:2579
  • REDACTED:3465 · REDACTED:3474 — all 2 copies are in the same file, 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. — REDACTED:3465
  • REDACTED:6572 · REDACTED:7062 — 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. — REDACTED:6572
  • REDACTED:5060 · REDACTED:5124 · REDACTED:8927 — all 3 copies are in the same file, 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. — REDACTED:5060
  • REDACTED:5170 · REDACTED:5182 — all 2 copies are in the same file, 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. — REDACTED:5170
  • REDACTED:5918 · REDACTED:5931 — all 2 copies are in the same file, 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. — REDACTED:5918
  • REDACTED:6117 · REDACTED:6391 — all 2 copies are in the same file, 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. — REDACTED:6117

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.
R2 · Cyclomatic Complexity4.4 / 10Weak✓ 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.

  • buildModelSettingsPayload has cyclomatic complexity 91 and cognitive complexity 108; 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. — REDACTED:3538
  • buildModelSettingsState has cyclomatic complexity 87 and cognitive complexity 84; 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. — REDACTED:2205
  • formValuesForProfile has cyclomatic complexity 52 and cognitive complexity 95; 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. — REDACTED:1755
  • accDownloadResult has cyclomatic complexity 36 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 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. — REDACTED:6588
  • checkRows has cyclomatic complexity 33 and cognitive complexity 40; 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. — apps/omlx-web/omlx_web/static/js/cluster_v2.js:2095
  • saveGlobalSettings has cyclomatic complexity 32 and cognitive complexity 36; 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. — REDACTED:1407
  • (anonymous) has cyclomatic complexity 31 and cognitive complexity 32; 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. — REDACTED:7250
  • prefillHelperStatusText has cyclomatic complexity 30 and cognitive complexity 25; 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. — REDACTED:3330
  • (anonymous) has cyclomatic complexity 29 and cognitive complexity 42; 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. — apps/omlx-web/omlx_web/static/js/cluster_v2.js:1913
  • applyANETuningRecommendation has cyclomatic complexity 26 and cognitive complexity 34; 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. — REDACTED:2968
  • runPlan has cyclomatic complexity 25 and cognitive complexity 24; 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. — apps/omlx-web/omlx_web/static/js/cluster_v2.js:2845
  • wizardState has cyclomatic complexity 24 and cognitive complexity 23; 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. — apps/omlx-web/omlx_web/static/js/cluster_v2.js:1049
  • validateQwenAneSettings has cyclomatic complexity 22 and cognitive complexity 30; 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. — REDACTED:3461
  • openModelSettings has cyclomatic complexity 22 and cognitive complexity 29; 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. — REDACTED:3060
  • accBuildText has cyclomatic complexity 21 and cognitive complexity 34; 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. — REDACTED:6466
  • submitPairApproval has cyclomatic complexity 21 and cognitive complexity 32; 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. — apps/omlx-web/omlx_web/static/js/cluster_v2.js:1427
  • aggregateLogRows has cyclomatic complexity 20 and cognitive complexity 24; 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. — REDACTED:71
  • defaults has cyclomatic complexity 19 and cognitive complexity 40; 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. — apps/omlx-web/omlx_web/static/js/custom_theme.js:299
  • handleMainTabChange has cyclomatic complexity 19 and cognitive complexity 30; 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. — REDACTED:895
  • previewMembershipExpansion has cyclomatic complexity 19 and cognitive complexity 16; 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. — apps/omlx-web/omlx_web/static/js/cluster_v2.js:3543
  • (anonymous) has cyclomatic complexity 19 and cognitive complexity 16; 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. — REDACTED:7371
  • (anonymous) has cyclomatic complexity 19 and cognitive complexity 12; 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. — REDACTED:8941
  • saveModelSettings has cyclomatic complexity 18 and cognitive complexity 25; 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. — REDACTED:3776
  • pollANETuning has cyclomatic complexity 18 and cognitive complexity 16; 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. — REDACTED:2908
  • onmessage has cyclomatic complexity 17 and cognitive complexity 22; 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. — REDACTED:5487
  • addToAccQueue has cyclomatic complexity 17 and cognitive complexity 20; 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. — REDACTED:6234
  • applyPresetToForm has cyclomatic complexity 17 and cognitive complexity 19; 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. — REDACTED:2433
  • cacheObsCumulative has cyclomatic complexity 17 and cognitive complexity 17; 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. — REDACTED:5082
  • dashboard has cyclomatic complexity 17 and cognitive complexity 16; 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. — REDACTED:129
  • startANETuning has cyclomatic complexity 17 and cognitive complexity 16; 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. — REDACTED:2850
  • applyProfileToForm has cyclomatic complexity 16 and cognitive complexity 20; 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. — REDACTED:2546
  • createProfile has cyclomatic complexity 16 and cognitive complexity 18; 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. — REDACTED:2496
  • searchHFModels has cyclomatic complexity 15 and cognitive complexity 18; 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. — REDACTED:9014
  • pollStagingJob has cyclomatic complexity 15 and cognitive complexity 17; 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. — apps/omlx-web/omlx_web/static/js/cluster_v2.js:3190
  • aneTuningRecommendationText has cyclomatic complexity 15 and cognitive complexity 15; 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. — REDACTED:2773
  • updateModelSetting has cyclomatic complexity 14 and cognitive complexity 27; 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. — REDACTED:1647
  • loadGlobalSettings has cyclomatic complexity 14 and cognitive complexity 20; 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. — REDACTED:1289
  • submitManualPeer has cyclomatic complexity 14 and cognitive complexity 15; 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. — apps/omlx-web/omlx_web/static/js/cluster_v2.js:1704
  • refreshJoinState has cyclomatic complexity 14 and cognitive complexity 14; 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. — apps/omlx-web/omlx_web/static/js/cluster_v2.js:485
  • startBenchmark has cyclomatic complexity 14 and cognitive complexity 14; 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. — REDACTED:5395
R3 · Large Files0.0 / 10Critical✓ 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.

  • REDACTED has 8886 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
  • apps/omlx-web/omlx_web/static/js/cluster_v2.js has 3811 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — apps/omlx-web/omlx_web/static/js/cluster_v2.js:1
  • apps/omlx-web/omlx_web/static/js/theme_preview.js has 420 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — apps/omlx-web/omlx_web/static/js/theme_preview.js:1

What to do

  • Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
R4 · Test Coverage5.6 / 10Adequate✓ 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. (×4) — apps/omlx-web/omlx_web/static/js/cluster_v2.js:1, REDACTED:1, apps/omlx-web/omlx_web/static/js/dashboard_layout.js:1, …

What to do

  • Add tests that import the unreached modules (directly or through their public entry).
R7 · Dead Code10.0 / 10Exemplary✓ 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.

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. — omlx/engine_core.py:1552

What to do

  • Task from `asyncio.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 reader2.9 / 10Weak✓ Tool-verified

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.

  • `header_len` is read from the bytes being parsed at line 2525 (`int.from_bytes(… 8 bytes …)`), then passed as the size of `read` at line 2526 — and nowhere in its function is `header_len` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: the call reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB (a 64-bit one for more than any machine has), and the reservation either raises `MemoryError` out of a parser whose failure path was written for malformed input, not for hostile input, or succeeds and holds gigabytes for a few bytes on the wire. Bound `header_len` against the bytes actually remaining and a maximum the format allows before reading. — REDACTED:2526
  • `header_len` is read from the bytes being parsed at line 2559 (`int.from_bytes(… 8 bytes …)`), then passed as the size of `read` at line 2560 — and nowhere in its function is `header_len` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: the call reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB (a 64-bit one for more than any machine has), and the reservation either raises `MemoryError` out of a parser whose failure path was written for malformed input, not for hostile input, or succeeds and holds gigabytes for a few bytes on the wire. Bound `header_len` against the bytes actually remaining and a maximum the format allows before reading. — REDACTED:2560
  • `header_len` is read from the bytes being parsed at line 1589 (`int.from_bytes(… 8 bytes …)`), then passed as the size of `read` at line 1590 — and nowhere in its function is `header_len` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: the call reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB (a 64-bit one for more than any machine has), and the reservation either raises `MemoryError` out of a parser whose failure path was written for malformed input, not for hostile input, or succeeds and holds gigabytes for a few bytes on the wire. Bound `header_len` against the bytes actually remaining and a maximum the format allows before reading. — omlx/utils/model_loading.py:1590
  • `length` is read from the bytes being parsed at line 47 (`struct.unpack("<Q")`), then passed as the size of `read` at line 48 — and nowhere in its function is `length` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: the call reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB (a 64-bit one for more than any machine has), and the reservation either raises `MemoryError` out of a parser whose failure path was written for malformed input, not for hostile input, or succeeds and holds gigabytes for a few bytes on the wire. Bound `length` against the bytes actually remaining and a maximum the format allows before reading. (×2) — omlx/prefill_helper/adapter.py:48, apps/omlx-cuda-helper/omlx_cuda_helper/checkpoint.py:48
  • `length` is read from the bytes being parsed at line 96 (`struct.unpack("<Q")`), then passed as the size of `read` at line 97 — and nowhere in its function is `length` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: the call reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB (a 64-bit one for more than any machine has), and the reservation either raises `MemoryError` out of a parser whose failure path was written for malformed input, not for hostile input, or succeeds and holds gigabytes for a few bytes on the wire. Bound `length` against the bytes actually remaining and a maximum the format allows before reading. — omlx/prefill_helper/adapters/qwen3_5.py:97
  • `header_len` is read from the bytes being parsed at line 123 (`struct.unpack("<Q")`), then passed as the size of `read` at line 124 — and nowhere in its function is `header_len` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: the call reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB (a 64-bit one for more than any machine has), and the reservation either raises `MemoryError` out of a parser whose failure path was written for malformed input, not for hostile input, or succeeds and holds gigabytes for a few bytes on the wire. Bound `header_len` against the bytes actually remaining and a maximum the format allows before reading. — omlx/patches/moe_expert_offload.py:124
  • `header_len` is read from the bytes being parsed at line 1222 (`struct.unpack("<Q")`), then passed as the size of `read` at line 1223 — and nowhere in its function is `header_len` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: the call reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB (a 64-bit one for more than any machine has), and the reservation either raises `MemoryError` out of a parser whose failure path was written for malformed input, not for hostile input, or succeeds and holds gigabytes for a few bytes on the wire. Bound `header_len` against the bytes actually remaining and a maximum the format allows before reading. — omlx/patches/moe_expert_offload.py:1223
  • `size` is read from the bytes being parsed at line 213 (`struct.unpack("<Q")`), then passed as the size of `read` at line 214 — and nowhere in its function is `size` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: the call reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB (a 64-bit one for more than any machine has), and the reservation either raises `MemoryError` out of a parser whose failure path was written for malformed input, not for hostile input, or succeeds and holds gigabytes for a few bytes on the wire. Bound `size` against the bytes actually remaining and a maximum the format allows before reading. — omlx/patches/muse_spark/model.py:214
  • `header_size` is read from the bytes being parsed at line 42 (`struct.unpack("<Q")`), then passed as the size of `read` at line 43 — and nowhere in its function is `header_size` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: the call reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB (a 64-bit one for more than any machine has), and the reservation either raises `MemoryError` out of a parser whose failure path was written for malformed input, not for hostile input, or succeeds and holds gigabytes for a few bytes on the wire. Bound `header_size` against the bytes actually remaining and a maximum the format allows before reading. — omlx/patches/mlx_vlm_qwen4_exp_compat/residency.py:43
  • `size` is read from the bytes being parsed at line 119 (`struct.unpack("<Q")`), then passed as the size of `read` at line 120 — and nowhere in its function is `size` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: the call reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB (a 64-bit one for more than any machine has), and the reservation either raises `MemoryError` out of a parser whose failure path was written for malformed input, not for hostile input, or succeeds and holds gigabytes for a few bytes on the wire. Bound `size` against the bytes actually remaining and a maximum the format allows before reading. — omlx/patches/deepseek_v41/oq.py:120
  • `size` is read from the bytes being parsed at line 290 (`struct.unpack("<Q")`), then passed as the size of `read` at line 291 — and nowhere in its function is `size` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: the call reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB (a 64-bit one for more than any machine has), and the reservation either raises `MemoryError` out of a parser whose failure path was written for malformed input, not for hostile input, or succeeds and holds gigabytes for a few bytes on the wire. Bound `size` against the bytes actually remaining and a maximum the format allows before reading. — omlx/patches/deepseek_v41/oq.py:291
  • `length` is read from the bytes being parsed at line 18 (`struct.unpack("<Q")`), then passed as the size of `read` at line 19 — and nowhere in its function is `length` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: the call reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB (a 64-bit one for more than any machine has), and the reservation either raises `MemoryError` out of a parser whose failure path was written for malformed input, not for hostile input, or succeeds and holds gigabytes for a few bytes on the wire. Bound `length` against the bytes actually remaining and a maximum the format allows before reading. — omlx/patches/deepseek_v41/oq_inventory.py:19
  • `length` is read from the bytes being parsed at line 140 (`struct.unpack("<Q")`), then passed as the size of `read` at line 141 — and nowhere in its function is `length` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: the call reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB (a 64-bit one for more than any machine has), and the reservation either raises `MemoryError` out of a parser whose failure path was written for malformed input, not for hostile input, or succeeds and holds gigabytes for a few bytes on the wire. Bound `length` against the bytes actually remaining and a maximum the format allows before reading. — omlx/patches/deepseek_v41/storage.py:141
  • `size` is read from the bytes being parsed at line 115 (`struct.unpack("<Q")`), then passed as the size of `read` at line 116 — and nowhere in its function is `size` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: the call reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB (a 64-bit one for more than any machine has), and the reservation either raises `MemoryError` out of a parser whose failure path was written for malformed input, not for hostile input, or succeeds and holds gigabytes for a few bytes on the wire. Bound `size` against the bytes actually remaining and a maximum the format allows before reading. — omlx/admin/hf_uploader.py:116

What to do

  • Each finding names the read that takes the length from the input and the site that spends it, and states that the value is never compared in between. Confirm from the two, then bound the length against the remaining stream before using it.
X17 · Uncapped recursion over a caller-supplied document2.0 / 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.

  • `collect_kv_layer_specs` is public, takes a document from its caller (line 1925) and hands it to `_walk`, which calls itself at line 1975 (`_walk`) with a piece of `c` — 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. — REDACTED:1975
  • `from_state` is public, takes a document from its caller (line 251) and hands it to `_from_wire_state`, which calls itself at line 99 (`_from_wire_state`) with a piece of `state` — and nowhere in `_from_wire_state` 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_wire_state` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — omlx/cluster/prompt_snapshot_cache.py:99
  • `find_lone_surrogate` is public and takes `value: Any` from its caller, and it calls itself at line 43 (`find_lone_surrogate`) with a piece of `value` (and at line 48) — and nowhere in `find_lone_surrogate` 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 `find_lone_surrogate` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — omlx/api/utils.py:43
  • `chat_template_preserves_mid_system` is public, takes a document from its caller (line 457) and hands it to `_freeze_template_value`, which calls itself at line 383 (`_freeze_template_value`) with a piece of `value` (and at line 386, line 388) — and nowhere in `_freeze_template_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 `_freeze_template_value` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — omlx/api/utils.py:383

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.
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 propagation4.6 / 10Weak✓ 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/109 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.
  • `checkForUpdate` 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 })`. — REDACTED:1200
  • `resetGlobalSettingsDefaults` 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 })`. — REDACTED:1231
  • `loadGlobalSettings` 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 })`. — REDACTED:1289
  • `saveGlobalSettings` 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 })`. — REDACTED:1407
  • `createSubKey` 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 })`. — REDACTED:1558
  • `deleteSubKey` 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 })`. — REDACTED:1591
  • `loadModels` 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 })`. — REDACTED:1609
  • `reloadModels` 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 })`. — REDACTED:1626
  • `updateModelSetting` 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 })`. — REDACTED:1647
  • `loadModel` 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 })`. — REDACTED:1689
  • `unloadModel` 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 })`. — REDACTED:1712
  • `abortRequest` 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 })`. — REDACTED:1735
  • `loadProfilesForModel` 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 })`. — REDACTED:1917
  • `loadTemplates` 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 })`. — REDACTED:1932
  • `loadProfileFields` 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 })`. — REDACTED:1945
  • `loadPresets` 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 })`. — REDACTED:1962
  • `refreshPresets` 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 })`. — REDACTED:1983
  • `createProfile` 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 })`. — REDACTED:2496
  • `applyProfileToForm` 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 })`. — REDACTED:2546
  • `deleteProfile` 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 })`. — REDACTED:2593
  • `updateProfile` 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 })`. — REDACTED:2644
  • `createTemplate` 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 })`. — REDACTED:2673
  • `updateTemplate` 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 })`. — REDACTED:2714
  • `deleteTemplate` 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 })`. — REDACTED:2740
  • `startANETuning` 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 })`. — REDACTED:2850
  • `pollANETuning` 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 })`. — REDACTED:2908
  • `cancelANETuning` 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 })`. — REDACTED:2944
  • `applyANETuningRecommendation` 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 })`. — REDACTED:2968
  • `openModelSettings` 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 })`. — REDACTED:3060
  • `pollPrefillLending` 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 })`. — REDACTED:3122
  • `stopPrefillLending` 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 })`. — REDACTED:3137
  • `loadPrefillHelperCandidates` 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 })`. — REDACTED:3177
  • `pollPrefillHelper` 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 })`. — REDACTED:3192
  • `prefillHelperAction` 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 })`. — REDACTED:3217
  • `applyPrefillHelper` 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 })`. — REDACTED:3265
  • `importMtplxSidecar` 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 })`. — REDACTED:3386
  • `saveModelSettings` 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 })`. — REDACTED:3776
  • `_settingsActionRequest` 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 })`. — REDACTED:3872
  • `loadGenerationDefaults` 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 })`. — REDACTED:4009

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.

X23 · Unguarded diagnostic materialisation7.9 / 10Strong✓ Tool-verified

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.

  • `debug` at line 3205 is called with an argument built by `sorted(_READABLE_CACHE_FORMAT_VERSIONS)` (line 3209), whose cost grows with the collection it walks. Python evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isEnabledFor(logging.DEBUG)` test, no debug flag, no `lambda` the logger calls only when the level is on. — omlx/cache/paged_ssd_cache.py:3205
  • `debug` at line 247 is called with an argument built by `{ k : v for k, v in self._stats.items() if v > 0 }` (line 249), whose cost grows with the collection it walks. Python evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isEnabledFor(logging.DEBUG)` test, no debug flag, no `lambda` the logger calls only when the level is on. — omlx/cache/vision_feature_cache.py:247

What to do

  • In Python, put the construction behind the logger's own check (`if logger.isEnabledFor(logging.DEBUG):`), or pass the collection itself with a `%s` placeholder (`logger.debug("Items %s", items)`) so the logging module renders it only when the record is emitted. The placeholder alone is not the fix when the argument is still built first: it defers the formatting, not a `json.dumps`, a `join` or a comprehension in the argument, and an f-string defers nothing at all.
X24 · Document value interpolated into markup unescaped10.0 / 10Exemplary○ Nothing flagged

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.

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. Whether a walk over a `Hash` or `Set` (`each`, `each_pair`, `map`, `for … in` and the other block walks) leaves it alone — Ruby refuses `rehash`, `replace`, `compare_by_identity` and `transform_keys!` on a Hash, and `reset`, `replace`, `compare_by_identity` and `map!` on a Set, while it is being iterated: the call raises `RuntimeError` at once and the remaining entries 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.

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. (×10) — omlx/_torch_stub.py:401, omlx/_torch_stub.py:412, REDACTED:574, …
  • `except Exception` 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. (×30) — REDACTED:604, omlx/engine_pool.py:1131, omlx/engine_pool.py:1148, …

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.3 / 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 `package.json` 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 455 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. — omlx/engine_core.py:455
  • `error` at line 719 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. — omlx/engine_core.py:719
  • `debug` at line 865 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. — omlx/engine_core.py:865
  • `warning` at line 1055 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. — omlx/engine_core.py:1055
  • `debug` at line 1135 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. — omlx/engine_core.py:1135
  • `warning` at line 1184 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. — omlx/engine_core.py:1184
  • `info` at line 1239 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. — omlx/engine_core.py:1239
  • `debug` at line 1344 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. — omlx/engine_core.py:1344
  • `debug` at line 1500 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. — omlx/engine_core.py:1500
  • `info` at line 1607 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. — omlx/engine_pool.py:1607
  • `warning` at line 1633 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. — omlx/engine_pool.py:1633
  • `info` at line 1635 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. — omlx/engine_pool.py:1635
  • `info` at line 1669 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. — omlx/engine_pool.py:1669
  • `warning` at line 1686 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. — omlx/engine_pool.py:1686
  • `info` at line 1689 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. — omlx/engine_pool.py:1689
  • `info` at line 2836 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. — omlx/engine_pool.py:2836
  • `info` at line 2943 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. — omlx/engine_pool.py:2943
  • `info` at line 2959 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. — omlx/engine_pool.py:2959
  • `info` at line 2989 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. — omlx/engine_pool.py:2989
  • `warning` at line 3006 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. — omlx/engine_pool.py:3006
  • `debug` at line 3213 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. — omlx/engine_pool.py:3213
  • `warning` at line 3773 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. — omlx/engine_pool.py:3773
  • `info` at line 3796 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. — omlx/engine_pool.py:3796
  • `error` at line 3820 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. — omlx/engine_pool.py:3820
  • `warning` at line 3827 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. — omlx/engine_pool.py:3827
  • `warning` at line 3838 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. — omlx/engine_pool.py:3838
  • `info` at line 3870 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. — omlx/engine_pool.py:3870
  • `debug` at line 3915 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. — omlx/engine_pool.py:3915
  • `info` at line 3931 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. — omlx/engine_pool.py:3931
  • `info` at line 3947 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. — omlx/engine_pool.py:3947
  • `debug` at line 3955 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. — omlx/engine_pool.py:3955
  • `info` at line 3969 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. — omlx/engine_pool.py:3969
  • `warning` at line 3990 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. — omlx/engine_pool.py:3990
  • `error` at line 4001 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. — omlx/engine_pool.py:4001
  • `info` at line 4008 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. — omlx/engine_pool.py:4008
  • `info` at line 4052 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. — omlx/engine_pool.py:4052
  • `warning` at line 4059 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. — omlx/engine_pool.py:4059
  • `info` at line 4147 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. — omlx/engine_pool.py:4147
  • `info` at line 4149 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. — omlx/engine_pool.py:4149
  • `warning` at line 4358 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. — omlx/engine_pool.py:4358

What to do

  • Interpolated log message defeats structured logging
X5 · Nullable reference types2.0 / 10Critical✓ Tool-verified

Other · Code Health — Whether Ruby's type checker checks nil and is not undermined by assertions — a file Sorbet reads at `# typed: true` or above, or a Steep target `check`s under its default or strict diagnostics, is one where a method call on a `T.nilable(String)` / `String?` is an error, and each `T.must`, `#: as !nil` or `# steep:ignore NoMethod` is the author telling the checker a value cannot be nil.

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

  • This repository commits no Sorbet configuration (`sorbet/config`) and no `Steepfile`, so nothing type-checks its 1 Ruby product file(s): a nilable value reaches a method call silently and raises `NoMethodError: undefined method … for nil` the first time it is nil. A `# typed:` sigil does nothing without a `sorbet/config` beside the code; a Steep run configured only on a command line is not something this check can read.

What to do

  • Adopt a checker and raise it file by file: with Sorbet, `srb init` (or `bundle exec tapioca init`) commits `sorbet/config`, then move each file's sigil from `# typed: false` to `# typed: true` and on to `strict` as its methods get `sig`s — `spoom bump` does the moving; with Steep, write RBS signatures and `check` the product directories in the `Steepfile` under `D::Ruby.default` or `strict`, not `lenient`. Then pay down the assertions rather than adding to them: each `T.must` is a nil the checker could not rule out — narrow it (`return unless x`, `x&.`, `if (y = x)`), make the attribute non-nilable and set it in `initialize`, or change the method so the nil cannot arrive.

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

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 Health23.9Weak — gated by D1, D2, R1, R3, X5Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture91.4Adequate — gated by D26Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Maturity70.3Adequate — gated by M2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Readiness38.2Weak — gated by D12, P3, P7Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security72.0Adequate — gated by D29Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Domain Modelling100.0ExemplaryStrongest area.
Accessibility43.0Weak — gated by AC2, AC4Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Performance100.0ExemplarySolid.
Unscored — 2 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 — 40 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 — 4 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.

  • C3 Audit Trail — Not assessed: these audit 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 audit 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.
  • C4 Data Retention — Not assessed: these retention 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 retention 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.
  • C5 Data-Subject Rights — Not assessed: these data-subject rights 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 data-subject rights 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.
  • P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 44 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
  • AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) 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
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • AX8 Test isolation — no test/production split to check
  • AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • AXR1 Runtime accessibility — docker build failed (exit 1) — -------------------- 6 | ARG CUDA=13.0.2 7 | 8 | >>> FROM nvidia/cuda:${CUDA}-cudnn-devel-ubuntu24.04 AS build 9 | ARG TARGETARCH 10 | # Empty: Ampere and newer on amd64 (the kernels need bf16 tensor cores), GB10 -------------------- ERROR: failed to solve: failed to register layer: write /usr/local/cuda-13.0/targets/x86_64-linux/lib/libcusolver.so.12.0.4.66: no space left on device; likely cause (our sandbox): our sandbox ran out of disk space while building the image. This is a limit of our sandbox, not of your repository; 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.
  • C2 Access Controls — Not assessed: these authorization 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 authorization 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.
  • 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 does not read html yet; 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. Aggregate roots were found in only one source directory (omlx), which is a layered codebase, not two contexts. 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
  • D30 Dependency Vulnerabilities — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Python REDACTED/requirements.txt (pip/uv/Poetry) — not scanned yet).
  • D32 Data Compliance (PII/GDPR) — 26 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
  • 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.
  • D43 Malicious Dependencies — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Python REDACTED/requirements.txt (pip/uv/Poetry) — not scanned yet).
  • 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 — Python suite
  • 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, Scala, Rust and Java, 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 not measured: this check compares the coverage of the analyzer's own test run across the domain and web layers, and that run measured none here — Test coverage (D8) says why
  • 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 scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
  • R11 Import Boundaries — No recognizable feature-sliced/layered src layout — boundary rules not applicable.
  • R5 Dependency Freshness — no package-lock.json — dependency freshness not measured (would require an npm lockfile); JS/npm CVEs are scored in D30 (Dependency Vulnerabilities), which answers every ecosystem
  • R6 Tooling — no package.json in the repository — test/lint/typecheck wiring is read from package.json scripts (corroborated against CI), so this project's own toolchain isn't measured here
  • R8 Dependency Hygiene — Not measured — no package.json declares any dependency, so there is nothing to check imports against (imports may resolve through a host runtime rather than node).
  • 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.
  • X16 Unfloored truncation loop — X16 reached only 5% of this repository's production lines — python (290,122 lines), swift (43,839 lines), cpp (8,247 lines), c (7,443 lines), objectivec (4,000 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X18 Disposal-pattern correctness — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • 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.
  • X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X29 Per-element action decided by a fixed element — X29 reached only 5% of this repository's production lines — python (290,122 lines), swift (43,839 lines), cpp (8,247 lines), c (7,443 lines), objectivec (4,000 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • 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.
  • X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • 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 — 77 finding(s)
AC4 · Keyboard semantics · Click handler on a non-interactive <div> · ×20
  • Click handler on a non-interactive <div> apps/omlx-web/omlx_web/templates/chat.html:1924 — 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> apps/omlx-web/omlx_web/templates/chat.html:2475 — 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> apps/omlx-web/omlx_web/templates/chat.html:2711 — 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> apps/omlx-web/omlx_web/templates/chat.html:2764 — 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> apps/omlx-web/omlx_web/templates/dashboard.html:66 — 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> apps/omlx-web/omlx_web/templates/dashboard/_bench.html:551 — 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:8 — 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> apps/omlx-web/omlx_web/templates/dashboard/_modal_settings_apply.html:7 — 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> apps/omlx-web/omlx_web/templates/dashboard/_models.html:86 — 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> apps/omlx-web/omlx_web/templates/dashboard/_models.html:90 — 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> apps/omlx-web/omlx_web/templates/dashboard/_models.html:94 — 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> apps/omlx-web/omlx_web/templates/dashboard/_settings.html:1770 — 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> apps/omlx-web/omlx_web/templates/dashboard/_settings.html:1774 — 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> apps/omlx-web/omlx_web/templates/dashboard/_settings.html:1778 — 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> apps/omlx-web/omlx_web/templates/dashboard/_settings.html:1782 — 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> apps/omlx-web/omlx_web/templates/dashboard/_settings.html:1786 — 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> apps/omlx-web/omlx_web/templates/dashboard/_settings.html:1790 — 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> apps/omlx-web/omlx_web/templates/dashboard/_settings.html:1794 — 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> apps/omlx-web/omlx_web/templates/dashboard/_settings.html:2315 — 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> apps/omlx-web/omlx_web/templates/dashboard/_settings.html:2334 — 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 · ×17
  • <label> that labels no control apps/omlx-web/omlx_web/templates/chat.html:2127 — This <label> has no for 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 for="<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 apps/omlx-web/omlx_web/templates/chat.html:2492 — This <label> has no for 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 for="<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 apps/omlx-web/omlx_web/templates/chat.html:2503 — This <label> has no for 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 for="<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 apps/omlx-web/omlx_web/templates/chat.html:2548 — This <label> has no for 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 for="<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 apps/omlx-web/omlx_web/templates/chat.html:2560 — This <label> has no for 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 for="<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 apps/omlx-web/omlx_web/templates/chat.html:2564 — This <label> has no for 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 for="<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 apps/omlx-web/omlx_web/templates/chat.html:2573 — This <label> has no for 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 for="<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 apps/omlx-web/omlx_web/templates/chat.html:2585 — This <label> has no for 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 for="<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 apps/omlx-web/omlx_web/templates/chat.html:2608 — This <label> has no for 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 for="<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 apps/omlx-web/omlx_web/templates/chat.html:2726 — This <label> has no for 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 for="<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 apps/omlx-web/omlx_web/templates/dashboard.html:78 — This <label> has no for 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 for="<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 apps/omlx-web/omlx_web/templates/dashboard/_bench.html:80 — This <label> has no for 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 for="<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 apps/omlx-web/omlx_web/templates/dashboard/_bench.html:95 — This <label> has no for 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 for="<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 apps/omlx-web/omlx_web/templates/dashboard/_bench.html:110 — This <label> has no for 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 for="<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 apps/omlx-web/omlx_web/templates/dashboard/_bench.html:137 — This <label> has no for 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 for="<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 apps/omlx-web/omlx_web/templates/dashboard/_bench.html:190 — This <label> has no for 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 for="<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 apps/omlx-web/omlx_web/templates/dashboard/_bench.html:199 — This <label> has no for 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 for="<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 · <input> without a programmatic label · ×8
  • <input> without a programmatic label apps/omlx-web/omlx_web/templates/chat.html:1220 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label apps/omlx-web/omlx_web/templates/chat.html:1284 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label apps/omlx-web/omlx_web/templates/chat.html:2269 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label apps/omlx-web/omlx_web/templates/chat.html:2566 — This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <input> without a programmatic label apps/omlx-web/omlx_web/templates/chat.html:2575 — This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <input> without a programmatic label apps/omlx-web/omlx_web/templates/dashboard.html:81 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label apps/omlx-web/omlx_web/templates/dashboard/_bench.html:191 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
  • <input> without a programmatic label apps/omlx-web/omlx_web/templates/dashboard/_bench.html:200 — This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
AC2 · Forms & labels · <button> with no accessible text · ×7
  • <button> with no accessible text apps/omlx-web/omlx_web/templates/chat.html:1389 — 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 apps/omlx-web/omlx_web/templates/chat.html:2303 — 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 apps/omlx-web/omlx_web/templates/chat.html:2308 — 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 apps/omlx-web/omlx_web/templates/chat.html:2697 — 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 apps/omlx-web/omlx_web/templates/chat.html:2720 — 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 apps/omlx-web/omlx_web/templates/chat.html:2770 — 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 apps/omlx-web/omlx_web/templates/dashboard.html:72 — 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 · ×4
  • <select> without a programmatic label apps/omlx-web/omlx_web/templates/chat.html:2135 — This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <select> without a programmatic label apps/omlx-web/omlx_web/templates/chat.html:2727 — This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <select> without a programmatic label apps/omlx-web/omlx_web/templates/dashboard/_bench.html:81 — This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
  • <select> without a programmatic label apps/omlx-web/omlx_web/templates/dashboard/_bench.html:96 — This control has no associated label. Add a <label for> / wrapping <label> / aria-label / aria-labelledby so assistive tech can name it.
AC2 · Forms & labels · <textarea> without a programmatic label · ×2
  • <textarea> without a programmatic label apps/omlx-web/omlx_web/templates/chat.html:2051 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
  • <textarea> without a programmatic label apps/omlx-web/omlx_web/templates/chat.html:2494 — This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label for>, a wrapping <label>, or aria-label.
AC2 · Forms & labels · Custom control with no accessible name on <div> · ×2
  • Custom control with no accessible name on <div> apps/omlx-web/omlx_web/templates/chat.html:2711 — This <div> carries a click handler, which makes it a control, but it has no text, aria-label or labelled child (the icon-only case), so assistive tech has no name to announce for it. Note that switching it to <button type="button"> — the right fix for its keyboard operability — does not give it a name either: an icon-only button still needs one. Add visible text or an aria-label.
  • Custom control with no accessible name on <div> apps/omlx-web/omlx_web/templates/dashboard.html:66 — This <div> carries a click handler, which makes it a control, but it has no text, aria-label or labelled child (the icon-only case), so assistive tech has no name to announce for it. Note that switching it to <button type="button"> — the right fix for its keyboard operability — does not give it a name either: an icon-only button still needs one. Add visible text or an aria-label.
AC4 · Keyboard semantics · Click handler on a non-interactive <span> · ×2
  • Click handler on a non-interactive <span> apps/omlx-web/omlx_web/templates/dashboard/_settings.html:563 — 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 <span> apps/omlx-web/omlx_web/templates/dashboard/_settings.html:606 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabindex="0" + a key handler.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
D35 · Change Coupling · Boundary-crossing change coupling · ×2
  • Boundary-crossing change coupling: PerformanceScreen.swift ↔ routes.py apps/omlx-mac/Sources/AppView/Screens/PerformanceScreen.swift:1 — `apps/omlx-mac/Sources/AppView/Screens/PerformanceScreen.swift` (context omlx-mac) and `omlx/admin/routes.py` (context omlx) sit in DIFFERENT parts of the tree yet change together 73% of the time (8 of the 11 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) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `09ad2e90` feat(scheduler): Concurrent Request Priority with an adaptive Balance…; `e6d5989e` fix(cache): turn the SSD cache off when its configured dir is unavail…; `0faa19cd` fix: size automatic SSD cache by available space (#3829) — run `git show` on any of them.
  • Boundary-crossing change coupling: PerformanceScreen.swift ↔ settings.py apps/omlx-mac/Sources/AppView/Screens/PerformanceScreen.swift:1 — `apps/omlx-mac/Sources/AppView/Screens/PerformanceScreen.swift` (context omlx-mac) and `omlx/settings.py` (context omlx) sit in DIFFERENT parts of the tree yet change together 55% of the time (6 of the 11 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) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `09ad2e90` feat(scheduler): Concurrent Request Priority with an adaptive Balance…; `e6d5989e` fix(cache): turn the SSD cache off when its configured dir is unavail…; `0faa19cd` fix: size automatic SSD cache by available space (#3829) — run `git show` on any of them.
AC4 · Keyboard semantics · Hover-only interaction on <div> · ×1
  • Hover-only interaction on <div> apps/omlx-web/omlx_web/templates/chat.html:2326 — 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 · Hover-only interaction on <i> · ×1
  • Hover-only interaction on <i> apps/omlx-web/omlx_web/templates/dashboard/_bench.html:6 — This <i> 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 <p> · ×1
  • Click handler on a non-interactive <p> REDACTED:422 — 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 <span> · ×1
  • Hover-only interaction on <span> apps/omlx-web/omlx_web/templates/dashboard/_models.html:1400 — This <span> 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.
D13 · Secret Scanning · Leaked secret · ×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
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D31 · IaC & Container Security · High IaC · ×1
  • REDACTED
Serious — 2641 finding(s)
D3 · God Classes · FileTooLong · ×122
  • FileTooLong: omlx/scheduler.py omlx/scheduler.py — FileTooLong — 11344 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 10844 over it, 22.69× 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: REDACTED REDACTED — FileTooLong — 8711 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 8211 over it, 17.42× 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: admin/routes.py omlx/admin/routes.py — FileTooLong — 7038 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 6538 over it, 14.08× 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: REDACTED REDACTED — FileTooLong — 6977 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units). The bar is 1500 significant lines; this is 5477 over it, 4.65× 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: REDACTED REDACTED — FileTooLong — 6803 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 6303 over it, 13.61× 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: engine/vlm.py omlx/engine/vlm.py — FileTooLong — 4457 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 3957 over it, 8.91× 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: templates/chat.html apps/omlx-web/omlx_web/templates/chat.html — FileTooLong — 4025 significant lines (blank, comment-only and punctuation-only lines excluded), about 99% of them inside a single declaration: chatApp (2841-8499). The bar is 500 significant lines; this is 3525 over it, 8.05× 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: cache/prefix_cache.py omlx/cache/prefix_cache.py — FileTooLong — 3707 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 3207 over it, 7.41× 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: cache/paged_ssd_cache.py omlx/cache/paged_ssd_cache.py — FileTooLong — 3616 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 3116 over it, 7.23× 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: omlx/engine_pool.py omlx/engine_pool.py — FileTooLong — 3472 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2972 over it, 6.94× 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: REDACTED REDACTED — FileTooLong — 3444 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2944 over it, 6.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: cluster/routes.py omlx/cluster/routes.py — FileTooLong — 2975 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2475 over it, 5.95× 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: patches/qwen35_ane_prefill.py omlx/patches/qwen35_ane_prefill.py — FileTooLong — 2824 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2324 over it, 5.65× 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: js/cluster_v2.js apps/omlx-web/omlx_web/static/js/cluster_v2.js — FileTooLong — 2785 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units), about 100% of them inside a single declaration: clusterV2Wizard (49-4033). The bar is 1500 significant lines; this is 1285 over it, 1.86× 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: cluster/launch.py omlx/cluster/launch.py — FileTooLong — 2596 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2096 over it, 5.19× 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: api/tool_calling.py omlx/api/tool_calling.py — FileTooLong — 2517 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2017 over it, 5.03× 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: Screens/ModelSettingsScreen.swift apps/omlx-mac/Sources/AppView/Screens/ModelSettingsScreen.swift — FileTooLong — 2328 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1828 over it, 4.66× 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: mlx_vlm_glm5_next_compat/decode_kernels.py omlx/patches/mlx_vlm_glm5_next_compat/decode_kernels.py — FileTooLong — 2308 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1808 over it, 4.62× 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: admin/ane_tuning.py omlx/admin/ane_tuning.py — FileTooLong — 2062 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1562 over it, 4.12× 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: deepseek_v4/deepseek_v4_model.py omlx/patches/deepseek_v4/deepseek_v4_model.py — FileTooLong — 2002 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1502 over it, 4.00× 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: ViewModels/ModelSettingsScreenVM.swift apps/omlx-mac/Sources/AppView/ViewModels/ModelSettingsScreenVM.swift — FileTooLong — 1797 significant lines (blank, comment-only and punctuation-only lines excluded), about 93% of them inside a single declaration: ModelSettingsScreenVM (36-2424). The bar is 500 significant lines; this is 1297 over it, 3.59× 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: admin/benchmark.py omlx/admin/benchmark.py — FileTooLong — 1774 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1274 over it, 3.55× 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: REDACTED REDACTED — FileTooLong — 1697 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1197 over it, 3.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: REDACTED REDACTED — FileTooLong — 1689 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1189 over it, 3.38× 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: cluster/planner.py omlx/cluster/planner.py — FileTooLong — 1684 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1184 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.
  • + 97 more in this group — see findings.md.
D15 · Churn × Complexity Hotspots · Hotspot · ×100
  • Hotspot: omlx/admin/routes.py omlx/admin/routes.py:5014 — omlx/admin/routes.py changed 116 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 298 in routes.update_global_settings at line 5014. 46 of those changes were fix/bug commits, and the other 70 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:01:09 +09:00' --until='2026-11-16 19:01:09 +09:00' --full-history --no-merges -- omlx/admin/routes.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: REDACTED REDACTED:129 — REDACTED changed 125 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 163 in dashboard.dashboard at line 129. 16 of those changes were fix/bug commits, and the other 109 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:01:09 +09:00' --until='2026-11-16 19:01:09 +09: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.
  • Hotspot: omlx/scheduler.py omlx/scheduler.py:13314 — omlx/scheduler.py changed 175 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 101 in Scheduler._schedule_waiting at line 13314. 107 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:01:09 +09:00' --until='2026-11-16 19:01:09 +09:00' --full-history --no-merges -- omlx/scheduler.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: omlx/engine/vlm.py omlx/engine/vlm.py:4072 — omlx/engine/vlm.py changed 117 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 123 in VLMBatchedEngine._prepare_vision_inputs at line 4072. 55 of those changes were fix/bug commits, and the other 62 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:01:09 +09:00' --until='2026-11-16 19:01:09 +09:00' --full-history --no-merges -- omlx/engine/vlm.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: apps/omlx-web/omlx_web/templates/chat.html apps/omlx-web/omlx_web/templates/chat.html:2841 — apps/omlx-web/omlx_web/templates/chat.html changed 34 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 412 in chat.html.chatApp at line 2841. 16 of those changes were fix/bug commits, and the other 18 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:01:09 +09:00' --until='2026-11-16 19:01:09 +09:00' --full-history --no-merges -- apps/omlx-web/omlx_web/templates/chat.html`: 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: REDACTED REDACTED:6631 — REDACTED changed 120 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 114 in server.stream_chat_completion at line 6631. 66 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:01:09 +09:00' --until='2026-11-16 19:01:09 +09: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.
  • Hotspot: REDACTED REDACTED:6997 — REDACTED changed 52 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 159 in oq.quantize_oq_streaming at line 6997. 23 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:01:09 +09:00' --until='2026-11-16 19:01:09 +09: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.
  • Hotspot: omlx/utils/model_loading.py omlx/utils/model_loading.py:519 — omlx/utils/model_loading.py changed 55 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 145 in model_loading.maybe_apply_pre_load_patches at line 519. 17 of those changes were fix/bug commits, and the other 38 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:01:09 +09:00' --until='2026-11-16 19:01:09 +09:00' --full-history --no-merges -- omlx/utils/model_loading.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: omlx/engine_pool.py omlx/engine_pool.py:4113 — omlx/engine_pool.py changed 90 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 87 in EnginePool._load_engine at line 4113. 40 of those changes were fix/bug commits, and the other 50 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:01:09 +09:00' --until='2026-11-16 19:01:09 +09:00' --full-history --no-merges -- omlx/engine_pool.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: omlx/cache/prefix_cache.py omlx/cache/prefix_cache.py:3286 — omlx/cache/prefix_cache.py changed 31 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 252 in BlockAwarePrefixCache.reconstruct_cache at line 3286. 20 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:01:09 +09:00' --until='2026-11-16 19:01:09 +09:00' --full-history --no-merges -- omlx/cache/prefix_cache.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: apps/omlx-mac/Sources/AppView/ViewModels/ModelSettingsScreenVM.swift apps/omlx-mac/Sources/AppView/ViewModels/ModelSettingsScreenVM.swift:865 — apps/omlx-mac/Sources/AppView/ViewModels/ModelSettingsScreenVM.swift changed 35 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 143 in ModelSettingsScreenVM.save at line 865. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:01:09 +09:00' --until='2026-11-16 19:01:09 +09:00' --full-history --no-merges -- apps/omlx-mac/Sources/AppView/ViewModels/ModelSettingsScreenVM.swift`: 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: omlx/patches/qwen35_ane_prefill.py omlx/patches/qwen35_ane_prefill.py:3078 — omlx/patches/qwen35_ane_prefill.py changed 38 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 81 in qwen35_ane_prefill.enable_qwen35_ane_prefill at line 3078. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:01:09 +09:00' --until='2026-11-16 19:01:09 +09:00' --full-history --no-merges -- omlx/patches/qwen35_ane_prefill.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: omlx/cache/paged_ssd_cache.py omlx/cache/paged_ssd_cache.py:3468 — omlx/cache/paged_ssd_cache.py changed 35 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 86 in PagedSSDCacheManager.save_block at line 3468. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:01:09 +09:00' --until='2026-11-16 19:01:09 +09:00' --full-history --no-merges -- omlx/cache/paged_ssd_cache.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: REDACTED REDACTED:4433 — REDACTED changed 48 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 49 in batch_generator._run_verify_cycle_chain at line 4433. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:01:09 +09:00' --until='2026-11-16 19:01:09 +09: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.
  • Hotspot: omlx/settings.py omlx/settings.py:1710 — omlx/settings.py changed 30 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 70 in GlobalSettings.validate at line 1710. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:01:09 +09:00' --until='2026-11-16 19:01:09 +09:00' --full-history --no-merges -- omlx/settings.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: REDACTED REDACTED:300 — REDACTED changed 50 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 41 in BatchedEngine.start at line 300. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:01:09 +09:00' --until='2026-11-16 19:01:09 +09: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.
  • Hotspot: omlx/api/tool_calling.py omlx/api/tool_calling.py:2056 — omlx/api/tool_calling.py changed 35 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 56 in tool_calling._parse_tool_calls_impl at line 2056. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:01:09 +09:00' --until='2026-11-16 19:01:09 +09:00' --full-history --no-merges -- omlx/api/tool_calling.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: omlx/admin/benchmark.py omlx/admin/benchmark.py:2027 — omlx/admin/benchmark.py changed 27 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 68 in benchmark.run_benchmark at line 2027. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:01:09 +09:00' --until='2026-11-16 19:01:09 +09:00' --full-history --no-merges -- omlx/admin/benchmark.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: omlx/cluster/routes.py omlx/cluster/routes.py:1205 — omlx/cluster/routes.py changed 25 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 71 in routes.cluster_autoconfigure at line 1205. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:01:09 +09:00' --until='2026-11-16 19:01:09 +09:00' --full-history --no-merges -- omlx/cluster/routes.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: omlx/model_discovery.py omlx/model_discovery.py:711 — omlx/model_discovery.py changed 32 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 54 in model_discovery.detect_model_type at line 711. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:01:09 +09:00' --until='2026-11-16 19:01:09 +09:00' --full-history --no-merges -- omlx/model_discovery.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: omlx/patches/deepseek_v41/language.py omlx/patches/deepseek_v41/language.py:1454 — omlx/patches/deepseek_v41/language.py changed 17 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 83 in LanguageModel._forward at line 1454. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:01:09 +09:00' --until='2026-11-16 19:01:09 +09:00' --full-history --no-merges -- omlx/patches/deepseek_v41/language.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: REDACTED REDACTED:473 — REDACTED changed 26 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 54 in cli.launch_command at line 473. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:01:09 +09:00' --until='2026-11-16 19:01:09 +09: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.
  • Hotspot: REDACTED REDACTED:2003 — REDACTED changed 23 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 53 in HFDownloader._run_download at line 2003. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:01:09 +09:00' --until='2026-11-16 19:01:09 +09: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.
  • Hotspot: omlx/admin/ane_tuning.py omlx/admin/ane_tuning.py:1080 — omlx/admin/ane_tuning.py changed 20 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 60 in ane_tuning._calibrate_fused_components_sync at line 1080. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:01:09 +09:00' --until='2026-11-16 19:01:09 +09:00' --full-history --no-merges -- omlx/admin/ane_tuning.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: omlx/model_settings.py omlx/model_settings.py:733 — omlx/model_settings.py changed 44 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in ModelSettingsManager._repair_profile_references at line 733. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:01:09 +09:00' --until='2026-11-16 19:01:09 +09:00' --full-history --no-merges -- omlx/model_settings.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.
  • + 75 more in this group — see findings.md.
X2 · Cancellation propagation · Async function without AbortSignal · ×39
  • Async function without AbortSignal: checkForUpdate REDACTED:1200 — `checkForUpdate` 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: resetGlobalSettingsDefaults REDACTED:1231 — `resetGlobalSettingsDefaults` 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: loadGlobalSettings REDACTED:1289 — `loadGlobalSettings` 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: saveGlobalSettings REDACTED:1407 — `saveGlobalSettings` 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: createSubKey REDACTED:1558 — `createSubKey` 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: deleteSubKey REDACTED:1591 — `deleteSubKey` 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: loadModels REDACTED:1609 — `loadModels` 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: reloadModels REDACTED:1626 — `reloadModels` 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: updateModelSetting REDACTED:1647 — `updateModelSetting` 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: loadModel REDACTED:1689 — `loadModel` 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: unloadModel REDACTED:1712 — `unloadModel` 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: abortRequest REDACTED:1735 — `abortRequest` 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: loadProfilesForModel REDACTED:1917 — `loadProfilesForModel` 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: loadTemplates REDACTED:1932 — `loadTemplates` 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: loadProfileFields REDACTED:1945 — `loadProfileFields` 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: loadPresets REDACTED:1962 — `loadPresets` 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: refreshPresets REDACTED:1983 — `refreshPresets` 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: createProfile REDACTED:2496 — `createProfile` 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: applyProfileToForm REDACTED:2546 — `applyProfileToForm` 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: deleteProfile REDACTED:2593 — `deleteProfile` 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: updateProfile REDACTED:2644 — `updateProfile` 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: createTemplate REDACTED:2673 — `createTemplate` 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: updateTemplate REDACTED:2714 — `updateTemplate` 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: deleteTemplate REDACTED:2740 — `deleteTemplate` 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: startANETuning REDACTED:2850 — `startANETuning` 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 })`.
  • + 14 more in this group — see findings.md.
X3 · Exception handling · Swallowed exception (caught, then discarded) · ×30
  • Swallowed exception (caught, then discarded) REDACTED:604 — `except Exception` 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) omlx/engine_pool.py:1131 — `except Exception` 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) omlx/engine_pool.py:1148 — `except Exception` 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) omlx/engine_pool.py:1164 — `except Exception` 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) omlx/engine_pool.py:1181 — `except Exception` 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) omlx/engine_pool.py:1198 — `except Exception` 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) omlx/engine_pool.py:1233 — `except Exception` 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) omlx/engine_pool.py:2097 — `except Exception` 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) omlx/engine_pool.py:2106 — `except Exception` 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) omlx/engine_pool.py:2140 — `except Exception` 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) REDACTED:412 — `except Exception` 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) REDACTED:1110 — `except Exception` 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) REDACTED:1991 — `except Exception` 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) REDACTED:2016 — `except Exception` 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) REDACTED:2094 — `except Exception` 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) omlx/model_discovery.py:936 — `except Exception` 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) REDACTED:4363 — `except Exception` 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) REDACTED:4371 — `except Exception` 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) REDACTED:4377 — `except Exception` 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) REDACTED:5455 — `except Exception` 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) REDACTED:5457 — `except Exception` 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) REDACTED:6863 — `except Exception` 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) REDACTED:8237 — `except Exception` 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) REDACTED:11241 — `except Exception` 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) REDACTED:12080 — `except Exception` 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 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×28
  • Duplicated block (7 lines × 2) apps/omlx-cuda-helper/omlx_cuda_helper/families/deepseek_v41/__init__.py:55 — apps/omlx-cuda-helper/omlx_cuda_helper/families/deepseek_v41/__init__.py:55-61 | apps/omlx-cuda-helper/omlx_cuda_helper/families/minimax_m3_vl/__init__.py:185-191 — 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.
  • Duplicated block (7 lines × 2) apps/omlx-cuda-helper/omlx_cuda_helper/families/inkling2/__init__.py:40 — apps/omlx-cuda-helper/omlx_cuda_helper/families/inkling2/__init__.py:40-46 | omlx/prefill_helper/adapters/inkling2.py:50-56 — 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) omlx/admin/ane_tuning.py:1450 — omlx/admin/ane_tuning.py:1450-1456 | omlx/admin/ane_tuning.py:2013-2019 — 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) REDACTED:1702 — REDACTED:1702-1708 | omlx/admin/ms_downloader.py:706-712 — 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 (7 lines × 2) omlx/admin/routes.py:3967 — omlx/admin/routes.py:3967-3973 | omlx/admin/routes.py:4509-4515 — 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 `omlx/admin/routes.py:3967` 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 before the matched lines, `omlx/admin/routes.py:3965` calls `set`, `get_model_ids` and `omlx/admin/routes.py:4508` 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 (7 lines × 2) omlx/cache/prefix_cache.py:2260 — omlx/cache/prefix_cache.py:2260-2266 | omlx/cache/prefix_cache.py:2446-2452 — 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 `omlx/cache/prefix_cache.py:2260` 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 (7 lines × 2) omlx/cache/type_handlers.py:1397 — omlx/cache/type_handlers.py:1397-1403 | omlx/cache/type_handlers.py:1483-1489 — 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) omlx/cluster/launch.py:426 — omlx/cluster/launch.py:426-432 | omlx/cluster/telemetry.py:1803-1809 — 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 (7 lines × 2) omlx/cluster/registry.py:55 — omlx/cluster/registry.py:55-61 | omlx/cluster/registry.py:247-253 — 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) REDACTED:1326 — REDACTED:1326-1332 | omlx/engine/vlm.py:5118-5124 — before extracting anything, compare `REDACTED` and `omlx/engine/vlm.py` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 480 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 (7 lines × 2) omlx/models/qwen2_embedding.py:90 — omlx/models/qwen2_embedding.py:90-98 | omlx/patches/glm_moe_dsa/deepseek_v32.py:598-604 — 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 (7 lines × 2) REDACTED:3753 — REDACTED:3753-3759 | REDACTED:3803-3809 — 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) REDACTED:7991 — REDACTED:7991-7997 | REDACTED:11941-11947 — 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) REDACTED:10592 — REDACTED:10592-10598 | REDACTED:10656-10663 — 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 `REDACTED:10592` 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) omlx/patches/deepseek_v4/deepseek_v4_model.py:1877 — omlx/patches/deepseek_v4/deepseek_v4_model.py:1877-1883 | omlx/patches/deepseek_v4/deepseek_v4_model.py:2146-2152 — 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) omlx/patches/deepseek_v4/moe_offload.py:126 — omlx/patches/deepseek_v4/moe_offload.py:126-132 | omlx/patches/glm_moe_dsa/moe_offload.py:166-172 — `omlx/patches/deepseek_v4/moe_offload.py` and `omlx/patches/glm_moe_dsa/moe_offload.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 9 separate duplicated blocks between them, totalling at least 157 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.
  • Duplicated block (7 lines × 2) omlx/patches/turboquant_attention.py:293 — omlx/patches/turboquant_attention.py:293-299 | omlx/patches/turboquant_attention.py:680-686 — 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 `omlx/patches/turboquant_attention.py:293` 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) omlx/patches/qwen35_moe_routed_decode.py:464 — omlx/patches/qwen35_moe_routed_decode.py:464-470 | omlx/patches/qwen35_moe_routed_decode.py:561-567 — 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 `omlx/patches/qwen35_moe_routed_decode.py:464` 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) omlx/patches/deepseek_v4/moe_offload.py:138 — omlx/patches/deepseek_v4/moe_offload.py:138-144 | omlx/patches/glm_moe_dsa/moe_offload.py:173-179 — `omlx/patches/deepseek_v4/moe_offload.py` and `omlx/patches/glm_moe_dsa/moe_offload.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 9 separate duplicated blocks between them, totalling at least 157 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.
  • Duplicated block (7 lines × 2) omlx/patches/moe_expert_offload.py:762 — omlx/patches/moe_expert_offload.py:762-768 | omlx/patches/moe_expert_offload.py:830-836 — 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) apps/omlx-cuda-helper/omlx_cuda_helper/families/inkling2/kernels.py:497 — apps/omlx-cuda-helper/omlx_cuda_helper/families/inkling2/kernels.py:497-503 | apps/omlx-cuda-helper/omlx_cuda_helper/families/minimax_m3_vl/kernels.py:194-200 — 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) REDACTED:1135 — REDACTED:1135-1141 | omlx/admin/hf_uploader.py:36-42 — 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) REDACTED:270 — REDACTED:270-276 | omlx/engine/vlm.py:1936-1942 — before extracting anything, compare `REDACTED` and `omlx/engine/vlm.py` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 480 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) omlx/patches/bailing_hybrid/bailing_hybrid_model.py:137 — omlx/patches/bailing_hybrid/bailing_hybrid_model.py:137-143 | omlx/patches/bailing_hybrid/swiglu_clamp.py:41-47 — 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) apps/omlx-cuda-helper/omlx_cuda_helper/families/inkling2/stage.py:179 — apps/omlx-cuda-helper/omlx_cuda_helper/families/inkling2/stage.py:179-185 | apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen3_5/stage.py:204-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.
  • + 3 more in this group — see findings.md.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×23
  • Duplicated block (6 lines × 2) apps/omlx-cuda-helper/omlx_cuda_helper/families/inkling2/layers.py:224 — apps/omlx-cuda-helper/omlx_cuda_helper/families/inkling2/layers.py:224-229 | omlx/patches/inkling2/model.py:317-322 — 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) apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen3_5/layers.py:66 — apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen3_5/layers.py:66-71 | apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen4_exp/layers.py:174-179 — 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) apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen4_exp/kernels.py:665 — apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen4_exp/kernels.py:665-670 | apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen4_exp/kernels.py:990-995 — 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 `apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen4_exp/kernels.py:665` 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) omlx/admin/oq_manager.py:363 — omlx/admin/oq_manager.py:363-368 | omlx/admin/oq_manager.py:398-404 — 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) omlx/admin/routes.py:2754 — omlx/admin/routes.py:2754-2759 | REDACTED:4035-4040 — 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) omlx/engine/distributed.py:1971 — omlx/engine/distributed.py:1971-1978 | omlx/engine/distributed.py:2016-2021 — 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 `omlx/engine/distributed.py:1971` 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 (6 lines × 2) omlx/model_settings.py:1206 — omlx/model_settings.py:1206-1211 | omlx/model_settings.py:1814-1819 — 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 `omlx/model_settings.py:1206` 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 (6 lines × 2) omlx/patches/deepseek_v4/switch_layers.py:469 — omlx/patches/deepseek_v4/switch_layers.py:469-474 | omlx/patches/glm_moe_dsa/switch_layers.py:192-197 — `omlx/patches/deepseek_v4/switch_layers.py` and `omlx/patches/glm_moe_dsa/switch_layers.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 75 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.
  • Duplicated block (6 lines × 2) omlx/patches/qwen35_oq_a8.py:491 — omlx/patches/qwen35_oq_a8.py:491-496 | omlx/patches/qwen35_q4_mlp.py:278-283 — 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 (6 lines × 2) omlx/patches/raon1_mini/raon1_mini_model.py:178 — omlx/patches/raon1_mini/raon1_mini_model.py:178-183 | omlx/patches/raon1_mini/raon1_mini_model.py:589-596 — 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) omlx/patches/raon1_mini/raon1_mini_model.py:1810 — omlx/patches/raon1_mini/raon1_mini_model.py:1810-1815 | omlx/patches/raon1_mini/raon1_mini_model.py:1836-1841 — 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) omlx/prefill_helper/launcher.py:357 — omlx/prefill_helper/launcher.py:357-362 | omlx/prefill_helper/launcher.py:378-383 — 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) apps/omlx-cuda-helper/omlx_cuda_helper/families/deepseek_v41/ngram.py:134 — apps/omlx-cuda-helper/omlx_cuda_helper/families/deepseek_v41/ngram.py:134-139 | omlx/patches/deepseek_v41/storage.py:362-367 — 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) omlx/api/decisions.py:170 — omlx/api/decisions.py:170-175 | omlx/models/openjev.py:168-173 — 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 `omlx/api/decisions.py:170` 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 (6 lines × 2) REDACTED:6920 — REDACTED:6920-6925 | REDACTED:6951-6956 — 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) omlx/patches/bailing_hybrid/bailing_hybrid_model.py:961 — omlx/patches/bailing_hybrid/bailing_hybrid_model.py:961-966 | omlx/patches/glm_moe_dsa/deepseek_v32.py:1026-1031 — 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) omlx/patches/m5_gather_qmm_a8.py:1344 — omlx/patches/m5_gather_qmm_a8.py:1344-1349 | omlx/patches/m5_gather_qmm_a8.py:1467-1472 — 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.
  • Duplicated block (6 lines × 2) apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen3_5/stage.py:101 — apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen3_5/stage.py:101-106 | apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen4_exp/stage.py:115-120 — 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) apps/omlx-cuda-helper/omlx_cuda_helper/wire.py:62 — apps/omlx-cuda-helper/omlx_cuda_helper/wire.py:62-67 | omlx/prefill_helper/wire.py:71-76 — 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) omlx/adapter/gemma4.py:296 — omlx/adapter/gemma4.py:296-301 | omlx/api/tool_calling.py:3253-3258 — 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) omlx/eval/cmmlu.py:27 — omlx/eval/cmmlu.py:27-32 | omlx/eval/jmmlu.py:27-32 — 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 (6 lines × 2) omlx/patches/mlx_lm_mtp/glm_moe_dsa_model.py:251 — omlx/patches/mlx_lm_mtp/glm_moe_dsa_model.py:251-256 | omlx/patches/mlx_vlm_mtp/glm5_next_vlm_runtime.py:199-204 — 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) apps/omlx-mac/Sources/AppView/Screens/DownloadsScreen.swift:645 — apps/omlx-mac/Sources/AppView/Screens/DownloadsScreen.swift:645-650 | apps/omlx-mac/Sources/AppView/Screens/DownloadsScreen.swift:764-769 — 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.
D3 · God Classes · MethodTooLong · ×22
  • MethodTooLong: ExperimentalSection.body apps/omlx-mac/Sources/AppView/Screens/ModelSettingsScreen.swift:2503 — MethodTooLong — body runs 296 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 196 over it, 2.96× 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: ModelSettingsScreenVM.save apps/omlx-mac/Sources/AppView/ViewModels/ModelSettingsScreenVM.swift:865 — MethodTooLong — save runs 208 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 108 over it, 2.08× 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: AppearanceScreen.body apps/omlx-mac/Sources/AppView/Screens/AppearanceScreen.swift:33 — MethodTooLong — body runs 186 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 86 over it, 1.86× 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: AccelerationSection.body apps/omlx-mac/Sources/AppView/Screens/ModelSettingsScreen.swift:2199 — MethodTooLong — body runs 173 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 73 over it, 1.73× 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: ServerScreen.body apps/omlx-mac/Sources/AppView/Screens/ServerScreen.swift:17 — MethodTooLong — body runs 167 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 67 over it, 1.67× 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: ServerScreenVM.applyServerSettings apps/omlx-mac/Sources/AppView/ViewModels/ServerScreenVM.swift:241 — MethodTooLong — applyServerSettings runs 163 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 63 over it, 1.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.
  • MethodTooLong: MenubarIconRecovery.fixStatusKitPermission apps/omlx-mac/Sources/Menubar/MenubarVisibilityWatcher.swift:368 — MethodTooLong — fixStatusKitPermission runs 163 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 63 over it, 1.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.
  • MethodTooLong: ModelSettingsScreenVM.load apps/omlx-mac/Sources/AppView/ViewModels/ModelSettingsScreenVM.swift:704 — MethodTooLong — load runs 141 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 41 over it, 1.41× 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: StatusScreen.body apps/omlx-mac/Sources/AppView/Screens/StatusScreen.swift:21 — MethodTooLong — body runs 138 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 38 over it, 1.38× 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: ExternalEnginesSection.body apps/omlx-mac/Sources/AppView/Screens/IntegrationsScreen.swift:42 — MethodTooLong — body runs 136 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 36 over it, 1.36× 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: AdvancedPage.body apps/omlx-mac/Sources/AppView/Screens/ModelSettingsScreen.swift:1221 — MethodTooLong — body runs 130 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 30 over it, 1.30× 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: ConfigurationSection.body apps/omlx-mac/Sources/AppView/Screens/ThroughputBenchScreen.swift:177 — MethodTooLong — body runs 123 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 23 over it, 1.23× 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: SubKeysSection.body apps/omlx-mac/Sources/AppView/Screens/SecurityScreen.swift:282 — MethodTooLong — body runs 114 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 14 over it, 1.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.
  • MethodTooLong: ServerDefaultProfileEditor.body apps/omlx-mac/Sources/AppView/Screens/ServerScreen.swift:492 — MethodTooLong — body runs 113 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 13 over it, 1.13× 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: WelcomeSetupBody.body apps/omlx-mac/Sources/Welcome/WelcomeWindow.swift:527 — MethodTooLong — body runs 113 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 13 over it, 1.13× 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: ModelSettingsScreenVM.currentSettingsDict apps/omlx-mac/Sources/AppView/ViewModels/ModelSettingsScreenVM.swift:1755 — MethodTooLong — currentSettingsDict runs 110 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 10 over it, 1.10× 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: AboutSection.aboutContent apps/omlx-mac/Sources/AppView/Screens/QuantizationScreen.swift:1266 — MethodTooLong — aboutContent runs 109 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 9 over it, 1.09× 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: UsageHistoryView.body apps/omlx-mac/Sources/AppView/Screens/UsageHistoryView.swift:16 — MethodTooLong — body runs 107 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 7 over it, 1.07× 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: PerformanceScreenVM.save apps/omlx-mac/Sources/AppView/ViewModels/PerformanceScreenVM.swift:232 — MethodTooLong — save runs 104 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 4 over it, 1.04× 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: IntegrationsScreenVM.save apps/omlx-mac/Sources/AppView/ViewModels/IntegrationsScreenVM.swift:354 — MethodTooLong — save runs 103 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 3 over it, 1.03× 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: WebSearchSection.body apps/omlx-mac/Sources/AppView/Screens/IntegrationsScreen.swift:314 — MethodTooLong — body runs 102 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 2 over it, 1.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: MenubarController.buildMenu apps/omlx-mac/Sources/Menubar/MenubarController.swift:241 — MethodTooLong — buildMenu runs 101 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1 over it, 1.01× 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 (11 lines × 2) · ×22
  • Duplicated block (11 lines × 2) omlx/adapter/gemma4.py:144 — omlx/adapter/gemma4.py:144-154 | omlx/adapter/gemma4.py:235-245 — 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) REDACTED:1824 — REDACTED:1824-1834 | omlx/admin/ms_downloader.py:765-775 — 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 (11 lines × 2) REDACTED:1865 — REDACTED:1865-1875 | omlx/admin/ms_downloader.py:803-813 — 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 (11 lines × 2) omlx/admin/routes.py:3901 — omlx/admin/routes.py:3901-3911 | omlx/admin/routes.py:3961-3971 — 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 `omlx/admin/routes.py:3901` 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 (11 lines × 2) omlx/cache/paged_ssd_cache.py:5392 — omlx/cache/paged_ssd_cache.py:5392-5402 | omlx/cache/paged_ssd_cache.py:5494-5504 — 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 `omlx/cache/paged_ssd_cache.py:5392` 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 (11 lines × 2) omlx/cluster/runtime.py:562 — omlx/cluster/runtime.py:562-572 | omlx/cluster/runtime.py:580-590 — 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) REDACTED:728 — REDACTED:728-738 | REDACTED:897-907 — 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) REDACTED:2249 — REDACTED:2249-2259 | omlx/scheduler.py:16780-16790 — 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 `REDACTED:2249` 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 (11 lines × 2) REDACTED:11497 — REDACTED:11497-11507 | REDACTED:12259-12269 — 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) omlx/patches/deepseek_v4/cache_handlers.py:128 — omlx/patches/deepseek_v4/cache_handlers.py:128-140 | omlx/patches/deepseek_v4/cache_handlers.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) omlx/patches/inkling2/loader.py:73 — omlx/patches/inkling2/loader.py:73-83 | omlx/patches/inkling2/oq_layout.py:97-107 — before extracting anything, compare `omlx/patches/inkling2/loader.py` and `omlx/patches/inkling2/oq_layout.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 51 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 `omlx/patches/inkling2/loader.py:73` 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 (11 lines × 2) omlx/patches/inkling2/oq_virtual.py:58 — omlx/patches/inkling2/oq_virtual.py:58-68 | omlx/patches/mlx_vlm_minimax_m3_compat/virtual_nvfp4.py:97-107 — 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 `omlx/patches/inkling2/oq_virtual.py:58` 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 (11 lines × 2) omlx/patches/qwen35_ane_prefill.py:1143 — omlx/patches/qwen35_ane_prefill.py:1143-1153 | omlx/patches/qwen35_ane_prefill.py:1392-1402 — 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 `omlx/patches/qwen35_ane_prefill.py:1143` 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 (11 lines × 2) omlx/patches/qwen35_q4_mlp.py:566 — omlx/patches/qwen35_q4_mlp.py:566-576 | omlx/patches/qwen35_q4_mlp.py:648-658 — 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) omlx/scheduler.py:4475 — omlx/scheduler.py:4475-4485 | omlx/scheduler.py:6813-6823 — 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) REDACTED:8313 — REDACTED:8313-8324 | REDACTED:8472-8482 — 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) apps/omlx-cuda-helper/omlx_cuda_helper/wire.py:139 — apps/omlx-cuda-helper/omlx_cuda_helper/wire.py:139-149 | omlx/prefill_helper/wire.py:144-154 — 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) omlx/cluster/launch.py:283 — omlx/cluster/launch.py:283-293 | omlx/cluster/liveness.py:260-274 — 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 (11 lines × 2) REDACTED:118 — REDACTED:118-128 | omlx/engine/vlm.py:1768-1778 — before extracting anything, compare `REDACTED` and `omlx/engine/vlm.py` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 480 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 (11 lines × 2) REDACTED:1683 — REDACTED:1683-1693 | omlx/engine/vlm.py:6249-6259 — before extracting anything, compare `REDACTED` and `omlx/engine/vlm.py` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 480 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 (11 lines × 2) omlx/cluster/enrollment.py:319 — omlx/cluster/enrollment.py:319-329 | REDACTED:438-448 — 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 (11 lines × 2) apps/omlx-mac/Sources/AppView/Screens/DownloadsScreen.swift:776 — apps/omlx-mac/Sources/AppView/Screens/DownloadsScreen.swift:776-786 | apps/omlx-mac/Sources/AppView/Screens/DownloadsScreen.swift:889-899 — 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 `apps/omlx-mac/Sources/AppView/Screens/DownloadsScreen.swift:776` 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 (9 lines × 2) · ×22
  • Duplicated block (9 lines × 2) apps/omlx-cuda-helper/omlx_cuda_helper/families/inkling2/layers.py:238 — apps/omlx-cuda-helper/omlx_cuda_helper/families/inkling2/layers.py:238-246 | omlx/patches/inkling2/model.py:331-339 — 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) omlx/admin/ane_tuning.py:1010 — omlx/admin/ane_tuning.py:1010-1018 | omlx/admin/ane_tuning.py:1069-1077 — 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) omlx/admin/ane_tuning.py:2422 — omlx/admin/ane_tuning.py:2422-2430 | omlx/admin/ane_tuning.py:2550-2558 — 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 `omlx/admin/ane_tuning.py:2422` 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) omlx/admin/oq_manager.py:127 — omlx/admin/oq_manager.py:127-135 | REDACTED:4331-4339 — 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 (9 lines × 2) omlx/admin/routes.py:7641 — omlx/admin/routes.py:7641-7649 | omlx/admin/routes.py:7757-7765 — 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) omlx/cache/paged_ssd_cache.py:5378 — omlx/cache/paged_ssd_cache.py:5378-5386 | omlx/cache/paged_ssd_cache.py:5480-5488 — 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 `omlx/cache/paged_ssd_cache.py:5378` 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) REDACTED:999 — REDACTED:999-1007 | REDACTED:1021-1029 — 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) omlx/patches/mimo_v2/mimo_v2_model.py:479 — omlx/patches/hy_v3/hy_v3_model.py:253-261 | omlx/patches/mimo_v2/mimo_v2_model.py:479-487 — 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) omlx/patches/mlx_lm_mtp/deepseek_v4_dspark.py:126 — omlx/patches/mlx_lm_mtp/deepseek_v4_dspark.py:126-134 | REDACTED:156-164 — 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) omlx/patches/qwen35_ane_prefill.py:744 — omlx/patches/qwen35_ane_prefill.py:744-752 | omlx/patches/qwen35_ane_prefill.py:866-874 — 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) omlx/patches/qwen35_ane_prefill.py:1126 — omlx/patches/qwen35_ane_prefill.py:1126-1134 | omlx/patches/qwen35_ane_prefill.py:1373-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. 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) omlx/patches/qwen35_gdn_prework.py:1525 — omlx/patches/qwen35_gdn_prework.py:1525-1533 | omlx/patches/qwen35_gdn_prework.py:1689-1697 — 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 `omlx/patches/qwen35_gdn_prework.py:1525` 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) REDACTED:5469 — REDACTED:5469-5477 | REDACTED:8263-8271 — 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) REDACTED:7165 — REDACTED:7165-7173 | REDACTED:7716-7724 — 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) REDACTED:9030 — REDACTED:9030-9038 | REDACTED:9648-9656 — 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) omlx/patches/qwen35_verify_qmm.py:251 — omlx/patches/qwen35_verify_qmm.py:251-259 | omlx/patches/qwen35_verify_qmm.py:399-407 — 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.
  • Duplicated block (9 lines × 2) omlx/admin/hf_uploader.py:636 — omlx/admin/hf_uploader.py:636-653 | omlx/admin/oq_manager.py:575-583 — 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) omlx/eval/humaneval.py:103 — omlx/eval/humaneval.py:103-111 | omlx/eval/livecodebench.py:68-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.
  • Duplicated block (9 lines × 2) omlx/admin/benchmark.py:613 — omlx/admin/benchmark.py:613-621 | omlx/admin/context_benchmark.py:151-159 — 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) apps/omlx-mac/Sources/AppView/Screens/ContextBenchScreen.swift:242 — apps/omlx-mac/Sources/AppView/Screens/ContextBenchScreen.swift:242-250 | apps/omlx-mac/Sources/AppView/Screens/ThroughputBenchScreen.swift:949-957 — 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 `apps/omlx-mac/Sources/AppView/Screens/ContextBenchScreen.swift:242` 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 before the matched lines, `apps/omlx-mac/Sources/AppView/Screens/ThroughputBenchScreen.swift:946` calls `font`, `omlxText`, `foregroundStyle` and `apps/omlx-mac/Sources/AppView/Screens/ContextBenchScreen.swift:241` 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) apps/omlx-mac/Sources/AppView/Screens/QuantizationScreen.swift:894 — apps/omlx-mac/Sources/AppView/Screens/QuantizationScreen.swift:894-902 | apps/omlx-mac/Sources/Theme/Components/ScreenScaffold.swift:77-85 — 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 `apps/omlx-mac/Sources/AppView/Screens/QuantizationScreen.swift: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.
  • Duplicated block (9 lines × 2) apps/omlx-mac/Sources/AppView/Utils/SystemMetricsPoller.swift:62 — apps/omlx-mac/Sources/AppView/Utils/SystemMetricsPoller.swift:62-70 | apps/omlx-mac/Sources/Menubar/SystemStatsSampler.swift:266-274 — 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.
D15 · Churn × Complexity Hotspots · Repeated repair · ×21
  • Repeated repair: omlx/prefill_transient_tracker.py omlx/prefill_transient_tracker.py:91 — omlx/prefill_transient_tracker.py changed 11 times in last 90 days and 10 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 PrefillTransientTracker.update at line 91), AT OR 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(scheduler): keep wide prefill chunks for flat-overhead models under memory pressure (#4902)”; “fix: expire prefill outlier samples after their prefill (#4903)”; “fix: account for prefill pool releases and preserve chunk sizing (#3465)”; “fix(qwen4_exp): bound masked SDPA256 memory pricing (#3461)”. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:01:09 +09:00' --until='2026-11-16 19:01:09 +09:00' --full-history --no-merges -- omlx/prefill_transient_tracker.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: omlx/patches/sdpa256_attention.py omlx/patches/sdpa256_attention.py:414 — omlx/patches/sdpa256_attention.py changed 12 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 sdpa256_attention.apply_sdpa256_attention_patch at line 414), AT OR 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: keep fp16 head_dim 256 SDPA under the M1/M2 thread limit (#4609)”; “fix(attention): keep SDPA256 prefill on the bounded route (#3685)”; “fix: use tiled attention for FP32 prefill (#3795)”; “fix: scope SDPA headroom providers to engine workers (#3333)”. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:01:09 +09:00' --until='2026-11-16 19:01:09 +09:00' --full-history --no-merges -- omlx/patches/sdpa256_attention.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: apps/omlx-mac/Sources/AppView/Screens/ServerScreen.swift apps/omlx-mac/Sources/AppView/Screens/ServerScreen.swift:424 — apps/omlx-mac/Sources/AppView/Screens/ServerScreen.swift 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 7 (its worst body is ServerHeroCard.pillStatus at line 424), AT OR 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: bracket IPv6 hosts in Server API endpoint URLs (#4043)”; “fix: restore previous settings when reset is canceled”; “fix: clarify pin in memory setting location (#3691)”; “fix(mac): align the macOS app UI with system conventions (#3376)”. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:01:09 +09:00' --until='2026-11-16 19:01:09 +09:00' --full-history --no-merges -- apps/omlx-mac/Sources/AppView/Screens/ServerScreen.swift`: 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: omlx/exceptions.py omlx/exceptions.py:43 — omlx/exceptions.py changed 5 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 exceptions.describe_ceiling_binding at line 43), AT OR 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(prefill-helper): keep the MTP head off the helper and step down on OOM (#5180)”; “fix: show oMLX's own memory use in dynamic ceiling advice”; “fix(memory-guard): stop rejecting long prompts that fit, and keep their cache afterward (#4554)”; “fix(memory-guard): free hot cache instead of rejecting prompts (#4252)”. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:01:09 +09:00' --until='2026-11-16 19:01:09 +09:00' --full-history --no-merges -- omlx/exceptions.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: omlx/patches/vlm_batch_kv_capacity.py omlx/patches/vlm_batch_kv_capacity.py:297 — omlx/patches/vlm_batch_kv_capacity.py changed 5 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 _CapacityMethods.filter at line 297), AT OR 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: keep batch KV rows and grow long banks one layer at a time (#4907) (#4971)”; “fix: keep long-context batch KV banks in place on finish and rollback (#4907) (#4954)”; “fix(cache): join requests in place and stop batch KV bank growth (#4936)”; “fix(mtp): reduce batched Lightning MTP peak memory at long context (#4916)”. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:01:09 +09:00' --until='2026-11-16 19:01:09 +09:00' --full-history --no-merges -- omlx/patches/vlm_batch_kv_capacity.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:1053 — REDACTED 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 STTEngine._transcribe_stream_token_ids at line 1053), AT OR 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(stt): reserve realtime sessions before backend startup (#5092)”; “fix: pass mx.array to whole-buffer STT models in realtime (#5043)”; “fix(stt): don't make a load error its own cause; stop on cause cycles (#4542)”; “fix: load quantized Qwen3-ASR audio layers (#4382)”. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:01:09 +09:00' --until='2026-11-16 19:01:09 +09: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: apps/omlx-mac/Sources/AppView/Screens/PerformanceScreen.swift apps/omlx-mac/Sources/AppView/Screens/PerformanceScreen.swift:24 — apps/omlx-mac/Sources/AppView/Screens/PerformanceScreen.swift 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 5 (its worst body is PerformanceScreen.body at line 24), AT OR 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(cache): turn the SSD cache off when its configured dir is unavailable”; “fix: size automatic SSD cache by available space (#3829)”; “fix: restore previous settings when reset is canceled”; “fix(mac): align the macOS app UI with system conventions (#3376)”. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:01:09 +09:00' --until='2026-11-16 19:01:09 +09:00' --full-history --no-merges -- apps/omlx-mac/Sources/AppView/Screens/PerformanceScreen.swift`: 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: apps/omlx-mac/Sources/Menubar/MenubarController.swift apps/omlx-mac/Sources/Menubar/MenubarController.swift:382 — apps/omlx-mac/Sources/Menubar/MenubarController.swift 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 MenubarController.refreshMenuState at line 382), AT OR 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(macos): preserve server restart during stale health updates (#5070)”; “fix(mac): skip menubar icon redraws when the icon did not change (#5049)”; “fix(mac): show the no-API-key stats hint in the menubar All-Time section”; “fix(mac): show counts in 万 and 亿 in Chinese (#3826)”. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:01:09 +09:00' --until='2026-11-16 19:01:09 +09:00' --full-history --no-merges -- apps/omlx-mac/Sources/Menubar/MenubarController.swift`: 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: omlx/api/responses_models.py omlx/api/responses_models.py:209 — omlx/api/responses_models.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 4 (its worst body is ResponseUsage.model_post_init at line 209), AT OR 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: reject non-positive max tokens on messages, responses and STT”; “fix(responses): route namespace tool groups through to the model and back (#3664)”; “fix(responses): route function_call_output images to vlm instead of prompt text (#2989)”; “fix(responses): surface max_output_tokens truncation as incomplete (#2817)”. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:01:09 +09:00' --until='2026-11-16 19:01:09 +09:00' --full-history --no-merges -- omlx/api/responses_models.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: omlx/cluster/system_socket_proxy.py omlx/cluster/system_socket_proxy.py:171 — omlx/cluster/system_socket_proxy.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 11 (its worst body is system_socket_proxy.open_system_tcp_proxy at line 171), AT OR 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: isolate cluster helper python and surface rank failures (#3937, #3967)”; “fix(cluster): preserve control proxy fallback and deadlines (#3577)”; “fix(cluster): direct-first control transport and venv-aware system proxy (#3577)”. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:01:09 +09:00' --until='2026-11-16 19:01:09 +09:00' --full-history --no-merges -- omlx/cluster/system_socket_proxy.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: omlx/integrations/dsh.py omlx/integrations/dsh.py:491 — omlx/integrations/dsh.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 11 (its worst body is dsh._validate_patch at line 491), AT OR 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: cache-stack invariants, SSD-tier hygiene, and small hardening follow-ups (#4163)”; “fix(integrations): stop writing duplicate keys into a new dsh patch entry”; “fix(integrations): create the dsh credential store as 0600 and drop unused dsh assets”. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:01:09 +09:00' --until='2026-11-16 19:01:09 +09:00' --full-history --no-merges -- omlx/integrations/dsh.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: apps/omlx-mac/Sources/AppView/Screens/SecurityScreen.swift apps/omlx-mac/Sources/AppView/Screens/SecurityScreen.swift:96 — apps/omlx-mac/Sources/AppView/Screens/SecurityScreen.swift 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 8 (its worst body is APIKeyEditorRow.body at line 96), AT OR 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: tint the disable-all-authentication switch red (#4899)”; “fix(omlx-mac): reload the API key for menubar status polls (#4450)”; “fix(mac): align the macOS app UI with system conventions (#3376)”. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:01:09 +09:00' --until='2026-11-16 19:01:09 +09:00' --full-history --no-merges -- apps/omlx-mac/Sources/AppView/Screens/SecurityScreen.swift`: 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: omlx/patches/mlx_vlm_minimax_m3_compat/__init__.py omlx/patches/mlx_vlm_minimax_m3_compat/__init__.py:308 — omlx/patches/mlx_vlm_minimax_m3_compat/__init__.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 13 (its worst body is mlx_vlm_minimax_m3_compat._normalize_quantization_config at line 308), AT OR 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(vlm): keep interleaved text and images in order for the generic formatter (#4770)”; “chore: reduce #4298, #4299, #4301, #4305 and #4307 to the root-cause fixes”; “fix(anthropic): stop collapsing thinking_mode adaptive into enabled (#4301)”. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:01:09 +09:00' --until='2026-11-16 19:01:09 +09:00' --full-history --no-merges -- omlx/patches/mlx_vlm_minimax_m3_compat/__init__.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: apps/omlx-mac/Sources/Server/ServerProcess.swift apps/omlx-mac/Sources/Server/ServerProcess.swift:501 — apps/omlx-mac/Sources/Server/ServerProcess.swift changed 4 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 15 (its worst body is ServerProcess.tickHealth at line 501), AT OR 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(macos): preserve server restart during stale health updates (#5070)”; “fix: recover startup with legacy unauthenticated network settings (#3730) (#3735)”; “fix: preserve macOS port changes across restarts (#1215)”. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:01:09 +09:00' --until='2026-11-16 19:01:09 +09:00' --full-history --no-merges -- apps/omlx-mac/Sources/Server/ServerProcess.swift`: 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: apps/omlx-mac/Sources/Menubar/MenubarStatsPoller.swift apps/omlx-mac/Sources/Menubar/MenubarStatsPoller.swift:322 — apps/omlx-mac/Sources/Menubar/MenubarStatsPoller.swift changed 4 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 10 (its worst body is MenubarStatsPoller.refreshOnce at line 322), AT OR 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(mac): show the no-API-key stats hint in the menubar All-Time section”; “fix(mac): show counts in 万 and 亿 in Chinese (#3826)”; “fix(omlx-mac): reload the API key for menubar status polls (#4450)”. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:01:09 +09:00' --until='2026-11-16 19:01:09 +09:00' --full-history --no-merges -- apps/omlx-mac/Sources/Menubar/MenubarStatsPoller.swift`: 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: omlx/api/anthropic_models.py omlx/api/anthropic_models.py:109 — omlx/api/anthropic_models.py changed 4 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 5 (its worst body is anthropic_models._content_block_tag at line 109), AT OR 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(anthropic): honor tool_choice none on /v1/messages (#4818)”; “fix: reject non-positive max tokens on messages, responses and STT”; “fix(anthropic): accept unknown content block types instead of 422ing (#4201)”. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:01:09 +09:00' --until='2026-11-16 19:01:09 +09:00' --full-history --no-merges -- omlx/api/anthropic_models.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: omlx/utils/metal_sync.py omlx/utils/metal_sync.py:106 — omlx/utils/metal_sync.py changed 4 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 6 (its worst body is metal_sync.unreleased_graphics_bytes at line 106), AT OR 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(engine): prevent GPU hangs when several models run at once (#4637)”; “fix(memory-guard): rework tier semantics and prefill accounting (#3933)”; “fix: exit on rejected Metal GPU submissions (#3706)”. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:01:09 +09:00' --until='2026-11-16 19:01:09 +09:00' --full-history --no-merges -- omlx/utils/metal_sync.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: omlx/eval/livecodebench.py omlx/eval/livecodebench.py:154 — omlx/eval/livecodebench.py changed 4 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 9 (its worst body is LiveCodeBenchBenchmark.load_dataset at line 154), AT OR 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(eval): grade LiveCodeBench functional problems by return value (#4545)”; “fix(eval): keep code scoring off the event loop (#3635)”; “fix(eval): run accuracy benchmark questions through a worker pool (#3635)”. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:01:09 +09:00' --until='2026-11-16 19:01:09 +09:00' --full-history --no-merges -- omlx/eval/livecodebench.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: omlx/patches/deepseek_v4/utils_patch.py omlx/patches/deepseek_v4/utils_patch.py:46 — omlx/patches/deepseek_v4/utils_patch.py changed 4 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 9 (its worst body is utils_patch._native_ratio128_attention_enabled at line 46), AT OR 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: “chore: reduce #4196, #4300, #4184 and #4182 to the root-cause fixes”; “fix(oq): log sanitizer patch failures at warning level (#4182)”; “fix(deepseek): detect nested low-bit attention overrides (#3560)”. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:01:09 +09:00' --until='2026-11-16 19:01:09 +09:00' --full-history --no-merges -- omlx/patches/deepseek_v4/utils_patch.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: omlx/eval/humaneval.py omlx/eval/humaneval.py:59 — omlx/eval/humaneval.py changed 3 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 13 (its worst body is humaneval._extract_code at line 59), AT OR 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(eval): place HumanEval body-only answers under the prompt's signature”; “fix(eval): keep code scoring off the event loop (#3635)”; “fix(eval): run accuracy benchmark questions through a worker pool (#3635)”. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:01:09 +09:00' --until='2026-11-16 19:01:09 +09:00' --full-history --no-merges -- omlx/eval/humaneval.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: omlx/utils/psutil_compat.py omlx/utils/psutil_compat.py:107 — omlx/utils/psutil_compat.py changed 3 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 11 (its worst body is psutil_compat.get_macos_vm_stats at line 107), AT OR 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(memory-guard): rework tier semantics and prefill accounting (#3933)”; “fix: preserve compressed memory stats with portable count (#2983)”; “fix(macos): use portable vm statistics request count (#3358)”. 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-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 19:01:09 +09:00' --until='2026-11-16 19:01:09 +09:00' --full-history --no-merges -- omlx/utils/psutil_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.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×21
  • Duplicated block (5 lines × 2) apps/omlx-cuda-helper/omlx_cuda_helper/checkpoint.py:47 — apps/omlx-cuda-helper/omlx_cuda_helper/checkpoint.py:47-51 | omlx/prefill_helper/adapter.py:47-51 — 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) apps/omlx-cuda-helper/omlx_cuda_helper/families/deepseek_v41/kernels.py:1289 — apps/omlx-cuda-helper/omlx_cuda_helper/families/deepseek_v41/kernels.py:1289-1293 | omlx/patches/deepseek_v41/hyper_connection.py:200-204 — 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 `apps/omlx-cuda-helper/omlx_cuda_helper/families/deepseek_v41/kernels.py:1289` 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 × 2) apps/omlx-cuda-helper/omlx_cuda_helper/families/deepseek_v41/ngram.py:91 — apps/omlx-cuda-helper/omlx_cuda_helper/families/deepseek_v41/ngram.py:91-95 | omlx/patches/deepseek_v41/engram.py:97-102 — 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 `apps/omlx-cuda-helper/omlx_cuda_helper/families/deepseek_v41/ngram.py:91` 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 × 2) apps/omlx-cuda-helper/omlx_cuda_helper/families/inkling2/layers.py:49 — apps/omlx-cuda-helper/omlx_cuda_helper/families/inkling2/layers.py:49-53 | omlx/patches/inkling2/model.py:166-174 — 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) REDACTED:57 — REDACTED:57-61 | REDACTED:193-197 — 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) omlx/cache/boundary_snapshot_store.py:1826 — omlx/cache/boundary_snapshot_store.py:1826-1830 | omlx/cache/boundary_snapshot_store.py:1853-1857 — 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) omlx/cache/prefix_cache.py:2148 — omlx/cache/prefix_cache.py:2148-2152 | omlx/cache/type_handlers.py:1060-1064 — 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) omlx/cache/prefix_cache.py:2707 — omlx/cache/prefix_cache.py:2707-2711 | omlx/cache/prefix_cache.py:3005-3009 — 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 `omlx/cache/prefix_cache.py:2707` 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 × 2) omlx/patches/laguna/laguna_model.py:424 — omlx/patches/laguna/laguna_model.py:424-428 | omlx/speculative/dflash/drafter.py:774-778 — 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 `omlx/patches/laguna/laguna_model.py:424` 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 (5 lines × 2) omlx/patches/m5_gather_qmm_a8.py:1319 — omlx/patches/m5_gather_qmm_a8.py:1319-1323 | omlx/patches/m5_gather_qmm_a8.py:1398-1402 — 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) omlx/patches/mlx_vlm_mtp/inkling_vlm_runtime.py:525 — omlx/patches/mlx_vlm_mtp/inkling_vlm_runtime.py:525-529 | omlx/patches/mlx_vlm_mtp/inkling_vlm_runtime.py:614-618 — 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) omlx/cluster/identity.py:38 — omlx/cluster/identity.py:38-42 | omlx/cluster/registry.py:208-212 — 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) omlx/patches/deepseek_v4/switch_layers.py:696 — omlx/patches/deepseek_v4/switch_layers.py:696-700 | omlx/patches/glm_moe_dsa/switch_layers.py:287-291 — `omlx/patches/deepseek_v4/switch_layers.py` and `omlx/patches/glm_moe_dsa/switch_layers.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 75 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.
  • Duplicated block (5 lines × 2) omlx/admin/benchmark.py:605 — omlx/admin/benchmark.py:605-609 | omlx/admin/context_benchmark.py:143-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 `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 `request` to `BenchmarkRequest` in one and `ContextBenchmarkRequest` 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) omlx/patches/deepseek_v4/deepseek_v4_model.py:2363 — omlx/patches/deepseek_v4/deepseek_v4_model.py:2363-2367 | omlx/patches/glm_moe_dsa/deepseek_v32.py:830-834 — 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) apps/omlx-cuda-helper/omlx_cuda_helper/families/inkling2/layers.py:275 — apps/omlx-cuda-helper/omlx_cuda_helper/families/inkling2/layers.py:275-279 | omlx/patches/inkling2/kernels.py:419-423 — 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 `apps/omlx-cuda-helper/omlx_cuda_helper/families/inkling2/layers.py:275` 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 (5 lines × 2) apps/omlx-cuda-helper/omlx_cuda_helper/families/inkling2/layers.py:327 — apps/omlx-cuda-helper/omlx_cuda_helper/families/inkling2/layers.py:327-331 | apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen3_5/layers.py:144-148 — 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) apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen3_5/__init__.py:61 — apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen3_5/__init__.py:61-65 | apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen4_exp/__init__.py:80-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. Read the line range as the matched WINDOW rather than a finished unit: at `apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen3_5/__init__.py:61` 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) apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen3_5/layers.py:101 — apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen3_5/layers.py:101-105 | apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen4_exp/layers.py:244-248 — 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) omlx/patches/specprefill.py:823 — omlx/patches/specprefill.py:823-827 | omlx/patches/specprefill.py:867-871 — 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) apps/omlx-mac/Sources/AppView/Screens/ContextBenchScreen.swift:204 — apps/omlx-mac/Sources/AppView/Screens/ContextBenchScreen.swift:204-209 | apps/omlx-mac/Sources/AppView/Screens/ThroughputBenchScreen.swift:333-337 — 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 `apps/omlx-mac/Sources/AppView/Screens/ContextBenchScreen.swift:204` 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.
AC6 · Visual & motion safety · Animation without a prefers-reduced-motion guard · ×20
  • Animation without a prefers-reduced-motion guard apps/omlx-web/omlx_web/templates/chat.html:80 — `.message-fade-in` moves (`animation: fadeIn 0.3s ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard apps/omlx-web/omlx_web/templates/chat.html:532 — `.svg-allow-switch-knob` moves (`transition: transform 0.2s ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard apps/omlx-web/omlx_web/templates/chat.html:657 — `.thinking-toggle` moves (`transition: transform 0.2s ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard apps/omlx-web/omlx_web/templates/chat.html:863 — `.composer-switch::after` moves (`transition: transform 0.15s`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard apps/omlx-web/omlx_web/templates/chat.html:897 — `.reasoning-slider-fill` moves (`transition: width 0.15s ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
  • Animation without a prefers-reduced-motion guard apps/omlx-web/omlx_web/templates/dashboard.html — <svg> moves — its `animate-spin` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:.
  • Animation without a prefers-reduced-motion guard apps/omlx-web/omlx_web/templates/dashboard/_bench.html:259 — <div> moves — its `animate-spin` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:.
  • Animation without a prefers-reduced-motion guard apps/omlx-web/omlx_web/templates/dashboard/_bench.html:400 — <div> moves — its `animate-spin` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:.
  • Animation without a prefers-reduced-motion guard apps/omlx-web/omlx_web/templates/dashboard/_bench_accuracy.html — <svg> moves — its `animate-spin` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:.
  • Animation without a prefers-reduced-motion guard apps/omlx-web/omlx_web/templates/dashboard/_cluster_v2.html:228 — <span> moves — its `animate-ping` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:.
  • Animation without a prefers-reduced-motion guard apps/omlx-web/omlx_web/templates/dashboard/_cluster_v2.html — <svg> moves — its `animate-spin` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:.
  • Animation without a prefers-reduced-motion guard apps/omlx-web/omlx_web/templates/dashboard/_modal_settings_apply.html — <svg> moves — its `animate-spin` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:.
  • Animation without a prefers-reduced-motion guard apps/omlx-web/omlx_web/templates/dashboard/_models.html:494 — <div> moves — its `animate-spin` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:.
  • Animation without a prefers-reduced-motion guard apps/omlx-web/omlx_web/templates/dashboard/_models.html:673 — <div> moves — its `animate-spin` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:.
  • Animation without a prefers-reduced-motion guard apps/omlx-web/omlx_web/templates/dashboard/_models.html — <svg> moves — its `animate-spin` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:.
  • Animation without a prefers-reduced-motion guard apps/omlx-web/omlx_web/templates/dashboard/_models.html:2103 — <div> moves — its `animate-spin` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:.
  • Animation without a prefers-reduced-motion guard REDACTED:84 — <div> moves — its `animate-spin` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:.
  • Animation without a prefers-reduced-motion guard apps/omlx-web/omlx_web/templates/dashboard/_settings.html:1279 — <i> moves — its `animate-spin` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:.
  • Animation without a prefers-reduced-motion guard apps/omlx-web/omlx_web/templates/dashboard/_settings.html:1296 — <i> moves — its `animate-spin` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:.
  • Animation without a prefers-reduced-motion guard apps/omlx-web/omlx_web/templates/dashboard/_settings.html — <svg> moves — its `animate-spin` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×20
  • Duplicated block (12 lines × 2) apps/omlx-cuda-helper/omlx_cuda_helper/families/deepseek_v41/ngram.py:78 — apps/omlx-cuda-helper/omlx_cuda_helper/families/deepseek_v41/ngram.py:78-89 | omlx/patches/deepseek_v41/engram.py:84-95 — 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 `apps/omlx-cuda-helper/omlx_cuda_helper/families/deepseek_v41/ngram.py:78` 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) omlx/adapter/muse_glimmer.py:343 — omlx/adapter/muse_glimmer.py:343-354 | omlx/adapter/output_parser.py:1064-1075 — 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 (12 lines × 2) omlx/admin/ane_tuning.py:1606 — omlx/admin/ane_tuning.py:1606-1617 | omlx/admin/ane_tuning.py:2063-2074 — 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 `omlx/admin/ane_tuning.py:1606` 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) omlx/cluster/registry.py:399 — omlx/cluster/registry.py:399-410 | omlx/cluster/registry.py:422-433 — 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) omlx/engine/vlm.py:1345 — omlx/engine/vlm.py:1345-1356 | omlx/models/vlm.py:380-391 — 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) omlx/engine_pool.py:4360 — omlx/engine_pool.py:4360-4372 | omlx/engine_pool.py:4397-4408 — 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 `omlx/engine_pool.py:4360` 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) omlx/engine_pool.py:4503 — omlx/engine_pool.py:4503-4516 | omlx/engine_pool.py:4593-4604 — 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 `omlx/engine_pool.py:4503` 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) REDACTED:3787 — REDACTED:3787-3798 | REDACTED:3869-3880 — 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) omlx/patches/bailing_hybrid/bailing_hybrid_model.py:307 — omlx/patches/bailing_hybrid/bailing_hybrid_model.py:307-318 | omlx/patches/glm_moe_dsa/glm_moe_dsa_model.py:397-408 — 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) omlx/patches/deepseek_v4/deepseek_v4_model.py:1790 — omlx/patches/deepseek_v4/deepseek_v4_model.py:1790-1801 | omlx/patches/deepseek_v4/deepseek_v4_model.py:1961-1972 — 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) omlx/patches/minimax_m3/generate_patch.py:34 — omlx/patches/minimax_m3/generate_patch.py:34-45 | omlx/scheduler.py:1847-1858 — 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) REDACTED:2410 — REDACTED:2410-2421 | REDACTED:309-320 — 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 lines × 2) omlx/patches/qwen35_ane_prefill.py:1226 — omlx/patches/qwen35_ane_prefill.py:1226-1237 | omlx/patches/qwen35_ane_prefill.py:1532-1543 — 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 `omlx/patches/qwen35_ane_prefill.py:1226` 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) omlx/patches/qwen35_ane_prefill.py:1687 — omlx/patches/qwen35_ane_prefill.py:1687-1699 | omlx/patches/qwen35_ane_prefill.py:2041-2052 — 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 `omlx/patches/qwen35_ane_prefill.py:1687` 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) omlx/patches/qwen35_gdn_prework.py:1588 — omlx/patches/qwen35_gdn_prework.py:1588-1599 | omlx/patches/qwen35_gdn_prework.py:1720-1731 — 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 `omlx/patches/qwen35_gdn_prework.py:1588` 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 (12 lines × 2) REDACTED:4905 — REDACTED:4905-4916 | REDACTED:7877-7888 — 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) apps/omlx-cuda-helper/omlx_cuda_helper/worker.py:217 — apps/omlx-cuda-helper/omlx_cuda_helper/worker.py:217-228 | omlx/prefill_helper/worker.py:123-134 — 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) REDACTED:146 — REDACTED:146-157 | omlx/engine/vlm.py:1794-1805 — before extracting anything, compare `REDACTED` and `omlx/engine/vlm.py` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 480 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) apps/omlx-mac/Sources/AppView/Screens/ContextBenchScreen.swift:153 — apps/omlx-mac/Sources/AppView/Screens/ContextBenchScreen.swift:153-164 | apps/omlx-mac/Sources/AppView/Screens/PerformanceScreen.swift:149-160 — 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 `apps/omlx-mac/Sources/AppView/Screens/ContextBenchScreen.swift:153` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, 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) apps/omlx-mac/Sources/AppView/Screens/ContextBenchScreen.swift:227 — apps/omlx-mac/Sources/AppView/Screens/ContextBenchScreen.swift:227-238 | apps/omlx-mac/Sources/AppView/Screens/ThroughputBenchScreen.swift:936-947 — 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 `apps/omlx-mac/Sources/AppView/Screens/ContextBenchScreen.swift:227` 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.
D3 · God Classes · TooManyMethods · ×19
  • TooManyMethods: Scheduler omlx/scheduler.py:2194 — TooManyMethods — 297 methods. The bar is 30 methods; this is 267 over it, 9.90× 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: EnginePool omlx/engine_pool.py:419 — TooManyMethods — 116 methods. The bar is 30 methods; this is 86 over it, 3.87× 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: OMLXClient apps/omlx-mac/Sources/Net/OMLXClient.swift:38 — TooManyMethods — 101 methods. The bar is 30 methods; this is 71 over it, 3.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.
  • TooManyMethods: PagedSSDCacheManager omlx/cache/paged_ssd_cache.py:1756 — TooManyMethods — 80 methods. The bar is 30 methods; this is 50 over it, 2.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: BlockAwarePrefixCache omlx/cache/prefix_cache.py:244 — TooManyMethods — 65 methods. The bar is 30 methods; this is 35 over it, 2.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.
  • TooManyMethods: MenubarController apps/omlx-mac/Sources/Menubar/MenubarController.swift:26 — 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: ProcessMemoryEnforcer omlx/process_memory_enforcer.py:401 — TooManyMethods — 63 methods. The bar is 30 methods; this is 33 over it, 2.10× 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: ModelSettingsScreenVM apps/omlx-mac/Sources/AppView/ViewModels/ModelSettingsScreenVM.swift:34 — TooManyMethods — 58 methods. The bar is 30 methods; this is 28 over it, 1.93× 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: VLMBatchedEngine omlx/engine/vlm.py:1706 — TooManyMethods — 56 methods. The bar is 30 methods; this is 26 over it, 1.87× 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: ModelSettingsManager omlx/model_settings.py:698 — 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: DistributedBatchedEngine omlx/engine/distributed.py:229 — TooManyMethods — 45 methods. The bar is 30 methods; this is 15 over it, 1.50× 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: TalkAIController apps/omlx-mac/Sources/AskAI/TalkAIController.swift:12 — 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: BoundarySnapshotSSDStore omlx/cache/boundary_snapshot_store.py:119 — TooManyMethods — 40 methods. The bar is 30 methods; this is 10 over it, 1.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: RuntimeTelemetry omlx/cluster/telemetry.py:135 — TooManyMethods — 37 methods. The bar is 30 methods; this is 7 over it, 1.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: DiscoveryService REDACTED:1165 — TooManyMethods — 34 methods. The bar is 30 methods; this is 4 over it, 1.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: AskAIController apps/omlx-mac/Sources/AskAI/AskAIController.swift:9 — TooManyMethods — 33 methods. The bar is 30 methods; this is 3 over it, 1.10× 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: SplashEngine REDACTED:1208 — 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: MLXRerankerModel omlx/models/reranker.py:69 — 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.
  • TooManyMethods: VLMModelAdapter omlx/models/vlm.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.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×19
  • Duplicated block (15 lines × 2) omlx/admin/ane_tuning.py:1225 — omlx/admin/ane_tuning.py:1225-1239 | omlx/admin/ane_tuning.py:1305-1319 — 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) REDACTED:2236 — REDACTED:2236-2250 | omlx/admin/ms_downloader.py:1015-1029 — 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 (15 lines × 2) omlx/admin/oq_manager.py:479 — omlx/admin/oq_manager.py:479-493 | REDACTED:7153-7167 — 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 `omlx/admin/oq_manager.py:479` 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 before the matched lines, `omlx/admin/oq_manager.py:477` calls `str` and `REDACTED:7151` 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 (15 lines × 2) omlx/admin/routes.py:8999 — omlx/admin/routes.py:8999-9013 | omlx/admin/routes.py:9604-9618 — 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 `omlx/admin/routes.py:8999` 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 (15 lines × 2) omlx/cluster/staging.py:1112 — omlx/cluster/staging.py:1112-1126 | omlx/cluster/staging.py:1359-1373 — 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 `omlx/cluster/staging.py:1112` 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 (15 lines × 2) REDACTED:1222 — REDACTED:1222-1236 | omlx/engine/vlm.py:4976-4990 — before extracting anything, compare `REDACTED` and `omlx/engine/vlm.py` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 480 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 `REDACTED:1222` 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 (15 lines × 2) REDACTED:1312 — REDACTED:1312-1326 | omlx/engine/vlm.py:5100-5114 — before extracting anything, compare `REDACTED` and `omlx/engine/vlm.py` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 480 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 `REDACTED:1312` 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 (15 lines × 2) omlx/engine/distributed.py:1253 — omlx/engine/distributed.py:1253-1267 | omlx/engine/distributed.py:1368-1382 — 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 `omlx/engine/distributed.py:1253` 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 (15 lines × 2) REDACTED:7797 — REDACTED:7797-7811 | REDACTED:11855-11869 — 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) REDACTED:8010 — REDACTED:8010-8024 | REDACTED:11952-11966 — 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 `REDACTED:8010` 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 (15 lines × 2) omlx/patches/deepseek_v4/chat_template_v4.py:322 — omlx/patches/deepseek_v4/chat_template_v4.py:322-336 | omlx/patches/deepseek_v41/encoding.py:590-604 — before extracting anything, compare `omlx/patches/deepseek_v4/chat_template_v4.py` and `omlx/patches/deepseek_v41/encoding.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 210 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 (15 lines × 2) omlx/patches/deepseek_v4/deepseek_v4_model.py:647 — omlx/patches/deepseek_v4/deepseek_v4_model.py:647-661 | omlx/patches/deepseek_v4/deepseek_v4_model.py:687-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.
  • Duplicated block (15 lines × 2) omlx/patches/deepseek_v4/deepseek_v4_model.py:1769 — omlx/patches/deepseek_v4/deepseek_v4_model.py:1769-1783 | omlx/patches/deepseek_v4/deepseek_v4_model.py:1940-1954 — 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.
  • Duplicated block (15 lines × 2) omlx/patches/glm_moe_dsa/moe_offload.py:136 — omlx/patches/glm_moe_dsa/moe_offload.py:136-150 | omlx/patches/moe_expert_offload.py:1028-1042 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `omlx/patches/moe_expert_offload.py:1025` calls `getattr`, `tuple` and `omlx/patches/glm_moe_dsa/moe_offload.py:135` 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 (15 lines × 2) omlx/patches/mlx_lm_mtp/drafter_target.py:80 — omlx/patches/mlx_lm_mtp/drafter_target.py:80-94 | omlx/patches/mlx_lm_mtp/qwen35_model.py:536-550 — 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 `omlx/patches/mlx_lm_mtp/drafter_target.py:80` 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 (15 lines × 2) omlx/patches/qwen35_ane_prefill.py:698 — omlx/patches/qwen35_ane_prefill.py:698-712 | omlx/patches/qwen35_ane_prefill.py:1240-1254 — 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) REDACTED:4759 — REDACTED:4759-4773 | REDACTED:6157-6171 — 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 `REDACTED:4759` 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 (15 lines × 2) apps/omlx-mac/Sources/Menubar/MenubarController.swift:661 — apps/omlx-mac/Sources/Menubar/MenubarController.swift:661-675 | apps/omlx-mac/Sources/Menubar/MenubarController.swift:695-709 — 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 `apps/omlx-mac/Sources/Menubar/MenubarController.swift:661` 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 (15 lines × 2) apps/omlx-mac/Sources/Theme/Components/Row.swift:205 — apps/omlx-mac/Sources/Theme/Components/Row.swift:205-219 | apps/omlx-mac/Sources/Theme/Components/Row.swift:276-290 — 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 `apps/omlx-mac/Sources/Theme/Components/Row.swift: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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `apps/omlx-mac/Sources/Theme/Components/Row.swift:275` calls `frame` and `apps/omlx-mac/Sources/Theme/Components/Row.swift:204` 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 · Edited copy of a member (4 corresponding lines) · ×16
  • Edited copy of a member (4 corresponding lines) apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen3_5/layers.py:126 — apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen3_5/layers.py:126-129 | apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen4_exp/layers.py:272-275 — These two members are one piece of code written twice and then edited apart: 4 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.
  • Edited copy of a member (4 corresponding lines) apps/omlx-cuda-helper/omlx_cuda_helper/families/minimax_m3_vl/stage.py:117 — apps/omlx-cuda-helper/omlx_cuda_helper/families/minimax_m3_vl/stage.py:117-120 | omlx/patches/m5_gather_qmm_nax.py:1703-1708 — These two members are one piece of code written twice and then edited apart: 4 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.
  • Edited copy of a member (4 corresponding lines) omlx/patches/mimo_v2/vision.py:99 — omlx/patches/mimo_v2/vision.py:99-102 | omlx/patches/raon1_mini/raon1_mini_model.py:1504-1510 — These two members are one piece of code written twice and then edited apart: 4 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.
  • Edited copy of a member (4 corresponding lines) apps/omlx-cuda-helper/omlx_cuda_helper/families/glm5_next/stage.py:73 — apps/omlx-cuda-helper/omlx_cuda_helper/families/glm5_next/stage.py:73-76 | apps/omlx-cuda-helper/omlx_cuda_helper/families/minimax_m3_vl/stage.py:157-160 — These two members are one piece of code written twice and then edited apart: 4 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.
  • Edited copy of a member (4 corresponding lines) apps/omlx-mac/Sources/AppView/ViewModels/IntegrationsScreenVM.swift:629 — apps/omlx-mac/Sources/AppView/ViewModels/IntegrationsScreenVM.swift:629-632 | apps/omlx-mac/Sources/Config/ShellEnvWriter.swift:314-317 — These two members are one piece of code written twice and then edited apart: 4 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.
  • Edited copy of a member (4 corresponding lines) apps/omlx-cuda-helper/omlx_cuda_helper/families/deepseek_v41/ops.py:60 — apps/omlx-cuda-helper/omlx_cuda_helper/families/deepseek_v41/ops.py:60-63 | omlx/patches/deepseek_v41/language.py:56-59 — These two members are one piece of code written twice and then edited apart: 4 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.
  • Edited copy of a member (4 corresponding lines) omlx/patches/inkling2/vlm.py:25 — omlx/patches/inkling2/vlm.py:25-34 | omlx/patches/mlx_vlm_muse_spark_compat/__init__.py:71-74 — These two members are one piece of code written twice and then edited apart: 4 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.
  • Edited copy of a member (4 corresponding lines) omlx/cache/type_handlers.py:375 — omlx/cache/type_handlers.py:375-379 | omlx/patches/deepseek_v4/cache_handlers.py:57-60 — These two members are one piece of code written twice and then edited apart: 4 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.
  • Edited copy of a member (4 corresponding lines) apps/omlx-mac/Sources/AppView/ViewModels/ThroughputBenchScreenVM.swift:374 — apps/omlx-mac/Sources/AppView/ViewModels/ThroughputBenchScreenVM.swift:374-377 | apps/omlx-mac/Sources/Menubar/MenubarController.swift:1350-1353 — These two members are one piece of code written twice and then edited apart: 4 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.
  • Edited copy of a member (4 corresponding lines) apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen3_5/stage.py:83 — apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen3_5/stage.py:83-86 | apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen4_exp/stage.py:97-100 — These two members are one piece of code written twice and then edited apart: 4 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.
  • Edited copy of a member (4 corresponding lines) apps/omlx-mac/Sources/AppView/Screens/ThroughputBenchScreen.swift:1055 — apps/omlx-mac/Sources/AppView/Screens/ThroughputBenchScreen.swift:1055-1058 | apps/omlx-mac/Sources/AppView/ViewModels/ThroughputBenchScreenVM.swift:379-382 — These two members are one piece of code written twice and then edited apart: 4 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.
  • Edited copy of a member (4 corresponding lines) omlx/patches/k2_horizon/k2_horizon_model.py:454 — omlx/patches/k2_horizon/k2_horizon_model.py:454-457 | omlx/patches/laguna/laguna_model.py:581-584 — These two members are one piece of code written twice and then edited apart: 4 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.
  • Edited copy of a member (4 corresponding lines) omlx/cluster/inference_worker.py:611 — omlx/cluster/inference_worker.py:611-614 | omlx/cluster/telemetry.py:257-262 — These two members are one piece of code written twice and then edited apart: 4 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.
  • Edited copy of a member (4 corresponding lines) omlx/engine_pool.py:1249 — omlx/engine_pool.py:1249-1252 | REDACTED:1464-1467 — These two members are one piece of code written twice and then edited apart: 4 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.
  • Edited copy of a member (4 corresponding lines) omlx/cluster/jaccl_side_channel.py:294 — omlx/cluster/jaccl_side_channel.py:294-299 | omlx/cluster/system_socket_proxy.py:98-101 — These two members are one piece of code written twice and then edited apart: 4 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.
  • Edited copy of a member (4 corresponding lines) omlx/patches/bailing_hybrid/bailing_hybrid_model.py:120 — omlx/patches/bailing_hybrid/bailing_hybrid_model.py:120-123 | omlx/patches/k2_horizon/k2_horizon_model.py:164-167 — These two members are one piece of code written twice and then edited apart: 4 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 · Duplicated block (13 lines × 2) · ×16
  • Duplicated block (13 lines × 2) apps/omlx-cuda-helper/omlx_cuda_helper/families/glm5_next/model.py:260 — apps/omlx-cuda-helper/omlx_cuda_helper/families/glm5_next/model.py:260-272 | apps/omlx-cuda-helper/omlx_cuda_helper/families/minimax_m3_vl/stage.py:199-211 — 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 `apps/omlx-cuda-helper/omlx_cuda_helper/families/glm5_next/model.py:260` 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) apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen3_5/stage.py:57 — apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen3_5/stage.py:57-69 | apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen4_exp/stage.py:73-85 — 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 `apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen3_5/stage.py:57` 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 (13 lines × 2) omlx/adapter/muse_glimmer.py:357 — omlx/adapter/muse_glimmer.py:357-369 | omlx/adapter/output_parser.py:1078-1090 — 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 (13 lines × 2) omlx/cache/paged_ssd_cache.py:2170 — omlx/cache/paged_ssd_cache.py:2170-2182 | omlx/cache/paged_ssd_cache.py:3961-3973 — 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) omlx/cluster/collective.py:241 — omlx/cluster/collective.py:241-253 | omlx/cluster/collective.py:335-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 `omlx/cluster/collective.py:241` 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 `rank` to `"MLX collective did not return one result from each rank" + suffix ) for` in one and `"pipeline smoke did not return one result from each rank" + suffix ) for` 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 (13 lines × 2) omlx/cluster/identity.py:143 — omlx/cluster/identity.py:143-155 | REDACTED:236-248 — 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 `omlx/cluster/identity.py:143` 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 (13 lines × 2) omlx/engine/sts.py:327 — omlx/engine/sts.py:327-339 | REDACTED:685-697 — 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 (13 lines × 2) REDACTED:987 — REDACTED:987-999 | REDACTED:1076-1088 — 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) omlx/engine/vlm.py:3901 — omlx/engine/vlm.py:3901-3913 | omlx/engine/vlm.py:3929-3941 — 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) omlx/patches/deepseek_v4/deepseek_v4_model.py:1753 — omlx/patches/deepseek_v4/deepseek_v4_model.py:1753-1765 | omlx/patches/deepseek_v4/deepseek_v4_model.py:2175-2187 — 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 `omlx/patches/deepseek_v4/deepseek_v4_model.py:1753` 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 (13 lines × 2) omlx/patches/deepseek_v4/moe_offload.py:221 — omlx/patches/deepseek_v4/moe_offload.py:221-233 | omlx/patches/glm_moe_dsa/moe_offload.py:271-283 — `omlx/patches/deepseek_v4/moe_offload.py` and `omlx/patches/glm_moe_dsa/moe_offload.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 9 separate duplicated blocks between them, totalling at least 157 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.
  • Duplicated block (13 lines × 2) omlx/patches/qwen35_ane_prefill.py:536 — omlx/patches/qwen35_ane_prefill.py:536-548 | omlx/patches/qwen35_ane_prefill.py:1535-1547 — 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) omlx/patches/turboquant_attention.py:1035 — omlx/patches/turboquant_attention.py:1035-1047 | omlx/patches/turboquant_attention.py:1130-1142 — 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 `omlx/patches/turboquant_attention.py:1035` 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) omlx/scheduler.py:11228 — omlx/scheduler.py:11228-11240 | omlx/scheduler.py:11258-11270 — 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 `omlx/scheduler.py:11228` 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 (13 lines × 2) apps/omlx-cuda-helper/omlx_cuda_helper/wire.py:76 — apps/omlx-cuda-helper/omlx_cuda_helper/wire.py:76-88 | omlx/prefill_helper/wire.py:85-97 — 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 first that the copies are not typed on the same thing: the declarations holding them bind `arrays` to `dict[str, HostArray] | None = None` in one and `dict[str, tuple[np.ndarray, str]] | 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 (13 lines × 2) omlx/patches/inkling2/dspark.py:368 — omlx/patches/inkling2/dspark.py:368-380 | omlx/patches/minimax_m3_dspark.py:307-319 — 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.
D4 · Code Duplication · Edited copy of a member (9 corresponding lines) · ×15
  • Edited copy of a member (9 corresponding lines) omlx/prefill_helper/adapters/deepseek_v41.py:53 — omlx/prefill_helper/adapters/deepseek_v41.py:53-61 | omlx/prefill_helper/adapters/qwen4_exp.py:179-195 — These two members are one piece of code written twice and then edited apart: 9 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.
  • Edited copy of a member (9 corresponding lines) REDACTED:163 — REDACTED:163-171 | omlx/cluster/ssh_keys.py:85-98 — These two members are one piece of code written twice and then edited apart: 9 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.
  • Edited copy of a member (9 corresponding lines) apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen3_5/layers.py:46 — apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen3_5/layers.py:46-54 | apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen4_exp/ops.py:140-149 — These two members are one piece of code written twice and then edited apart: 9 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.
  • Edited copy of a member (9 corresponding lines) omlx/patches/deepseek_v4/hyper_connection.py:223 — omlx/patches/deepseek_v4/hyper_connection.py:223-232 | omlx/patches/deepseek_v4/hyper_connection.py:272-280 — These two members are one piece of code written twice and then edited apart: 9 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.
  • Edited copy of a member (9 corresponding lines) omlx/patches/flint_decode.py:156 — omlx/patches/deepseek_v41/hyper_connection.py:135-143 | omlx/patches/flint_decode.py:156-166 — These two members are one piece of code written twice and then edited apart: 9 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.
  • Edited copy of a member (9 corresponding lines) apps/omlx-mac/Sources/AppView/AppServices.swift:406 — apps/omlx-mac/Sources/AppView/AppServices.swift:406-414 | apps/omlx-mac/Sources/AppView/ViewModels/ServerScreenVM.swift:549-557 — These two members are one piece of code written twice and then edited apart: 9 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.
  • Edited copy of a member (9 corresponding lines) omlx/patches/glm_moe_dsa/deepseek_v32.py:653 — omlx/patches/glm_moe_dsa/deepseek_v32.py:653-663 | omlx/patches/mimo_v2/mimo_v2_model.py:265-273 — These two members are one piece of code written twice and then edited apart: 9 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.
  • Edited copy of a member (9 corresponding lines) apps/omlx-cuda-helper/omlx_cuda_helper/families/inkling2/__init__.py:38 — apps/omlx-cuda-helper/omlx_cuda_helper/families/inkling2/__init__.py:38-46 | omlx/prefill_helper/adapters/inkling2.py:48-56 — These two members are one piece of code written twice and then edited apart: 9 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.
  • Edited copy of a member (9 corresponding lines) apps/omlx-mac/Sources/AskAI/AskAIImage.swift:104 — apps/omlx-mac/Sources/AskAI/AskAIImage.swift:104-114 | apps/omlx-mac/Sources/AskAI/ScreenCapture.swift:68-76 — These two members are one piece of code written twice and then edited apart: 9 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.
  • Edited copy of a member (9 corresponding lines) apps/omlx-mac/Sources/Config/ShellEnvWriter.swift:257 — apps/omlx-mac/Sources/Config/ShellEnvWriter.swift:257-265 | apps/omlx-mac/Sources/Updater/UpdateController.swift:526-540 — These two members are one piece of code written twice and then edited apart: 9 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.
  • Edited copy of a member (9 corresponding lines) omlx/cluster/runtime.py:61 — omlx/cluster/runtime.py:61-69 | omlx/cluster/runtime.py:78-88 — These two members are one piece of code written twice and then edited apart: 9 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.
  • Edited copy of a member (9 corresponding lines) omlx/patches/deepseek_v4/switch_layers.py:418 — omlx/patches/deepseek_v4/switch_layers.py:418-427 | omlx/patches/glm_moe_dsa/switch_layers.py:142-150 — These two members are one piece of code written twice and then edited apart: 9 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.
  • Edited copy of a member (9 corresponding lines) omlx/patches/laguna/tool_parser.py:133 — omlx/patches/hy_v3/hy_v3_tool_parser.py:100-108 | omlx/patches/laguna/tool_parser.py:133-142 — These two members are one piece of code written twice and then edited apart: 9 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.
  • Edited copy of a member (9 corresponding lines) omlx/integrations/claude.py:48 — omlx/integrations/claude.py:48-56 | omlx/integrations/hermes.py:19-27 — These two members are one piece of code written twice and then edited apart: 9 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.
  • Edited copy of a member (9 corresponding lines) omlx/patches/glm_moe_dsa/deepseek_v32.py:666 — omlx/patches/glm_moe_dsa/deepseek_v32.py:666-674 | omlx/patches/mimo_v2/mimo_v2_model.py:277-285 — These two members are one piece of code written twice and then edited apart: 9 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.
X15 · Unvalidated length from an untrusted reader · Length read from the parsed input is spent without ever being bounded · ×15
  • Length read from the parsed input is spent without ever being bounded REDACTED:2526 — `header_len` is read from the bytes being parsed at line 2525 (`int.from_bytes(… 8 bytes …)`), then passed as the size of `read` at line 2526 — and nowhere in its function is `header_len` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: the call reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB (a 64-bit one for more than any machine has), and the reservation either raises `MemoryError` out of a parser whose failure path was written for malformed input, not for hostile input, or succeeds and holds gigabytes for a few bytes on the wire. Bound `header_len` against the bytes actually remaining and a maximum the format allows before reading.
  • Length read from the parsed input is spent without ever being bounded REDACTED:2560 — `header_len` is read from the bytes being parsed at line 2559 (`int.from_bytes(… 8 bytes …)`), then passed as the size of `read` at line 2560 — and nowhere in its function is `header_len` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: the call reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB (a 64-bit one for more than any machine has), and the reservation either raises `MemoryError` out of a parser whose failure path was written for malformed input, not for hostile input, or succeeds and holds gigabytes for a few bytes on the wire. Bound `header_len` against the bytes actually remaining and a maximum the format allows before reading.
  • Length read from the parsed input is spent without ever being bounded omlx/utils/model_loading.py:1590 — `header_len` is read from the bytes being parsed at line 1589 (`int.from_bytes(… 8 bytes …)`), then passed as the size of `read` at line 1590 — and nowhere in its function is `header_len` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: the call reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB (a 64-bit one for more than any machine has), and the reservation either raises `MemoryError` out of a parser whose failure path was written for malformed input, not for hostile input, or succeeds and holds gigabytes for a few bytes on the wire. Bound `header_len` against the bytes actually remaining and a maximum the format allows before reading.
  • Length read from the parsed input is spent without ever being bounded omlx/prefill_helper/adapter.py:48 — `length` is read from the bytes being parsed at line 47 (`struct.unpack("<Q")`), then passed as the size of `read` at line 48 — and nowhere in its function is `length` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: the call reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB (a 64-bit one for more than any machine has), and the reservation either raises `MemoryError` out of a parser whose failure path was written for malformed input, not for hostile input, or succeeds and holds gigabytes for a few bytes on the wire. Bound `length` against the bytes actually remaining and a maximum the format allows before reading.
  • Length read from the parsed input is spent without ever being bounded omlx/prefill_helper/adapters/qwen3_5.py:97 — `length` is read from the bytes being parsed at line 96 (`struct.unpack("<Q")`), then passed as the size of `read` at line 97 — and nowhere in its function is `length` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: the call reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB (a 64-bit one for more than any machine has), and the reservation either raises `MemoryError` out of a parser whose failure path was written for malformed input, not for hostile input, or succeeds and holds gigabytes for a few bytes on the wire. Bound `length` against the bytes actually remaining and a maximum the format allows before reading.
  • Length read from the parsed input is spent without ever being bounded omlx/patches/moe_expert_offload.py:124 — `header_len` is read from the bytes being parsed at line 123 (`struct.unpack("<Q")`), then passed as the size of `read` at line 124 — and nowhere in its function is `header_len` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: the call reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB (a 64-bit one for more than any machine has), and the reservation either raises `MemoryError` out of a parser whose failure path was written for malformed input, not for hostile input, or succeeds and holds gigabytes for a few bytes on the wire. Bound `header_len` against the bytes actually remaining and a maximum the format allows before reading.
  • Length read from the parsed input is spent without ever being bounded omlx/patches/moe_expert_offload.py:1223 — `header_len` is read from the bytes being parsed at line 1222 (`struct.unpack("<Q")`), then passed as the size of `read` at line 1223 — and nowhere in its function is `header_len` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: the call reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB (a 64-bit one for more than any machine has), and the reservation either raises `MemoryError` out of a parser whose failure path was written for malformed input, not for hostile input, or succeeds and holds gigabytes for a few bytes on the wire. Bound `header_len` against the bytes actually remaining and a maximum the format allows before reading.
  • Length read from the parsed input is spent without ever being bounded omlx/patches/muse_spark/model.py:214 — `size` is read from the bytes being parsed at line 213 (`struct.unpack("<Q")`), then passed as the size of `read` at line 214 — and nowhere in its function is `size` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: the call reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB (a 64-bit one for more than any machine has), and the reservation either raises `MemoryError` out of a parser whose failure path was written for malformed input, not for hostile input, or succeeds and holds gigabytes for a few bytes on the wire. Bound `size` against the bytes actually remaining and a maximum the format allows before reading.
  • Length read from the parsed input is spent without ever being bounded omlx/patches/mlx_vlm_qwen4_exp_compat/residency.py:43 — `header_size` is read from the bytes being parsed at line 42 (`struct.unpack("<Q")`), then passed as the size of `read` at line 43 — and nowhere in its function is `header_size` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: the call reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB (a 64-bit one for more than any machine has), and the reservation either raises `MemoryError` out of a parser whose failure path was written for malformed input, not for hostile input, or succeeds and holds gigabytes for a few bytes on the wire. Bound `header_size` against the bytes actually remaining and a maximum the format allows before reading.
  • Length read from the parsed input is spent without ever being bounded omlx/patches/deepseek_v41/oq.py:120 — `size` is read from the bytes being parsed at line 119 (`struct.unpack("<Q")`), then passed as the size of `read` at line 120 — and nowhere in its function is `size` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: the call reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB (a 64-bit one for more than any machine has), and the reservation either raises `MemoryError` out of a parser whose failure path was written for malformed input, not for hostile input, or succeeds and holds gigabytes for a few bytes on the wire. Bound `size` against the bytes actually remaining and a maximum the format allows before reading.
  • Length read from the parsed input is spent without ever being bounded omlx/patches/deepseek_v41/oq.py:291 — `size` is read from the bytes being parsed at line 290 (`struct.unpack("<Q")`), then passed as the size of `read` at line 291 — and nowhere in its function is `size` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: the call reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB (a 64-bit one for more than any machine has), and the reservation either raises `MemoryError` out of a parser whose failure path was written for malformed input, not for hostile input, or succeeds and holds gigabytes for a few bytes on the wire. Bound `size` against the bytes actually remaining and a maximum the format allows before reading.
  • Length read from the parsed input is spent without ever being bounded omlx/patches/deepseek_v41/oq_inventory.py:19 — `length` is read from the bytes being parsed at line 18 (`struct.unpack("<Q")`), then passed as the size of `read` at line 19 — and nowhere in its function is `length` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: the call reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB (a 64-bit one for more than any machine has), and the reservation either raises `MemoryError` out of a parser whose failure path was written for malformed input, not for hostile input, or succeeds and holds gigabytes for a few bytes on the wire. Bound `length` against the bytes actually remaining and a maximum the format allows before reading.
  • Length read from the parsed input is spent without ever being bounded omlx/patches/deepseek_v41/storage.py:141 — `length` is read from the bytes being parsed at line 140 (`struct.unpack("<Q")`), then passed as the size of `read` at line 141 — and nowhere in its function is `length` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: the call reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB (a 64-bit one for more than any machine has), and the reservation either raises `MemoryError` out of a parser whose failure path was written for malformed input, not for hostile input, or succeeds and holds gigabytes for a few bytes on the wire. Bound `length` against the bytes actually remaining and a maximum the format allows before reading.
  • Length read from the parsed input is spent without ever being bounded omlx/admin/hf_uploader.py:116 — `size` is read from the bytes being parsed at line 115 (`struct.unpack("<Q")`), then passed as the size of `read` at line 116 — and nowhere in its function is `size` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: the call reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB (a 64-bit one for more than any machine has), and the reservation either raises `MemoryError` out of a parser whose failure path was written for malformed input, not for hostile input, or succeeds and holds gigabytes for a few bytes on the wire. Bound `size` against the bytes actually remaining and a maximum the format allows before reading.
  • Length read from the parsed input is spent without ever being bounded apps/omlx-cuda-helper/omlx_cuda_helper/checkpoint.py:48 — `length` is read from the bytes being parsed at line 47 (`struct.unpack("<Q")`), then passed as the size of `read` at line 48 — and nowhere in its function is `length` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: the call reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB (a 64-bit one for more than any machine has), and the reservation either raises `MemoryError` out of a parser whose failure path was written for malformed input, not for hostile input, or succeeds and holds gigabytes for a few bytes on the wire. Bound `length` against the bytes actually remaining and a maximum the format allows before reading.
AC6 · Visual & motion safety · Focus outline removed inline · ×14
  • Focus outline removed inline apps/omlx-web/omlx_web/templates/chat.html:1220 — <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 apps/omlx-web/omlx_web/templates/chat.html:1284 — <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 apps/omlx-web/omlx_web/templates/chat.html:2135 — <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 apps/omlx-web/omlx_web/templates/chat.html:2494 — <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 apps/omlx-web/omlx_web/templates/chat.html:2566 — <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 apps/omlx-web/omlx_web/templates/chat.html:2575 — <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 apps/omlx-web/omlx_web/templates/chat.html:2629 — <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 apps/omlx-web/omlx_web/templates/chat.html:2727 — <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 apps/omlx-web/omlx_web/templates/dashboard/_bench.html:381 — <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 apps/omlx-web/omlx_web/templates/dashboard/_bench_accuracy.html:551 — <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 apps/omlx-web/omlx_web/templates/dashboard/_logs.html:64 — <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).
  • Focus outline removed inline apps/omlx-web/omlx_web/templates/dashboard/_logs.html:103 — <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 apps/omlx-web/omlx_web/templates/dashboard/_settings.html:563 — <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 apps/omlx-web/omlx_web/templates/dashboard/_settings.html:606 — <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).
D4 · Code Duplication · Edited copy of a member (14 corresponding lines) · ×12
  • Edited copy of a member (14 corresponding lines) apps/omlx-mac/Sources/Updater/AppUpdater.swift:548 — apps/omlx-mac/Sources/Updater/AppUpdater.swift:548-561 | apps/omlx-mac/Sources/Updater/UpdateInstaller.swift:298-324 — These two members are one piece of code written twice and then edited apart: 14 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.
  • Edited copy of a member (14 corresponding lines) apps/omlx-mac/Sources/Menubar/MenubarStatsPoller.swift:413 — apps/omlx-mac/Sources/Menubar/MenubarStatsPoller.swift:413-430 | apps/omlx-mac/Sources/Menubar/MenubarStatsPoller.swift:432-446 — These two members are one piece of code written twice and then edited apart: 14 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.
  • Edited copy of a member (14 corresponding lines) apps/omlx-mac/Sources/AppView/ViewModels/ModelSettingsScreenVM.swift:2466 — apps/omlx-mac/Sources/AppView/ViewModels/ModelSettingsScreenVM.swift:2466-2481 | apps/omlx-mac/Sources/AppView/ViewModels/ModelSettingsScreenVM.swift:2505-2520 — These two members are one piece of code written twice and then edited apart: 14 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.
  • Edited copy of a member (14 corresponding lines) apps/omlx-cuda-helper/omlx_cuda_helper/families/deepseek_v41/kernels.py:1483 — apps/omlx-cuda-helper/omlx_cuda_helper/families/deepseek_v41/kernels.py:1483-1496 | apps/omlx-cuda-helper/omlx_cuda_helper/families/deepseek_v41/kernels.py:1511-1526 — These two members are one piece of code written twice and then edited apart: 14 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.
  • Edited copy of a member (14 corresponding lines) apps/omlx-cuda-helper/omlx_cuda_helper/families/inkling2/kernels.py:507 — apps/omlx-cuda-helper/omlx_cuda_helper/families/inkling2/kernels.py:507-520 | apps/omlx-cuda-helper/omlx_cuda_helper/families/minimax_m3_vl/kernels.py:226-239 — These two members are one piece of code written twice and then edited apart: 14 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.
  • Edited copy of a member (14 corresponding lines) omlx/cluster/enrollment.py:147 — omlx/cluster/enrollment.py:147-161 | omlx/cluster/strategy_benchmarks.py:131-144 — These two members are one piece of code written twice and then edited apart: 14 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.
  • Edited copy of a member (14 corresponding lines) omlx/patches/specprefill.py:112 — omlx/patches/specprefill.py:112-125 | omlx/patches/specprefill.py:129-142 — These two members are one piece of code written twice and then edited apart: 14 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.
  • Edited copy of a member (14 corresponding lines) omlx/engine/vlm.py:483 — omlx/engine/vlm.py:483-504 | omlx/engine/vlm.py:526-539 — These two members are one piece of code written twice and then edited apart: 14 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.
  • Edited copy of a member (14 corresponding lines) omlx/patches/gemma4_verify_kernel.py:342 — omlx/patches/gemma4_verify_kernel.py:342-359 | omlx/patches/qwen35_verify_sdpa_split.py:660-673 — These two members are one piece of code written twice and then edited apart: 14 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.
  • Edited copy of a member (14 corresponding lines) apps/omlx-cuda-helper/omlx_cuda_helper/worker.py:308 — apps/omlx-cuda-helper/omlx_cuda_helper/worker.py:308-325 | omlx/prefill_helper/worker.py:187-200 — These two members are one piece of code written twice and then edited apart: 14 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.
  • Edited copy of a member (14 corresponding lines) apps/omlx-cuda-helper/omlx_cuda_helper/worker.py:197 — apps/omlx-cuda-helper/omlx_cuda_helper/worker.py:197-213 | omlx/prefill_helper/worker.py:105-118 — These two members are one piece of code written twice and then edited apart: 14 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.
  • Edited copy of a member (14 corresponding lines) omlx/custom_kernels/attention/fast.py:131 — omlx/custom_kernels/attention/fast.py:131-144 | omlx/custom_kernels/quant_matmul/fast.py:684-704 — These two members are one piece of code written twice and then edited apart: 14 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 · Edited copy of a member (15 corresponding lines) · ×12
  • Edited copy of a member (15 corresponding lines) apps/omlx-cuda-helper/omlx_cuda_helper/families/inkling2/layers.py:238 — apps/omlx-cuda-helper/omlx_cuda_helper/families/inkling2/layers.py:238-252 | omlx/patches/inkling2/model.py:331-345 — These two members are one piece of code written twice and then edited apart: 15 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.
  • Edited copy of a member (15 corresponding lines) apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen3_5/layers.py:61 — apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen3_5/layers.py:61-75 | apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen4_exp/layers.py:166-185 — These two members are one piece of code written twice and then edited apart: 15 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.
  • Edited copy of a member (15 corresponding lines) apps/omlx-cuda-helper/omlx_cuda_helper/families/glm5_next/kernels.py:224 — apps/omlx-cuda-helper/omlx_cuda_helper/families/glm5_next/kernels.py:224-238 | apps/omlx-cuda-helper/omlx_cuda_helper/families/minimax_m3_vl/kernels.py:352-367 — These two members are one piece of code written twice and then edited apart: 15 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.
  • Edited copy of a member (15 corresponding lines) apps/omlx-cuda-helper/omlx_cuda_helper/families/inkling2/layers.py:45 — apps/omlx-cuda-helper/omlx_cuda_helper/families/inkling2/layers.py:45-59 | omlx/patches/inkling2/model.py:160-183 — These two members are one piece of code written twice and then edited apart: 15 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.
  • Edited copy of a member (15 corresponding lines) omlx/admin/routes.py:4476 — omlx/admin/routes.py:4476-4490 | omlx/admin/routes.py:4499-4516 — These two members are one piece of code written twice and then edited apart: 15 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.
  • Edited copy of a member (15 corresponding lines) omlx/engine/embedding.py:108 — omlx/engine/embedding.py:108-125 | omlx/engine/reranker.py:66-80 — These two members are one piece of code written twice and then edited apart: 15 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.
  • Edited copy of a member (15 corresponding lines) omlx/api/markitdown.py:154 — omlx/api/markitdown.py:154-168 | omlx/api/markitdown.py:180-197 — These two members are one piece of code written twice and then edited apart: 15 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.
  • Edited copy of a member (15 corresponding lines) omlx/engine/vlm.py:1340 — omlx/engine/vlm.py:1340-1356 | omlx/models/vlm.py:377-391 — These two members are one piece of code written twice and then edited apart: 15 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.
  • Edited copy of a member (15 corresponding lines) omlx/patches/mlx_lm_mtp/nemotron_h_model.py:72 — omlx/patches/mlx_lm_mtp/nemotron_h_model.py:72-86 | omlx/patches/mlx_lm_mtp/qwen35_model.py:117-140 — These two members are one piece of code written twice and then edited apart: 15 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.
  • Edited copy of a member (15 corresponding lines) omlx/patches/qwen35_moe_weighted_sum.py:184 — omlx/patches/qwen35_moe_weighted_sum.py:184-198 | omlx/patches/qwen35_oq_a8.py:546-561 — These two members are one piece of code written twice and then edited apart: 15 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.
  • Edited copy of a member (15 corresponding lines) omlx/eval/hellaswag.py:53 — omlx/eval/hellaswag.py:53-67 | omlx/eval/truthfulqa.py:82-97 — These two members are one piece of code written twice and then edited apart: 15 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.
  • Edited copy of a member (15 corresponding lines) omlx/patches/glm53_kda_recurrence.py:286 — omlx/patches/glm53_kda_recurrence.py:286-302 | omlx/patches/glm53_kda_recurrence.py:619-633 — These two members are one piece of code written twice and then edited apart: 15 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 · Edited copy of a member (12 corresponding lines) · ×12
  • Edited copy of a member (12 corresponding lines) omlx/patches/minimax_m3_dspark.py:146 — omlx/patches/hy_v3/hy_v3_model.py:48-72 | omlx/patches/minimax_m3_dspark.py:146-157 — These two members are one piece of code written twice and then edited apart: 12 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.
  • Edited copy of a member (12 corresponding lines) apps/omlx-cuda-helper/omlx_cuda_helper/families/deepseek_v41/kernels.py:1662 — apps/omlx-cuda-helper/omlx_cuda_helper/families/deepseek_v41/kernels.py:1662-1673 | apps/omlx-cuda-helper/omlx_cuda_helper/families/deepseek_v41/kernels.py:1677-1689 — These two members are one piece of code written twice and then edited apart: 12 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.
  • Edited copy of a member (12 corresponding lines) omlx/patches/bailing_hybrid/bailing_hybrid_model.py:744 — omlx/patches/bailing_hybrid/bailing_hybrid_model.py:744-757 | omlx/patches/raon1_mini/raon1_mini_model.py:1755-1766 — These two members are one piece of code written twice and then edited apart: 12 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.
  • Edited copy of a member (12 corresponding lines) apps/omlx-mac/Sources/AppView/Screens/SecurityScreen.swift:149 — apps/omlx-mac/Sources/AppView/Screens/SecurityScreen.swift:149-167 | apps/omlx-mac/Sources/AskAI/TalkAIPanel.swift:305-316 — These two members are one piece of code written twice and then edited apart: 12 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.
  • Edited copy of a member (12 corresponding lines) omlx/patches/qwen35_verify_qmm.py:951 — omlx/patches/qwen35_verify_qmm.py:951-962 | omlx/patches/qwen35_verify_qmm.py:1046-1059 — These two members are one piece of code written twice and then edited apart: 12 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.
  • Edited copy of a member (12 corresponding lines) omlx/scheduler.py:1741 — omlx/scheduler.py:1741-1752 | omlx/scheduler.py:1756-1767 — These two members are one piece of code written twice and then edited apart: 12 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.
  • Edited copy of a member (12 corresponding lines) apps/omlx-cuda-helper/omlx_cuda_helper/families/glm5_next/kernels.py:92 — apps/omlx-cuda-helper/omlx_cuda_helper/families/glm5_next/kernels.py:92-105 | apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen4_exp/kernels.py:1238-1249 — These two members are one piece of code written twice and then edited apart: 12 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.
  • Edited copy of a member (12 corresponding lines) apps/omlx-mac/Sources/AppView/ViewModels/ModelSettingsScreenVM.swift:2378 — apps/omlx-mac/Sources/AppView/ViewModels/ModelSettingsScreenVM.swift:2378-2390 | apps/omlx-mac/Sources/AppView/ViewModels/ModelSettingsScreenVM.swift:2392-2403 — These two members are one piece of code written twice and then edited apart: 12 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.
  • Edited copy of a member (12 corresponding lines) omlx/utils/image.py:500 — omlx/utils/image.py:500-523 | omlx/utils/image.py:527-538 — These two members are one piece of code written twice and then edited apart: 12 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.
  • Edited copy of a member (12 corresponding lines) REDACTED:1085 — REDACTED:1085-1096 | REDACTED:1137-1155 — These two members are one piece of code written twice and then edited apart: 12 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.
  • Edited copy of a member (12 corresponding lines) omlx/patches/deepseek_v4/chat_template_v4.py:257 — omlx/patches/deepseek_v4/chat_template_v4.py:257-273 | omlx/patches/deepseek_v41/encoding.py:509-520 — These two members are one piece of code written twice and then edited apart: 12 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.
  • Edited copy of a member (12 corresponding lines) scripts/repack_ternary_t5.py:180 — scripts/repack_ternary_t5.py:180-192 | scripts/repack_ternary_t5.py:196-207 — These two members are one piece of code written twice and then edited apart: 12 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 · Duplicated block (10 lines × 2) · ×12
  • Duplicated block (10 lines × 2) omlx/adapter/gemma4.py:41 — omlx/adapter/gemma4.py:41-50 | omlx/api/responses_utils.py:38-47 — 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) omlx/admin/routes.py:2748 — omlx/admin/routes.py:2748-2757 | omlx/admin/routes.py:2783-2792 — 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) REDACTED:1627 — REDACTED:1627-1636 | REDACTED:1681-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. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:1627` 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) omlx/patches/bailing_hybrid/__init__.py:48 — omlx/patches/bailing_hybrid/__init__.py:48-57 | omlx/patches/raon1_mini/__init__.py:49-58 — 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) omlx/patches/deepseek_v4/switch_layers.py:394 — omlx/patches/deepseek_v4/switch_layers.py:394-403 | omlx/patches/glm_moe_dsa/switch_layers.py:118-127 — `omlx/patches/deepseek_v4/switch_layers.py` and `omlx/patches/glm_moe_dsa/switch_layers.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 75 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.
  • Duplicated block (10 lines × 2) omlx/patches/glm53_kda_prework.py:231 — omlx/patches/glm53_kda_prework.py:231-240 | omlx/patches/qwen35_gdn_prework.py:970-979 — 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 `omlx/patches/glm53_kda_prework.py:231` 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) omlx/patches/inkling2/model.py:681 — omlx/patches/inkling2/model.py:681-690 | omlx/patches/muse_spark/model.py:192-201 — 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) omlx/patches/mlx_lm_mtp/deepseek_v4_model.py:361 — omlx/patches/mlx_lm_mtp/deepseek_v4_model.py:361-370 | omlx/patches/mlx_lm_mtp/deepseek_v4_model.py:395-404 — 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) omlx/patches/qwen35_ane_prefill.py:1235 — omlx/patches/qwen35_ane_prefill.py:1235-1244 | omlx/patches/qwen35_ane_prefill.py:1460-1469 — 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 `omlx/patches/qwen35_ane_prefill.py:1235` 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) omlx/patches/qwen35_verify_sdpa_split.py:381 — omlx/patches/qwen35_verify_sdpa_split.py:381-390 | omlx/patches/qwen35_verify_sdpa_split.py:635-644 — 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 `omlx/patches/qwen35_verify_sdpa_split.py:381` 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) omlx/scheduler.py:4160 — omlx/scheduler.py:4160-4169 | omlx/scheduler.py:4211-4220 — 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) apps/omlx-mac/Sources/AppView/ViewModels/ServerScreenVM.swift:124 — apps/omlx-mac/Sources/AppView/ViewModels/ServerScreenVM.swift:124-133 | apps/omlx-mac/Sources/AppView/ViewModels/ServerScreenVM.swift:176-185 — 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.
D29 · Static Analysis (SAST) · REDACTED · ×11
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (16 corresponding lines) · ×11
  • Edited copy of a member (16 corresponding lines) apps/omlx-cuda-helper/omlx_cuda_helper/families/glm5_next/model.py:146 — apps/omlx-cuda-helper/omlx_cuda_helper/families/glm5_next/model.py:146-161 | omlx/patches/deepseek_v4/hyper_connection.py:194-211 — These two members are one piece of code written twice and then edited apart: 16 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.
  • Edited copy of a member (16 corresponding lines) REDACTED:57 — REDACTED:57-72 | REDACTED:191-210 — These two members are one piece of code written twice and then edited apart: 16 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.
  • Edited copy of a member (16 corresponding lines) apps/omlx-cuda-helper/omlx_cuda_helper/families/inkling2/stage.py:143 — apps/omlx-cuda-helper/omlx_cuda_helper/families/inkling2/stage.py:143-159 | apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen3_5/stage.py:165-180 — These two members are one piece of code written twice and then edited apart: 16 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.
  • Edited copy of a member (16 corresponding lines) apps/omlx-cuda-helper/omlx_cuda_helper/worker.py:216 — apps/omlx-cuda-helper/omlx_cuda_helper/worker.py:216-231 | omlx/prefill_helper/worker.py:121-139 — These two members are one piece of code written twice and then edited apart: 16 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.
  • Edited copy of a member (16 corresponding lines) omlx/patches/deepseek_v4/verify_qmv.py:368 — omlx/patches/deepseek_v4/verify_qmv.py:368-384 | omlx/patches/deepseek_v4/verify_qmv.py:506-521 — These two members are one piece of code written twice and then edited apart: 16 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.
  • Edited copy of a member (16 corresponding lines) REDACTED:1585 — REDACTED:1585-1605 | REDACTED:3625-3640 — These two members are one piece of code written twice and then edited apart: 16 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.
  • Edited copy of a member (16 corresponding lines) omlx/patches/bailing_hybrid/bailing_hybrid_model.py:787 — omlx/patches/bailing_hybrid/bailing_hybrid_model.py:787-802 | omlx/patches/mimo_v2/mimo_v2_model.py:497-518 — These two members are one piece of code written twice and then edited apart: 16 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.
  • Edited copy of a member (16 corresponding lines) omlx/patches/inkling2/vlm.py:83 — omlx/patches/inkling2/vlm.py:83-101 | omlx/patches/muse_spark/model.py:242-257 — These two members are one piece of code written twice and then edited apart: 16 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.
  • Edited copy of a member (16 corresponding lines) apps/omlx-mac/Sources/AskAI/AskAIController.swift:98 — apps/omlx-mac/Sources/AskAI/AskAIController.swift:98-113 | apps/omlx-mac/Sources/AskAI/TalkAIController.swift:145-161 — These two members are one piece of code written twice and then edited apart: 16 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.
  • Edited copy of a member (16 corresponding lines) omlx/cluster/node_role.py:233 — omlx/cluster/node_role.py:233-256 | omlx/cluster/node_role.py:260-275 — These two members are one piece of code written twice and then edited apart: 16 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.
  • Edited copy of a member (16 corresponding lines) apps/omlx-mac/Sources/Server/AppControlServer.swift:26 — apps/omlx-mac/Sources/Server/AppControlServer.swift:26-41 | apps/omlx-mac/Sources/Server/AppControlServer.swift:43-58 — These two members are one piece of code written twice and then edited apart: 16 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 · Duplicated block (14 lines × 2) · ×11
  • Duplicated block (14 lines × 2) omlx/admin/ane_tuning.py:1540 — omlx/admin/ane_tuning.py:1540-1553 | omlx/admin/ane_tuning.py:2041-2054 — 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 `omlx/admin/ane_tuning.py:1540` 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 (14 lines × 2) omlx/api/anthropic_utils.py:296 — omlx/api/anthropic_utils.py:296-309 | omlx/api/anthropic_utils.py:431-444 — 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 (14 lines × 2) omlx/api/audio_routes.py:555 — omlx/api/audio_routes.py:555-568 | omlx/api/audio_routes.py:1657-1670 — 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 (14 lines × 2) omlx/cluster/collective.py:66 — omlx/cluster/collective.py:66-79 | omlx/cluster/launch.py:1398-1411 — 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 `omlx/cluster/collective.py:66` 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 (14 lines × 2) omlx/engine/distributed.py:1614 — omlx/engine/distributed.py:1614-1627 | omlx/engine/distributed.py:1701-1714 — 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 `omlx/engine/distributed.py:1614` 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 (14 lines × 2) REDACTED:1415 — REDACTED:1415-1431 | REDACTED:1507-1520 — 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 `REDACTED:1415` 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 (14 lines × 2) omlx/patches/deepseek_v4/switch_layers.py:706 — omlx/patches/deepseek_v4/switch_layers.py:706-719 | omlx/patches/glm_moe_dsa/switch_layers.py:299-312 — `omlx/patches/deepseek_v4/switch_layers.py` and `omlx/patches/glm_moe_dsa/switch_layers.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 75 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. 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) omlx/patches/mlx_vlm_inkling_compat/__init__.py:101 — omlx/patches/mlx_vlm_inkling_compat/__init__.py:101-114 | omlx/patches/mlx_vlm_unlimited_ocr_compat/__init__.py:41-54 — 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 (14 lines × 2) omlx/scheduler.py:15226 — omlx/scheduler.py:15226-15239 | omlx/scheduler.py:15500-15513 — 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 first that the copies are not typed on the same thing: the declarations holding them bind `request` to `Request` in one and `"Request"` 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 (14 lines × 2) omlx/patches/inkling2/loader.py:126 — omlx/patches/inkling2/loader.py:126-139 | omlx/patches/inkling2/oq_layout.py:154-167 — before extracting anything, compare `omlx/patches/inkling2/loader.py` and `omlx/patches/inkling2/oq_layout.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 51 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 `omlx/patches/inkling2/loader.py:126` 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 (14 lines × 2) apps/omlx-mac/Sources/AppView/ViewModels/ModelSettingsScreenVM.swift:2468 — apps/omlx-mac/Sources/AppView/ViewModels/ModelSettingsScreenVM.swift:2468-2481 | apps/omlx-mac/Sources/AppView/ViewModels/ModelSettingsScreenVM.swift:2507-2520 — 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 `apps/omlx-mac/Sources/AppView/ViewModels/ModelSettingsScreenVM.swift:2468` 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 · Edited copy of a member (10 corresponding lines) · ×10
  • Edited copy of a member (10 corresponding lines) apps/omlx-cuda-helper/omlx_cuda_helper/families/deepseek_v41/ops.py:119 — apps/omlx-cuda-helper/omlx_cuda_helper/families/deepseek_v41/ops.py:119-129 | omlx/patches/deepseek_v41/language.py:141-150 — These two members are one piece of code written twice and then edited apart: 10 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.
  • Edited copy of a member (10 corresponding lines) apps/omlx-mac/Sources/AppView/Screens/IntegrationsScreen.swift:18 — apps/omlx-mac/Sources/AppView/Screens/IntegrationsScreen.swift:18-29 | apps/omlx-mac/Sources/AppView/Screens/SecurityScreen.swift:25-34 — These two members are one piece of code written twice and then edited apart: 10 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.
  • Edited copy of a member (10 corresponding lines) omlx/patches/laguna/tool_parser.py:34 — omlx/patches/hy_v3/hy_v3_tool_parser.py:56-65 | omlx/patches/laguna/tool_parser.py:34-48 — These two members are one piece of code written twice and then edited apart: 10 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.
  • Edited copy of a member (10 corresponding lines) apps/omlx-mac/Sources/AppView/Screens/ModelCardSheet.swift:535 — apps/omlx-mac/Sources/AppView/Screens/ModelCardSheet.swift:535-546 | apps/omlx-mac/Sources/AppView/Screens/QuantizationScreen.swift:320-329 — These two members are one piece of code written twice and then edited apart: 10 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.
  • Edited copy of a member (10 corresponding lines) apps/omlx-mac/Sources/AppView/Screens/StatusScreen.swift:441 — apps/omlx-mac/Sources/AppView/Screens/StatusScreen.swift:441-452 | apps/omlx-mac/Sources/AppView/Screens/StatusScreen.swift:475-484 — These two members are one piece of code written twice and then edited apart: 10 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.
  • Edited copy of a member (10 corresponding lines) omlx/patches/mlx_lm_mtp/deepseek_v4_dspark.py:64 — omlx/patches/mlx_lm_mtp/deepseek_v4_dspark.py:64-73 | omlx/patches/mlx_lm_mtp/deepseek_v4_dspark.py:76-86 — These two members are one piece of code written twice and then edited apart: 10 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.
  • Edited copy of a member (10 corresponding lines) apps/omlx-mac/Sources/AppView/ViewModels/SecurityScreenVM.swift:42 — apps/omlx-mac/Sources/AppView/ViewModels/SecurityScreenVM.swift:42-54 | apps/omlx-mac/Sources/AppView/ViewModels/SecurityScreenVM.swift:107-116 — These two members are one piece of code written twice and then edited apart: 10 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.
  • Edited copy of a member (10 corresponding lines) apps/omlx-mac/Sources/Menubar/MenubarVisibilityWatcher.swift:783 — apps/omlx-mac/Sources/Menubar/MenubarVisibilityWatcher.swift:783-792 | apps/omlx-mac/Sources/Server/ServerProcess.swift:472-483 — These two members are one piece of code written twice and then edited apart: 10 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.
  • Edited copy of a member (10 corresponding lines) apps/omlx-mac/Sources/Menubar/MenubarStatsPoller.swift:273 — apps/omlx-mac/Sources/Menubar/MenubarStatsPoller.swift:273-282 | apps/omlx-mac/Sources/Server/ServerProcess.swift:485-494 — These two members are one piece of code written twice and then edited apart: 10 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.
  • Edited copy of a member (10 corresponding lines) REDACTED:816 — REDACTED:816-830 | omlx/engine/tts.py:192-201 — These two members are one piece of code written twice and then edited apart: 10 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 · Edited copy of a member (7 corresponding lines) · ×10
  • Edited copy of a member (7 corresponding lines) apps/omlx-mac/Sources/AppView/Screens/DownloadsScreen.swift:604 — apps/omlx-mac/Sources/AppView/Screens/DownloadsScreen.swift:604-610 | apps/omlx-mac/Sources/AppView/Screens/DownloadsScreen.swift:925-932 — These two members are one piece of code written twice and then edited apart: 7 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.
  • Edited copy of a member (7 corresponding lines) apps/omlx-mac/Sources/Menubar/MenubarController.swift:1014 — apps/omlx-mac/Sources/Menubar/MenubarController.swift:1014-1020 | apps/omlx-mac/Sources/Menubar/MenubarController.swift:1022-1028 — These two members are one piece of code written twice and then edited apart: 7 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.
  • Edited copy of a member (7 corresponding lines) omlx/cluster/jaccl_side_channel.py:345 — omlx/cluster/jaccl_side_channel.py:345-352 | omlx/cluster/system_socket_proxy.py:145-151 — These two members are one piece of code written twice and then edited apart: 7 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.
  • Edited copy of a member (7 corresponding lines) apps/omlx-mac/Sources/Menubar/MenubarVisibilityWatcher.swift:695 — apps/omlx-mac/Sources/Menubar/MenubarVisibilityWatcher.swift:695-701 | apps/omlx-mac/Sources/Menubar/MenubarVisibilityWatcher.swift:703-714 — These two members are one piece of code written twice and then edited apart: 7 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.
  • Edited copy of a member (7 corresponding lines) omlx/patches/laguna/laguna_model.py:55 — omlx/patches/laguna/laguna_model.py:55-61 | omlx/patches/laguna/laguna_model.py:65-78 — These two members are one piece of code written twice and then edited apart: 7 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.
  • Edited copy of a member (7 corresponding lines) REDACTED:88 — REDACTED:88-95 | omlx/patches/mlx_vlm_qwen4_exp_compat/virtual_ple.py:32-38 — These two members are one piece of code written twice and then edited apart: 7 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.
  • Edited copy of a member (7 corresponding lines) omlx/patches/m1_verify_qmv.py:194 — omlx/patches/m1_verify_qmv.py:194-202 | omlx/patches/row_exact_qmv.py:366-372 — These two members are one piece of code written twice and then edited apart: 7 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.
  • Edited copy of a member (7 corresponding lines) apps/omlx-mac/Sources/Menubar/MenubarMetricPopover.swift:114 — apps/omlx-mac/Sources/Menubar/MenubarMetricPopover.swift:114-120 | apps/omlx-mac/Sources/Menubar/SystemStatsPanels.swift:280-286 — These two members are one piece of code written twice and then edited apart: 7 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.
  • Edited copy of a member (7 corresponding lines) apps/omlx-cuda-helper/omlx_cuda_helper/families/deepseek_v41/kernels.py:878 — apps/omlx-cuda-helper/omlx_cuda_helper/families/deepseek_v41/kernels.py:878-884 | omlx/patches/ming3_dit_kernels.py:288-295 — These two members are one piece of code written twice and then edited apart: 7 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.
  • Edited copy of a member (7 corresponding lines) omlx/patches/qwen35_fa256_attention.py:105 — omlx/patches/qwen35_fa256_attention.py:105-111 | omlx/patches/qwen35_moe_weighted_sum.py:32-38 — These two members are one piece of code written twice and then edited apart: 7 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 · Duplicated block (8 lines × 2) · ×10
  • Duplicated block (8 lines × 2) apps/omlx-cuda-helper/omlx_cuda_helper/families/deepseek_v41/config.py:105 — apps/omlx-cuda-helper/omlx_cuda_helper/families/deepseek_v41/config.py:105-112 | omlx/patches/deepseek_v41/config.py:211-218 — 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 first that the copies are not typed on the same thing: the declarations holding them bind `i` to `"Invalid RoPE head dimension") source = index = None for` in one and `"Invalid routed expert count") source = None index = None for` 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 (8 lines × 2) apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen3_5/layers.py:189 — apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen3_5/layers.py:189-196 | apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen4_exp/attention.py:84-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 (8 lines × 2) apps/omlx-cuda-helper/omlx_cuda_helper/tensors.py:66 — apps/omlx-cuda-helper/omlx_cuda_helper/tensors.py:66-73 | omlx/prefill_helper/wire.py:51-58 — 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.
  • Duplicated block (8 lines × 2) omlx/cache/boundary_snapshot_store.py:1875 — omlx/cache/boundary_snapshot_store.py:1875-1882 | omlx/cache/boundary_snapshot_store.py:1883-1890 — 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) omlx/patches/k2_horizon/k2_horizon_model.py:323 — omlx/patches/k2_horizon/k2_horizon_model.py:323-330 | omlx/patches/laguna/laguna_model.py:428-435 — 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 `omlx/patches/k2_horizon/k2_horizon_model.py:323` 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 (8 lines × 2) omlx/patches/mlx_lm_mtp/deepseek_v4_model.py:642 — omlx/patches/mlx_lm_mtp/deepseek_v4_model.py:642-649 | omlx/patches/mlx_vlm_mtp/glm5_next_vlm_runtime.py:979-986 — 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) omlx/scheduler.py:1741 — omlx/scheduler.py:1741-1748 | omlx/scheduler.py:1756-1763 — 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) omlx/utils/nax_attention.py:899 — omlx/utils/nax_attention.py:899-906 | omlx/utils/nax_attention.py:929-937 — 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) apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen3_5/__init__.py:52 — apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen3_5/__init__.py:52-59 | apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen4_exp/__init__.py:65-72 — 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) omlx/patches/glm_moe_dsa/deepseek_v32.py:499 — omlx/patches/glm_moe_dsa/deepseek_v32.py:499-506 | omlx/patches/glm_moe_dsa/glm_moe_dsa_model.py:192-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.
X3 · Exception handling · Swallowed exception (empty catch) · ×10
  • Swallowed exception (empty catch) omlx/_torch_stub.py:401 — 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) omlx/_torch_stub.py:412 — 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) REDACTED:574 — 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) omlx/engine_pool.py:4365 — 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) omlx/engine_pool.py:4401 — 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) REDACTED:2220 — 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) REDACTED:6170 — 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) REDACTED:6181 — 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) REDACTED:6193 — 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) REDACTED:8369 — 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.
D4 · Code Duplication · Edited copy of a member (8 corresponding lines) · ×9
  • Edited copy of a member (8 corresponding lines) REDACTED:1702 — REDACTED:1702-1711 | omlx/admin/ms_downloader.py:706-713 — These two members are one piece of code written twice and then edited apart: 8 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.
  • Edited copy of a member (8 corresponding lines) apps/omlx-cuda-helper/omlx_cuda_helper/families/deepseek_v41/ops.py:96 — apps/omlx-cuda-helper/omlx_cuda_helper/families/deepseek_v41/ops.py:96-103 | omlx/patches/deepseek_v41/language.py:129-136 — These two members are one piece of code written twice and then edited apart: 8 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.
  • Edited copy of a member (8 corresponding lines) apps/omlx-mac/Sources/AppView/Utils/PresetBundleStore.swift:61 — apps/omlx-mac/Sources/AppView/Utils/PresetBundleStore.swift:61-68 | apps/omlx-mac/Sources/Config/AppConfig.swift:270-277 — These two members are one piece of code written twice and then edited apart: 8 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.
  • Edited copy of a member (8 corresponding lines) omlx/model_profiles.py:221 — omlx/model_profiles.py:221-230 | omlx/model_profiles.py:256-263 — These two members are one piece of code written twice and then edited apart: 8 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.
  • Edited copy of a member (8 corresponding lines) omlx/patches/ming3_dit_kernels.py:429 — omlx/patches/ming3_dit_kernels.py:429-436 | omlx/patches/ming3_dit_kernels.py:440-461 — These two members are one piece of code written twice and then edited apart: 8 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.
  • Edited copy of a member (8 corresponding lines) apps/omlx-cuda-helper/omlx_cuda_helper/worker.py:187 — apps/omlx-cuda-helper/omlx_cuda_helper/worker.py:187-194 | omlx/prefill_helper/worker.py:94-102 — These two members are one piece of code written twice and then edited apart: 8 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.
  • Edited copy of a member (8 corresponding lines) omlx/scheduler.py:915 — omlx/scheduler.py:915-933 | omlx/scheduler.py:1318-1325 — These two members are one piece of code written twice and then edited apart: 8 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.
  • Edited copy of a member (8 corresponding lines) apps/omlx-mac/Sources/AppView/Screens/SecurityScreen.swift:169 — apps/omlx-mac/Sources/AppView/Screens/SecurityScreen.swift:169-176 | apps/omlx-mac/Sources/Theme/Components/CodeChip.swift:39-47 — These two members are one piece of code written twice and then edited apart: 8 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.
  • Edited copy of a member (8 corresponding lines) REDACTED:1004 — REDACTED:1004-1012 | omlx/admin/ms_downloader.py:121-128 — These two members are one piece of code written twice and then edited apart: 8 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.
D29 · Static Analysis (SAST) · REDACTED · ×8
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (13 corresponding lines) · ×8
  • Edited copy of a member (13 corresponding lines) apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen3_5/stage.py:115 — apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen3_5/stage.py:115-127 | apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen4_exp/stage.py:129-143 — These two members are one piece of code written twice and then edited apart: 13 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.
  • Edited copy of a member (13 corresponding lines) apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen3_5/layers.py:170 — apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen3_5/layers.py:170-182 | apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen4_exp/attention.py:217-229 — These two members are one piece of code written twice and then edited apart: 13 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.
  • Edited copy of a member (13 corresponding lines) apps/omlx-mac/Sources/Net/OMLXClient.swift:323 — apps/omlx-mac/Sources/Net/OMLXClient.swift:323-335 | apps/omlx-mac/Sources/Net/OMLXClient.swift:395-407 — These two members are one piece of code written twice and then edited apart: 13 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.
  • Edited copy of a member (13 corresponding lines) apps/omlx-mac/Sources/AppView/ViewModels/ModelSettingsScreenVM.swift:2042 — apps/omlx-mac/Sources/AppView/ViewModels/ModelSettingsScreenVM.swift:2042-2054 | apps/omlx-mac/Sources/AppView/ViewModels/ModelSettingsScreenVM.swift:2056-2069 — These two members are one piece of code written twice and then edited apart: 13 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.
  • Edited copy of a member (13 corresponding lines) apps/omlx-mac/Sources/AppView/Screens/ModelSettingsScreen.swift:2144 — apps/omlx-mac/Sources/AppView/Screens/ModelSettingsScreen.swift:2144-2156 | apps/omlx-mac/Sources/AppView/Screens/ModelSettingsScreen.swift:2178-2190 — These two members are one piece of code written twice and then edited apart: 13 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.
  • Edited copy of a member (13 corresponding lines) apps/omlx-mac/Sources/Menubar/MenubarController.swift:1222 — apps/omlx-mac/Sources/Menubar/MenubarController.swift:1222-1235 | apps/omlx-mac/Sources/Menubar/MenubarController.swift:1237-1249 — These two members are one piece of code written twice and then edited apart: 13 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.
  • Edited copy of a member (13 corresponding lines) omlx/adapter/muse_glimmer.py:193 — omlx/adapter/muse_glimmer.py:193-208 | omlx/adapter/output_parser.py:1020-1032 — These two members are one piece of code written twice and then edited apart: 13 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.
  • Edited copy of a member (13 corresponding lines) omlx/patches/glm_moe_dsa/switch_layers.py:97 — omlx/patches/glm_moe_dsa/switch_layers.py:97-111 | omlx/patches/qwen38_modelopt_mixed.py:113-125 — These two members are one piece of code written twice and then edited apart: 13 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 · Edited copy of a member (5 corresponding lines) · ×8
  • Edited copy of a member (5 corresponding lines) apps/omlx-cuda-helper/omlx_cuda_helper/families/inkling2/layers.py:327 — apps/omlx-cuda-helper/omlx_cuda_helper/families/inkling2/layers.py:327-331 | apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen3_5/layers.py:143-149 — These two members are one piece of code written twice and then edited apart: 5 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.
  • Edited copy of a member (5 corresponding lines) omlx/patches/inkling2/model.py:122 — omlx/patches/inkling2/model.py:122-126 | omlx/patches/raon1_mini/raon1_mini_model.py:795-801 — These two members are one piece of code written twice and then edited apart: 5 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.
  • Edited copy of a member (5 corresponding lines) omlx/prefill_helper/adapters/glm5_next.py:200 — omlx/prefill_helper/adapters/glm5_next.py:200-204 | omlx/prefill_helper/adapters/qwen3_5.py:295-299 — These two members are one piece of code written twice and then edited apart: 5 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.
  • Edited copy of a member (5 corresponding lines) REDACTED:76 — REDACTED:76-80 | REDACTED:217-226 — These two members are one piece of code written twice and then edited apart: 5 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.
  • Edited copy of a member (5 corresponding lines) apps/omlx-cuda-helper/omlx_cuda_helper/state.py:17 — apps/omlx-cuda-helper/omlx_cuda_helper/state.py:17-21 | omlx/cluster/autoconfigure.py:1104-1108 — These two members are one piece of code written twice and then edited apart: 5 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.
  • Edited copy of a member (5 corresponding lines) REDACTED:418 — REDACTED:418-422 | omlx/prefill_helper/lending.py:41-45 — These two members are one piece of code written twice and then edited apart: 5 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.
  • Edited copy of a member (5 corresponding lines) omlx/integrations/dsh.py:98 — omlx/integrations/dsh.py:98-107 | omlx/integrations/pi.py:14-18 — These two members are one piece of code written twice and then edited apart: 5 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.
  • Edited copy of a member (5 corresponding lines) apps/omlx-cuda-helper/omlx_cuda_helper/worker.py:85 — apps/omlx-cuda-helper/omlx_cuda_helper/worker.py:85-89 | omlx/prefill_helper/client.py:224-229 — These two members are one piece of code written twice and then edited apart: 5 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 · Duplicated block (16 lines × 2) · ×8
  • Duplicated block (16 lines × 2) omlx/api/anthropic_utils.py:234 — omlx/api/anthropic_utils.py:234-249 | omlx/api/anthropic_utils.py:503-518 — 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 (16 lines × 2) omlx/cluster/launch.py:1828 — omlx/cluster/launch.py:1828-1843 | omlx/cluster/launch.py:1867-1882 — 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 `omlx/cluster/launch.py:1828` 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) omlx/cluster/tensor_strategies.py:392 — omlx/cluster/tensor_strategies.py:392-407 | omlx/cluster/tensor_strategies.py:585-600 — 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 (16 lines × 2) omlx/cluster/transport.py:201 — omlx/cluster/transport.py:201-216 | omlx/cluster/transport.py:632-647 — 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 (16 lines × 2) omlx/patches/mlx_vlm_mtp/qwen35_moe_vlm_model.py:149 — omlx/patches/mlx_vlm_mtp/qwen35_moe_vlm_model.py:149-164 | omlx/patches/mlx_vlm_mtp/qwen35_vlm_model.py:107-122 — before extracting anything, compare `omlx/patches/mlx_vlm_mtp/qwen35_moe_vlm_model.py` and `omlx/patches/mlx_vlm_mtp/qwen35_vlm_model.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 52 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 (16 lines × 2) omlx/prefill_helper/adapters/glm5_next.py:137 — omlx/prefill_helper/adapters/glm5_next.py:137-152 | omlx/prefill_helper/adapters/qwen3_5.py:201-216 — 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, `omlx/prefill_helper/adapters/qwen3_5.py:196` calls `_custom_loader`, `ValueError` and `omlx/prefill_helper/adapters/glm5_next.py:136` 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 (16 lines × 2) apps/omlx-mac/Sources/AppView/Screens/ThroughputBenchScreen.swift:493 — apps/omlx-mac/Sources/AppView/Screens/ThroughputBenchScreen.swift:493-508 | apps/omlx-mac/Sources/AppView/Screens/ThroughputBenchScreen.swift:579-594 — 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 `apps/omlx-mac/Sources/AppView/Screens/ThroughputBenchScreen.swift:493` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (16 lines × 2) apps/omlx-mac/Sources/AppView/ViewModels/ModelSettingsScreenVM.swift:2449 — apps/omlx-mac/Sources/AppView/ViewModels/ModelSettingsScreenVM.swift:2449-2464 | apps/omlx-mac/Sources/AppView/ViewModels/ModelSettingsScreenVM.swift:2484-2499 — 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 `apps/omlx-mac/Sources/AppView/ViewModels/ModelSettingsScreenVM.swift:2449` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D3 · God Classes · ClassTooLong · ×7
  • ClassTooLong: ModelSettingsScreenVM apps/omlx-mac/Sources/AppView/ViewModels/ModelSettingsScreenVM.swift:34 — ClassTooLong — 1671 significant lines (blank, comment-only and punctuation-only lines excluded), 58 methods. The bar is 400 significant lines; this is 1271 over it, 4.18× 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: MenubarController apps/omlx-mac/Sources/Menubar/MenubarController.swift:26 — ClassTooLong — 903 significant lines (blank, comment-only and punctuation-only lines excluded), 64 methods. The bar is 400 significant lines; this is 503 over it, 2.26× 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: TalkAIController apps/omlx-mac/Sources/AskAI/TalkAIController.swift:12 — ClassTooLong — 547 significant lines (blank, comment-only and punctuation-only lines excluded), 44 methods. The bar is 400 significant lines; this is 147 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: ProfileDetailCard apps/omlx-mac/Sources/AppView/Screens/ProfileViews.swift:500 — ClassTooLong — 534 significant lines (blank, comment-only and punctuation-only lines excluded), 16 methods. The bar is 400 significant lines; this is 134 over it, 1.34× 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: ServerScreenVM apps/omlx-mac/Sources/AppView/ViewModels/ServerScreenVM.swift:3 — ClassTooLong — 530 significant lines (blank, comment-only and punctuation-only lines excluded), 30 methods. The bar is 400 significant lines; this is 130 over it, 1.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.
  • ClassTooLong: IntegrationsScreenVM apps/omlx-mac/Sources/AppView/ViewModels/IntegrationsScreenVM.swift:4 — ClassTooLong — 474 significant lines (blank, comment-only and punctuation-only lines excluded), 18 methods. The bar is 400 significant lines; this is 74 over it, 1.19× 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: ModelCardSheet apps/omlx-mac/Sources/AppView/Screens/ModelCardSheet.swift:95 — ClassTooLong — 469 significant lines (blank, comment-only and punctuation-only lines excluded), 20 methods. The bar is 400 significant lines; this is 69 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.
D4 · Code Duplication · Edited copy of a member (18 corresponding lines) · ×7
  • Edited copy of a member (18 corresponding lines) apps/omlx-cuda-helper/omlx_cuda_helper/families/deepseek_v41/quant.py:148 — apps/omlx-cuda-helper/omlx_cuda_helper/families/deepseek_v41/quant.py:148-165 | omlx/patches/deepseek_v41/quantization.py:176-198 — These two members are one piece of code written twice and then edited apart: 18 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.
  • Edited copy of a member (18 corresponding lines) omlx/patches/inkling2/model.py:674 — omlx/patches/inkling2/model.py:674-691 | omlx/patches/muse_spark/model.py:181-203 — These two members are one piece of code written twice and then edited apart: 18 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.
  • Edited copy of a member (18 corresponding lines) omlx/patches/qwen35_moe_routed_decode.py:457 — omlx/patches/qwen35_moe_routed_decode.py:457-474 | omlx/patches/qwen35_moe_routed_decode.py:551-571 — These two members are one piece of code written twice and then edited apart: 18 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.
  • Edited copy of a member (18 corresponding lines) omlx/patches/deepseek_v4/switch_layers.py:430 — omlx/patches/deepseek_v4/switch_layers.py:430-449 | omlx/patches/glm_moe_dsa/switch_layers.py:153-170 — These two members are one piece of code written twice and then edited apart: 18 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.
  • Edited copy of a member (18 corresponding lines) omlx/patches/mlx_lm_mtp/deepseek_v4_model.py:44 — omlx/patches/mlx_lm_mtp/deepseek_v4_model.py:44-69 | omlx/patches/mlx_lm_mtp/glm_moe_dsa_model.py:57-74 — These two members are one piece of code written twice and then edited apart: 18 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.
  • Edited copy of a member (18 corresponding lines) omlx/cluster/planner.py:47 — omlx/cluster/planner.py:47-69 | omlx/cluster/planner.py:73-90 — These two members are one piece of code written twice and then edited apart: 18 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.
  • Edited copy of a member (18 corresponding lines) omlx/custom_kernels/quant_matmul/ane.py:43 — omlx/custom_kernels/quant_matmul/ane.py:43-60 | omlx/custom_kernels/quant_matmul/ane.py:77-97 — These two members are one piece of code written twice and then edited apart: 18 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 · Edited copy of a member (19 corresponding lines) · ×7
  • Edited copy of a member (19 corresponding lines) apps/omlx-cuda-helper/omlx_cuda_helper/families/inkling2/stage.py:172 — apps/omlx-cuda-helper/omlx_cuda_helper/families/inkling2/stage.py:172-191 | apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen3_5/stage.py:195-213 — These two members are one piece of code written twice and then edited apart: 19 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.
  • Edited copy of a member (19 corresponding lines) apps/omlx-mac/Sources/AppView/ViewModels/DownloadsScreenVM.swift:228 — apps/omlx-mac/Sources/AppView/ViewModels/DownloadsScreenVM.swift:228-247 | apps/omlx-mac/Sources/AppView/ViewModels/DownloadsScreenVM.swift:254-272 — These two members are one piece of code written twice and then edited apart: 19 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.
  • Edited copy of a member (19 corresponding lines) omlx/prefill_helper/adapters/glm5_next.py:137 — omlx/prefill_helper/adapters/glm5_next.py:137-155 | omlx/prefill_helper/adapters/minimax_m3.py:94-114 — These two members are one piece of code written twice and then edited apart: 19 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.
  • Edited copy of a member (19 corresponding lines) apps/omlx-cuda-helper/omlx_cuda_helper/families/deepseek_v41/kernels.py:1404 — apps/omlx-cuda-helper/omlx_cuda_helper/families/deepseek_v41/kernels.py:1404-1422 | apps/omlx-cuda-helper/omlx_cuda_helper/families/minimax_m3_vl/kernels.py:114-137 — These two members are one piece of code written twice and then edited apart: 19 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.
  • Edited copy of a member (19 corresponding lines) omlx/patches/deepseek_v4/wsdpa_attention.py:130 — omlx/patches/deepseek_v4/wsdpa_attention.py:130-148 | omlx/patches/deepseek_v4/wsdpa_attention.py:243-262 — These two members are one piece of code written twice and then edited apart: 19 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.
  • Edited copy of a member (19 corresponding lines) omlx/patches/arrays_cache_extract.py:14 — omlx/patches/arrays_cache_extract.py:14-32 | omlx/patches/arrays_cache_metadata.py:19-39 — These two members are one piece of code written twice and then edited apart: 19 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.
  • Edited copy of a member (19 corresponding lines) omlx/cache/prefix_cache.py:5734 — omlx/cache/prefix_cache.py:5734-5754 | omlx/cache/prefix_cache.py:5757-5775 — These two members are one piece of code written twice and then edited apart: 19 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 · Edited copy of a member (17 corresponding lines) · ×7
  • Edited copy of a member (17 corresponding lines) apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen3_5/__init__.py:49 — apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen3_5/__init__.py:49-65 | apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen4_exp/__init__.py:62-84 — These two members are one piece of code written twice and then edited apart: 17 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.
  • Edited copy of a member (17 corresponding lines) omlx/patches/deepseek_v4/switch_layers.py:703 — omlx/patches/deepseek_v4/switch_layers.py:703-719 | omlx/patches/glm_moe_dsa/switch_layers.py:294-312 — These two members are one piece of code written twice and then edited apart: 17 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.
  • Edited copy of a member (17 corresponding lines) omlx/adapter/output_parser.py:242 — omlx/adapter/output_parser.py:242-258 | omlx/adapter/output_parser.py:581-602 — These two members are one piece of code written twice and then edited apart: 17 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.
  • Edited copy of a member (17 corresponding lines) apps/omlx-cuda-helper/omlx_cuda_helper/families/glm5_next/model.py:256 — apps/omlx-cuda-helper/omlx_cuda_helper/families/glm5_next/model.py:256-272 | apps/omlx-cuda-helper/omlx_cuda_helper/families/minimax_m3_vl/stage.py:191-211 — These two members are one piece of code written twice and then edited apart: 17 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.
  • Edited copy of a member (17 corresponding lines) apps/omlx-mac/Sources/Net/DTO/ProfileDTO.swift:93 — apps/omlx-mac/Sources/Net/DTO/ProfileDTO.swift:93-109 | apps/omlx-mac/Sources/Net/DTO/ProfileDTO.swift:147-163 — These two members are one piece of code written twice and then edited apart: 17 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.
  • Edited copy of a member (17 corresponding lines) apps/omlx-mac/Sources/AppView/Utils/ChatTemplateKwargs.swift:47 — apps/omlx-mac/Sources/AppView/Utils/ChatTemplateKwargs.swift:47-63 | apps/omlx-mac/Sources/AskAI/AskAISettings.swift:46-62 — These two members are one piece of code written twice and then edited apart: 17 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.
  • Edited copy of a member (17 corresponding lines) omlx/patches/inkling2/dspark.py:343 — omlx/patches/inkling2/dspark.py:343-359 | omlx/patches/minimax_m3_dspark.py:278-298 — These two members are one piece of code written twice and then edited apart: 17 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 · Edited copy of a member (11 corresponding lines) · ×7
  • Edited copy of a member (11 corresponding lines) apps/omlx-cuda-helper/omlx_cuda_helper/families/inkling2/layers.py:224 — apps/omlx-cuda-helper/omlx_cuda_helper/families/inkling2/layers.py:224-234 | omlx/patches/inkling2/model.py:312-327 — These two members are one piece of code written twice and then edited apart: 11 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.
  • Edited copy of a member (11 corresponding lines) apps/omlx-cuda-helper/omlx_cuda_helper/families/deepseek_v41/ngram.py:143 — apps/omlx-cuda-helper/omlx_cuda_helper/families/deepseek_v41/ngram.py:143-153 | omlx/patches/deepseek_v41/storage.py:311-321 — These two members are one piece of code written twice and then edited apart: 11 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.
  • Edited copy of a member (11 corresponding lines) omlx/patches/row_exact_qmv.py:628 — omlx/patches/row_exact_qmv.py:628-638 | omlx/patches/row_exact_qmv.py:644-658 — These two members are one piece of code written twice and then edited apart: 11 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.
  • Edited copy of a member (11 corresponding lines) omlx/engine/lfm3_realtime.py:188 — omlx/engine/lfm3_realtime.py:188-198 | omlx/engine/qwen3_omni_realtime.py:170-182 — These two members are one piece of code written twice and then edited apart: 11 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.
  • Edited copy of a member (11 corresponding lines) apps/omlx-mac/Sources/Server/ServerProcess.swift:588 — apps/omlx-mac/Sources/Server/ServerProcess.swift:588-605 | apps/omlx-mac/Sources/Server/ServerProcess.swift:607-617 — These two members are one piece of code written twice and then edited apart: 11 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.
  • Edited copy of a member (11 corresponding lines) apps/omlx-mac/Sources/AppView/ViewModels/AccuracyBenchScreenVM.swift:47 — apps/omlx-mac/Sources/AppView/ViewModels/AccuracyBenchScreenVM.swift:47-57 | apps/omlx-mac/Sources/AppView/ViewModels/QuantizationScreenVM.swift:131-144 — These two members are one piece of code written twice and then edited apart: 11 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.
  • Edited copy of a member (11 corresponding lines) REDACTED:54 — REDACTED:54-68 | omlx/patches/mlx_lm_mtp/fused_batch.py:44-54 — These two members are one piece of code written twice and then edited apart: 11 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 · Duplicated block (10 lines × 3) · ×7
  • Duplicated block (10 lines × 3) omlx/api/audio_routes.py:561 — omlx/api/audio_routes.py:561-570 | omlx/api/audio_routes.py:1563-1572 | omlx/api/audio_routes.py:1663-1672 — 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.
  • Duplicated block (10 lines × 3) omlx/cluster/transport.py:211 — omlx/cluster/transport.py:211-220 | omlx/cluster/transport.py:595-604 | omlx/cluster/transport.py:642-651 — 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.
  • Duplicated block (10 lines × 3) omlx/patches/deepseek_v4/deepseek_v4_model.py:2501 — omlx/patches/deepseek_v4/deepseek_v4_model.py:2501-2510 | omlx/patches/mlx_lm_mtp/deepseek_v4_model.py:829-838 | omlx/patches/mlx_lm_mtp/deepseek_v4_model.py:882-891 — 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 `omlx/patches/deepseek_v4/deepseek_v4_model.py:2501` 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 (10 lines × 3) omlx/patches/deepseek_v4/moe_offload.py:312 — omlx/patches/deepseek_v4/moe_offload.py:312-321 | omlx/patches/glm_moe_dsa/moe_offload.py:357-366 | omlx/patches/moe_expert_offload.py:956-965 — `omlx/patches/deepseek_v4/moe_offload.py` and `omlx/patches/glm_moe_dsa/moe_offload.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 9 separate duplicated blocks between them, totalling at least 157 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. 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 × 3) omlx/patches/mlx_lm_mtp/qwen35_model.py:268 — omlx/patches/mlx_lm_mtp/qwen35_model.py:268-277 | omlx/patches/qwen35_q4_mlp.py:423-432 | omlx/patches/qwen35_q4_mlp.py:733-742 — 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 (10 lines × 3) apps/omlx-mac/Sources/AppView/Screens/AccuracyBenchScreen.swift:808 — apps/omlx-mac/Sources/AppView/Screens/AccuracyBenchScreen.swift:808-817 | apps/omlx-mac/Sources/AppView/Screens/QuantizationScreen.swift:744-753 | apps/omlx-mac/Sources/AppView/Screens/ThroughputBenchScreen.swift:867-876 — 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.
  • Duplicated block (10 lines × 3) apps/omlx-mac/Sources/AppView/Screens/DownloadsScreen.swift:251 — apps/omlx-mac/Sources/AppView/Screens/DownloadsScreen.swift:251-260 | apps/omlx-mac/Sources/AppView/Screens/DownloadsScreen.swift:407-416 | apps/omlx-mac/Sources/AppView/Screens/ThroughputBenchScreen.swift:899-908 — 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 `apps/omlx-mac/Sources/AppView/Screens/DownloadsScreen.swift:251` 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 first that the copies are not typed on the same thing: the declarations holding them bind `spacing` to `8` in one and `10` 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.
D6 · Cohesion (LCOM4) · Low cohesion · ×7
  • Low cohesion: ModelRegistry (LCOM4 7) omlx/model_registry.py:30 — ModelRegistry'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: QSAKVCache (LCOM4 6) omlx/patches/mlx_vlm_qwen4_exp_compat/vendor/mlx_vlm/models/qwen4_exp/language.py:481 — QSAKVCache's methods fall into 6 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 6 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: MemoryMonitor (LCOM4 5) REDACTED:221 — MemoryMonitor's methods fall into 5 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 5 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: _LazyTensorIndex (LCOM4 5) REDACTED:5481 — _LazyTensorIndex's methods fall into 5 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 5 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: ServiceMailbox (LCOM4 4) omlx/cluster/rdma/mailbox.py:159 — ServiceMailbox'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.
  • Low cohesion: AsyncEngineCore (LCOM4 4) omlx/engine_core.py:1516 — AsyncEngineCore'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.
  • Low cohesion: Inkling2Attention (LCOM4 4) omlx/patches/inkling2/model.py:348 — Inkling2Attention'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.
D4 · Code Duplication · Edited copy of a member (21 corresponding lines) · ×6
  • Edited copy of a member (21 corresponding lines) omlx/patches/specprefill.py:807 — omlx/patches/specprefill.py:807-827 | omlx/patches/specprefill.py:831-871 — These two members are one piece of code written twice and then edited apart: 21 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.
  • Edited copy of a member (21 corresponding lines) apps/omlx-mac/Sources/Welcome/WelcomeWindow.swift:877 — apps/omlx-mac/Sources/Welcome/WelcomeWindow.swift:877-897 | apps/omlx-mac/Sources/Welcome/WelcomeWindow.swift:918-939 — These two members are one piece of code written twice and then edited apart: 21 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.
  • Edited copy of a member (21 corresponding lines) omlx/admin/routes.py:8288 — omlx/admin/routes.py:8288-8329 | omlx/admin/routes.py:8904-8924 — These two members are one piece of code written twice and then edited apart: 21 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.
  • Edited copy of a member (21 corresponding lines) apps/omlx-mac/Sources/AskAI/AskAIPanel.swift:9 — apps/omlx-mac/Sources/AskAI/AskAIPanel.swift:9-29 | apps/omlx-mac/Sources/AskAI/TalkAIPanel.swift:10-30 — These two members are one piece of code written twice and then edited apart: 21 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.
  • Edited copy of a member (21 corresponding lines) omlx/patches/deepseek_v4/chat_template_v4.py:230 — omlx/patches/deepseek_v4/chat_template_v4.py:230-253 | omlx/patches/deepseek_v41/encoding.py:164-184 — These two members are one piece of code written twice and then edited apart: 21 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.
  • Edited copy of a member (21 corresponding lines) omlx/model_settings.py:1012 — omlx/model_settings.py:1012-1032 | omlx/model_settings.py:1337-1357 — These two members are one piece of code written twice and then edited apart: 21 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 · Edited copy of a member (6 corresponding lines) · ×6
  • Edited copy of a member (6 corresponding lines) omlx/model_settings.py:1297 — omlx/model_settings.py:1297-1309 | omlx/model_settings.py:1314-1319 — These two members are one piece of code written twice and then edited apart: 6 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.
  • Edited copy of a member (6 corresponding lines) apps/omlx-mac/Sources/Theme/Theme.swift:12 — apps/omlx-mac/Sources/Theme/Theme.swift:12-17 | apps/omlx-mac/Sources/Theme/Theme.swift:326-331 — These two members are one piece of code written twice and then edited apart: 6 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.
  • Edited copy of a member (6 corresponding lines) apps/omlx-cuda-helper/omlx_cuda_helper/families/deepseek_v41/ops.py:133 — apps/omlx-cuda-helper/omlx_cuda_helper/families/deepseek_v41/ops.py:133-141 | omlx/patches/deepseek_v41/a8.py:189-194 — These two members are one piece of code written twice and then edited apart: 6 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.
  • Edited copy of a member (6 corresponding lines) omlx/patches/laguna/laguna_model.py:269 — omlx/patches/hy_v3/hy_v3_model.py:141-146 | omlx/patches/laguna/laguna_model.py:269-277 — These two members are one piece of code written twice and then edited apart: 6 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.
  • Edited copy of a member (6 corresponding lines) apps/omlx-mac/Sources/AppView/Utils/PresetBundleStore.swift:93 — apps/omlx-mac/Sources/AppView/Utils/PresetBundleStore.swift:93-98 | apps/omlx-mac/Sources/AskAI/AskAISettings.swift:484-492 — These two members are one piece of code written twice and then edited apart: 6 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.
  • Edited copy of a member (6 corresponding lines) omlx/eval/kmmlu.py:28 — omlx/eval/kmmlu.py:28-33 | omlx/eval/mmlu.py:29-35 — These two members are one piece of code written twice and then edited apart: 6 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.
P7 · Outbound HTTP resilience · Outbound HTTP without resilience · ×6
  • Outbound HTTP without resilience REDACTED:40 — `urllib.request.urlopen(` 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 REDACTED:452 — `requests.get(` 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 REDACTED:865 — `requests.get(` 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 omlx/scheduler.py:3874 — `requests.get(` 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 omlx/scheduler.py:16194 — `requests.get(` 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 REDACTED:127 — `urllib.request.urlopen(` 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.
D4 · Code Duplication · Edited copy of a member (32 corresponding lines) · ×5
  • Edited copy of a member (32 corresponding lines) omlx/patches/glm53_kda_prework.py:217 — omlx/patches/glm53_kda_prework.py:217-252 | omlx/patches/qwen35_gdn_prework.py:959-990 — These two members are one piece of code written twice and then edited apart: 32 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.
  • Edited copy of a member (32 corresponding lines) apps/omlx-mac/Sources/AppView/ViewModels/DownloadsScreenVM.swift:285 — apps/omlx-mac/Sources/AppView/ViewModels/DownloadsScreenVM.swift:285-325 | apps/omlx-mac/Sources/AppView/ViewModels/DownloadsScreenVM.swift:346-377 — These two members are one piece of code written twice and then edited apart: 32 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.
  • Edited copy of a member (32 corresponding lines) omlx/patches/mlx_lm_mtp/glm_moe_dsa_model.py:234 — omlx/patches/mlx_lm_mtp/glm_moe_dsa_model.py:234-265 | omlx/patches/mlx_lm_mtp/step3p7_model.py:194-237 — These two members are one piece of code written twice and then edited apart: 32 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.
  • Edited copy of a member (32 corresponding lines) omlx/eval/kmmlu.py:46 — omlx/eval/kmmlu.py:46-77 | omlx/eval/mmlu.py:62-98 — These two members are one piece of code written twice and then edited apart: 32 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.
  • Edited copy of a member (32 corresponding lines) omlx/cache/paged_ssd_cache.py:1115 — omlx/cache/paged_ssd_cache.py:1115-1146 | omlx/config.py:8-42 — These two members are one piece of code written twice and then edited apart: 32 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 · Edited copy of a member (25 corresponding lines) · ×5
  • Edited copy of a member (25 corresponding lines) apps/omlx-mac/Sources/AppView/Screens/ContextBenchScreen.swift:227 — apps/omlx-mac/Sources/AppView/Screens/ContextBenchScreen.swift:227-251 | apps/omlx-mac/Sources/AppView/Screens/ThroughputBenchScreen.swift:936-960 — These two members are one piece of code written twice and then edited apart: 25 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.
  • Edited copy of a member (25 corresponding lines) REDACTED:10583 — REDACTED:10583-10607 | REDACTED:10640-10670 — These two members are one piece of code written twice and then edited apart: 25 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.
  • Edited copy of a member (25 corresponding lines) omlx/patches/mlx_vlm_glm5_next_compat/decode_kernels.py:1275 — omlx/patches/mlx_vlm_glm5_next_compat/decode_kernels.py:1275-1306 | omlx/patches/mlx_vlm_glm5_next_compat/decode_kernels.py:1557-1581 — These two members are one piece of code written twice and then edited apart: 25 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.
  • Edited copy of a member (25 corresponding lines) omlx/patches/bailing_hybrid/__init__.py:37 — omlx/patches/bailing_hybrid/__init__.py:37-67 | omlx/patches/raon1_mini/__init__.py:44-68 — These two members are one piece of code written twice and then edited apart: 25 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.
  • Edited copy of a member (25 corresponding lines) omlx/admin/ane_tuning.py:994 — omlx/admin/ane_tuning.py:994-1018 | omlx/admin/ane_tuning.py:1053-1077 — These two members are one piece of code written twice and then edited apart: 25 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 · Edited copies of one member (3 members, 11+ corresponding lines) · ×5
  • Edited copies of one member (3 members, 11+ corresponding lines) apps/omlx-cuda-helper/omlx_cuda_helper/families/deepseek_v41/kernels.py:1126 — apps/omlx-cuda-helper/omlx_cuda_helper/families/deepseek_v41/kernels.py:1126-1143 | apps/omlx-cuda-helper/omlx_cuda_helper/families/deepseek_v41/kernels.py:1265-1279 | apps/omlx-cuda-helper/omlx_cuda_helper/families/deepseek_v41/kernels.py:1283-1293 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 11+ corresponding lines) apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen4_exp/kernels.py:660 — apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen4_exp/kernels.py:660-671 | apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen4_exp/kernels.py:971-981 | apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen4_exp/kernels.py:985-995 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 11+ corresponding lines) apps/omlx-mac/Sources/AppView/ViewModels/DownloadsScreenVM.swift:162 — apps/omlx-mac/Sources/AppView/ViewModels/DownloadsScreenVM.swift:162-175 | apps/omlx-mac/Sources/AppView/ViewModels/LogsScreenVM.swift:72-82 | apps/omlx-mac/Sources/AppView/ViewModels/ModelsScreenVM.swift:85-95 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 11+ corresponding lines) apps/omlx-mac/Sources/AppView/ViewModels/ModelsScreenVM.swift:102 — apps/omlx-mac/Sources/AppView/ViewModels/ModelsScreenVM.swift:102-112 | apps/omlx-mac/Sources/AppView/ViewModels/ModelsScreenVM.swift:114-124 | apps/omlx-mac/Sources/AppView/ViewModels/ModelsScreenVM.swift:126-138 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 11+ corresponding lines) apps/omlx-mac/Sources/AppView/ViewModels/ModelSettingsScreenVM.swift:1944 — apps/omlx-mac/Sources/AppView/ViewModels/ModelSettingsScreenVM.swift:1944-1954 | apps/omlx-mac/Sources/AppView/ViewModels/ModelSettingsScreenVM.swift:1958-1969 | apps/omlx-mac/Sources/AppView/ViewModels/ModelSettingsScreenVM.swift:1974-1985 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (21 lines × 2) · ×5
  • Duplicated block (21 lines × 2) omlx/cache/boundary_snapshot_store.py:1617 — omlx/cache/boundary_snapshot_store.py:1617-1637 | omlx/cache/boundary_snapshot_store.py:1662-1682 — 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 after the matched lines, `omlx/cache/boundary_snapshot_store.py:1639` calls `_restore_tensor_from_bytes` and `omlx/cache/boundary_snapshot_store.py:1683` 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 (21 lines × 2) omlx/cache/boundary_snapshot_store.py:1732 — omlx/cache/boundary_snapshot_store.py:1732-1752 | omlx/cache/boundary_snapshot_store.py:1898-1918 — 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 (21 lines × 2) REDACTED:3296 — REDACTED:3296-3316 | REDACTED:3326-3346 — 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, `REDACTED:3323` calls `list`, `sum` and `REDACTED:3295` 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 (21 lines × 2) omlx/patches/deepseek_v4/moe_offload.py:246 — omlx/patches/deepseek_v4/moe_offload.py:246-266 | omlx/patches/glm_moe_dsa/moe_offload.py:296-316 — `omlx/patches/deepseek_v4/moe_offload.py` and `omlx/patches/glm_moe_dsa/moe_offload.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 9 separate duplicated blocks between them, totalling at least 157 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 `omlx/patches/deepseek_v4/moe_offload.py:246` 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 (21 lines × 2) apps/omlx-mac/Sources/AppView/Screens/NetworkScreen.swift:28 — apps/omlx-mac/Sources/AppView/Screens/NetworkScreen.swift:28-48 | apps/omlx-mac/Sources/AppView/Screens/PerformanceScreen.swift:30-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. Read the line range as the matched WINDOW rather than a finished unit: at `apps/omlx-mac/Sources/AppView/Screens/NetworkScreen.swift:28` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (6 lines × 3) · ×5
  • Duplicated block (6 lines × 3) omlx/patches/deepseek_v4/deepseek_v4_model.py:1746 — omlx/patches/deepseek_v4/deepseek_v4_model.py:1746-1751 | omlx/patches/deepseek_v4/deepseek_v4_model.py:1876-1881 | omlx/patches/deepseek_v4/deepseek_v4_model.py:2145-2150 — 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 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 × 3) omlx/patches/bailing_hybrid/bailing_hybrid_model.py:1068 — omlx/patches/bailing_hybrid/bailing_hybrid_model.py:1068-1073 | omlx/patches/hy_v3/hy_v3_model.py:381-386 | omlx/patches/laguna/laguna_model.py:784-789 — 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 (6 lines × 3) omlx/patches/k2_horizon/k2_horizon_model.py:446 — omlx/patches/hy_v3/hy_v3_model.py:268-273 | omlx/patches/k2_horizon/k2_horizon_model.py:446-451 | omlx/patches/laguna/laguna_model.py:568-573 — 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 (6 lines × 3) apps/omlx-mac/Sources/AppView/Screens/AccuracyBenchScreen.swift:879 — apps/omlx-mac/Sources/AppView/Screens/AccuracyBenchScreen.swift:879-884 | apps/omlx-mac/Sources/AppView/Screens/QuantizationScreen.swift:346-351 | apps/omlx-mac/Sources/AppView/Screens/ThroughputBenchScreen.swift:652-657 — 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 `apps/omlx-mac/Sources/AppView/Screens/AccuracyBenchScreen.swift:879` 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 first that the copies are not typed on the same thing: the declarations holding them bind `spacing` to `8` in one and `0` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `apps/omlx-mac/Sources/AppView/Screens/ThroughputBenchScreen.swift:651` calls `HStack` and `apps/omlx-mac/Sources/AppView/Screens/QuantizationScreen.swift:345` 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 (6 lines × 3) apps/omlx-mac/Sources/AppView/Screens/NetworkScreen.swift:29 — apps/omlx-mac/Sources/AppView/Screens/NetworkScreen.swift:29-34 | apps/omlx-mac/Sources/AppView/Screens/PerformanceScreen.swift:31-36 | apps/omlx-mac/Sources/AppView/Screens/ServerScreen.swift:189-196 — 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 `apps/omlx-mac/Sources/AppView/Screens/ServerScreen.swift:189` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D29 · Static Analysis (SAST) · REDACTED · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D3 · God Classes · FunctionTooLong · ×4
  • FunctionTooLong: chat.html.chatApp apps/omlx-web/omlx_web/templates/chat.html:2841 — FunctionTooLong — chatApp runs 3992 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 3892 over it, 39.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.
  • FunctionTooLong: cluster_v2.clusterV2Wizard apps/omlx-web/omlx_web/static/js/cluster_v2.js:49 — FunctionTooLong — clusterV2Wizard runs 2785 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 2685 over it, 27.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.
  • FunctionTooLong: cluster_v2.clusterV2Wizard.checkRows apps/omlx-web/omlx_web/static/js/cluster_v2.js:2095 — FunctionTooLong — clusterV2Wizard.checkRows runs 157 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 57 over it, 1.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: theme_preview.drawCard apps/omlx-web/omlx_web/static/js/theme_preview.js:178 — FunctionTooLong — drawCard runs 119 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 19 over it, 1.19× 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.
D31 · IaC & Container Security · Medium IaC · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D35 · Change Coupling · Change coupling · ×4
  • Change coupling: qwen35_moe_vlm_model.py ↔ qwen35_moe_vlm_runtime.py omlx/patches/mlx_vlm_mtp/qwen35_moe_vlm_model.py:1 — `omlx/patches/mlx_vlm_mtp/qwen35_moe_vlm_model.py` and `omlx/patches/mlx_vlm_mtp/qwen35_moe_vlm_runtime.py` change together 80% of the time (8 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 8 shared commits counted here, the most recent 3 are `8be91344` chore: bump mlx-vlm to 9790231 (v0.7.8) (#4529); `940c7983` fix: load MLX-format MTP head norms as stored (#3742) (#3788); `a5911924` feat: support Ornith models in oQ and inference (#2044) — run `git show` on any of them.
  • Change coupling: PerformanceScreen.swift ↔ GlobalSettingsDTO.swift apps/omlx-mac/Sources/AppView/Screens/PerformanceScreen.swift:1 — `apps/omlx-mac/Sources/AppView/Screens/PerformanceScreen.swift` and `apps/omlx-mac/Sources/Net/DTO/GlobalSettingsDTO.swift` change together 64% of the time (7 of the 11 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). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder — so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `09ad2e90` feat(scheduler): Concurrent Request Priority with an adaptive Balance…; `e6d5989e` fix(cache): turn the SSD cache off when its configured dir is unavail…; `d610102a` fix(admin): allow disabling idle timeout from the macOS app (#2498) — run `git show` on any of them.
  • Change coupling: qwen35_model.py ↔ qwen35_moe_vlm_model.py omlx/patches/mlx_lm_mtp/qwen35_model.py:1 — `omlx/patches/mlx_lm_mtp/qwen35_model.py` and `omlx/patches/mlx_vlm_mtp/qwen35_moe_vlm_model.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 `940c7983` fix: load MLX-format MTP head norms as stored (#3742) (#3788); `a5911924` feat: support Ornith models in oQ and inference (#2044); `f0510008` fix(oq): defer MTP norm shift decisions — run `git show` on any of them.
  • Change coupling: embedding.py ↔ reranker.py omlx/engine/embedding.py:1 — `omlx/engine/embedding.py` and `omlx/engine/reranker.py` change together 50% of the time (6 of the 12 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 6 shared commits counted here, the most recent 3 are `beca2e36` fix(security): default trust_remote_code to false with per-model opt-…; `bda11fc4` fix: synchronize GPU before clearing Metal buffer cache (#300); `5e58c97d` fix: remove keepalive warmup loop that caused sustained GPU spike (#292) — run `git show` on any of them.
D4 · Code Duplication · Edited copy of a member (35 corresponding lines) · ×4
  • Edited copy of a member (35 corresponding lines) apps/omlx-mac/Sources/AppView/Screens/NetworkScreen.swift:23 — apps/omlx-mac/Sources/AppView/Screens/NetworkScreen.swift:23-60 | apps/omlx-mac/Sources/AppView/Screens/PerformanceScreen.swift:24-62 — These two members are one piece of code written twice and then edited apart: 35 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.
  • Edited copy of a member (35 corresponding lines) omlx/patches/qwen35_verify_sdpa_split.py:361 — omlx/patches/qwen35_verify_sdpa_split.py:361-399 | omlx/patches/qwen35_verify_sdpa_split.py:806-840 — These two members are one piece of code written twice and then edited apart: 35 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.
  • Edited copy of a member (35 corresponding lines) omlx/patches/k2_horizon/k2_horizon_model.py:308 — omlx/patches/k2_horizon/k2_horizon_model.py:308-342 | omlx/patches/laguna/laguna_model.py:417-465 — These two members are one piece of code written twice and then edited apart: 35 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.
  • Edited copy of a member (35 corresponding lines) REDACTED:1119 — REDACTED:1119-1153 | omlx/engine/vlm.py:4858-4894 — These two members are one piece of code written twice and then edited apart: 35 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 (5 members, 50+ identical tokens) · ×4
  • Members sharing a duplicated core (5 members, 50+ identical tokens) omlx/eval/arc.py:29 — omlx/eval/arc.py:29-52 | omlx/eval/bbq.py:29-54 | omlx/eval/mathqa.py:28-52 | omlx/eval/mmlu_pro.py:31-55 | omlx/eval/safetybench.py:29-53 — 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) omlx/eval/arc.py:55 — omlx/eval/arc.py:55-70 | omlx/eval/bbq.py:57-74 | omlx/eval/mathqa.py:55-70 | omlx/eval/mmlu_pro.py:58-73 | omlx/eval/safetybench.py:56-72 — 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) REDACTED:4625 — REDACTED:4625-4856 | REDACTED:5042-5546 | REDACTED:6099-6298 | REDACTED:8016-8296 | REDACTED:8593-9127 — 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) apps/omlx-mac/Sources/AppView/Screens/AccuracyBenchScreen.swift:765 — apps/omlx-mac/Sources/AppView/Screens/AccuracyBenchScreen.swift:765-820 | apps/omlx-mac/Sources/AppView/Screens/DownloadsScreen.swift:251-285 | apps/omlx-mac/Sources/AppView/Screens/DownloadsScreen.swift:407-441 | apps/omlx-mac/Sources/AppView/Screens/ThroughputBenchScreen.swift:832-889 | apps/omlx-mac/Sources/AppView/Screens/ThroughputBenchScreen.swift:899-925 — 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 · Edited copy of a member (22 corresponding lines) · ×4
  • Edited copy of a member (22 corresponding lines) apps/omlx-cuda-helper/omlx_cuda_helper/families/deepseek_v41/ngram.py:103 — apps/omlx-cuda-helper/omlx_cuda_helper/families/deepseek_v41/ngram.py:103-124 | omlx/patches/deepseek_v41/engram.py:112-134 — 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.
  • Edited copy of a member (22 corresponding lines) apps/omlx-cuda-helper/omlx_cuda_helper/families/deepseek_v41/config.py:91 — apps/omlx-cuda-helper/omlx_cuda_helper/families/deepseek_v41/config.py:91-112 | omlx/patches/deepseek_v41/config.py:191-220 — 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.
  • Edited copy of a member (22 corresponding lines) omlx/cluster/registry.py:52 — omlx/cluster/registry.py:52-84 | omlx/cluster/registry.py:244-265 — 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.
  • Edited copy of a member (22 corresponding lines) REDACTED:1137 — REDACTED:1137-1163 | REDACTED:1203-1224 — 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 · Edited copy of a member (23 corresponding lines) · ×4
  • Edited copy of a member (23 corresponding lines) omlx/cache/type_handlers.py:1389 — omlx/cache/type_handlers.py:1389-1412 | omlx/cache/type_handlers.py:1475-1497 — These two members are one piece of code written twice and then edited apart: 23 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.
  • Edited copy of a member (23 corresponding lines) omlx/patches/minimax_m3/generate_patch.py:34 — omlx/patches/minimax_m3/generate_patch.py:34-68 | omlx/scheduler.py:1846-1868 — These two members are one piece of code written twice and then edited apart: 23 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.
  • Edited copy of a member (23 corresponding lines) REDACTED:1538 — REDACTED:1538-1560 | omlx/engine/vlm.py:5401-5428 — These two members are one piece of code written twice and then edited apart: 23 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.
  • Edited copy of a member (23 corresponding lines) omlx/admin/routes.py:8205 — omlx/admin/routes.py:8205-8228 | omlx/admin/routes.py:8871-8893 — These two members are one piece of code written twice and then edited apart: 23 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 · Edited copies of one member (3 members, 15+ corresponding lines) · ×4
  • Edited copies of one member (3 members, 15+ corresponding lines) omlx/model_settings.py:929 — omlx/model_settings.py:929-947 | omlx/model_settings.py:1202-1216 | omlx/model_settings.py:1810-1824 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 15+ corresponding lines) apps/omlx-mac/Sources/AppView/ViewModels/DownloadsScreenVM.swift:430 — apps/omlx-mac/Sources/AppView/ViewModels/DownloadsScreenVM.swift:430-444 | apps/omlx-mac/Sources/AppView/ViewModels/DownloadsScreenVM.swift:446-460 | apps/omlx-mac/Sources/AppView/ViewModels/DownloadsScreenVM.swift:462-476 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 15+ corresponding lines) omlx/admin/ane_tuning.py:945 — omlx/admin/ane_tuning.py:945-959 | omlx/admin/ane_tuning.py:970-984 | omlx/admin/ane_tuning.py:1029-1043 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 15+ corresponding lines) omlx/custom_kernels/attention/fast.py:159 — omlx/custom_kernels/attention/fast.py:159-180 | omlx/custom_kernels/quant_matmul/fast.py:520-534 | omlx/custom_kernels/sparse_index/fast.py:246-260 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (3 corresponding lines) · ×4
  • Edited copy of a member (3 corresponding lines) apps/omlx-cuda-helper/omlx_cuda_helper/families/inkling2/layers.py:207 — apps/omlx-cuda-helper/omlx_cuda_helper/families/inkling2/layers.py:207-212 | omlx/patches/inkling2/model.py:115-117 — These two members are one piece of code written twice and then edited apart: 3 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.
  • Edited copy of a member (3 corresponding lines) apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen3_5/layers.py:89 — apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen3_5/layers.py:89-91 | apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen4_exp/layers.py:188-190 — These two members are one piece of code written twice and then edited apart: 3 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.
  • Edited copy of a member (3 corresponding lines) apps/omlx-cuda-helper/omlx_cuda_helper/families/glm5_next/model.py:213 — apps/omlx-cuda-helper/omlx_cuda_helper/families/glm5_next/model.py:213-216 | omlx/patches/m5_gather_qmm_nax.py:1693-1695 — These two members are one piece of code written twice and then edited apart: 3 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.
  • Edited copy of a member (3 corresponding lines) omlx/patches/qwen35_ane_prefill.py:194 — omlx/patches/qwen35_ane_prefill.py:194-196 | omlx/patches/qwen35_moe_weighted_sum.py:42-44 — These two members are one piece of code written twice and then edited apart: 3 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 · Duplicated block (28 lines × 2) · ×4
  • Duplicated block (28 lines × 2) omlx/admin/hf_uploader.py:452 — omlx/admin/hf_uploader.py:452-479 | omlx/admin/hf_uploader.py:502-529 — 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 (28 lines × 2) omlx/cache/paged_ssd_cache.py:4414 — omlx/cache/paged_ssd_cache.py:4414-4441 | omlx/cache/paged_ssd_cache.py:4450-4477 — 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 after the matched lines, `omlx/cache/paged_ssd_cache.py:4479` calls `_promote_pending_write_to_hot_cache` and `omlx/cache/paged_ssd_cache.py:4442` 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 (28 lines × 2) omlx/engine/vlm.py:1114 — omlx/engine/vlm.py:1114-1141 | omlx/engine/vlm.py:1233-1260 — 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 (28 lines × 2) apps/omlx-mac/Sources/AppView/Screens/ContextBenchScreen.swift:172 — apps/omlx-mac/Sources/AppView/Screens/ContextBenchScreen.swift:172-199 | apps/omlx-mac/Sources/AppView/Screens/ThroughputBenchScreen.swift:291-318 — 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 `apps/omlx-mac/Sources/AppView/Screens/ContextBenchScreen.swift:172` 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 (18–19 lines × 2) · ×4
  • Duplicated block (18–19 lines × 2) omlx/cache/paged_ssd_cache.py:4332 — omlx/cache/paged_ssd_cache.py:4332-4350 | omlx/cache/paged_ssd_cache.py:4516-4533 — 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 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 (18–19 lines × 2) omlx/cluster/incidents.py:164 — omlx/cluster/incidents.py:164-181 | omlx/cluster/registry.py:87-105 — 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 (18–19 lines × 2) omlx/patches/qwen35_ane_prefill.py:617 — omlx/patches/qwen35_ane_prefill.py:617-634 | omlx/patches/qwen35_ane_prefill.py:754-772 — 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 `omlx/patches/qwen35_ane_prefill.py:617` 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 (18–19 lines × 2) omlx/scheduler.py:13947 — omlx/scheduler.py:13947-13965 | omlx/scheduler.py:14030-14047 — 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 `omlx/scheduler.py:13947` 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 (17 lines × 2) · ×4
  • Duplicated block (17 lines × 2) omlx/cluster/staging.py:798 — omlx/cluster/staging.py:798-814 | omlx/cluster/staging.py:943-959 — 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) omlx/patches/deepseek_v4/chat_template_v4.py:415 — omlx/patches/deepseek_v4/chat_template_v4.py:415-431 | omlx/patches/deepseek_v41/encoding.py:668-684 — before extracting anything, compare `omlx/patches/deepseek_v4/chat_template_v4.py` and `omlx/patches/deepseek_v41/encoding.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 210 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. Read the line range as the matched WINDOW rather than a finished unit: at `omlx/patches/deepseek_v4/chat_template_v4.py:415` 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) omlx/patches/qwen35_ane_prefill.py:1157 — omlx/patches/qwen35_ane_prefill.py:1157-1173 | omlx/patches/qwen35_ane_prefill.py:1404-1420 — 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 (17 lines × 2) REDACTED:8063 — REDACTED:8063-8079 | REDACTED:8813-8829 — 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 `REDACTED:8063` 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 (14–15 lines × 2) · ×4
  • Duplicated block (14–15 lines × 2) omlx/cache/boundary_snapshot_store.py:1833 — omlx/cache/boundary_snapshot_store.py:1833-1847 | omlx/cache/boundary_snapshot_store.py:1988-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. Read the line range as the matched WINDOW rather than a finished unit: at `omlx/cache/boundary_snapshot_store.py:1833` 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–15 lines × 2) REDACTED:993 — REDACTED:993-1007 | omlx/engine/vlm.py:4790-4803 — before extracting anything, compare `REDACTED` and `omlx/engine/vlm.py` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 480 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 (14–15 lines × 2) omlx/patches/glm_moe_dsa/deepseek_v32.py:796 — omlx/patches/glm_moe_dsa/deepseek_v32.py:796-810 | omlx/patches/glm_moe_dsa/glm_moe_dsa_model.py:447-460 — 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–15 lines × 2) REDACTED:9058 — REDACTED:9058-9071 | REDACTED:9752-9766 — 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 (13–15 lines × 2) · ×4
  • Duplicated block (13–15 lines × 2) omlx/cluster/ssh_keys.py:392 — omlx/cluster/ssh_keys.py:392-404 | omlx/cluster/ssh_keys.py:428-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.
  • Duplicated block (13–15 lines × 2) omlx/engine/sts.py:393 — omlx/engine/sts.py:393-405 | omlx/engine/tts.py:401-415 — 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 `omlx/engine/sts.py:393` 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–15 lines × 2) omlx/patches/deepseek_v4/moe_offload.py:344 — omlx/patches/deepseek_v4/moe_offload.py:344-358 | omlx/patches/glm_moe_dsa/moe_offload.py:379-391 — `omlx/patches/deepseek_v4/moe_offload.py` and `omlx/patches/glm_moe_dsa/moe_offload.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 9 separate duplicated blocks between them, totalling at least 157 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. 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, `omlx/patches/deepseek_v4/moe_offload.py:359` calls `_is_mtp_path` and `omlx/patches/glm_moe_dsa/moe_offload.py:392` 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 (13–15 lines × 2) REDACTED:1173 — REDACTED:1173-1185 | omlx/patches/mlx_vlm_mtp/inkling_vlm_runtime.py:852-866 — 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 (11 lines × 3) · ×4
  • Duplicated block (11 lines × 3) omlx/api/audio_routes.py:363 — omlx/api/audio_routes.py:363-373 | omlx/api/audio_routes.py:412-422 | omlx/api/audio_routes.py:1610-1620 — 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.
  • Duplicated block (11 lines × 3) omlx/patches/mlx_lm_mtp/qwen35_model.py:622 — omlx/patches/mlx_lm_mtp/qwen35_model.py:622-632 | omlx/patches/mlx_vlm_mtp/qwen35_moe_vlm_runtime.py:339-349 | omlx/patches/mlx_vlm_mtp/qwen35_vlm_runtime.py:405-415 — 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 `omlx/patches/mlx_lm_mtp/qwen35_model.py:622` 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 (11 lines × 3) omlx/patches/qwen35_ane_prefill.py:535 — omlx/patches/qwen35_ane_prefill.py:535-545 | omlx/patches/qwen35_ane_prefill.py:1228-1238 | omlx/patches/qwen35_ane_prefill.py:1534-1544 — 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.
  • Duplicated block (11 lines × 3) apps/omlx-mac/Sources/AppView/ViewModels/ServerScreenVM.swift:522 — apps/omlx-mac/Sources/AppView/ViewModels/ServerScreenVM.swift:522-532 | apps/omlx-mac/Sources/Welcome/WelcomeWindow.swift:222-232 | apps/omlx-mac/Sources/Welcome/WelcomeWindow.swift:239-249 — 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.
D4 · Code Duplication · Duplicated block (5 lines × 3) · ×4
  • Duplicated block (5 lines × 3) omlx/cluster/inference_worker.py:877 — omlx/cluster/inference_worker.py:877-881 | omlx/cluster/telemetry.py:730-734 | omlx/engine/distributed.py:1188-1193 — 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 `omlx/engine/distributed.py:1188` 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 (5 lines × 3) REDACTED:1959 — REDACTED:1959-1963 | omlx/admin/hf_uploader.py:656-660 | omlx/admin/ms_downloader.py:874-878 — 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.
  • Duplicated block (5 lines × 3) REDACTED:3505 — REDACTED:3505-3509 | REDACTED:3537-3541 | REDACTED:3557-3561 — 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.
  • Duplicated block (5 lines × 3) apps/omlx-mac/Sources/AskAI/MicrophoneAccess.swift:33 — apps/omlx-mac/Sources/AskAI/MicrophoneAccess.swift:33-37 | apps/omlx-mac/Sources/AskAI/PromptPlaceholders.swift:85-89 | apps/omlx-mac/Sources/AskAI/ScreenCapture.swift:18-22 — 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.
R10 · Code Duplication · Duplicated block (11 lines × 2 locations) · ×4
  • Duplicated block (11 lines × 2 locations) REDACTED:1611 — REDACTED:1611 · REDACTED:1933 — 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 locations) REDACTED:2602 — REDACTED:2602 · REDACTED:2748 — all 2 copies are in the same file, 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 (11 lines × 2 locations) REDACTED:6553 — REDACTED:6553 · REDACTED:6674 — 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 locations) REDACTED:8443 — REDACTED:8443 · REDACTED:8502 — all 2 copies are in the same file, 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.
R4 · Test Coverage · No test reaches this file · ×4
  • No test reaches this file apps/omlx-web/omlx_web/static/js/cluster_v2.js: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 REDACTED: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 apps/omlx-web/omlx_web/static/js/dashboard_layout.js: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 apps/omlx-web/omlx_web/static/js/marked-highlight.umd.js: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.
X17 · Uncapped recursion over a caller-supplied document · Recursive walk over a caller-supplied document has no depth cap · ×4
  • Recursive walk over a caller-supplied document has no depth cap REDACTED:1975 — `collect_kv_layer_specs` is public, takes a document from its caller (line 1925) and hands it to `_walk`, which calls itself at line 1975 (`_walk`) with a piece of `c` — 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 omlx/cluster/prompt_snapshot_cache.py:99 — `from_state` is public, takes a document from its caller (line 251) and hands it to `_from_wire_state`, which calls itself at line 99 (`_from_wire_state`) with a piece of `state` — and nowhere in `_from_wire_state` 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_wire_state` 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 omlx/api/utils.py:43 — `find_lone_surrogate` is public and takes `value: Any` from its caller, and it calls itself at line 43 (`find_lone_surrogate`) with a piece of `value` (and at line 48) — and nowhere in `find_lone_surrogate` 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 `find_lone_surrogate` 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 omlx/api/utils.py:383 — `chat_template_preserves_mid_system` is public, takes a document from its caller (line 457) and hands it to `_freeze_template_value`, which calls itself at line 383 (`_freeze_template_value`) with a piece of `value` (and at line 386, line 388) — and nowhere in `_freeze_template_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 `_freeze_template_value` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
D29 · Static Analysis (SAST) · REDACTED · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×3
  • Members sharing a duplicated core (4 members, 50+ identical tokens) REDACTED:1178 — REDACTED:1178-1253 | REDACTED:1268-1393 | omlx/engine/vlm.py:4914-5012 | omlx/engine/vlm.py:5032-5172 — 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) apps/omlx-mac/Sources/AppView/ViewModels/IntegrationsScreenVM.swift:248 — apps/omlx-mac/Sources/AppView/ViewModels/IntegrationsScreenVM.swift:248-263 | apps/omlx-mac/Sources/AppView/ViewModels/ServerScreenVM.swift:520-536 | apps/omlx-mac/Sources/Welcome/WelcomeWindow.swift:221-236 | apps/omlx-mac/Sources/Welcome/WelcomeWindow.swift:238-253 — 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) apps/omlx-mac/Sources/AppView/ViewModels/IntegrationsScreenVM.swift:265 — apps/omlx-mac/Sources/AppView/ViewModels/IntegrationsScreenVM.swift:265-277 | apps/omlx-mac/Sources/AppView/ViewModels/ModelSettingsScreenVM.swift:646-658 | apps/omlx-mac/Sources/AppView/ViewModels/SecurityScreenVM.swift:13-25 | apps/omlx-mac/Sources/AppView/ViewModels/ServerScreenVM.swift:722-734 — 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 · Edited copy of a member (33 corresponding lines) · ×3
  • Edited copy of a member (33 corresponding lines) apps/omlx-cuda-helper/omlx_cuda_helper/families/deepseek_v41/ngram.py:68 — apps/omlx-cuda-helper/omlx_cuda_helper/families/deepseek_v41/ngram.py:68-100 | omlx/patches/deepseek_v41/engram.py:74-109 — These two members are one piece of code written twice and then edited apart: 33 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.
  • Edited copy of a member (33 corresponding lines) omlx/patches/deepseek_v4/chat_template_v4.py:572 — omlx/patches/deepseek_v4/chat_template_v4.py:572-612 | omlx/patches/deepseek_v41/encoding.py:237-269 — These two members are one piece of code written twice and then edited apart: 33 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.
  • Edited copy of a member (33 corresponding lines) REDACTED:1919 — REDACTED:1919-1956 | omlx/admin/ms_downloader.py:839-871 — These two members are one piece of code written twice and then edited apart: 33 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 · Edited copy of a member (24 corresponding lines) · ×3
  • Edited copy of a member (24 corresponding lines) apps/omlx-cuda-helper/omlx_cuda_helper/families/deepseek_v41/ops.py:68 — apps/omlx-cuda-helper/omlx_cuda_helper/families/deepseek_v41/ops.py:68-91 | omlx/patches/deepseek_v41/language.py:88-115 — These two members are one piece of code written twice and then edited apart: 24 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.
  • Edited copy of a member (24 corresponding lines) omlx/utils/nax_attention.py:899 — omlx/utils/nax_attention.py:899-924 | omlx/utils/nax_attention.py:929-952 — These two members are one piece of code written twice and then edited apart: 24 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.
  • Edited copy of a member (24 corresponding lines) omlx/websearch.py:244 — omlx/websearch.py:244-271 | omlx/websearch.py:284-307 — These two members are one piece of code written twice and then edited apart: 24 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 · Edited copy of a member (30 corresponding lines) · ×3
  • Edited copy of a member (30 corresponding lines) omlx/patches/deepseek_v4/deepseek_v4_model.py:644 — omlx/patches/deepseek_v4/deepseek_v4_model.py:644-673 | omlx/patches/deepseek_v4/deepseek_v4_model.py:684-714 — These two members are one piece of code written twice and then edited apart: 30 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.
  • Edited copy of a member (30 corresponding lines) omlx/engine_pool.py:3511 — omlx/engine_pool.py:3511-3576 | omlx/engine_pool.py:3581-3610 — These two members are one piece of code written twice and then edited apart: 30 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.
  • Edited copy of a member (30 corresponding lines) omlx/prefill_helper/adapters/qwen3_5.py:196 — omlx/prefill_helper/adapters/qwen3_5.py:196-233 | omlx/prefill_helper/adapters/qwen4_exp.py:283-312 — These two members are one piece of code written twice and then edited apart: 30 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 · Edited copy of a member (37 corresponding lines) · ×3
  • Edited copy of a member (37 corresponding lines) omlx/utils/image.py:77 — omlx/utils/image.py:77-121 | omlx/utils/image.py:125-161 — These two members are one piece of code written twice and then edited apart: 37 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.
  • Edited copy of a member (37 corresponding lines) apps/omlx-mac/Sources/AppView/ViewModels/ModelSettingsScreenVM.swift:2193 — apps/omlx-mac/Sources/AppView/ViewModels/ModelSettingsScreenVM.swift:2193-2234 | apps/omlx-mac/Sources/AppView/ViewModels/ModelSettingsScreenVM.swift:2239-2275 — These two members are one piece of code written twice and then edited apart: 37 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.
  • Edited copy of a member (37 corresponding lines) omlx/admin/hf_uploader.py:452 — omlx/admin/hf_uploader.py:452-499 | omlx/admin/hf_uploader.py:502-538 — These two members are one piece of code written twice and then edited apart: 37 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 · Edited copy of a member (36 corresponding lines) · ×3
  • Edited copy of a member (36 corresponding lines) omlx/cluster/transport.py:190 — omlx/cluster/transport.py:190-225 | omlx/cluster/transport.py:571-608 — These two members are one piece of code written twice and then edited apart: 36 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.
  • Edited copy of a member (36 corresponding lines) REDACTED:1837 — REDACTED:1837-1875 | omlx/admin/ms_downloader.py:778-813 — These two members are one piece of code written twice and then edited apart: 36 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.
  • Edited copy of a member (36 corresponding lines) apps/omlx-cuda-helper/omlx_cuda_helper/families/deepseek_v41/kernels.py:955 — apps/omlx-cuda-helper/omlx_cuda_helper/families/deepseek_v41/kernels.py:955-998 | apps/omlx-cuda-helper/omlx_cuda_helper/families/minimax_m3_vl/kernels.py:289-324 — These two members are one piece of code written twice and then edited apart: 36 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 · Edited copies of one member (3 members, 4+ corresponding lines) · ×3
  • Edited copies of one member (3 members, 4+ corresponding lines) apps/omlx-mac/Sources/AppView/Utils/PresetBundleStore.swift:70 — apps/omlx-mac/Sources/AppView/Utils/PresetBundleStore.swift:70-74 | apps/omlx-mac/Sources/AskAI/AskAISettings.swift:494-497 | apps/omlx-mac/Sources/Updater/UpdateController.swift:521-524 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 4+ corresponding lines) omlx/patches/glm_moe_dsa/deepseek_v32.py:753 — omlx/patches/glm_moe_dsa/deepseek_v32.py:753-756 | omlx/patches/glm_moe_dsa/glm_moe_dsa_model.py:426-431 | omlx/patches/hy_v3/hy_v3_model.py:221-224 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 4+ corresponding lines) apps/omlx-mac/Sources/AppView/Screens/ThroughputBenchScreen.swift:1050 — apps/omlx-mac/Sources/AppView/Screens/ThroughputBenchScreen.swift:1050-1053 | apps/omlx-mac/Sources/AppView/ViewModels/ThroughputBenchScreenVM.swift:374-377 | apps/omlx-mac/Sources/Menubar/MenubarController.swift:1345-1348 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (30 lines × 2) · ×3
  • Duplicated block (30 lines × 2) REDACTED:494 — REDACTED:494-523 | omlx/engine/vlm.py:2553-2582 — before extracting anything, compare `REDACTED` and `omlx/engine/vlm.py` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 480 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 `REDACTED:494` 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 (30 lines × 2) omlx/engine/vlm.py:5218 — omlx/engine/vlm.py:5218-5247 | omlx/engine/vlm.py:5476-5505 — 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 (30 lines × 2) REDACTED:8235 — REDACTED:8235-8264 | REDACTED:9001-9030 — 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 `REDACTED:8235` 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 (25 lines × 2) · ×3
  • Duplicated block (25 lines × 2) REDACTED:11444 — REDACTED:11444-11468 | REDACTED:12130-12154 — 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, `REDACTED:12128` calls `synchronize`, `clear_cache` and `REDACTED:11443` 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 (25 lines × 2) omlx/patches/mlx_vlm_mtp/qwen35_moe_vlm_runtime.py:88 — omlx/patches/mlx_vlm_mtp/qwen35_moe_vlm_runtime.py:88-112 | omlx/patches/mlx_vlm_mtp/qwen35_vlm_runtime.py:163-187 — before extracting anything, compare `omlx/patches/mlx_vlm_mtp/qwen35_moe_vlm_runtime.py` and `omlx/patches/mlx_vlm_mtp/qwen35_vlm_runtime.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 282 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 (25 lines × 2) REDACTED:7785 — REDACTED:7785-7809 | REDACTED:9863-9887 — 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) omlx/api/audio_routes.py:573 — omlx/api/audio_routes.py:573-591 | omlx/api/audio_routes.py:1675-1693 — 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 first that the copies are not typed on the same thing: `STTEngine` names `..engine.stt` in one and `omlx.engine.stt` in another — different types that share a simple name, which is why the text matched. A single extracted unit cannot be given a parameter type that fits both, so unifying those types (or introducing a shared abstraction over them) is the step that has to come BEFORE the extraction above; if they are deliberately separate, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (19 lines × 2) omlx/adapter/muse_glimmer.py:172 — omlx/adapter/muse_glimmer.py:172-190 | omlx/adapter/output_parser.py:999-1017 — 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 (19 lines × 2) REDACTED:1896 — REDACTED:1896-1914 | omlx/admin/ms_downloader.py:816-834 — 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 (18 lines × 2) · ×3
  • Duplicated block (18 lines × 2) omlx/cache/prefix_cache.py:362 — omlx/cache/prefix_cache.py:362-379 | omlx/cache/prefix_cache.py:5658-5675 — 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 (18 lines × 2) REDACTED:1236 — REDACTED:1236-1253 | omlx/engine/vlm.py:4995-5012 — before extracting anything, compare `REDACTED` and `omlx/engine/vlm.py` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 480 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 `REDACTED:1236` 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, `REDACTED:1235` calls `pop` and `omlx/engine/vlm.py:4994` 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 (18 lines × 2) omlx/patches/deepseek_v4/cache_extras.py:158 — omlx/patches/deepseek_v4/cache_extras.py:158-175 | omlx/patches/deepseek_v4/cache_extras.py:532-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. Read the line range as the matched WINDOW rather than a finished unit: at `omlx/patches/deepseek_v4/cache_extras.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 (15–16 lines × 2) · ×3
  • Duplicated block (15–16 lines × 2) omlx/admin/routes.py:9018 — omlx/admin/routes.py:9018-9032 | omlx/admin/routes.py:9635-9650 — 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–16 lines × 2) omlx/engine/vlm.py:5250 — omlx/engine/vlm.py:5250-5265 | omlx/engine/vlm.py:5508-5522 — 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 `omlx/engine/vlm.py:5250` 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 (15–16 lines × 2) omlx/patches/deepseek_v4/switch_layers.py:430 — omlx/patches/deepseek_v4/switch_layers.py:430-444 | omlx/patches/glm_moe_dsa/switch_layers.py:153-168 — `omlx/patches/deepseek_v4/switch_layers.py` and `omlx/patches/glm_moe_dsa/switch_layers.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 75 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.
D4 · Code Duplication · Duplicated block (14–16 lines × 2) · ×3
  • Duplicated block (14–16 lines × 2) omlx/admin/routes.py:9491 — omlx/admin/routes.py:9491-9506 | omlx/admin/routes.py:9739-9752 — 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.
  • Duplicated block (14–16 lines × 2) omlx/patches/glm_moe_dsa/deepseek_v32.py:538 — omlx/patches/glm_moe_dsa/deepseek_v32.py:538-551 | omlx/patches/index_cache.py:167-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 `omlx/patches/glm_moe_dsa/deepseek_v32.py:538` 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 (14–16 lines × 2) omlx/patches/qwen35_ane_prefill.py:714 — omlx/patches/qwen35_ane_prefill.py:714-729 | omlx/patches/qwen35_ane_prefill.py:916-929 — 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 `omlx/patches/qwen35_ane_prefill.py:714` 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 (13–16 lines × 2) · ×3
  • Duplicated block (13–16 lines × 2) omlx/api/anthropic_utils.py:447 — omlx/api/anthropic_utils.py:447-459 | omlx/api/anthropic_utils.py:678-693 — 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 `omlx/api/anthropic_utils.py:447` 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 (13–16 lines × 2) omlx/cache/prefix_cache.py:2307 — omlx/cache/prefix_cache.py:2307-2319 | omlx/cache/prefix_cache.py:2864-2879 — 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 `omlx/cache/prefix_cache.py:2307` 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 (13–16 lines × 2) omlx/patches/deepseek_v4/wsdpa_attention.py:310 — omlx/patches/deepseek_v4/wsdpa_attention.py:310-322 | omlx/patches/deepseek_v4/wsdpa_attention.py:395-410 — 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 `omlx/patches/deepseek_v4/wsdpa_attention.py:310` 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 (13 lines × 3) · ×3
  • Duplicated block (13 lines × 3) omlx/adapter/output_parser.py:246 — omlx/adapter/output_parser.py:246-258 | omlx/adapter/output_parser.py:590-602 | omlx/adapter/output_parser.py:697-709 — 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, `omlx/adapter/output_parser.py:710` calls `_MiniMaxM3ProtocolNormalizer` and `omlx/adapter/output_parser.py:260` 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 (13 lines × 3) REDACTED:1578 — REDACTED:1578-1590 | REDACTED:1646-1658 | REDACTED:1870-1882 — 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 `REDACTED:1578` 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 (13 lines × 3) apps/omlx-mac/Sources/AppView/Screens/AskAIScreen.swift:729 — apps/omlx-mac/Sources/AppView/Screens/AskAIScreen.swift:729-741 | apps/omlx-mac/Sources/AppView/Screens/AskAIScreen.swift:1108-1120 | apps/omlx-mac/Sources/AppView/Screens/AskAIScreen.swift:1577-1589 — 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 (9–10 lines × 2) · ×3
  • Duplicated block (9–10 lines × 2) apps/omlx-cuda-helper/omlx_cuda_helper/worker.py:431 — apps/omlx-cuda-helper/omlx_cuda_helper/worker.py:431-439 | omlx/prefill_helper/worker.py:232-241 — 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 (9–10 lines × 2) REDACTED:8877 — REDACTED:8877-8886 | REDACTED:8890-8898 — 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 `REDACTED:8877` 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 (9–10 lines × 2) REDACTED:4397 — REDACTED:4397-4406 | REDACTED:4510-4518 — 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 `REDACTED:4397` 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) · ×3
  • Duplicated block (8 lines × 3) omlx/admin/routes.py:9023 — omlx/admin/routes.py:9023-9030 | omlx/admin/routes.py:9228-9235 | omlx/admin/routes.py:9641-9648 — 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 `omlx/admin/routes.py:9023` 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 × 3) omlx/patches/mlx_vlm_mtp/qwen35_moe_vlm_model.py:132 — omlx/patches/mlx_vlm_mtp/qwen35_moe_vlm_model.py:132-141 | omlx/patches/mlx_vlm_mtp/qwen35_moe_vlm_runtime.py:541-548 | omlx/patches/mlx_vlm_mtp/qwen35_vlm_model.py:89-102 — 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.
  • Duplicated block (8 lines × 3) omlx/patches/deepseek_v4/deepseek_v4_model.py:1735 — omlx/patches/deepseek_v4/deepseek_v4_model.py:1735-1742 | omlx/patches/deepseek_v4/deepseek_v4_model.py:1849-1856 | omlx/patches/deepseek_v4/deepseek_v4_model.py:2021-2028 — 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 (7 lines × 3) · ×3
  • Duplicated block (7 lines × 3) omlx/patches/bailing_hybrid/bailing_hybrid_model.py:298 — omlx/patches/bailing_hybrid/bailing_hybrid_model.py:298-304 | omlx/patches/glm_moe_dsa/glm_moe_dsa_model.py:242-250 | omlx/patches/glm_moe_dsa/glm_moe_dsa_model.py:386-394 — 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 `omlx/patches/glm_moe_dsa/glm_moe_dsa_model.py:242` 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 × 3) omlx/patches/k2_horizon/k2_horizon_model.py:325 — omlx/patches/k2_horizon/k2_horizon_model.py:325-331 | omlx/patches/laguna/laguna_model.py:430-436 | omlx/patches/mimo_v2/mimo_v2_model.py:172-178 — 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 (7 lines × 3) omlx/patches/qwen35_ane_prefill.py:463 — omlx/patches/qwen35_ane_prefill.py:463-469 | omlx/patches/qwen35_ane_prefill.py:542-548 | omlx/patches/qwen35_ane_prefill.py:1541-1547 — 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 `omlx/patches/qwen35_ane_prefill.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.
R10 · Code Duplication · Duplicated block (14 lines × 2 locations) · ×3
  • Duplicated block (14 lines × 2 locations) apps/omlx-web/omlx_web/static/js/cluster_v2.js:3762 — apps/omlx-web/omlx_web/static/js/cluster_v2.js:3762 · apps/omlx-web/omlx_web/static/js/cluster_v2.js:3786 — 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 (14 lines × 2 locations) REDACTED:1813 — REDACTED:1813 · REDACTED:3543 — all 2 copies are in the same file, 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 (14 lines × 2 locations) REDACTED:6971 — REDACTED:6971 · REDACTED:7208 — all 2 copies are in the same file, 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 (12 lines × 2 locations) · ×3
  • Duplicated block (12 lines × 2 locations) REDACTED:3826 — REDACTED:3826 · REDACTED:3996 — 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 locations) REDACTED:4300 — REDACTED:4300 · REDACTED:4743 — all 2 copies are in the same file, 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 (12 lines × 2 locations) REDACTED:7922 — REDACTED:7922 · REDACTED:9289 — 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.
R10 · Code Duplication · Duplicated block (8 lines × 2 locations) · ×3
  • Duplicated block (8 lines × 2 locations) REDACTED:4593 — REDACTED:4593 · REDACTED:5760 — all 2 copies are in the same file, 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 (8 lines × 2 locations) REDACTED:5439 — REDACTED:5439 · REDACTED:6264 — all 2 copies are in the same file, 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 (8 lines × 2 locations) REDACTED:8703 — REDACTED:8703 · REDACTED:9558 — 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.
R10 · Code Duplication · Duplicated block (7 lines × 2 locations) · ×3
  • Duplicated block (7 lines × 2 locations) REDACTED:2524 — REDACTED:2524 · REDACTED:2650 — all 2 copies are in the same file, 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 (7 lines × 2 locations) REDACTED:3465 — REDACTED:3465 · REDACTED:3474 — all 2 copies are in the same file, 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 (7 lines × 2 locations) REDACTED:6572 — REDACTED:6572 · REDACTED:7062 — 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.
AC6 · Visual & motion safety · Low contrast Tailwind colour pair (3.2 · ×2
  • Low contrast Tailwind colour pair (3.2:1) apps/omlx-web/omlx_web/templates/dashboard.html:29 — 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.
  • Low contrast Tailwind colour pair (3.2:1) apps/omlx-web/omlx_web/templates/dashboard/_bench.html:57 — 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.3 · ×2
  • Low contrast Tailwind colour pair (4.3:1) apps/omlx-web/omlx_web/templates/dashboard/_bench_accuracy.html:343 — 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.
  • Low contrast Tailwind colour pair (4.3:1) apps/omlx-web/omlx_web/templates/dashboard/_bench_accuracy.html:351 — 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.
D1 · Cyclomatic Complexity · Model.sanitize (cyclomatic 40) · ×2
  • Model.sanitize (cyclomatic 40) omlx/patches/deepseek_v4/deepseek_v4_model.py:2414 — Model.sanitize has cyclomatic complexity 40 (threshold 15). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
  • Model.sanitize (cyclomatic 40) omlx/patches/glm_moe_dsa/deepseek_v32.py:844 — Model.sanitize has cyclomatic complexity 40 (threshold 15). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (43 corresponding lines) · ×2
  • Edited copy of a member (43 corresponding lines) apps/omlx-cuda-helper/omlx_cuda_helper/families/inkling2/layers.py:267 — apps/omlx-cuda-helper/omlx_cuda_helper/families/inkling2/layers.py:267-309 | omlx/patches/inkling2/kernels.py:409-464 — These two members are one piece of code written twice and then edited apart: 43 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.
  • Edited copy of a member (43 corresponding lines) REDACTED:228 — REDACTED:228-270 | REDACTED:330-381 — These two members are one piece of code written twice and then edited apart: 43 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 · Edited copy of a member (78 corresponding lines) · ×2
  • Edited copy of a member (78 corresponding lines) omlx/cache/boundary_snapshot_store.py:1792 — omlx/cache/boundary_snapshot_store.py:1792-1891 | omlx/cache/boundary_snapshot_store.py:1954-2031 — These two members are one piece of code written twice and then edited apart: 78 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.
  • Edited copy of a member (78 corresponding lines) omlx/patches/qwen35_verify_qmm.py:149 — omlx/patches/qwen35_verify_qmm.py:149-259 | omlx/patches/qwen35_verify_qmm.py:330-407 — These two members are one piece of code written twice and then edited apart: 78 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 · Edited copy of a member (51 corresponding lines) · ×2
  • Edited copy of a member (51 corresponding lines) apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen3_5/stage.py:30 — apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen3_5/stage.py:30-80 | apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen4_exp/stage.py:40-94 — These two members are one piece of code written twice and then edited apart: 51 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.
  • Edited copy of a member (51 corresponding lines) omlx/patches/deepseek_v4/moe_offload.py:331 — omlx/patches/deepseek_v4/moe_offload.py:331-408 | omlx/patches/glm_moe_dsa/moe_offload.py:372-422 — These two members are one piece of code written twice and then edited apart: 51 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 · Edited copy of a member (63 corresponding lines) · ×2
  • Edited copy of a member (63 corresponding lines) omlx/patches/qwen35_ane_prefill.py:1687 — omlx/patches/qwen35_ane_prefill.py:1687-1762 | omlx/patches/qwen35_ane_prefill.py:2041-2103 — These two members are one piece of code written twice and then edited apart: 63 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.
  • Edited copy of a member (63 corresponding lines) omlx/engine_pool.py:914 — omlx/engine_pool.py:914-982 | omlx/engine_pool.py:1012-1074 — These two members are one piece of code written twice and then edited apart: 63 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 · Edited copy of a member (72 corresponding lines) · ×2
  • Edited copy of a member (72 corresponding lines) omlx/api/markitdown.py:298 — omlx/api/markitdown.py:298-369 | omlx/api/markitdown.py:382-456 — These two members are one piece of code written twice and then edited apart: 72 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.
  • Edited copy of a member (72 corresponding lines) REDACTED:944 — REDACTED:944-1015 | omlx/engine/vlm.py:4755-4827 — These two members are one piece of code written twice and then edited apart: 72 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 · Edited copy of a member (44 corresponding lines) · ×2
  • Edited copy of a member (44 corresponding lines) omlx/scheduler.py:4126 — omlx/scheduler.py:4126-4169 | omlx/scheduler.py:4172-4220 — These two members are one piece of code written twice and then edited apart: 44 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.
  • Edited copy of a member (44 corresponding lines) REDACTED:209 — REDACTED:209-266 | omlx/engine/vlm.py:1889-1932 — These two members are one piece of code written twice and then edited apart: 44 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 · Edited copies of one member (3 members, 19+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 19+ corresponding lines) omlx/patches/bailing_hybrid/bailing_hybrid_model.py:582 — omlx/patches/bailing_hybrid/bailing_hybrid_model.py:582-605 | omlx/patches/glm_moe_dsa/deepseek_v32.py:627-648 | omlx/patches/mimo_v2/mimo_v2_model.py:242-260 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 19 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 19+ corresponding lines) omlx/patches/qwen35_gdn_prework.py:1581 — omlx/patches/qwen35_gdn_prework.py:1581-1599 | omlx/patches/qwen35_gdn_prework.py:1713-1731 | omlx/patches/qwen35_gdn_prework.py:1796-1819 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 19 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (27 corresponding lines) · ×2
  • Edited copy of a member (27 corresponding lines) omlx/patches/deepseek_v4/moe_offload.py:270 — omlx/patches/deepseek_v4/moe_offload.py:270-301 | omlx/patches/glm_moe_dsa/moe_offload.py:320-346 — These two members are one piece of code written twice and then edited apart: 27 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.
  • Edited copy of a member (27 corresponding lines) omlx/adapter/muse_glimmer.py:164 — omlx/adapter/muse_glimmer.py:164-190 | omlx/adapter/output_parser.py:991-1017 — These two members are one piece of code written twice and then edited apart: 27 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 · Edited copy of a member (34 corresponding lines) · ×2
  • Edited copy of a member (34 corresponding lines) omlx/cache/boundary_snapshot_store.py:1617 — omlx/cache/boundary_snapshot_store.py:1617-1652 | omlx/cache/boundary_snapshot_store.py:1662-1695 — These two members are one piece of code written twice and then edited apart: 34 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.
  • Edited copy of a member (34 corresponding lines) omlx/eval/livecodebench.py:104 — omlx/eval/livecodebench.py:104-141 | omlx/eval/mbpp.py:71-104 — These two members are one piece of code written twice and then edited apart: 34 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 · Edited copy of a member (45 corresponding lines) · ×2
  • Edited copy of a member (45 corresponding lines) REDACTED:8617 — REDACTED:8617-8664 | REDACTED:10329-10373 — These two members are one piece of code written twice and then edited apart: 45 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.
  • Edited copy of a member (45 corresponding lines) REDACTED:1790 — REDACTED:1790-1834 | omlx/admin/ms_downloader.py:726-775 — These two members are one piece of code written twice and then edited apart: 45 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 · Edited copy of a member (31 corresponding lines) · ×2
  • Edited copy of a member (31 corresponding lines) omlx/cluster/collective.py:58 — omlx/cluster/collective.py:58-89 | omlx/cluster/launch.py:1391-1421 — These two members are one piece of code written twice and then edited apart: 31 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.
  • Edited copy of a member (31 corresponding lines) omlx/patches/deepseek_v4/chat_template_v4.py:194 — omlx/patches/deepseek_v4/chat_template_v4.py:194-224 | omlx/patches/deepseek_v41/encoding.py:524-554 — These two members are one piece of code written twice and then edited apart: 31 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 · Edited copy of a member (26 corresponding lines) · ×2
  • Edited copy of a member (26 corresponding lines) omlx/patches/qwen35_moe_router.py:531 — omlx/patches/qwen35_moe_router.py:531-557 | omlx/patches/qwen35_moe_router.py:583-608 — These two members are one piece of code written twice and then edited apart: 26 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.
  • Edited copy of a member (26 corresponding lines) apps/omlx-mac/Sources/AppView/AppView.swift:281 — apps/omlx-mac/Sources/AppView/AppView.swift:281-313 | apps/omlx-mac/Sources/AppView/Screens/ModelCardSheet.swift:340-365 — These two members are one piece of code written twice and then edited apart: 26 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 · Edited copy of a member (47 corresponding lines) · ×2
  • Edited copy of a member (47 corresponding lines) omlx/patches/mlx_vlm_mtp/inkling_vlm_runtime.py:881 — omlx/patches/mlx_vlm_mtp/inkling_vlm_runtime.py:881-931 | omlx/patches/mlx_vlm_mtp/qwen35_vlm_runtime.py:441-487 — These two members are one piece of code written twice and then edited apart: 47 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.
  • Edited copy of a member (47 corresponding lines) omlx/scheduler.py:17108 — omlx/scheduler.py:17108-17154 | omlx/scheduler.py:17157-17208 — These two members are one piece of code written twice and then edited apart: 47 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 · Edited copy of a member (20 corresponding lines) · ×2
  • Edited copy of a member (20 corresponding lines) REDACTED:2398 — REDACTED:2398-2425 | REDACTED:303-322 — These two members are one piece of code written twice and then edited apart: 20 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.
  • Edited copy of a member (20 corresponding lines) REDACTED:1966 — REDACTED:1966-1991 | omlx/admin/ms_downloader.py:881-900 — These two members are one piece of code written twice and then edited apart: 20 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 · Edited copies of one member (3 members, 16+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 16+ corresponding lines) omlx/patches/deepseek_v4/__init__.py:80 — omlx/patches/deepseek_v4/__init__.py:80-101 | omlx/patches/hy_v3/__init__.py:53-68 | omlx/patches/step3p7/__init__.py:26-44 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 16+ corresponding lines) omlx/cluster/planner.py:629 — omlx/cluster/planner.py:629-651 | omlx/cluster/planner.py:655-670 | omlx/cluster/planner.py:1110-1137 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 14+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 14+ corresponding lines) omlx/admin/routes.py:9265 — omlx/admin/routes.py:9265-9278 | omlx/admin/routes.py:9488-9506 | omlx/admin/routes.py:9736-9752 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 14+ corresponding lines) omlx/patches/qwen35_verify_sdpa_split.py:341 — omlx/patches/qwen35_verify_sdpa_split.py:341-357 | omlx/patches/qwen35_verify_sdpa_split.py:788-802 | omlx/patches/raon1_mini/raon1_mini_model.py:161-174 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 14 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 12+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 12+ corresponding lines) omlx/engine/decision.py:98 — omlx/engine/decision.py:98-109 | omlx/engine/reranker.py:83-99 | omlx/engine/tts.py:255-271 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 12+ corresponding lines) apps/omlx-cuda-helper/omlx_cuda_helper/checkpoint.py:67 — apps/omlx-cuda-helper/omlx_cuda_helper/checkpoint.py:67-78 | apps/omlx-cuda-helper/omlx_cuda_helper/families/deepseek_v41/__init__.py:48-61 | apps/omlx-cuda-helper/omlx_cuda_helper/families/minimax_m3_vl/__init__.py:177-191 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 9+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 9+ corresponding lines) apps/omlx-cuda-helper/omlx_cuda_helper/families/glm5_next/model.py:316 — apps/omlx-cuda-helper/omlx_cuda_helper/families/glm5_next/model.py:316-324 | omlx/patches/deepseek_v4/deepseek_v4_model.py:338-346 | omlx/patches/hy_v3/hy_v3_model.py:126-136 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 9+ corresponding lines) omlx/patches/deepseek_v41_mlx_lm/__init__.py:21 — omlx/patches/deepseek_v41_mlx_lm/__init__.py:21-31 | omlx/patches/glm5_next_mlx_lm/__init__.py:23-33 | omlx/patches/inkling2/__init__.py:16-24 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 10+ corresponding lines) · ×2
  • Edited copies of one member (3 members, 10+ corresponding lines) REDACTED:510 — REDACTED:510-528 | REDACTED:561-576 | REDACTED:3101-3110 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
  • Edited copies of one member (3 members, 10+ corresponding lines) omlx/patches/deepseek_v4/sparse_attention_nax.py:366 — omlx/patches/deepseek_v4/sparse_attention_nax.py:366-375 | omlx/patches/glm_moe_dsa/indexer_nax.py:186-195 | omlx/patches/glm_moe_dsa/sparse_mla_nax.py:325-334 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (2 corresponding lines) · ×2
  • Edited copy of a member (2 corresponding lines) apps/omlx-cuda-helper/omlx_cuda_helper/families/deepseek_v41/kernels.py:950 — apps/omlx-cuda-helper/omlx_cuda_helper/families/deepseek_v41/kernels.py:950-951 | apps/omlx-cuda-helper/omlx_cuda_helper/families/glm5_next/kernels.py:134-135 — These two members are one piece of code written twice and then edited apart: 2 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.
  • Edited copy of a member (2 corresponding lines) omlx/patches/k2_horizon/k2_horizon_model.py:421 — omlx/patches/k2_horizon/k2_horizon_model.py:421-422 | omlx/patches/mimo_v2/mimo_v2_model.py:340-341 — These two members are one piece of code written twice and then edited apart: 2 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 · Duplicated block (34 lines × 2) · ×2
  • Duplicated block (34 lines × 2) REDACTED:818 — REDACTED:818-851 | omlx/engine/vlm.py:2834-2867 — before extracting anything, compare `REDACTED` and `omlx/engine/vlm.py` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 480 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 `REDACTED:818` 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 after the matched lines, `omlx/engine/vlm.py:2870` calls `_inject_tool_calling` and `REDACTED:853` 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 (34 lines × 2) REDACTED:1178 — REDACTED:1178-1211 | REDACTED:1268-1301 — 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 `REDACTED:1178` 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 (31–32 lines × 2) · ×2
  • Duplicated block (31–32 lines × 2) REDACTED:700 — REDACTED:700-730 | omlx/engine/vlm.py:2744-2775 — before extracting anything, compare `REDACTED` and `omlx/engine/vlm.py` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 480 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 (31–32 lines × 2) omlx/patches/deepseek_v4/deepseek_v4_model.py:2477 — omlx/patches/deepseek_v4/deepseek_v4_model.py:2477-2507 | omlx/patches/mlx_lm_mtp/deepseek_v4_model.py:804-835 — 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.
D4 · Code Duplication · Duplicated block (31 lines × 2) · ×2
  • Duplicated block (31 lines × 2) omlx/patches/qwen35_ane_prefill.py:1195 — omlx/patches/qwen35_ane_prefill.py:1195-1225 | omlx/patches/qwen35_ane_prefill.py:1422-1452 — 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 (31 lines × 2) apps/omlx-mac/Sources/AppView/Screens/DownloadsScreen.swift:255 — apps/omlx-mac/Sources/AppView/Screens/DownloadsScreen.swift:255-285 | apps/omlx-mac/Sources/AppView/Screens/DownloadsScreen.swift:411-441 — 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 `apps/omlx-mac/Sources/AppView/Screens/DownloadsScreen.swift:255` 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 (29 lines × 2) · ×2
  • Duplicated block (29 lines × 2) REDACTED:5410 — REDACTED:5410-5438 | REDACTED:8212-8240 — 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 `REDACTED:5410` 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 (29 lines × 2) REDACTED:7058 — REDACTED:7058-7086 | REDACTED:7103-7131 — 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) omlx/cluster/planner.py:1770 — omlx/cluster/planner.py:1770-1789 | omlx/cluster/planner.py:2402-2421 — 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 (20 lines × 2) REDACTED:1089 — REDACTED:1089-1108 | omlx/engine/vlm.py:4831-4850 — before extracting anything, compare `REDACTED` and `omlx/engine/vlm.py` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 480 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 `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 (16–19 lines × 2) · ×2
  • Duplicated block (16–19 lines × 2) omlx/scheduler.py:6989 — omlx/scheduler.py:6989-7004 | omlx/scheduler.py:7255-7273 — 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 (16–19 lines × 2) REDACTED:5259 — REDACTED:5259-5277 | REDACTED:8858-8873 — 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 `REDACTED:5259` 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 (13–14 lines × 2) · ×2
  • Duplicated block (13–14 lines × 2) omlx/cache/boundary_snapshot_store.py:1640 — omlx/cache/boundary_snapshot_store.py:1640-1652 | omlx/cache/boundary_snapshot_store.py:1682-1695 — 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 `omlx/cache/boundary_snapshot_store.py:1682` 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, `omlx/cache/boundary_snapshot_store.py:1639` calls `_restore_tensor_from_bytes` and `omlx/cache/boundary_snapshot_store.py:1682` 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–14 lines × 2) apps/omlx-mac/Sources/Menubar/MenubarStatsPoller.swift:417 — apps/omlx-mac/Sources/Menubar/MenubarStatsPoller.swift:417-430 | apps/omlx-mac/Sources/Menubar/MenubarStatsPoller.swift:434-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. Read the line range as the matched WINDOW rather than a finished unit: at `apps/omlx-mac/Sources/Menubar/MenubarStatsPoller.swift:417` 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–13 lines × 2) · ×2
  • Duplicated block (11–13 lines × 2) omlx/cluster/launch.py:1435 — omlx/cluster/launch.py:1435-1447 | omlx/cluster/launch.py:1568-1578 — 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 `omlx/cluster/launch.py:1435` 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 (11–13 lines × 2) omlx/patches/glm_moe_dsa/deepseek_v32.py:1075 — omlx/patches/glm_moe_dsa/deepseek_v32.py:1075-1087 | omlx/patches/hy_v3/hy_v3_model.py:338-348 — 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 × 3) · ×2
  • Duplicated block (12 lines × 3) omlx/admin/routes.py:5367 — omlx/admin/routes.py:5367-5378 | omlx/admin/routes.py:5408-5419 | omlx/admin/routes.py:5449-5460 — 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 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 × 3) apps/omlx-mac/Sources/AppView/ViewModels/IntegrationsScreenVM.swift:266 — apps/omlx-mac/Sources/AppView/ViewModels/IntegrationsScreenVM.swift:266-277 | apps/omlx-mac/Sources/AppView/ViewModels/ModelSettingsScreenVM.swift:647-658 | apps/omlx-mac/Sources/AppView/ViewModels/SecurityScreenVM.swift:14-25 — 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 `apps/omlx-mac/Sources/AppView/ViewModels/IntegrationsScreenVM.swift:266` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (11–12 lines × 2) · ×2
  • Duplicated block (11–12 lines × 2) omlx/cluster/collective.py:147 — omlx/cluster/collective.py:147-158 | omlx/cluster/collective.py:237-247 — 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–12 lines × 2) omlx/utils/image.py:99 — omlx/utils/image.py:99-110 | omlx/utils/image.py:143-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 `omlx/utils/image.py:99` 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 after the matched lines, `omlx/utils/image.py:153` calls `except`, `InvalidRequestError` and `omlx/utils/image.py:110` 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 (9 lines × 4) · ×2
  • Duplicated block (9 lines × 4) omlx/cluster/enrollment.py:175 — omlx/cluster/enrollment.py:175-183 | omlx/cluster/incidents.py:179-187 | omlx/cluster/registry.py:103-111 | omlx/cluster/registry.py:321-329 — there are 4 copies across 3 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 (9 lines × 4) apps/omlx-mac/Sources/AppView/ViewModels/IntegrationsScreenVM.swift:265 — apps/omlx-mac/Sources/AppView/ViewModels/IntegrationsScreenVM.swift:265-273 | apps/omlx-mac/Sources/AppView/ViewModels/ModelSettingsScreenVM.swift:646-654 | apps/omlx-mac/Sources/AppView/ViewModels/SecurityScreenVM.swift:13-21 | apps/omlx-mac/Sources/AppView/ViewModels/ServerScreenVM.swift:722-730 — 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 4 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `apps/omlx-mac/Sources/AppView/ViewModels/IntegrationsScreenVM.swift:265` 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 (9 lines × 3) · ×2
  • Duplicated block (9 lines × 3) omlx/patches/bailing_hybrid/bailing_hybrid_model.py:308 — omlx/patches/bailing_hybrid/bailing_hybrid_model.py:308-316 | omlx/patches/glm_moe_dsa/deepseek_v32.py:562-570 | omlx/patches/glm_moe_dsa/glm_moe_dsa_model.py:398-406 — 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) omlx/patches/mlx_lm_mtp/qwen35_model.py:910 — omlx/patches/mlx_lm_mtp/qwen35_model.py:910-918 | omlx/patches/mlx_vlm_mtp/qwen35_moe_vlm_model.py:75-83 | omlx/patches/mlx_vlm_mtp/qwen35_moe_vlm_runtime.py:457-465 — 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.
D4 · Code Duplication · Duplicated block (7–9 lines × 2) · ×2
  • Duplicated block (7–9 lines × 2) omlx/cache/prefix_cache.py:4267 — omlx/cache/prefix_cache.py:4267-4275 | omlx/cache/prefix_cache.py:4352-4358 — 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 `omlx/cache/prefix_cache.py:4267` 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 (7–9 lines × 2) omlx/cluster/planner.py:1738 — omlx/cluster/planner.py:1738-1744 | omlx/cluster/planner.py:2349-2357 — 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–9 lines × 2) · ×2
  • Duplicated block (8–9 lines × 2) omlx/cluster/launch.py:2050 — omlx/cluster/launch.py:2050-2058 | omlx/cluster/launch.py:2202-2209 — 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 `omlx/cluster/launch.py:2050` 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 (8–9 lines × 2) omlx/scheduler.py:14007 — omlx/scheduler.py:14007-14014 | omlx/scheduler.py:14028-14036 — 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 `omlx/scheduler.py:14007` 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 × 4) · ×2
  • Duplicated block (8 lines × 4) omlx/cluster/collective.py:229 — omlx/cluster/collective.py:229-236 | omlx/cluster/collective.py:322-329 | omlx/cluster/launch.py:1507-1514 | omlx/cluster/launch.py:1652-1659 — 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. 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 × 4) REDACTED:5470 — REDACTED:5470-5477 | REDACTED:7166-7173 | REDACTED:7717-7724 | REDACTED:8264-8271 — 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.
R10 · Code Duplication · Duplicated block (36 lines × 2 locations) · ×2
  • Duplicated block (36 lines × 2 locations) REDACTED:5453 — REDACTED:5453 · REDACTED:5607 — all 2 copies are in the same file, 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) REDACTED:5551 — REDACTED:5551 · REDACTED:5654 — 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.
R10 · Code Duplication · Duplicated block (10 lines × 2 locations) · ×2
  • Duplicated block (10 lines × 2 locations) REDACTED:2507 — REDACTED:2507 · REDACTED:2678 — 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 locations) REDACTED:5688 — REDACTED:5688 · REDACTED:5971 — all 2 copies are in the same file, 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 (9 lines × 2 locations) · ×2
  • Duplicated block (9 lines × 2 locations) REDACTED:5945 — REDACTED:5945 · REDACTED:6568 — all 2 copies are in the same file, 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 (9 lines × 2 locations) REDACTED:7253 — REDACTED:7253 · REDACTED:7375 — all 2 copies are in the same file, 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 (6 lines × 2 locations) · ×2
  • Duplicated block (6 lines × 2 locations) REDACTED:5170 — REDACTED:5170 · REDACTED:5182 — all 2 copies are in the same file, 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 (6 lines × 2 locations) REDACTED:5918 — REDACTED:5918 · REDACTED:5931 — all 2 copies are in the same file, 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.
AC1 · Text alternatives · <canvas> without a text alternative · ×1
  • <canvas> without a text alternative apps/omlx-web/omlx_web/static/js/theme_preview.js:377 — 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.
AC3 · Page structure · Page without a main landmark · ×1
  • Page without a main landmark REDACTED:2 — No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
AC3 · Page structure · Heading level jumps from h1 to h3 · ×1
  • Heading level jumps from h1 to h3 apps/omlx-web/omlx_web/templates/chat.html:2719 — Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
AC3 · Page structure · Data table has no header cells · ×1
  • Data table has no header cells apps/omlx-web/omlx_web/templates/dashboard/_bench.html:322 — 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).
AC4 · Keyboard semantics · Modal dialog does not manage focus · ×1
  • Modal dialog does not manage focus apps/omlx-web/omlx_web/templates/chat.html:2366 — 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.
AC6 · Visual & motion safety · Focus outline removed in CSS without a · ×1
  • Focus outline removed in CSS without a :focus replacement apps/omlx-web/omlx_web/templates/chat.html:603 — `.inline-edit-textarea` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
AC6 · Visual & motion safety · Low contrast Tailwind colour pair (3.8 · ×1
  • Low contrast Tailwind colour pair (3.8:1) apps/omlx-web/omlx_web/templates/dashboard/_modal_settings_apply.html:25 — 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.
D1 · Cyclomatic Complexity · chat.html.chatApp (cyclomatic 412) · ×1
  • chat.html.chatApp (cyclomatic 412) apps/omlx-web/omlx_web/templates/chat.html:2841 — chat.html.chatApp has cyclomatic complexity 412 (threshold 15). Of this number, 381 points are the body's own statements and 31 belong to 13 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 · routes.update_global_settings (cyclomatic 298) · ×1
  • routes.update_global_settings (cyclomatic 298) omlx/admin/routes.py:5014 — routes.update_global_settings has cyclomatic complexity 298 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BlockAwarePrefixCache.reconstruct_cache (cyclomatic 252) · ×1
  • BlockAwarePrefixCache.reconstruct_cache (cyclomatic 252) omlx/cache/prefix_cache.py:3286 — BlockAwarePrefixCache.reconstruct_cache has cyclomatic complexity 252 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · routes.update_model_settings (cyclomatic 226) · ×1
  • routes.update_model_settings (cyclomatic 226) omlx/admin/routes.py:2959 — routes.update_model_settings has cyclomatic complexity 226 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · dashboard.dashboard (cyclomatic 163) · ×1
  • dashboard.dashboard (cyclomatic 163) REDACTED:129 — dashboard.dashboard has cyclomatic complexity 163 (threshold 15). Of this number, 101 points are the body's own statements and 62 belong to 12 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 · oq.quantize_oq_streaming (cyclomatic 159) · ×1
  • oq.quantize_oq_streaming (cyclomatic 159) REDACTED:6997 — oq.quantize_oq_streaming has cyclomatic complexity 159 (threshold 15). To reduce it, separate the cases: extract each independent branch into its 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_loading.maybe_apply_pre_load_patches (cyclomatic 145) · ×1
  • model_loading.maybe_apply_pre_load_patches (cyclomatic 145) omlx/utils/model_loading.py:519 — model_loading.maybe_apply_pre_load_patches has cyclomatic complexity 145 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ModelSettingsScreenVM.save (cyclomatic 143) · ×1
  • ModelSettingsScreenVM.save (cyclomatic 143) apps/omlx-mac/Sources/AppView/ViewModels/ModelSettingsScreenVM.swift:865 — ModelSettingsScreenVM.save has cyclomatic complexity 143 (threshold 15). 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 · BlockAwarePrefixCache.store_cache (cyclomatic 138) · ×1
  • BlockAwarePrefixCache.store_cache (cyclomatic 138) omlx/cache/prefix_cache.py:950 — BlockAwarePrefixCache.store_cache has cyclomatic complexity 138 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · VLMBatchedEngine._prepare_vision_inputs (cyclomatic 123) · ×1
  • VLMBatchedEngine._prepare_vision_inputs (cyclomatic 123) omlx/engine/vlm.py:4072 — VLMBatchedEngine._prepare_vision_inputs has cyclomatic complexity 123 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · server.stream_chat_completion (cyclomatic 114) · ×1
  • server.stream_chat_completion (cyclomatic 114) REDACTED:6631 — server.stream_chat_completion has cyclomatic complexity 114 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · server.stream_responses_api (cyclomatic 114) · ×1
  • server.stream_responses_api (cyclomatic 114) REDACTED:9130 — server.stream_responses_api has cyclomatic complexity 114 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · oq._build_quant_plan (cyclomatic 113) · ×1
  • oq._build_quant_plan (cyclomatic 113) REDACTED:1359 — oq._build_quant_plan has cyclomatic complexity 113 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Scheduler._schedule_waiting (cyclomatic 101) · ×1
  • Scheduler._schedule_waiting (cyclomatic 101) omlx/scheduler.py:13314 — Scheduler._schedule_waiting has cyclomatic complexity 101 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · server.stream_anthropic_messages (cyclomatic 98) · ×1
  • server.stream_anthropic_messages (cyclomatic 98) REDACTED:7354 — server.stream_anthropic_messages has cyclomatic complexity 98 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · routes._build_runtime_cache_observability (cyclomatic 97) · ×1
  • routes._build_runtime_cache_observability (cyclomatic 97) omlx/admin/routes.py:6719 — routes._build_runtime_cache_observability has cyclomatic complexity 97 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · BlockAwarePrefixCache._extract_block_tensor_slice (cyclomatic 96) · ×1
  • BlockAwarePrefixCache._extract_block_tensor_slice (cyclomatic 96) omlx/cache/prefix_cache.py:2471 — BlockAwarePrefixCache._extract_block_tensor_slice has cyclomatic complexity 96 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Scheduler._process_batch_responses (cyclomatic 92) · ×1
  • Scheduler._process_batch_responses (cyclomatic 92) omlx/scheduler.py:14180 — Scheduler._process_batch_responses has cyclomatic complexity 92 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · dashboard.buildModelSettingsPayload (cyclomatic 91) · ×1
  • dashboard.buildModelSettingsPayload (cyclomatic 91) REDACTED:3538 — dashboard.buildModelSettingsPayload has cyclomatic complexity 91 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · dashboard.dashboard.buildModelSettingsPayload (cyclomatic 90) · ×1
  • dashboard.dashboard.buildModelSettingsPayload (cyclomatic 90) REDACTED:3538 — dashboard.dashboard.buildModelSettingsPayload has cyclomatic complexity 90 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Scheduler._do_external_prefill (cyclomatic 89) · ×1
  • Scheduler._do_external_prefill (cyclomatic 89) omlx/scheduler.py:4402 — Scheduler._do_external_prefill has cyclomatic complexity 89 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · EnginePool._load_engine (cyclomatic 87) · ×1
  • EnginePool._load_engine (cyclomatic 87) omlx/engine_pool.py:4113 — EnginePool._load_engine has cyclomatic complexity 87 (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 · dashboard.buildModelSettingsState (cyclomatic 87) · ×1
  • dashboard.buildModelSettingsState (cyclomatic 87) REDACTED:2205 — dashboard.buildModelSettingsState has cyclomatic complexity 87 (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 · PagedSSDCacheManager.save_block (cyclomatic 86) · ×1
  • PagedSSDCacheManager.save_block (cyclomatic 86) omlx/cache/paged_ssd_cache.py:3468 — PagedSSDCacheManager.save_block has cyclomatic complexity 86 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · oq.universal_quant_predicate (cyclomatic 82) · ×1
  • oq.universal_quant_predicate (cyclomatic 82) REDACTED:683 — oq.universal_quant_predicate has cyclomatic complexity 82 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · qwen35_ane_prefill.enable_qwen35_ane_prefill (cyclomatic 81) · ×1
  • qwen35_ane_prefill.enable_qwen35_ane_prefill (cyclomatic 81) omlx/patches/qwen35_ane_prefill.py:3078 — qwen35_ane_prefill.enable_qwen35_ane_prefill has cyclomatic complexity 81 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · routes._build_active_models_data (cyclomatic 79) · ×1
  • routes._build_active_models_data (cyclomatic 79) omlx/admin/routes.py:7154 — routes._build_active_models_data 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 · VLMBatchedEngine._format_messages_for_vlm_template (cyclomatic 75) · ×1
  • VLMBatchedEngine._format_messages_for_vlm_template (cyclomatic 75) omlx/engine/vlm.py:3180 — VLMBatchedEngine._format_messages_for_vlm_template has cyclomatic complexity 75 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · VLMBatchedEngine.start (cyclomatic 72) · ×1
  • VLMBatchedEngine.start (cyclomatic 72) omlx/engine/vlm.py:1982 — VLMBatchedEngine.start has cyclomatic complexity 72 (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 · routes.cluster_autoconfigure (cyclomatic 71) · ×1
  • routes.cluster_autoconfigure (cyclomatic 71) omlx/cluster/routes.py:1205 — routes.cluster_autoconfigure has cyclomatic complexity 71 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ServerScreenVM.applyServerSettings (cyclomatic 71) · ×1
  • ServerScreenVM.applyServerSettings (cyclomatic 71) apps/omlx-mac/Sources/AppView/ViewModels/ServerScreenVM.swift:241 — ServerScreenVM.applyServerSettings has cyclomatic complexity 71 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · GlobalSettings.validate (cyclomatic 70) · ×1
  • GlobalSettings.validate (cyclomatic 70) omlx/settings.py:1710 — GlobalSettings.validate has cyclomatic complexity 70 (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 · benchmark.run_benchmark (cyclomatic 68) · ×1
  • benchmark.run_benchmark (cyclomatic 68) omlx/admin/benchmark.py:2027 — benchmark.run_benchmark has cyclomatic complexity 68 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · anthropic_utils.convert_anthropic_to_internal (cyclomatic 68) · ×1
  • anthropic_utils.convert_anthropic_to_internal (cyclomatic 68) omlx/api/anthropic_utils.py:189 — anthropic_utils.convert_anthropic_to_internal has cyclomatic complexity 68 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Scheduler._cleanup_finished (cyclomatic 68) · ×1
  • Scheduler._cleanup_finished (cyclomatic 68) omlx/scheduler.py:14604 — Scheduler._cleanup_finished has cyclomatic complexity 68 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · ProcessMemoryEnforcer._check_and_enforce (cyclomatic 61) · ×1
  • ProcessMemoryEnforcer._check_and_enforce (cyclomatic 61) omlx/process_memory_enforcer.py:1734 — ProcessMemoryEnforcer._check_and_enforce 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 · dashboard.dashboard.buildModelSettingsState (cyclomatic 61) · ×1
  • dashboard.dashboard.buildModelSettingsState (cyclomatic 61) REDACTED:2205 — dashboard.dashboard.buildModelSettingsState has cyclomatic complexity 61 (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 · ane_tuning._calibrate_fused_components_sync (cyclomatic 60) · ×1
  • ane_tuning._calibrate_fused_components_sync (cyclomatic 60) omlx/admin/ane_tuning.py:1080 — ane_tuning._calibrate_fused_components_sync 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 · GlobalSettings._apply_cli_overrides (cyclomatic 58) · ×1
  • GlobalSettings._apply_cli_overrides (cyclomatic 58) omlx/settings.py:1415 — GlobalSettings._apply_cli_overrides has cyclomatic complexity 58 (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 · IntegrationsScreenVM.save (cyclomatic 57) · ×1
  • IntegrationsScreenVM.save (cyclomatic 57) apps/omlx-mac/Sources/AppView/ViewModels/IntegrationsScreenVM.swift:354 — IntegrationsScreenVM.save has cyclomatic complexity 57 (threshold 15). To reduce it, separate the cases: extract each independent branch into its 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_calling._parse_tool_calls_impl (cyclomatic 56) · ×1
  • tool_calling._parse_tool_calls_impl (cyclomatic 56) omlx/api/tool_calling.py:2056 — tool_calling._parse_tool_calls_impl has cyclomatic complexity 56 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · server.create_response (cyclomatic 56) · ×1
  • server.create_response (cyclomatic 56) REDACTED:8588 — server.create_response has cyclomatic complexity 56 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · cli.launch_command (cyclomatic 54) · ×1
  • cli.launch_command (cyclomatic 54) REDACTED:473 — cli.launch_command 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 · DistributedBatchedEngine.stream_chat (cyclomatic 54) · ×1
  • DistributedBatchedEngine.stream_chat (cyclomatic 54) omlx/engine/distributed.py:1338 — DistributedBatchedEngine.stream_chat 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 · model_discovery.detect_model_type (cyclomatic 54) · ×1
  • model_discovery.detect_model_type (cyclomatic 54) omlx/model_discovery.py:711 — model_discovery.detect_model_type 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 · moe_offload_compat._inspect (cyclomatic 54) · ×1
  • moe_offload_compat._inspect (cyclomatic 54) omlx/patches/moe_offload_compat.py:46 — moe_offload_compat._inspect 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 · ane_tuning._calibrate_components_sync (cyclomatic 53) · ×1
  • ane_tuning._calibrate_components_sync (cyclomatic 53) omlx/admin/ane_tuning.py:1728 — ane_tuning._calibrate_components_sync 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 · HFDownloader._run_download (cyclomatic 53) · ×1
  • HFDownloader._run_download (cyclomatic 53) REDACTED:2003 — HFDownloader._run_download has cyclomatic complexity 53 (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 · responses_utils.convert_responses_input_to_messages (cyclomatic 53) · ×1
  • responses_utils.convert_responses_input_to_messages (cyclomatic 53) omlx/api/responses_utils.py:176 — responses_utils.convert_responses_input_to_messages 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 · probe.collect_cluster_status (cyclomatic 53) · ×1
  • probe.collect_cluster_status (cyclomatic 53) omlx/cluster/probe.py:409 — probe.collect_cluster_status has cyclomatic complexity 53 (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 · oq._forward_layer_result (cyclomatic 53) · ×1
  • oq._forward_layer_result (cyclomatic 53) REDACTED:8745 — oq._forward_layer_result 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 · qwen35_ane_prefill._enable_dual_procedure_banks (cyclomatic 53) · ×1
  • qwen35_ane_prefill._enable_dual_procedure_banks (cyclomatic 53) omlx/patches/qwen35_ane_prefill.py:2466 — qwen35_ane_prefill._enable_dual_procedure_banks 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 · dashboard.dashboard.formValuesForProfile (cyclomatic 52) · ×1
  • dashboard.dashboard.formValuesForProfile (cyclomatic 52) REDACTED:1755 — dashboard.dashboard.formValuesForProfile has cyclomatic complexity 52 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · dashboard.formValuesForProfile (cyclomatic 52) · ×1
  • dashboard.formValuesForProfile (cyclomatic 52) REDACTED:1755 — dashboard.formValuesForProfile has cyclomatic complexity 52 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · DFlashDrafter._draft_batched (cyclomatic 51) · ×1
  • DFlashDrafter._draft_batched (cyclomatic 51) omlx/speculative/dflash/drafter.py:596 — DFlashDrafter._draft_batched 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 · EnginePool.get_engine (cyclomatic 50) · ×1
  • EnginePool.get_engine (cyclomatic 50) omlx/engine_pool.py:2719 — EnginePool.get_engine 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 · server.get_sampling_params (cyclomatic 50) · ×1
  • server.get_sampling_params (cyclomatic 50) REDACTED:1896 — server.get_sampling_params has cyclomatic complexity 50 (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 · GlobalSettings._apply_env_overrides (cyclomatic 50) · ×1
  • GlobalSettings._apply_env_overrides (cyclomatic 50) omlx/settings.py:1249 — GlobalSettings._apply_env_overrides has cyclomatic complexity 50 (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 · oq.estimate_bpw_and_size (cyclomatic 49) · ×1
  • oq.estimate_bpw_and_size (cyclomatic 49) REDACTED:4031 — oq.estimate_bpw_and_size has cyclomatic complexity 49 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · batch_generator._run_verify_cycle_chain (cyclomatic 49) · ×1
  • batch_generator._run_verify_cycle_chain (cyclomatic 49) REDACTED:4433 — batch_generator._run_verify_cycle_chain has cyclomatic complexity 49 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Scheduler.step (cyclomatic 49) · ×1
  • Scheduler.step (cyclomatic 49) omlx/scheduler.py:15836 — Scheduler.step has cyclomatic complexity 49 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · oq._build_model_sanitizer (cyclomatic 48) · ×1
  • oq._build_model_sanitizer (cyclomatic 48) REDACTED:4792 — oq._build_model_sanitizer 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 · tool_calling._gemma4_transcode_to_json (cyclomatic 46) · ×1
  • tool_calling._gemma4_transcode_to_json (cyclomatic 46) omlx/api/tool_calling.py:1567 — tool_calling._gemma4_transcode_to_json 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 · oq._collect_imatrix_streaming (cyclomatic 46) · ×1
  • oq._collect_imatrix_streaming (cyclomatic 46) REDACTED:10673 — oq._collect_imatrix_streaming 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 · context_benchmark.run_context_benchmark (cyclomatic 45) · ×1
  • context_benchmark.run_context_benchmark (cyclomatic 45) omlx/admin/context_benchmark.py:401 — context_benchmark.run_context_benchmark 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 · cli.serve_command (cyclomatic 45) · ×1
  • cli.serve_command (cyclomatic 45) REDACTED:173 — cli.serve_command has cyclomatic complexity 45 (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 · cluster_v2.clusterV2Wizard.checkRows (cyclomatic 45) · ×1
  • cluster_v2.clusterV2Wizard.checkRows (cyclomatic 45) apps/omlx-web/omlx_web/static/js/cluster_v2.js:2095 — cluster_v2.clusterV2Wizard.checkRows has cyclomatic complexity 45 (threshold 15). Of this number, 33 points are the body's own statements and 12 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 · clusterV2Wizard.checkRows (cyclomatic 45) · ×1
  • clusterV2Wizard.checkRows (cyclomatic 45) apps/omlx-web/omlx_web/static/js/cluster_v2.js:2095 — clusterV2Wizard.checkRows has cyclomatic complexity 45 (threshold 15). Of this number, 33 points are the body's own statements and 12 belong to 14 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 · runtime._validated_marker (cyclomatic 44) · ×1
  • runtime._validated_marker (cyclomatic 44) omlx/cluster/runtime.py:418 — runtime._validated_marker 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 · server.lifespan (cyclomatic 44) · ×1
  • server.lifespan (cyclomatic 44) REDACTED:509 — server.lifespan has cyclomatic complexity 44 (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 · accuracy_benchmark.run_accuracy_benchmark (cyclomatic 43) · ×1
  • accuracy_benchmark.run_accuracy_benchmark (cyclomatic 43) omlx/admin/accuracy_benchmark.py:374 — accuracy_benchmark.run_accuracy_benchmark 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 · ane_tuning.run_tuning (cyclomatic 43) · ×1
  • ane_tuning.run_tuning (cyclomatic 43) omlx/admin/ane_tuning.py:2102 — ane_tuning.run_tuning 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 · chat_template_v4.render_message (cyclomatic 43) · ×1
  • chat_template_v4.render_message (cyclomatic 43) omlx/patches/deepseek_v4/chat_template_v4.py:291 — chat_template_v4.render_message has cyclomatic complexity 43 (threshold 15). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D1 · Cyclomatic Complexity · Scheduler._set_model_info_for_monitor (cyclomatic 43) · ×1
  • Scheduler._set_model_info_for_monitor (cyclomatic 43) omlx/scheduler.py:16511 — Scheduler._set_model_info_for_monitor has cyclomatic complexity 43 (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 · server.create_chat_completion (cyclomatic 43) · ×1
  • server.create_chat_completion (cyclomatic 43) REDACTED:5037 — server.create_chat_completion has cyclomatic complexity 43 (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 · StageServer._run_chunks (cyclomatic 42) · ×1
  • StageServer._run_chunks (cyclomatic 42) apps/omlx-cuda-helper/omlx_cuda_helper/worker.py:400 — StageServer._run_chunks 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 · Scheduler._extract_cache_states (cyclomatic 42) · ×1
  • Scheduler._extract_cache_states (cyclomatic 42) omlx/scheduler.py:10483 — Scheduler._extract_cache_states 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 · ModelSettingsScreenVM.enabledFeatures (cyclomatic 42) · ×1
  • ModelSettingsScreenVM.enabledFeatures (cyclomatic 42) apps/omlx-mac/Sources/AppView/ViewModels/ModelSettingsScreenVM.swift:1597 — ModelSettingsScreenVM.enabledFeatures 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 · benchmark._run_single_test (cyclomatic 41) · ×1
  • benchmark._run_single_test (cyclomatic 41) omlx/admin/benchmark.py:922 — benchmark._run_single_test 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 · routes.list_models (cyclomatic 41) · ×1
  • routes.list_models (cyclomatic 41) omlx/admin/routes.py:2458 — routes.list_models 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 · BatchedEngine.start (cyclomatic 41) · ×1
  • BatchedEngine.start (cyclomatic 41) REDACTED:300 — BatchedEngine.start has cyclomatic complexity 41 (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 · VLMBatchedEngine._iter_diffusion_outputs_sync (cyclomatic 41) · ×1
  • VLMBatchedEngine._iter_diffusion_outputs_sync (cyclomatic 41) omlx/engine/vlm.py:5895 — VLMBatchedEngine._iter_diffusion_outputs_sync 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 · oq._build_streaming_proxy_for_sensitivity (cyclomatic 41) · ×1
  • oq._build_streaming_proxy_for_sensitivity (cyclomatic 41) REDACTED:11754 — oq._build_streaming_proxy_for_sensitivity 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 · SparseCompressedAttention.__call__ (cyclomatic 41) · ×1
  • SparseCompressedAttention.__call__ (cyclomatic 41) omlx/patches/deepseek_v4/deepseek_v4_model.py:2004 — SparseCompressedAttention.__call__ has cyclomatic complexity 41 (threshold 15). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D1 · Cyclomatic Complexity · decode_kernels.moe_gate_up_swiglu (cyclomatic 40) · ×1
  • decode_kernels.moe_gate_up_swiglu (cyclomatic 40) omlx/patches/mlx_vlm_glm5_next_compat/decode_kernels.py:798 — decode_kernels.moe_gate_up_swiglu has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · anthropic_utils.convert_anthropic_to_internal_harmony (cyclomatic 39) · ×1
  • anthropic_utils.convert_anthropic_to_internal_harmony (cyclomatic 39) omlx/api/anthropic_utils.py:476 — anthropic_utils.convert_anthropic_to_internal_harmony 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 · tool_calling.parse_qwen_tool_calls (cyclomatic 39) · ×1
  • tool_calling.parse_qwen_tool_calls (cyclomatic 39) omlx/api/tool_calling.py:2353 — tool_calling.parse_qwen_tool_calls 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 · oq._measure_sensitivity_from_quantized_model (cyclomatic 39) · ×1
  • oq._measure_sensitivity_from_quantized_model (cyclomatic 39) REDACTED:11983 — oq._measure_sensitivity_from_quantized_model 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 · server.get_engine (cyclomatic 39) · ×1
  • server.get_engine (cyclomatic 39) REDACTED:1470 — server.get_engine 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 · ModelSettingsScreenVM.currentSettingsDict (cyclomatic 39) · ×1
  • ModelSettingsScreenVM.currentSettingsDict (cyclomatic 39) apps/omlx-mac/Sources/AppView/ViewModels/ModelSettingsScreenVM.swift:1755 — ModelSettingsScreenVM.currentSettingsDict has cyclomatic complexity 39 (threshold 15). Of this number, 34 points are the body's own statements and 5 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 · dashboard.accDownloadResult (cyclomatic 39) · ×1
  • dashboard.accDownloadResult (cyclomatic 39) REDACTED:6588 — dashboard.accDownloadResult has cyclomatic complexity 39 (threshold 15). Of this number, 36 points are the body's own statements and 3 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 · autoconfigure.choose_parallelism (cyclomatic 38) · ×1
  • autoconfigure.choose_parallelism (cyclomatic 38) omlx/cluster/autoconfigure.py:142 — autoconfigure.choose_parallelism 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 · PairingManager.handle_join_request (cyclomatic 38) · ×1
  • PairingManager.handle_join_request (cyclomatic 38) REDACTED:1245 — PairingManager.handle_join_request has cyclomatic complexity 38 (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 · decode_kernels.kda_decode_step (cyclomatic 38) · ×1
  • decode_kernels.kda_decode_step (cyclomatic 38) omlx/patches/mlx_vlm_glm5_next_compat/decode_kernels.py:2373 — decode_kernels.kda_decode_step 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 · Scheduler.__init__ (cyclomatic 38) · ×1
  • Scheduler.__init__ (cyclomatic 38) omlx/scheduler.py:2222 — Scheduler.__init__ 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 · server.init_server (cyclomatic 38) · ×1
  • server.init_server (cyclomatic 38) REDACTED:2483 — server.init_server has cyclomatic complexity 38 (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 · dashboard.dashboard.accDownloadResult (cyclomatic 38) · ×1
  • dashboard.dashboard.accDownloadResult (cyclomatic 38) REDACTED:6588 — dashboard.dashboard.accDownloadResult has cyclomatic complexity 38 (threshold 15). Of this number, 35 points are the body's own statements and 3 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 · gemma4.extract_gemma4_messages (cyclomatic 37) · ×1
  • gemma4.extract_gemma4_messages (cyclomatic 37) omlx/adapter/gemma4.py:73 — gemma4.extract_gemma4_messages 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 · PagedSSDCacheManager._reconstruct_cache_data (cyclomatic 37) · ×1
  • PagedSSDCacheManager._reconstruct_cache_data (cyclomatic 37) omlx/cache/paged_ssd_cache.py:3992 — PagedSSDCacheManager._reconstruct_cache_data 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 · launch._sweep_rank_processes (cyclomatic 37) · ×1
  • launch._sweep_rank_processes (cyclomatic 37) omlx/cluster/launch.py:651 — launch._sweep_rank_processes 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 · Indexer.__call__ (cyclomatic 37) · ×1
  • Indexer.__call__ (cyclomatic 37) omlx/patches/glm_moe_dsa/deepseek_v32.py:214 — Indexer.__call__ has cyclomatic complexity 37 (threshold 15). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D1 · Cyclomatic Complexity · Scheduler._do_abort_request (cyclomatic 37) · ×1
  • Scheduler._do_abort_request (cyclomatic 37) omlx/scheduler.py:12386 — Scheduler._do_abort_request 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 · PerformanceScreenVM.save (cyclomatic 37) · ×1
  • PerformanceScreenVM.save (cyclomatic 37) apps/omlx-mac/Sources/AppView/ViewModels/PerformanceScreenVM.swift:232 — PerformanceScreenVM.save has cyclomatic complexity 37 (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 · BlockAwarePrefixCache._get_cache_seq_len (cyclomatic 36) · ×1
  • BlockAwarePrefixCache._get_cache_seq_len (cyclomatic 36) omlx/cache/prefix_cache.py:2012 — BlockAwarePrefixCache._get_cache_seq_len 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 · routes.replan_cluster_deployment (cyclomatic 36) · ×1
  • routes.replan_cluster_deployment (cyclomatic 36) omlx/cluster/routes.py:3842 — routes.replan_cluster_deployment 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 · EnginePool._engine_runtime_signature (cyclomatic 36) · ×1
  • EnginePool._engine_runtime_signature (cyclomatic 36) omlx/engine_pool.py:1260 — EnginePool._engine_runtime_signature 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 · server.list_models (cyclomatic 36) · ×1
  • server.list_models (cyclomatic 36) REDACTED:3807 — server.list_models 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 · image._extract_media (cyclomatic 36) · ×1
  • image._extract_media (cyclomatic 36) omlx/utils/image.py:352 — image._extract_media 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 · ane_tuning._measure_candidate (cyclomatic 35) · ×1
  • ane_tuning._measure_candidate (cyclomatic 35) omlx/admin/ane_tuning.py:591 — ane_tuning._measure_candidate 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 · progressive_loading.progressive_sharded_load (cyclomatic 34) · ×1
  • progressive_loading.progressive_sharded_load (cyclomatic 34) omlx/cluster/progressive_loading.py:74 — progressive_loading.progressive_sharded_load 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 · oq._collect_imatrix_from_model (cyclomatic 34) · ×1
  • oq._collect_imatrix_from_model (cyclomatic 34) REDACTED:9718 — oq._collect_imatrix_from_model 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 · routes.list_hf_models (cyclomatic 33) · ×1
  • routes.list_hf_models (cyclomatic 33) omlx/admin/routes.py:8393 — routes.list_hf_models 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 · routes.delete_hf_model (cyclomatic 33) · ×1
  • routes.delete_hf_model (cyclomatic 33) omlx/admin/routes.py:8535 — routes.delete_hf_model 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 · deepseek_v41_delta.restore_chain (cyclomatic 33) · ×1
  • deepseek_v41_delta.restore_chain (cyclomatic 33) omlx/cache/deepseek_v41_delta.py:87 — deepseek_v41_delta.restore_chain 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 · BlockAwarePrefixCache._maybe_backfill_dedup_block_payload (cyclomatic 33) · ×1
  • BlockAwarePrefixCache._maybe_backfill_dedup_block_payload (cyclomatic 33) omlx/cache/prefix_cache.py:2333 — BlockAwarePrefixCache._maybe_backfill_dedup_block_payload 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 · PairingManager.complete_join (cyclomatic 33) · ×1
  • PairingManager.complete_join (cyclomatic 33) REDACTED:1093 — PairingManager.complete_join 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 · Scheduler._plan_prefill_rows (cyclomatic 33) · ×1
  • Scheduler._plan_prefill_rows (cyclomatic 33) omlx/scheduler.py:7824 — Scheduler._plan_prefill_rows 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 · Scheduler._get_boundary_store_override (cyclomatic 33) · ×1
  • Scheduler._get_boundary_store_override (cyclomatic 33) omlx/scheduler.py:9673 — Scheduler._get_boundary_store_override 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 · dashboard.dashboard.validateQwenAneSettings (cyclomatic 33) · ×1
  • dashboard.dashboard.validateQwenAneSettings (cyclomatic 33) REDACTED:3461 — dashboard.dashboard.validateQwenAneSettings has cyclomatic complexity 33 (threshold 15). Of this number, 22 points are the body's own statements and 11 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 · dashboard.validateQwenAneSettings (cyclomatic 33) · ×1
  • dashboard.validateQwenAneSettings (cyclomatic 33) REDACTED:3461 — dashboard.validateQwenAneSettings has cyclomatic complexity 33 (threshold 15). Of this number, 22 points are the body's own statements and 11 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 · tool_calling._coerce_param_value (cyclomatic 32) · ×1
  • tool_calling._coerce_param_value (cyclomatic 32) omlx/api/tool_calling.py:348 — tool_calling._coerce_param_value 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 · ClusterDeployment.__post_init__ (cyclomatic 32) · ×1
  • ClusterDeployment.__post_init__ (cyclomatic 32) omlx/cluster/deployment.py:369 — ClusterDeployment.__post_init__ 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 · prompt_priming._capture_single (cyclomatic 32) · ×1
  • prompt_priming._capture_single (cyclomatic 32) REDACTED:1100 — prompt_priming._capture_single 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 · MenubarIconRecovery.fixStatusKitPermission (cyclomatic 32) · ×1
  • MenubarIconRecovery.fixStatusKitPermission (cyclomatic 32) apps/omlx-mac/Sources/Menubar/MenubarVisibilityWatcher.swift:368 — MenubarIconRecovery.fixStatusKitPermission 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 · dashboard.saveGlobalSettings (cyclomatic 32) · ×1
  • dashboard.saveGlobalSettings (cyclomatic 32) REDACTED:1407 — dashboard.saveGlobalSettings has cyclomatic complexity 32 (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 · benchmark._upload_to_omlx_ai (cyclomatic 31) · ×1
  • benchmark._upload_to_omlx_ai (cyclomatic 31) omlx/admin/benchmark.py:1746 — benchmark._upload_to_omlx_ai 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 · HFDownloader.search_models (cyclomatic 31) · ×1
  • HFDownloader.search_models (cyclomatic 31) REDACTED:1463 — HFDownloader.search_models 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 · OQManager.start_quantization (cyclomatic 31) · ×1
  • OQManager.start_quantization (cyclomatic 31) omlx/admin/oq_manager.py:304 — OQManager.start_quantization 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 · ToolCallStreamFilter.feed (cyclomatic 31) · ×1
  • ToolCallStreamFilter.feed (cyclomatic 31) omlx/api/tool_calling.py:3581 — ToolCallStreamFilter.feed 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 · discovery_routes._enrich_paired_row (cyclomatic 31) · ×1
  • discovery_routes._enrich_paired_row (cyclomatic 31) omlx/cluster/discovery_routes.py:213 — discovery_routes._enrich_paired_row 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 · launch.build_mlx_launch_argv (cyclomatic 31) · ×1
  • launch.build_mlx_launch_argv (cyclomatic 31) omlx/cluster/launch.py:1188 — launch.build_mlx_launch_argv 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 · planner.inspect_safetensors_layout (cyclomatic 31) · ×1
  • planner.inspect_safetensors_layout (cyclomatic 31) omlx/cluster/planner.py:1251 — planner.inspect_safetensors_layout 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 · planner.plan_hybrid (cyclomatic 31) · ×1
  • planner.plan_hybrid (cyclomatic 31) omlx/cluster/planner.py:2267 — planner.plan_hybrid 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 · runtime._validated_metrics (cyclomatic 31) · ×1
  • runtime._validated_metrics (cyclomatic 31) omlx/cluster/runtime.py:196 — runtime._validated_metrics 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 · transport.assess_link (cyclomatic 31) · ×1
  • transport.assess_link (cyclomatic 31) omlx/cluster/transport.py:890 — transport.assess_link 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 · VLMModelAdapter.__call__ (cyclomatic 31) · ×1
  • VLMModelAdapter.__call__ (cyclomatic 31) omlx/models/vlm.py:613 — VLMModelAdapter.__call__ 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 · SwitchGLU.__call__ (cyclomatic 31) · ×1
  • SwitchGLU.__call__ (cyclomatic 31) omlx/patches/deepseek_v4/switch_layers.py:482 — SwitchGLU.__call__ has cyclomatic complexity 31 (threshold 15). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D1 · Cyclomatic Complexity · Scheduler._advance_chunked_prefills (cyclomatic 31) · ×1
  • Scheduler._advance_chunked_prefills (cyclomatic 31) omlx/scheduler.py:8007 — Scheduler._advance_chunked_prefills 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 · Scheduler._prepare_prefix_cache_for_request (cyclomatic 31) · ×1
  • Scheduler._prepare_prefix_cache_for_request (cyclomatic 31) omlx/scheduler.py:11112 — Scheduler._prepare_prefix_cache_for_request 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 · Scheduler._route_to_vlm_mtp (cyclomatic 31) · ×1
  • Scheduler._route_to_vlm_mtp (cyclomatic 31) omlx/scheduler.py:11588 — Scheduler._route_to_vlm_mtp 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 · server._prepare_anthropic_prompt (cyclomatic 31) · ×1
  • server._prepare_anthropic_prompt (cyclomatic 31) REDACTED:7831 — server._prepare_anthropic_prompt 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 · cluster_v2.clusterV2Wizard.acceleratorRows (cyclomatic 31) · ×1
  • cluster_v2.clusterV2Wizard.acceleratorRows (cyclomatic 31) apps/omlx-web/omlx_web/static/js/cluster_v2.js:1906 — cluster_v2.clusterV2Wizard.acceleratorRows has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 2 of the 31 points are its own statements and the rest belongs to 2 function items inside it that branch (a function literal at line 1913, size). 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 · dashboard.dashboard.saveGlobalSettings (cyclomatic 31) · ×1
  • dashboard.dashboard.saveGlobalSettings (cyclomatic 31) REDACTED:1407 — dashboard.dashboard.saveGlobalSettings 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 · clusterV2Wizard.acceleratorRows (cyclomatic 31) · ×1
  • clusterV2Wizard.acceleratorRows (cyclomatic 31) apps/omlx-web/omlx_web/static/js/cluster_v2.js:1906 — clusterV2Wizard.acceleratorRows has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 2 of the 31 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 1913, size, t, …). 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 · dashboard.prefillHelperStatusText (cyclomatic 31) · ×1
  • dashboard.prefillHelperStatusText (cyclomatic 31) REDACTED:3330 — dashboard.prefillHelperStatusText has cyclomatic complexity 31 (threshold 15). Of this number, 30 points are the body's own statements and 1 belongs to 3 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 · dashboard.sortedModels (cyclomatic 31) · ×1
  • dashboard.sortedModels (cyclomatic 31) REDACTED:7249 — dashboard.sortedModels has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 1 of the 31 points is its own statement and the rest belongs to one function literal inside it that branches (line 7250). 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 · benchmark._log_ane_benchmark_trace (cyclomatic 30) · ×1
  • benchmark._log_ane_benchmark_trace (cyclomatic 30) omlx/admin/benchmark.py:1112 — benchmark._log_ane_benchmark_trace 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 · routes._feature_problem (cyclomatic 30) · ×1
  • routes._feature_problem (cyclomatic 30) omlx/admin/routes.py:4137 — routes._feature_problem 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 · routes.probe_cache (cyclomatic 30) · ×1
  • routes.probe_cache (cyclomatic 30) omlx/admin/routes.py:7922 — routes.probe_cache 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 · DistributedBatchedEngine.stream_generate (cyclomatic 30) · ×1
  • DistributedBatchedEngine.stream_generate (cyclomatic 30) omlx/engine/distributed.py:1688 — DistributedBatchedEngine.stream_generate 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 · model_discovery._missing_weight_shards (cyclomatic 30) · ×1
  • model_discovery._missing_weight_shards (cyclomatic 30) omlx/model_discovery.py:1271 — model_discovery._missing_weight_shards 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 · Scheduler._buffer_stop_sequence_output (cyclomatic 30) · ×1
  • Scheduler._buffer_stop_sequence_output (cyclomatic 30) omlx/scheduler.py:8261 — Scheduler._buffer_stop_sequence_output 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 · audio_routes._run_realtime_voice (cyclomatic 29) · ×1
  • audio_routes._run_realtime_voice (cyclomatic 29) omlx/api/audio_routes.py:1143 — audio_routes._run_realtime_voice 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 · ToolCallStreamFilter._advance_json_scan (cyclomatic 29) · ×1
  • ToolCallStreamFilter._advance_json_scan (cyclomatic 29) omlx/api/tool_calling.py:2921 — ToolCallStreamFilter._advance_json_scan 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 · BoundarySnapshotSSDStore._process_write_item (cyclomatic 29) · ×1
  • BoundarySnapshotSSDStore._process_write_item (cyclomatic 29) omlx/cache/boundary_snapshot_store.py:1072 — BoundarySnapshotSSDStore._process_write_item 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 · routes._activate_and_report (cyclomatic 29) · ×1
  • routes._activate_and_report (cyclomatic 29) omlx/cluster/routes.py:3479 — routes._activate_and_report 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 · VLMBatchedEngine._try_build_cached_vision_inputs (cyclomatic 29) · ×1
  • VLMBatchedEngine._try_build_cached_vision_inputs (cyclomatic 29) omlx/engine/vlm.py:3706 — VLMBatchedEngine._try_build_cached_vision_inputs 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 · PipelinedTextModel.__call__ (cyclomatic 29) · ×1
  • PipelinedTextModel.__call__ (cyclomatic 29) omlx/patches/glm5_next_mlx_lm/model.py:86 — PipelinedTextModel.__call__ has cyclomatic complexity 29 (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 · fused_batch._advance_group (cyclomatic 29) · ×1
  • fused_batch._advance_group (cyclomatic 29) omlx/patches/mlx_lm_mtp/fused_batch.py:205 — fused_batch._advance_group 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 · decode_kernels.moe_down_combine (cyclomatic 29) · ×1
  • decode_kernels.moe_down_combine (cyclomatic 29) omlx/patches/mlx_vlm_glm5_next_compat/decode_kernels.py:936 — decode_kernels.moe_down_combine 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 · Scheduler._run_prefill_chunks (cyclomatic 29) · ×1
  • Scheduler._run_prefill_chunks (cyclomatic 29) omlx/scheduler.py:7286 — Scheduler._run_prefill_chunks 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 · Scheduler._normalize_rotating_snapshot_state (cyclomatic 29) · ×1
  • Scheduler._normalize_rotating_snapshot_state (cyclomatic 29) omlx/scheduler.py:10353 — Scheduler._normalize_rotating_snapshot_state has cyclomatic complexity 29 (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 · paged_ssd_cache._block_cachelist_subtypes (cyclomatic 28) · ×1
  • paged_ssd_cache._block_cachelist_subtypes (cyclomatic 28) omlx/cache/paged_ssd_cache.py:599 — paged_ssd_cache._block_cachelist_subtypes 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 · PairingManager.approve (cyclomatic 28) · ×1
  • PairingManager.approve (cyclomatic 28) REDACTED:1371 — PairingManager.approve 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 · runtime_optimizations.install_runtime_optimizations (cyclomatic 28) · ×1
  • runtime_optimizations.install_runtime_optimizations (cyclomatic 28) omlx/cluster/runtime_optimizations.py:274 — runtime_optimizations.install_runtime_optimizations 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 · VLMBatchedEngine._compute_vision_features (cyclomatic 28) · ×1
  • VLMBatchedEngine._compute_vision_features (cyclomatic 28) omlx/engine/vlm.py:3485 — VLMBatchedEngine._compute_vision_features 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 · EnginePool._entry_runtime_resident_size (cyclomatic 28) · ×1
  • EnginePool._entry_runtime_resident_size (cyclomatic 28) omlx/engine_pool.py:603 — EnginePool._entry_runtime_resident_size 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 · EnginePool._stop_and_unload_engine (cyclomatic 28) · ×1
  • EnginePool._stop_and_unload_engine (cyclomatic 28) omlx/engine_pool.py:3779 — EnginePool._stop_and_unload_engine 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 · oq._discover_sanitize_plan (cyclomatic 28) · ×1
  • oq._discover_sanitize_plan (cyclomatic 28) REDACTED:3236 — oq._discover_sanitize_plan 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 · m5_gather_qmm_a8._launch (cyclomatic 28) · ×1
  • m5_gather_qmm_a8._launch (cyclomatic 28) omlx/patches/m5_gather_qmm_a8.py:845 — m5_gather_qmm_a8._launch 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 · Model.sanitize (cyclomatic 28) · ×1
  • Model.sanitize (cyclomatic 28) omlx/patches/mimo_v2/mimo_v2_model.py:598 — Model.sanitize has cyclomatic complexity 28 (threshold 15). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D1 · Cyclomatic Complexity · cluster_v2.clusterV2Wizard.runPlan (cyclomatic 28) · ×1
  • cluster_v2.clusterV2Wizard.runPlan (cyclomatic 28) apps/omlx-web/omlx_web/static/js/cluster_v2.js:2845 — cluster_v2.clusterV2Wizard.runPlan has cyclomatic complexity 28 (threshold 15). Of this number, 25 points are the body's own statements and 3 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 · clusterV2Wizard.runPlan (cyclomatic 28) · ×1
  • clusterV2Wizard.runPlan (cyclomatic 28) apps/omlx-web/omlx_web/static/js/cluster_v2.js:2845 — clusterV2Wizard.runPlan has cyclomatic complexity 28 (threshold 15). Of this number, 25 points are the body's own statements and 3 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 · model_recommender.kv_cache_cost (cyclomatic 27) · ×1
  • model_recommender.kv_cache_cost (cyclomatic 27) omlx/admin/model_recommender.py:647 — model_recommender.kv_cache_cost 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 · MSDownloader._run_download (cyclomatic 27) · ×1
  • MSDownloader._run_download (cyclomatic 27) omlx/admin/ms_downloader.py:902 — MSDownloader._run_download 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 · PagedSSDCacheManager._is_compatible_cache_signature (cyclomatic 27) · ×1
  • PagedSSDCacheManager._is_compatible_cache_signature (cyclomatic 27) omlx/cache/paged_ssd_cache.py:2874 — PagedSSDCacheManager._is_compatible_cache_signature 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 · DiscoveryService._probe_candidate (cyclomatic 27) · ×1
  • DiscoveryService._probe_candidate (cyclomatic 27) REDACTED:1854 — DiscoveryService._probe_candidate 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 · inference_worker.run_worker (cyclomatic 27) · ×1
  • inference_worker.run_worker (cyclomatic 27) omlx/cluster/inference_worker.py:1405 — inference_worker.run_worker 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 · DistributedJobSupervisor._terminate (cyclomatic 27) · ×1
  • DistributedJobSupervisor._terminate (cyclomatic 27) omlx/cluster/launch.py:3083 — DistributedJobSupervisor._terminate 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 · launch.preflight_remote_hosts (cyclomatic 27) · ×1
  • launch.preflight_remote_hosts (cyclomatic 27) omlx/cluster/launch.py:2402 — launch.preflight_remote_hosts 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 · model_discovery.discover_models (cyclomatic 27) · ×1
  • model_discovery.discover_models (cyclomatic 27) omlx/model_discovery.py:1995 — model_discovery.discover_models 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 · ModelSettingsManager._repair_profile_references (cyclomatic 27) · ×1
  • ModelSettingsManager._repair_profile_references (cyclomatic 27) omlx/model_settings.py:733 — ModelSettingsManager._repair_profile_references 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 · MLXEmbeddingModel.embed (cyclomatic 27) · ×1
  • MLXEmbeddingModel.embed (cyclomatic 27) omlx/models/embedding.py:957 — MLXEmbeddingModel.embed 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 · MLXRerankerModel._resolve_token_id (cyclomatic 27) · ×1
  • MLXRerankerModel._resolve_token_id (cyclomatic 27) omlx/models/reranker.py:549 — MLXRerankerModel._resolve_token_id 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 · m5_gather_qmm_nax.supports (cyclomatic 27) · ×1
  • m5_gather_qmm_nax.supports (cyclomatic 27) omlx/patches/m5_gather_qmm_nax.py:1402 — m5_gather_qmm_nax.supports 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 · glm5_next_batch_rollback.rollback_rows (cyclomatic 27) · ×1
  • glm5_next_batch_rollback.rollback_rows (cyclomatic 27) omlx/patches/mlx_vlm_mtp/glm5_next_batch_rollback.py:10 — glm5_next_batch_rollback.rollback_rows 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 · server._with_sse_keepalive (cyclomatic 27) · ×1
  • server._with_sse_keepalive (cyclomatic 27) REDACTED:3076 — server._with_sse_keepalive 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 · server.stream_completion (cyclomatic 27) · ×1
  • server.stream_completion (cyclomatic 27) REDACTED:6088 — server.stream_completion 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 · ModelSettingsScreenVM.validateAneWorkingSettings (cyclomatic 27) · ×1
  • ModelSettingsScreenVM.validateAneWorkingSettings (cyclomatic 27) apps/omlx-mac/Sources/AppView/ViewModels/ModelSettingsScreenVM.swift:2292 — ModelSettingsScreenVM.validateAneWorkingSettings has cyclomatic complexity 27 (threshold 15). 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 · TalkAIController.handle (cyclomatic 27) · ×1
  • TalkAIController.handle (cyclomatic 27) apps/omlx-mac/Sources/AskAI/TalkAIController.swift:331 — TalkAIController.handle 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 · dashboard.dashboard.prefillHelperStatusText (cyclomatic 27) · ×1
  • dashboard.dashboard.prefillHelperStatusText (cyclomatic 27) REDACTED:3330 — dashboard.dashboard.prefillHelperStatusText has cyclomatic complexity 27 (threshold 15). Of this number, 26 points are the body's own statements and 1 belongs to one function item inside it that branches. 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 · routes._delete_gguf_model (cyclomatic 26) · ×1
  • routes._delete_gguf_model (cyclomatic 26) omlx/admin/routes.py:8693 — routes._delete_gguf_model 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 · PagedSSDCacheManager.load_block_with_metadata (cyclomatic 26) · ×1
  • PagedSSDCacheManager.load_block_with_metadata (cyclomatic 26) omlx/cache/paged_ssd_cache.py:4379 — PagedSSDCacheManager.load_block_with_metadata 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 · stage_transport.install_stage_links (cyclomatic 26) · ×1
  • stage_transport.install_stage_links (cyclomatic 26) omlx/cluster/rdma/stage_transport.py:218 — stage_transport.install_stage_links 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 · memory_monitor.set_model_info_from_model (cyclomatic 26) · ×1
  • memory_monitor.set_model_info_from_model (cyclomatic 26) REDACTED:2125 — memory_monitor.set_model_info_from_model 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 · oq._load_hf_calibration (cyclomatic 26) · ×1
  • oq._load_hf_calibration (cyclomatic 26) REDACTED:8310 — oq._load_hf_calibration 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 · moe_expert_offload.estimate_offload_admission_bytes (cyclomatic 26) · ×1
  • moe_expert_offload.estimate_offload_admission_bytes (cyclomatic 26) omlx/patches/moe_expert_offload.py:1172 — moe_expert_offload.estimate_offload_admission_bytes 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 · qwen35_ane_prefill._compile_gdn (cyclomatic 26) · ×1
  • qwen35_ane_prefill._compile_gdn (cyclomatic 26) omlx/patches/qwen35_ane_prefill.py:1112 — qwen35_ane_prefill._compile_gdn 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 · Model.sanitize (cyclomatic 26) · ×1
  • Model.sanitize (cyclomatic 26) omlx/patches/raon1_mini/raon1_mini_model.py:1932 — Model.sanitize has cyclomatic complexity 26 (threshold 15). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D1 · Cyclomatic Complexity · dashboard.applyANETuningRecommendation (cyclomatic 26) · ×1
  • dashboard.applyANETuningRecommendation (cyclomatic 26) REDACTED:2968 — dashboard.applyANETuningRecommendation 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 · ane_tuning._profile_refinement (cyclomatic 25) · ×1
  • ane_tuning._profile_refinement (cyclomatic 25) omlx/admin/ane_tuning.py:802 — ane_tuning._profile_refinement 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 · affine4._native_attention (cyclomatic 25) · ×1
  • affine4._native_attention (cyclomatic 25) omlx/affine4.py:796 — affine4._native_attention 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 · BlockAwarePrefixCache._validate_block_cache_data (cyclomatic 25) · ×1
  • BlockAwarePrefixCache._validate_block_cache_data (cyclomatic 25) omlx/cache/prefix_cache.py:5242 — BlockAwarePrefixCache._validate_block_cache_data 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 · cli.cluster_command (cyclomatic 25) · ×1
  • cli.cluster_command (cyclomatic 25) REDACTED:955 — cli.cluster_command 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 · DiscoveryService._handle_mdns_service (cyclomatic 25) · ×1
  • DiscoveryService._handle_mdns_service (cyclomatic 25) REDACTED:2118 — DiscoveryService._handle_mdns_service 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 · discovery_routes.cluster_devices (cyclomatic 25) · ×1
  • discovery_routes.cluster_devices (cyclomatic 25) omlx/cluster/discovery_routes.py:305 — discovery_routes.cluster_devices 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 · launch.run_cuda_fabric_probe (cyclomatic 25) · ×1
  • launch.run_cuda_fabric_probe (cyclomatic 25) omlx/cluster/launch.py:1536 — launch.run_cuda_fabric_probe 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 · planner._partition_layers (cyclomatic 25) · ×1
  • planner._partition_layers (cyclomatic 25) omlx/cluster/planner.py:1547 — planner._partition_layers 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 · d3.decode_video (cyclomatic 25) · ×1
  • d3.decode_video (cyclomatic 25) omlx/models/d3.py:302 — d3.decode_video has cyclomatic complexity 25 (threshold 15). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D1 · Cyclomatic Complexity · _DiscoveredPlan.pop (cyclomatic 25) · ×1
  • _DiscoveredPlan.pop (cyclomatic 25) REDACTED:3835 — _DiscoveredPlan.pop 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 · oq._lookup_imatrix_importance (cyclomatic 25) · ×1
  • oq._lookup_imatrix_importance (cyclomatic 25) REDACTED:6480 — oq._lookup_imatrix_importance 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 · Indexer.__call__ (cyclomatic 25) · ×1
  • Indexer.__call__ (cyclomatic 25) omlx/patches/deepseek_v4/deepseek_v4_model.py:1364 — Indexer.__call__ has cyclomatic complexity 25 (threshold 15). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D1 · Cyclomatic Complexity · GlmMoeDsaAttention.__call__ (cyclomatic 25) · ×1
  • GlmMoeDsaAttention.__call__ (cyclomatic 25) omlx/patches/glm_moe_dsa/glm_moe_dsa_model.py:185 — GlmMoeDsaAttention.__call__ has cyclomatic complexity 25 (threshold 15). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D1 · Cyclomatic Complexity · ModelArgs.__post_init__ (cyclomatic 25) · ×1
  • ModelArgs.__post_init__ (cyclomatic 25) omlx/patches/laguna/laguna_model.py:144 — ModelArgs.__post_init__ 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 · sdpa_flash.sdpa_flash (cyclomatic 25) · ×1
  • sdpa_flash.sdpa_flash (cyclomatic 25) omlx/patches/mimo_v2/sdpa_flash.py:418 — sdpa_flash.sdpa_flash 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 · batch_generator._chain_next_drafts (cyclomatic 25) · ×1
  • batch_generator._chain_next_drafts (cyclomatic 25) REDACTED:3252 — batch_generator._chain_next_drafts 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 · batch_generator._run_verify_cycle_batched (cyclomatic 25) · ×1
  • batch_generator._run_verify_cycle_batched (cyclomatic 25) REDACTED:3643 — batch_generator._run_verify_cycle_batched 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 · prompt_priming.maybe_capture (cyclomatic 25) · ×1
  • prompt_priming.maybe_capture (cyclomatic 25) REDACTED:877 — prompt_priming.maybe_capture 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 · qwen35_ane_prefill._backend_exact (cyclomatic 25) · ×1
  • qwen35_ane_prefill._backend_exact (cyclomatic 25) omlx/patches/qwen35_ane_prefill.py:1765 — qwen35_ane_prefill._backend_exact 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 · Scheduler._detect_needs_think_prefix (cyclomatic 25) · ×1
  • Scheduler._detect_needs_think_prefix (cyclomatic 25) omlx/scheduler.py:8928 — Scheduler._detect_needs_think_prefix 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 · model_loading.expand_per_layer_quant_keys (cyclomatic 25) · ×1
  • model_loading.expand_per_layer_quant_keys (cyclomatic 25) omlx/utils/model_loading.py:185 — model_loading.expand_per_layer_quant_keys 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 · ExperimentalSection.body (cyclomatic 25) · ×1
  • ExperimentalSection.body (cyclomatic 25) apps/omlx-mac/Sources/AppView/Screens/ModelSettingsScreen.swift:2503 — ExperimentalSection.body 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 · IntegrationsScreenVM.saveWebSearch (cyclomatic 25) · ×1
  • IntegrationsScreenVM.saveWebSearch (cyclomatic 25) apps/omlx-mac/Sources/AppView/ViewModels/IntegrationsScreenVM.swift:483 — IntegrationsScreenVM.saveWebSearch 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 · dashboard.dashboard.applyANETuningRecommendation (cyclomatic 25) · ×1
  • dashboard.dashboard.applyANETuningRecommendation (cyclomatic 25) REDACTED:2968 — dashboard.dashboard.applyANETuningRecommendation 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 · MSDownloader.get_model_info (cyclomatic 24) · ×1
  • MSDownloader.get_model_info (cyclomatic 24) omlx/admin/ms_downloader.py:588 — MSDownloader.get_model_info 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 · routes.clear_ssd_cache (cyclomatic 24) · ×1
  • routes.clear_ssd_cache (cyclomatic 24) omlx/admin/routes.py:7605 — routes.clear_ssd_cache has cyclomatic complexity 24 (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 · audio_routes.create_transcription (cyclomatic 24) · ×1
  • audio_routes.create_transcription (cyclomatic 24) omlx/api/audio_routes.py:514 — audio_routes.create_transcription 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 · LFM3VoiceBackend._slot (cyclomatic 24) · ×1
  • LFM3VoiceBackend._slot (cyclomatic 24) omlx/engine/lfm3_realtime.py:311 — LFM3VoiceBackend._slot 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 · engine_pool._qwen35_cpu_share_estimated_bytes (cyclomatic 24) · ×1
  • engine_pool._qwen35_cpu_share_estimated_bytes (cyclomatic 24) omlx/engine_pool.py:203 — engine_pool._qwen35_cpu_share_estimated_bytes 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 · BaseBenchmark.run (cyclomatic 24) · ×1
  • BaseBenchmark.run (cyclomatic 24) omlx/eval/base.py:364 — BaseBenchmark.run 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 · oq._quantize_chunked (cyclomatic 24) · ×1
  • oq._quantize_chunked (cyclomatic 24) REDACTED:6888 — oq._quantize_chunked 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 · CompressedAttention.__call__ (cyclomatic 24) · ×1
  • CompressedAttention.__call__ (cyclomatic 24) omlx/patches/deepseek_v4/deepseek_v4_model.py:1833 — CompressedAttention.__call__ has cyclomatic complexity 24 (threshold 15). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D1 · Cyclomatic Complexity · deepseek_v4_model._sparse_pooled_attention (cyclomatic 24) · ×1
  • deepseek_v4_model._sparse_pooled_attention (cyclomatic 24) omlx/patches/deepseek_v4/deepseek_v4_model.py:789 — deepseek_v4_model._sparse_pooled_attention has cyclomatic complexity 24 (threshold 15). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D1 · Cyclomatic Complexity · _DepthController.observe (cyclomatic 24) · ×1
  • _DepthController.observe (cyclomatic 24) REDACTED:2790 — _DepthController.observe 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 · qwen35_q4_mlp._is_supported_affine_linear_shape (cyclomatic 24) · ×1
  • qwen35_q4_mlp._is_supported_affine_linear_shape (cyclomatic 24) omlx/patches/qwen35_q4_mlp.py:140 — qwen35_q4_mlp._is_supported_affine_linear_shape 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 · cluster_v2.clusterV2Wizard.wizardState (cyclomatic 24) · ×1
  • cluster_v2.clusterV2Wizard.wizardState (cyclomatic 24) apps/omlx-web/omlx_web/static/js/cluster_v2.js:1049 — cluster_v2.clusterV2Wizard.wizardState 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 · cluster_v2.clusterV2Wizard.previewMembershipExpansion (cyclomatic 24) · ×1
  • cluster_v2.clusterV2Wizard.previewMembershipExpansion (cyclomatic 24) apps/omlx-web/omlx_web/static/js/cluster_v2.js:3543 — cluster_v2.clusterV2Wizard.previewMembershipExpansion has cyclomatic complexity 24 (threshold 15). Of this number, 19 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 · logs.aggregateLogRows (cyclomatic 24) · ×1
  • logs.aggregateLogRows (cyclomatic 24) REDACTED:71 — logs.aggregateLogRows has cyclomatic complexity 24 (threshold 15). Of this number, 20 points are the body's own statements and 4 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 · clusterV2Wizard.wizardState (cyclomatic 24) · ×1
  • clusterV2Wizard.wizardState (cyclomatic 24) apps/omlx-web/omlx_web/static/js/cluster_v2.js:1049 — clusterV2Wizard.wizardState 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 · clusterV2Wizard.previewMembershipExpansion (cyclomatic 24) · ×1
  • clusterV2Wizard.previewMembershipExpansion (cyclomatic 24) apps/omlx-web/omlx_web/static/js/cluster_v2.js:3543 — clusterV2Wizard.previewMembershipExpansion has cyclomatic complexity 24 (threshold 15). Of this number, 19 points are the body's own statements and 5 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 · paged_ssd_cache._load_nstate_flat (cyclomatic 23) · ×1
  • paged_ssd_cache._load_nstate_flat (cyclomatic 23) omlx/cache/paged_ssd_cache.py:837 — paged_ssd_cache._load_nstate_flat 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 · runtime._validated_assignments (cyclomatic 23) · ×1
  • runtime._validated_assignments (cyclomatic 23) omlx/cluster/runtime.py:91 — runtime._validated_assignments 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 · staging.stage_files_from_source (cyclomatic 23) · ×1
  • staging.stage_files_from_source (cyclomatic 23) omlx/cluster/staging.py:1000 — staging.stage_files_from_source 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 · EnginePool.resolve_model_id (cyclomatic 23) · ×1
  • EnginePool.resolve_model_id (cyclomatic 23) omlx/engine_pool.py:2000 — EnginePool.resolve_model_id 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 · fused_batch.advance (cyclomatic 23) · ×1
  • fused_batch.advance (cyclomatic 23) omlx/patches/mlx_lm_mtp/fused_batch.py:57 — fused_batch.advance 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 · qwen35_fa256_attention.apply_qwen35_fa256_attention_patch (cyclomatic 23) · ×1
  • qwen35_fa256_attention.apply_qwen35_fa256_attention_patch (cyclomatic 23) omlx/patches/qwen35_fa256_attention.py:323 — qwen35_fa256_attention.apply_qwen35_fa256_attention_patch 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 · Scheduler._prepare_prompt_boundary_cache_store (cyclomatic 23) · ×1
  • Scheduler._prepare_prompt_boundary_cache_store (cyclomatic 23) omlx/scheduler.py:10137 — Scheduler._prepare_prompt_boundary_cache_store 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 · target.run_specprefill_target_prefill (cyclomatic 23) · ×1
  • target.run_specprefill_target_prefill (cyclomatic 23) omlx/specprefill/target.py:57 — target.run_specprefill_target_prefill 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 · AdvancedPage.body (cyclomatic 23) · ×1
  • AdvancedPage.body (cyclomatic 23) apps/omlx-mac/Sources/AppView/Screens/ModelSettingsScreen.swift:1221 — AdvancedPage.body 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 · dashboard.dashboard.openModelSettings (cyclomatic 23) · ×1
  • dashboard.dashboard.openModelSettings (cyclomatic 23) REDACTED:3060 — dashboard.dashboard.openModelSettings has cyclomatic complexity 23 (threshold 15). 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: 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 · dashboard.openModelSettings (cyclomatic 23) · ×1
  • dashboard.openModelSettings (cyclomatic 23) REDACTED:3060 — dashboard.openModelSettings has cyclomatic complexity 23 (threshold 15). 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: 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 · harmony.parse_tool_calls_from_tokens (cyclomatic 22) · ×1
  • harmony.parse_tool_calls_from_tokens (cyclomatic 22) omlx/adapter/harmony.py:429 — harmony.parse_tool_calls_from_tokens 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 · audio_routes._split_tts_text (cyclomatic 22) · ×1
  • audio_routes._split_tts_text (cyclomatic 22) omlx/api/audio_routes.py:285 — audio_routes._split_tts_text 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 · audio_routes.realtime_voice (cyclomatic 22) · ×1
  • audio_routes.realtime_voice (cyclomatic 22) omlx/api/audio_routes.py:1002 — audio_routes.realtime_voice 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 · BoundarySnapshotSSDStore._serialize_extracted (cyclomatic 22) · ×1
  • BoundarySnapshotSSDStore._serialize_extracted (cyclomatic 22) omlx/cache/boundary_snapshot_store.py:1212 — BoundarySnapshotSSDStore._serialize_extracted 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 · pooling_delta.compact_pooling_cache_snapshot (cyclomatic 22) · ×1
  • pooling_delta.compact_pooling_cache_snapshot (cyclomatic 22) omlx/cache/pooling_delta.py:22 — pooling_delta.compact_pooling_cache_snapshot 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.stop_deployment_processes (cyclomatic 22) · ×1
  • launch.stop_deployment_processes (cyclomatic 22) omlx/cluster/launch.py:827 — launch.stop_deployment_processes 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.probe_remote_host (cyclomatic 22) · ×1
  • launch.probe_remote_host (cyclomatic 22) omlx/cluster/launch.py:2222 — launch.probe_remote_host 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 · PairingSession._begin (cyclomatic 22) · ×1
  • PairingSession._begin (cyclomatic 22) omlx/cluster/pairing_session.py:198 — PairingSession._begin 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 · routes.cluster_cuda_fabric_verify (cyclomatic 22) · ×1
  • routes.cluster_cuda_fabric_verify (cyclomatic 22) omlx/cluster/routes.py:2681 — routes.cluster_cuda_fabric_verify 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 · transport.detect_transports (cyclomatic 22) · ×1
  • transport.detect_transports (cyclomatic 22) omlx/cluster/transport.py:236 — transport.detect_transports 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 · EnginePool._evict_idle_lru_for_prefill (cyclomatic 22) · ×1
  • EnginePool._evict_idle_lru_for_prefill (cyclomatic 22) omlx/engine_pool.py:3259 — EnginePool._evict_idle_lru_for_prefill 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 · ModelSettingsManager._load_profiles (cyclomatic 22) · ×1
  • ModelSettingsManager._load_profiles (cyclomatic 22) omlx/model_settings.py:1126 — ModelSettingsManager._load_profiles 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 · oq.import_mtplx_sidecar (cyclomatic 22) · ×1
  • oq.import_mtplx_sidecar (cyclomatic 22) REDACTED:2345 — oq.import_mtplx_sidecar 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 · BatchPoolingCache.accumulate_windows (cyclomatic 22) · ×1
  • BatchPoolingCache.accumulate_windows (cyclomatic 22) omlx/patches/deepseek_v4/cache_extras.py:515 — BatchPoolingCache.accumulate_windows 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 · prompt_priming._prepare_prefix_context (cyclomatic 22) · ×1
  • prompt_priming._prepare_prefix_context (cyclomatic 22) REDACTED:601 — prompt_priming._prepare_prefix_context 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 · qwen35_ane_prefill._compile_pair (cyclomatic 22) · ×1
  • qwen35_ane_prefill._compile_pair (cyclomatic 22) omlx/patches/qwen35_ane_prefill.py:597 — qwen35_ane_prefill._compile_pair 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 · PrefillHelperManager._run (cyclomatic 22) · ×1
  • PrefillHelperManager._run (cyclomatic 22) omlx/prefill_helper/manager.py:613 — PrefillHelperManager._run 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 · Scheduler._build_sampler_and_processors (cyclomatic 22) · ×1
  • Scheduler._build_sampler_and_processors (cyclomatic 22) omlx/scheduler.py:8551 — Scheduler._build_sampler_and_processors 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 · Scheduler._validate_cache (cyclomatic 22) · ×1
  • Scheduler._validate_cache (cyclomatic 22) omlx/scheduler.py:10283 — Scheduler._validate_cache 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 · GlobalSettings._load_from_file (cyclomatic 22) · ×1
  • GlobalSettings._load_from_file (cyclomatic 22) omlx/settings.py:1170 — GlobalSettings._load_from_file 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 · UpdateController.runCheck (cyclomatic 22) · ×1
  • UpdateController.runCheck (cyclomatic 22) apps/omlx-mac/Sources/Updater/UpdateController.swift:312 — UpdateController.runCheck 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 · accuracy_upload.trim_question_results (cyclomatic 21) · ×1
  • accuracy_upload.trim_question_results (cyclomatic 21) omlx/admin/accuracy_upload.py:147 — accuracy_upload.trim_question_results 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 · ane_tuning._settings_for_candidate (cyclomatic 21) · ×1
  • ane_tuning._settings_for_candidate (cyclomatic 21) omlx/admin/ane_tuning.py:445 — ane_tuning._settings_for_candidate 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 · ExternalAPIClient.stream_chat_completion (cyclomatic 21) · ×1
  • ExternalAPIClient.stream_chat_completion (cyclomatic 21) omlx/admin/external_api.py:363 — ExternalAPIClient.stream_chat_completion 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 · recipe.decode_recipe (cyclomatic 21) · ×1
  • recipe.decode_recipe (cyclomatic 21) omlx/admin/recipe.py:60 — recipe.decode_recipe 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 · audio_routes.realtime_transcription (cyclomatic 21) · ×1
  • audio_routes.realtime_transcription (cyclomatic 21) omlx/api/audio_routes.py:694 — audio_routes.realtime_transcription has cyclomatic complexity 21 (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 · ThinkingParser.feed (cyclomatic 21) · ×1
  • ThinkingParser.feed (cyclomatic 21) omlx/api/thinking.py:321 — ThinkingParser.feed 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 · BoundarySnapshotSSDStore._write_inline (cyclomatic 21) · ×1
  • BoundarySnapshotSSDStore._write_inline (cyclomatic 21) omlx/cache/boundary_snapshot_store.py:939 — BoundarySnapshotSSDStore._write_inline 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 · base._run_scheduler_preflight_with_cleanup_retry (cyclomatic 21) · ×1
  • base._run_scheduler_preflight_with_cleanup_retry (cyclomatic 21) omlx/engine/base.py:87 — base._run_scheduler_preflight_with_cleanup_retry 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 · memory_monitor._make_deepseek_v41_prefill_memory_profile (cyclomatic 21) · ×1
  • memory_monitor._make_deepseek_v41_prefill_memory_profile (cyclomatic 21) REDACTED:1754 — memory_monitor._make_deepseek_v41_prefill_memory_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 · MLXRerankerModel._rerank_jina (cyclomatic 21) · ×1
  • MLXRerankerModel._rerank_jina (cyclomatic 21) omlx/models/reranker.py:1149 — MLXRerankerModel._rerank_jina 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 · oq._collect_mtp_head_imatrix (cyclomatic 21) · ×1
  • oq._collect_mtp_head_imatrix (cyclomatic 21) REDACTED:9611 — oq._collect_mtp_head_imatrix 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 · m5_gather_qmm_a8.supports (cyclomatic 21) · ×1
  • m5_gather_qmm_a8.supports (cyclomatic 21) omlx/patches/m5_gather_qmm_a8.py:784 — m5_gather_qmm_a8.supports 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 · batched_head.draft (cyclomatic 21) · ×1
  • batched_head.draft (cyclomatic 21) omlx/patches/mlx_lm_mtp/batched_head.py:90 — batched_head.draft 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 · Scheduler._find_relevant_inflight_store (cyclomatic 21) · ×1
  • Scheduler._find_relevant_inflight_store (cyclomatic 21) omlx/scheduler.py:10898 — Scheduler._find_relevant_inflight_store 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 · Scheduler._align_minimax_m3_partial_cache_to_prefill_step (cyclomatic 21) · ×1
  • Scheduler._align_minimax_m3_partial_cache_to_prefill_step (cyclomatic 21) omlx/scheduler.py:12119 — Scheduler._align_minimax_m3_partial_cache_to_prefill_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 · cluster_v2.clusterV2Wizard.submitPairApproval (cyclomatic 21) · ×1
  • cluster_v2.clusterV2Wizard.submitPairApproval (cyclomatic 21) apps/omlx-web/omlx_web/static/js/cluster_v2.js:1427 — cluster_v2.clusterV2Wizard.submitPairApproval 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 · dashboard.dashboard.handleMainTabChange (cyclomatic 21) · ×1
  • dashboard.dashboard.handleMainTabChange (cyclomatic 21) REDACTED:895 — dashboard.dashboard.handleMainTabChange 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 · dashboard.dashboard.accBuildText (cyclomatic 21) · ×1
  • dashboard.dashboard.accBuildText (cyclomatic 21) REDACTED:6466 — dashboard.dashboard.accBuildText 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 · clusterV2Wizard.submitPairApproval (cyclomatic 21) · ×1
  • clusterV2Wizard.submitPairApproval (cyclomatic 21) apps/omlx-web/omlx_web/static/js/cluster_v2.js:1427 — clusterV2Wizard.submitPairApproval 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 · dashboard.handleMainTabChange (cyclomatic 21) · ×1
  • dashboard.handleMainTabChange (cyclomatic 21) REDACTED:895 — dashboard.handleMainTabChange has cyclomatic complexity 21 (threshold 15). Of this number, 19 points are the body's own statements and 2 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 · dashboard.accBuildText (cyclomatic 21) · ×1
  • dashboard.accBuildText (cyclomatic 21) REDACTED:6466 — dashboard.accBuildText 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 · output_parser.detect_output_parser (cyclomatic 20) · ×1
  • output_parser.detect_output_parser (cyclomatic 20) omlx/adapter/output_parser.py:1369 — output_parser.detect_output_parser 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 · HFDownloader.get_model_info (cyclomatic 20) · ×1
  • HFDownloader.get_model_info (cyclomatic 20) REDACTED:1590 — HFDownloader.get_model_info 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 · HFDownloader._poll_progress (cyclomatic 20) · ×1
  • HFDownloader._poll_progress (cyclomatic 20) REDACTED:2376 — HFDownloader._poll_progress 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 · HFUploader._run_upload (cyclomatic 20) · ×1
  • HFUploader._run_upload (cyclomatic 20) omlx/admin/hf_uploader.py:673 — HFUploader._run_upload 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 · OQManager._run_quantization (cyclomatic 20) · ×1
  • OQManager._run_quantization (cyclomatic 20) omlx/admin/oq_manager.py:599 — OQManager._run_quantization 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 · audio_routes.create_speech (cyclomatic 20) · ×1
  • audio_routes.create_speech (cyclomatic 20) omlx/api/audio_routes.py:1533 — audio_routes.create_speech 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 · ToolCallStreamFilter._should_drop_tail_at_finish (cyclomatic 20) · ×1
  • ToolCallStreamFilter._should_drop_tail_at_finish (cyclomatic 20) omlx/api/tool_calling.py:3373 — ToolCallStreamFilter._should_drop_tail_at_finish 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 · BoundarySnapshotSSDStore._read_state_tuple_raw (cyclomatic 20) · ×1
  • BoundarySnapshotSSDStore._read_state_tuple_raw (cyclomatic 20) omlx/cache/boundary_snapshot_store.py:1786 — BoundarySnapshotSSDStore._read_state_tuple_raw 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 · BoundarySnapshotSSDStore._read_state_tuple_arrays (cyclomatic 20) · ×1
  • BoundarySnapshotSSDStore._read_state_tuple_arrays (cyclomatic 20) omlx/cache/boundary_snapshot_store.py:1948 — BoundarySnapshotSSDStore._read_state_tuple_arrays 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 · PagedSSDCacheManager.signature_mismatch_reason (cyclomatic 20) · ×1
  • PagedSSDCacheManager.signature_mismatch_reason (cyclomatic 20) omlx/cache/paged_ssd_cache.py:2983 — PagedSSDCacheManager.signature_mismatch_reason 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 · PagedSSDCacheManager.load_block (cyclomatic 20) · ×1
  • PagedSSDCacheManager.load_block (cyclomatic 20) omlx/cache/paged_ssd_cache.py:4221 — PagedSSDCacheManager.load_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 · PagedSSDCacheManager.invalidate_stale_layer_signature (cyclomatic 20) · ×1
  • PagedSSDCacheManager.invalidate_stale_layer_signature (cyclomatic 20) omlx/cache/paged_ssd_cache.py:4850 — PagedSSDCacheManager.invalidate_stale_layer_signature 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 · probe.detect_accelerator_hardware (cyclomatic 20) · ×1
  • probe.detect_accelerator_hardware (cyclomatic 20) omlx/cluster/probe.py:72 — probe.detect_accelerator_hardware 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 · DeviceRegistry._coerce (cyclomatic 20) · ×1
  • DeviceRegistry._coerce (cyclomatic 20) omlx/cluster/registry.py:438 — DeviceRegistry._coerce 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 · routes._run_staging_job (cyclomatic 20) · ×1
  • routes._run_staging_job (cyclomatic 20) omlx/cluster/routes.py:1728 — routes._run_staging_job 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 · DistributedBatchedEngine._write_rank_cancel_request (cyclomatic 20) · ×1
  • DistributedBatchedEngine._write_rank_cancel_request (cyclomatic 20) omlx/engine/distributed.py:1099 — DistributedBatchedEngine._write_rank_cancel_request 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 · VLMBatchedEngine._split_vision_features (cyclomatic 20) · ×1
  • VLMBatchedEngine._split_vision_features (cyclomatic 20) omlx/engine/vlm.py:3855 — VLMBatchedEngine._split_vision_features 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 · vlm._audio_feature_cache_key_ranges (cyclomatic 20) · ×1
  • vlm._audio_feature_cache_key_ranges (cyclomatic 20) omlx/engine/vlm.py:1630 — vlm._audio_feature_cache_key_ranges 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 · model_discovery._register_model (cyclomatic 20) · ×1
  • model_discovery._register_model (cyclomatic 20) omlx/model_discovery.py:1703 — model_discovery._register_model 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 · _LazyTensorIndex._discover_fp8_pairs (cyclomatic 20) · ×1
  • _LazyTensorIndex._discover_fp8_pairs (cyclomatic 20) REDACTED:5640 — _LazyTensorIndex._discover_fp8_pairs 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 · oq._prepare_layer_inputs (cyclomatic 20) · ×1
  • oq._prepare_layer_inputs (cyclomatic 20) REDACTED:9126 — oq._prepare_layer_inputs 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 · BatchPoolingCache.merge (cyclomatic 20) · ×1
  • BatchPoolingCache.merge (cyclomatic 20) omlx/patches/deepseek_v4/cache_extras.py:1147 — BatchPoolingCache.merge 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 · m5_gather_qmm_a8._self_test_extended (cyclomatic 20) · ×1
  • m5_gather_qmm_a8._self_test_extended (cyclomatic 20) omlx/patches/m5_gather_qmm_a8.py:1367 — m5_gather_qmm_a8._self_test_extended 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 · m5_gather_qmm_nax._launch (cyclomatic 20) · ×1
  • m5_gather_qmm_nax._launch (cyclomatic 20) omlx/patches/m5_gather_qmm_nax.py:1463 — m5_gather_qmm_nax._launch 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 · batch_generator._post_init_mtp (cyclomatic 20) · ×1
  • batch_generator._post_init_mtp (cyclomatic 20) REDACTED:3426 — batch_generator._post_init_mtp 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 · norm_repair.repair_legacy_head_norms (cyclomatic 20) · ×1
  • norm_repair.repair_legacy_head_norms (cyclomatic 20) omlx/patches/mlx_lm_mtp/norm_repair.py:51 — norm_repair.repair_legacy_head_norms 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 · qwen38_modelopt_mixed.transform_weights_exact (cyclomatic 20) · ×1
  • qwen38_modelopt_mixed.transform_weights_exact (cyclomatic 20) omlx/patches/qwen38_modelopt_mixed.py:283 — qwen38_modelopt_mixed.transform_weights_exact 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 · Scheduler._init_tiered_cache (cyclomatic 20) · ×1
  • Scheduler._init_tiered_cache (cyclomatic 20) omlx/scheduler.py:16914 — Scheduler._init_tiered_cache 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 · websearch.run_fetch_url (cyclomatic 20) · ×1
  • websearch.run_fetch_url (cyclomatic 20) omlx/websearch.py:591 — websearch.run_fetch_url 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 · ProfileGroup.chip (cyclomatic 20) · ×1
  • ProfileGroup.chip (cyclomatic 20) apps/omlx-mac/Sources/AppView/Screens/ProfileViews.swift:181 — ProfileGroup.chip 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 · dashboard.dashboard.sortModels (cyclomatic 20) · ×1
  • dashboard.dashboard.sortModels (cyclomatic 20) REDACTED:8938 — dashboard.dashboard.sortModels has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 2 of the 20 points are its own statements and the rest belongs to one function literal inside it that branches (line 8941). 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 · dashboard.sortModels (cyclomatic 20) · ×1
  • dashboard.sortModels (cyclomatic 20) REDACTED:8938 — dashboard.sortModels has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 2 of the 20 points are its own statements and the rest belongs to one function literal inside it that branches (line 8941). 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 · benchmark._filter_uploaded_settings (cyclomatic 19) · ×1
  • benchmark._filter_uploaded_settings (cyclomatic 19) omlx/admin/benchmark.py:432 — benchmark._filter_uploaded_settings 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 · routes.clear_hot_cache (cyclomatic 19) · ×1
  • routes.clear_hot_cache (cyclomatic 19) omlx/admin/routes.py:7732 — routes.clear_hot_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 · _XmlFunctionBoundary.feed (cyclomatic 19) · ×1
  • _XmlFunctionBoundary.feed (cyclomatic 19) omlx/api/tool_calling.py:562 — _XmlFunctionBoundary.feed 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 · tool_calling._parse_xml_tool_calls (cyclomatic 19) · ×1
  • tool_calling._parse_xml_tool_calls (cyclomatic 19) omlx/api/tool_calling.py:944 — tool_calling._parse_xml_tool_calls 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 · tool_calling._parse_hermes_tool_calls (cyclomatic 19) · ×1
  • tool_calling._parse_hermes_tool_calls (cyclomatic 19) omlx/api/tool_calling.py:1180 — tool_calling._parse_hermes_tool_calls 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 · catalogue.assess_model (cyclomatic 19) · ×1
  • catalogue.assess_model (cyclomatic 19) omlx/cluster/catalogue.py:345 — catalogue.assess_model 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 · collective.run_local_pipeline_smoke (cyclomatic 19) · ×1
  • collective.run_local_pipeline_smoke (cyclomatic 19) omlx/cluster/collective.py:188 — collective.run_local_pipeline_smoke 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. This shape REPEATS in the file: one other method here (collective._run_local_minimax_decode_smoke) 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 · collective._run_local_minimax_decode_smoke (cyclomatic 19) · ×1
  • collective._run_local_minimax_decode_smoke (cyclomatic 19) omlx/cluster/collective.py:279 — collective._run_local_minimax_decode_smoke 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. This shape REPEATS in the file: one other method here (collective.run_local_pipeline_smoke) 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 · PeerWatchdog.run (cyclomatic 19) · ×1
  • PeerWatchdog.run (cyclomatic 19) omlx/cluster/liveness.py:511 — PeerWatchdog.run 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 · ModelLayout.__post_init__ (cyclomatic 19) · ×1
  • ModelLayout.__post_init__ (cyclomatic 19) omlx/cluster/planner.py:130 — ModelLayout.__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 · planner._tensor_parallel_divisors (cyclomatic 19) · ×1
  • planner._tensor_parallel_divisors (cyclomatic 19) omlx/cluster/planner.py:734 — planner._tensor_parallel_divisors 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 · DeviceRegistry.mark_paired (cyclomatic 19) · ×1
  • DeviceRegistry.mark_paired (cyclomatic 19) omlx/cluster/registry.py:485 — DeviceRegistry.mark_paired 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 · routes._resolve_fabric (cyclomatic 19) · ×1
  • routes._resolve_fabric (cyclomatic 19) omlx/cluster/routes.py:1059 — routes._resolve_fabric 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 · VLMBatchedEngine._encode_missing_vision_features (cyclomatic 19) · ×1
  • VLMBatchedEngine._encode_missing_vision_features (cyclomatic 19) omlx/engine/vlm.py:3615 — VLMBatchedEngine._encode_missing_vision_features 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 · base.chat_models (cyclomatic 19) · ×1
  • base.chat_models (cyclomatic 19) omlx/integrations/base.py:71 — base.chat_models 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 · d3.normalize_question (cyclomatic 19) · ×1
  • d3.normalize_question (cyclomatic 19) omlx/models/d3.py:112 — d3.normalize_question has cyclomatic complexity 19 (threshold 15). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D1 · Cyclomatic Complexity · OpenJevModel.encode (cyclomatic 19) · ×1
  • OpenJevModel.encode (cyclomatic 19) omlx/models/openjev.py:260 — OpenJevModel.encode 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 · oq._load_builtin_calibration (cyclomatic 19) · ×1
  • oq._load_builtin_calibration (cyclomatic 19) REDACTED:8241 — oq._load_builtin_calibration 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 · deepseek_v4_model._batch_indexer_rows (cyclomatic 19) · ×1
  • deepseek_v4_model._batch_indexer_rows (cyclomatic 19) omlx/patches/deepseek_v4/deepseek_v4_model.py:1549 — deepseek_v4_model._batch_indexer_rows has cyclomatic complexity 19 (threshold 15). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D1 · Cyclomatic Complexity · loader.sanitize_weights (cyclomatic 19) · ×1
  • loader.sanitize_weights (cyclomatic 19) omlx/patches/inkling2/loader.py:46 — loader.sanitize_weights 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 · ane_prefill.enable_ane_prefill (cyclomatic 19) · ×1
  • ane_prefill.enable_ane_prefill (cyclomatic 19) omlx/patches/k2_horizon/ane_prefill.py:277 — ane_prefill.enable_ane_prefill 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 · m5_gather_qmm_a8._supports_mx (cyclomatic 19) · ×1
  • m5_gather_qmm_a8._supports_mx (cyclomatic 19) omlx/patches/m5_gather_qmm_a8.py:1111 — m5_gather_qmm_a8._supports_mx 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 · batch_generator._call_backbone_impl (cyclomatic 19) · ×1
  • batch_generator._call_backbone_impl (cyclomatic 19) REDACTED:2222 — batch_generator._call_backbone_impl 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 · prompt_priming._capture_boundary_candidate (cyclomatic 19) · ×1
  • prompt_priming._capture_boundary_candidate (cyclomatic 19) REDACTED:742 — prompt_priming._capture_boundary_candidate 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 · decode_kernels.mla_head_qmv (cyclomatic 19) · ×1
  • decode_kernels.mla_head_qmv (cyclomatic 19) omlx/patches/mlx_vlm_glm5_next_compat/decode_kernels.py:3452 — decode_kernels.mla_head_qmv 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 · moe_expert_offload.apply_moe_expert_offload (cyclomatic 19) · ×1
  • moe_expert_offload.apply_moe_expert_offload (cyclomatic 19) omlx/patches/moe_expert_offload.py:1045 — moe_expert_offload.apply_moe_expert_offload 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 · Scheduler._infer_live_layer_cache_types (cyclomatic 19) · ×1
  • Scheduler._infer_live_layer_cache_types (cyclomatic 19) omlx/scheduler.py:16792 — Scheduler._infer_live_layer_cache_types 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 · draft.run_specprefill_draft_scoring (cyclomatic 19) · ×1
  • draft.run_specprefill_draft_scoring (cyclomatic 19) omlx/specprefill/draft.py:92 — draft.run_specprefill_draft_scoring 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 · BatchTurboQuantKVCache.merge (cyclomatic 19) · ×1
  • BatchTurboQuantKVCache.merge (cyclomatic 19) omlx/turboquant_kv.py:585 — BatchTurboQuantKVCache.merge 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 · PrefillAcceleratorGroup.statusText (cyclomatic 19) · ×1
  • PrefillAcceleratorGroup.statusText (cyclomatic 19) apps/omlx-mac/Sources/AppView/Screens/ModelSettingsScreen.swift:1617 — PrefillAcceleratorGroup.statusText 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 · custom_theme.defaults (cyclomatic 19) · ×1
  • custom_theme.defaults (cyclomatic 19) apps/omlx-web/omlx_web/static/js/custom_theme.js:299 — custom_theme.defaults 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 · dashboard.sortedManagerModels (cyclomatic 19) · ×1
  • dashboard.sortedManagerModels (cyclomatic 19) REDACTED:7369 — dashboard.sortedManagerModels 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 one function literal inside it that branches (line 7371). 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 · minimax_m3_vl.read_config (cyclomatic 18) · ×1
  • minimax_m3_vl.read_config (cyclomatic 18) apps/omlx-cuda-helper/omlx_cuda_helper/families/minimax_m3_vl/__init__.py:93 — minimax_m3_vl.read_config 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 · Gemma4OutputParserSession._consume_text (cyclomatic 18) · ×1
  • Gemma4OutputParserSession._consume_text (cyclomatic 18) omlx/adapter/gemma4.py:373 — Gemma4OutputParserSession._consume_text 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 · ToolCallStreamFilter.__init__ (cyclomatic 18) · ×1
  • ToolCallStreamFilter.__init__ (cyclomatic 18) omlx/api/tool_calling.py:2647 — ToolCallStreamFilter.__init__ 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 · PagedSSDCacheManager._scan_existing_files (cyclomatic 18) · ×1
  • PagedSSDCacheManager._scan_existing_files (cyclomatic 18) omlx/cache/paged_ssd_cache.py:2460 — PagedSSDCacheManager._scan_existing_files 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 · PagedSSDCacheManager.preload_matched_blocks (cyclomatic 18) · ×1
  • PagedSSDCacheManager.preload_matched_blocks (cyclomatic 18) omlx/cache/paged_ssd_cache.py:4636 — PagedSSDCacheManager.preload_matched_blocks 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 · BlockAwarePrefixCache._drop_superseded_arrays_snapshots (cyclomatic 18) · ×1
  • BlockAwarePrefixCache._drop_superseded_arrays_snapshots (cyclomatic 18) omlx/cache/prefix_cache.py:4915 — BlockAwarePrefixCache._drop_superseded_arrays_snapshots 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 · autoconfigure.preflight_issues (cyclomatic 18) · ×1
  • autoconfigure.preflight_issues (cyclomatic 18) omlx/cluster/autoconfigure.py:657 — autoconfigure.preflight_issues 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 · launch.probe_remote_admission_ceiling (cyclomatic 18) · ×1
  • launch.probe_remote_admission_ceiling (cyclomatic 18) omlx/cluster/launch.py:2097 — launch.probe_remote_admission_ceiling 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 · PairingManager.unpair (cyclomatic 18) · ×1
  • PairingManager.unpair (cyclomatic 18) REDACTED:1655 — PairingManager.unpair 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 · prefill_guard.rank_monitor (cyclomatic 18) · ×1
  • prefill_guard.rank_monitor (cyclomatic 18) omlx/cluster/prefill_guard.py:37 — prefill_guard.rank_monitor 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 · tensor_strategies.native_shard_is_layer_local (cyclomatic 18) · ×1
  • tensor_strategies.native_shard_is_layer_local (cyclomatic 18) omlx/cluster/tensor_strategies.py:186 — tensor_strategies.native_shard_is_layer_local 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 · vlm._gemma4_global_kv_from_per_layer_config (cyclomatic 18) · ×1
  • vlm._gemma4_global_kv_from_per_layer_config (cyclomatic 18) omlx/engine/vlm.py:784 — vlm._gemma4_global_kv_from_per_layer_config 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 · ClaudeCodeIntegration.launch (cyclomatic 18) · ×1
  • ClaudeCodeIntegration.launch (cyclomatic 18) omlx/integrations/claude.py:86 — ClaudeCodeIntegration.launch 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 · ModelSettingsManager.update_profile (cyclomatic 18) · ×1
  • ModelSettingsManager.update_profile (cyclomatic 18) omlx/model_settings.py:1538 — ModelSettingsManager.update_profile 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 · _LazyTensorIndex._classify_pair (cyclomatic 18) · ×1
  • _LazyTensorIndex._classify_pair (cyclomatic 18) REDACTED:5692 — _LazyTensorIndex._classify_pair 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 · oq._source_imatrix_signature (cyclomatic 18) · ×1
  • oq._source_imatrix_signature (cyclomatic 18) REDACTED:6203 — oq._source_imatrix_signature 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 · oq._find_model_layers (cyclomatic 18) · ×1
  • oq._find_model_layers (cyclomatic 18) REDACTED:8410 — oq._find_model_layers 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 · m5_gather_qmm.fused_gate_up_activation (cyclomatic 18) · ×1
  • m5_gather_qmm.fused_gate_up_activation (cyclomatic 18) omlx/patches/m5_gather_qmm.py:253 — m5_gather_qmm.fused_gate_up_activation 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 · m5_gather_qmm_nax.sorted_gather_qmm_swiglu_oai (cyclomatic 18) · ×1
  • m5_gather_qmm_nax.sorted_gather_qmm_swiglu_oai (cyclomatic 18) omlx/patches/m5_gather_qmm_nax.py:1958 — m5_gather_qmm_nax.sorted_gather_qmm_swiglu_oai 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 · decode_fast.run_layers (cyclomatic 18) · ×1
  • decode_fast.run_layers (cyclomatic 18) omlx/patches/mimo_v2/decode_fast.py:974 — decode_fast.run_layers 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 · batch_generator._run_verify_cycle_legacy (cyclomatic 18) · ×1
  • batch_generator._run_verify_cycle_legacy (cyclomatic 18) REDACTED:4942 — batch_generator._run_verify_cycle_legacy 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 · qwen35_verify_attention.verify_attention (cyclomatic 18) · ×1
  • qwen35_verify_attention.verify_attention (cyclomatic 18) omlx/patches/mlx_vlm_mtp/qwen35_verify_attention.py:178 — qwen35_verify_attention.verify_attention 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 · moe_expert_offload._resolve_store_view (cyclomatic 18) · ×1
  • moe_expert_offload._resolve_store_view (cyclomatic 18) omlx/patches/moe_expert_offload.py:979 — moe_expert_offload._resolve_store_view 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 · qwen35_verify_sdpa_split._vector_plan (cyclomatic 18) · ×1
  • qwen35_verify_sdpa_split._vector_plan (cyclomatic 18) omlx/patches/qwen35_verify_sdpa_split.py:103 — qwen35_verify_sdpa_split._vector_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 · agent._fastest_link (cyclomatic 18) · ×1
  • agent._fastest_link (cyclomatic 18) REDACTED:183 — agent._fastest_link 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 · Scheduler._drain_pending_async_removes (cyclomatic 18) · ×1
  • Scheduler._drain_pending_async_removes (cyclomatic 18) omlx/scheduler.py:3093 — Scheduler._drain_pending_async_removes 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 · Scheduler._detect_qwen35_prefill_floor (cyclomatic 18) · ×1
  • Scheduler._detect_qwen35_prefill_floor (cyclomatic 18) omlx/scheduler.py:3380 — Scheduler._detect_qwen35_prefill_floor 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 · AppServices.applyStorageChanges (cyclomatic 18) · ×1
  • AppServices.applyStorageChanges (cyclomatic 18) apps/omlx-mac/Sources/AppView/AppServices.swift:195 — AppServices.applyStorageChanges 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 · ModelSettingsScreenVM.load (cyclomatic 18) · ×1
  • ModelSettingsScreenVM.load (cyclomatic 18) apps/omlx-mac/Sources/AppView/ViewModels/ModelSettingsScreenVM.swift:704 — ModelSettingsScreenVM.load 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 is NOT this file's highest cyclomatic complexity: ModelSettingsScreenVM.isDiffusionUnsupportedField (cyclomatic 27) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · ServerScreenVM.restart (cyclomatic 18) · ×1
  • ServerScreenVM.restart (cyclomatic 18) apps/omlx-mac/Sources/AppView/ViewModels/ServerScreenVM.swift:644 — ServerScreenVM.restart 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 · dashboard.dashboard.saveModelSettings (cyclomatic 18) · ×1
  • dashboard.dashboard.saveModelSettings (cyclomatic 18) REDACTED:3776 — dashboard.dashboard.saveModelSettings 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 is NOT this file's highest cyclomatic complexity: dashboard.dashboard.connectBenchSSE (cyclomatic 20) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · dashboard.pollANETuning (cyclomatic 18) · ×1
  • dashboard.pollANETuning (cyclomatic 18) REDACTED:2908 — dashboard.pollANETuning 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 · dashboard.saveModelSettings (cyclomatic 18) · ×1
  • dashboard.saveModelSettings (cyclomatic 18) REDACTED:3776 — dashboard.saveModelSettings 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 · HarmonyStreamingParser.process_token (cyclomatic 17) · ×1
  • HarmonyStreamingParser.process_token (cyclomatic 17) omlx/adapter/harmony.py:274 — HarmonyStreamingParser.process_token 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 · InklingOutputParserSession.finalize (cyclomatic 17) · ×1
  • InklingOutputParserSession.finalize (cyclomatic 17) omlx/adapter/output_parser.py:1077 — InklingOutputParserSession.finalize 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 · ExternalAPIClient.chat_completion (cyclomatic 17) · ×1
  • ExternalAPIClient.chat_completion (cyclomatic 17) omlx/admin/external_api.py:287 — ExternalAPIClient.chat_completion 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 · hf_uploader._generate_model_card (cyclomatic 17) · ×1
  • hf_uploader._generate_model_card (cyclomatic 17) omlx/admin/hf_uploader.py:226 — hf_uploader._generate_model_card 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 · model_recommender.build_sections (cyclomatic 17) · ×1
  • model_recommender.build_sections (cyclomatic 17) omlx/admin/model_recommender.py:368 — model_recommender.build_sections 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 · routes._mtp_compat_for_model (cyclomatic 17) · ×1
  • routes._mtp_compat_for_model (cyclomatic 17) omlx/admin/routes.py:1230 — routes._mtp_compat_for_model 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 · routes._validate_model_settings (cyclomatic 17) · ×1
  • routes._validate_model_settings (cyclomatic 17) omlx/admin/routes.py:3802 — routes._validate_model_settings 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 · routes._vlm_mtp_recipe_problem (cyclomatic 17) · ×1
  • routes._vlm_mtp_recipe_problem (cyclomatic 17) omlx/admin/routes.py:4096 — routes._vlm_mtp_recipe_problem 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 · embedding_utils._item_from_content_parts (cyclomatic 17) · ×1
  • embedding_utils._item_from_content_parts (cyclomatic 17) omlx/api/embedding_utils.py:195 — embedding_utils._item_from_content_parts 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 · ToolCallStreamFilter._could_be_partial_attr_function_open (cyclomatic 17) · ×1
  • ToolCallStreamFilter._could_be_partial_attr_function_open (cyclomatic 17) omlx/api/tool_calling.py:3282 — ToolCallStreamFilter._could_be_partial_attr_function_open 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_calling._merge_json_fragments (cyclomatic 17) · ×1
  • tool_calling._merge_json_fragments (cyclomatic 17) omlx/api/tool_calling.py:227 — tool_calling._merge_json_fragments 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 · PagedSSDCacheManager.commit_gdn_checkpoint_file (cyclomatic 17) · ×1
  • PagedSSDCacheManager.commit_gdn_checkpoint_file (cyclomatic 17) omlx/cache/paged_ssd_cache.py:2620 — PagedSSDCacheManager.commit_gdn_checkpoint_file 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 · BlockAwarePrefixCache._block_token_count_matches_slices (cyclomatic 17) · ×1
  • BlockAwarePrefixCache._block_token_count_matches_slices (cyclomatic 17) omlx/cache/prefix_cache.py:1960 — BlockAwarePrefixCache._block_token_count_matches_slices 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 · BlockAwarePrefixCache._strip_rotating_payload (cyclomatic 17) · ×1
  • BlockAwarePrefixCache._strip_rotating_payload (cyclomatic 17) omlx/cache/prefix_cache.py:2197 — BlockAwarePrefixCache._strip_rotating_payload 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 · cli.diagnose_menubar (cyclomatic 17) · ×1
  • cli.diagnose_menubar (cyclomatic 17) REDACTED:854 — cli.diagnose_menubar 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 · RankControlPlane.broadcast_owned_bytes (cyclomatic 17) · ×1
  • RankControlPlane.broadcast_owned_bytes (cyclomatic 17) REDACTED:436 — RankControlPlane.broadcast_owned_bytes 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 · inference_worker.main (cyclomatic 17) · ×1
  • inference_worker.main (cyclomatic 17) omlx/cluster/inference_worker.py:1916 — inference_worker.main 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 · DistributedJobSupervisor._drain (cyclomatic 17) · ×1
  • DistributedJobSupervisor._drain (cyclomatic 17) omlx/cluster/launch.py:2902 — DistributedJobSupervisor._drain 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 · launch.run_cluster_performance_probe (cyclomatic 17) · ×1
  • launch.run_cluster_performance_probe (cyclomatic 17) omlx/cluster/launch.py:1424 — launch.run_cluster_performance_probe 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 · ModelSyncManager.resolve_local_model_path (cyclomatic 17) · ×1
  • ModelSyncManager.resolve_local_model_path (cyclomatic 17) REDACTED:415 — ModelSyncManager.resolve_local_model_path 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 · RuntimeTelemetry._sample_snapshot (cyclomatic 17) · ×1
  • RuntimeTelemetry._sample_snapshot (cyclomatic 17) omlx/cluster/telemetry.py:888 — RuntimeTelemetry._sample_snapshot 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 · splash._check_model (cyclomatic 17) · ×1
  • splash._check_model (cyclomatic 17) REDACTED:594 — splash._check_model 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 · VLMBatchedEngine.stream_generate (cyclomatic 17) · ×1
  • VLMBatchedEngine.stream_generate (cyclomatic 17) omlx/engine/vlm.py:5014 — VLMBatchedEngine.stream_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 · VLMBatchedEngine._diffusion_apply_chat_template (cyclomatic 17) · ×1
  • VLMBatchedEngine._diffusion_apply_chat_template (cyclomatic 17) omlx/engine/vlm.py:5758 — VLMBatchedEngine._diffusion_apply_chat_template 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 · EnginePool.moe_offload_fit (cyclomatic 17) · ×1
  • EnginePool.moe_offload_fit (cyclomatic 17) omlx/engine_pool.py:781 — EnginePool.moe_offload_fit 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 · Integration.select_model (cyclomatic 17) · ×1
  • Integration.select_model (cyclomatic 17) omlx/integrations/base.py:173 — Integration.select_model 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 · claude_desktop.restore (cyclomatic 17) · ×1
  • claude_desktop.restore (cyclomatic 17) omlx/integrations/claude_desktop.py:226 — claude_desktop.restore 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 · _TrackedTensor.__getitem__ (cyclomatic 17) · ×1
  • _TrackedTensor.__getitem__ (cyclomatic 17) REDACTED:2982 — _TrackedTensor.__getitem__ 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 · oq._normalize_sensitivity_map_override (cyclomatic 17) · ×1
  • oq._normalize_sensitivity_map_override (cyclomatic 17) REDACTED:515 — oq._normalize_sensitivity_map_override 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 · oq._oqe_calibration_batch_plan (cyclomatic 17) · ×1
  • oq._oqe_calibration_batch_plan (cyclomatic 17) REDACTED:4514 — oq._oqe_calibration_batch_plan 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 · oq._prepare_gemma4_layer_inputs (cyclomatic 17) · ×1
  • oq._prepare_gemma4_layer_inputs (cyclomatic 17) REDACTED:8510 — oq._prepare_gemma4_layer_inputs 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 · BatchPoolingCache.extend (cyclomatic 17) · ×1
  • BatchPoolingCache.extend (cyclomatic 17) omlx/patches/deepseek_v4/cache_extras.py:1017 — BatchPoolingCache.extend 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 · chat_template_v4.relocate_mid_system_messages (cyclomatic 17) · ×1
  • chat_template_v4.relocate_mid_system_messages (cyclomatic 17) omlx/patches/deepseek_v4/chat_template_v4.py:776 — chat_template_v4.relocate_mid_system_messages has cyclomatic complexity 17 (threshold 15). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D1 · Cyclomatic Complexity · MiMoV2Model.__call__ (cyclomatic 17) · ×1
  • MiMoV2Model.__call__ (cyclomatic 17) omlx/patches/mimo_v2/mimo_v2_model.py:425 — MiMoV2Model.__call__ has cyclomatic complexity 17 (threshold 15). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D1 · Cyclomatic Complexity · pipeline_patch._pipelined_call (cyclomatic 17) · ×1
  • pipeline_patch._pipelined_call (cyclomatic 17) omlx/patches/minimax_m3_mlx_lm/pipeline_patch.py:154 — pipeline_patch._pipelined_call 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 · mlx_audio_ming3._onnx_float_initializers (cyclomatic 17) · ×1
  • mlx_audio_ming3._onnx_float_initializers (cyclomatic 17) omlx/patches/mlx_audio_ming3.py:469 — mlx_audio_ming3._onnx_float_initializers 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 · inkling_vlm_runtime._inkling_prime_capture (cyclomatic 17) · ×1
  • inkling_vlm_runtime._inkling_prime_capture (cyclomatic 17) omlx/patches/mlx_vlm_mtp/inkling_vlm_runtime.py:813 — inkling_vlm_runtime._inkling_prime_capture 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 · qwen35_ane_prefill._prepare_gdn_for_bank (cyclomatic 17) · ×1
  • qwen35_ane_prefill._prepare_gdn_for_bank (cyclomatic 17) omlx/patches/qwen35_ane_prefill.py:1367 — qwen35_ane_prefill._prepare_gdn_for_bank 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 · qwen35_oq_a8._classify_uncached (cyclomatic 17) · ×1
  • qwen35_oq_a8._classify_uncached (cyclomatic 17) omlx/patches/qwen35_oq_a8.py:166 — qwen35_oq_a8._classify_uncached 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 · specprefill.sparse_prefill (cyclomatic 17) · ×1
  • specprefill.sparse_prefill (cyclomatic 17) omlx/patches/specprefill.py:975 — specprefill.sparse_prefill 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 · turboquant_attention._fused_multirow_mse_attention (cyclomatic 17) · ×1
  • turboquant_attention._fused_multirow_mse_attention (cyclomatic 17) omlx/patches/turboquant_attention.py:200 — turboquant_attention._fused_multirow_mse_attention 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 · launcher.resolve_target (cyclomatic 17) · ×1
  • launcher.resolve_target (cyclomatic 17) omlx/prefill_helper/launcher.py:107 — launcher.resolve_target 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 · routes._check (cyclomatic 17) · ×1
  • routes._check (cyclomatic 17) omlx/prefill_helper/routes.py:156 — routes._check 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 · ProcessMemoryEnforcer._shrink_hot_cache_by (cyclomatic 17) · ×1
  • ProcessMemoryEnforcer._shrink_hot_cache_by (cyclomatic 17) omlx/process_memory_enforcer.py:1282 — ProcessMemoryEnforcer._shrink_hot_cache_by 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 · Scheduler._collect_arrays_from_extracted_cache (cyclomatic 17) · ×1
  • Scheduler._collect_arrays_from_extracted_cache (cyclomatic 17) omlx/scheduler.py:2874 — Scheduler._collect_arrays_from_extracted_cache 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 · Scheduler._adaptive_chunk_size (cyclomatic 17) · ×1
  • Scheduler._adaptive_chunk_size (cyclomatic 17) omlx/scheduler.py:5462 — Scheduler._adaptive_chunk_size 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 · model_loading._add_glm5_next_nextn_quant_keys (cyclomatic 17) · ×1
  • model_loading._add_glm5_next_nextn_quant_keys (cyclomatic 17) omlx/utils/model_loading.py:128 — model_loading._add_glm5_next_nextn_quant_keys 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 · nax_attention.nax_mixed_head_dim_attention (cyclomatic 17) · ×1
  • nax_attention.nax_mixed_head_dim_attention (cyclomatic 17) omlx/utils/nax_attention.py:970 — nax_attention.nax_mixed_head_dim_attention has cyclomatic complexity 17 (threshold 15). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D1 · Cyclomatic Complexity · ThroughputBenchScreenVM.pollResults (cyclomatic 17) · ×1
  • ThroughputBenchScreenVM.pollResults (cyclomatic 17) apps/omlx-mac/Sources/AppView/ViewModels/ThroughputBenchScreenVM.swift:290 — ThroughputBenchScreenVM.pollResults 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 · TalkAIPanelView.body (cyclomatic 17) · ×1
  • TalkAIPanelView.body (cyclomatic 17) apps/omlx-mac/Sources/AskAI/TalkAIPanel.swift:152 — TalkAIPanelView.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 · AppConfig.load (cyclomatic 17) · ×1
  • AppConfig.load (cyclomatic 17) apps/omlx-mac/Sources/Config/AppConfig.swift:287 — AppConfig.load 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 · UpdateController.startDownload (cyclomatic 17) · ×1
  • UpdateController.startDownload (cyclomatic 17) apps/omlx-mac/Sources/Updater/UpdateController.swift:385 — UpdateController.startDownload 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 · dashboard.dashboard.pollANETuning (cyclomatic 17) · ×1
  • dashboard.dashboard.pollANETuning (cyclomatic 17) REDACTED:2908 — dashboard.dashboard.pollANETuning 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 is NOT this file's highest cyclomatic complexity: dashboard.dashboard.connectBenchSSE (cyclomatic 20) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · dashboard.dashboard.cacheObsCumulative (cyclomatic 17) · ×1
  • dashboard.dashboard.cacheObsCumulative (cyclomatic 17) REDACTED:5082 — dashboard.dashboard.cacheObsCumulative 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 is NOT this file's highest cyclomatic complexity: dashboard.dashboard.connectBenchSSE (cyclomatic 20) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · dashboard.dashboard.addToAccQueue (cyclomatic 17) · ×1
  • dashboard.dashboard.addToAccQueue (cyclomatic 17) REDACTED:6234 — dashboard.dashboard.addToAccQueue 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. This is NOT this file's highest cyclomatic complexity: dashboard.dashboard.connectBenchSSE (cyclomatic 20) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · dashboard.applyPresetToForm (cyclomatic 17) · ×1
  • dashboard.applyPresetToForm (cyclomatic 17) REDACTED:2433 — dashboard.applyPresetToForm 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 · dashboard.startANETuning (cyclomatic 17) · ×1
  • dashboard.startANETuning (cyclomatic 17) REDACTED:2850 — dashboard.startANETuning 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 · dashboard.cacheObsCumulative (cyclomatic 17) · ×1
  • dashboard.cacheObsCumulative (cyclomatic 17) REDACTED:5082 — dashboard.cacheObsCumulative 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 · dashboard.connectBenchSSE · ×1
  • dashboard.connectBenchSSE::onmessage (cyclomatic 17) REDACTED:5487 — dashboard.connectBenchSSE::onmessage 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 · dashboard.addToAccQueue (cyclomatic 17) · ×1
  • dashboard.addToAccQueue (cyclomatic 17) REDACTED:6234 — dashboard.addToAccQueue 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 · ControlServer._handle (cyclomatic 16) · ×1
  • ControlServer._handle (cyclomatic 16) apps/omlx-cuda-helper/omlx_cuda_helper/control.py:136 — ControlServer._handle 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 · ModelStore.probe (cyclomatic 16) · ×1
  • ModelStore.probe (cyclomatic 16) apps/omlx-cuda-helper/omlx_cuda_helper/files.py:38 — ModelStore.probe 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 · MSDownloader._poll_progress (cyclomatic 16) · ×1
  • MSDownloader._poll_progress (cyclomatic 16) omlx/admin/ms_downloader.py:1066 — MSDownloader._poll_progress 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 · ms_downloader._enrich_ms_entry (cyclomatic 16) · ×1
  • ms_downloader._enrich_ms_entry (cyclomatic 16) omlx/admin/ms_downloader.py:262 — ms_downloader._enrich_ms_entry 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 · routes._apply_model_dirs_runtime (cyclomatic 16) · ×1
  • routes._apply_model_dirs_runtime (cyclomatic 16) omlx/admin/routes.py:1370 — routes._apply_model_dirs_runtime 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 · audio_routes._parse_session_update (cyclomatic 16) · ×1
  • audio_routes._parse_session_update (cyclomatic 16) omlx/api/audio_routes.py:900 — audio_routes._parse_session_update 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 · decisions.decisions_request (cyclomatic 16) · ×1
  • decisions.decisions_request (cyclomatic 16) omlx/api/decisions.py:465 — decisions.decisions_request 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 · markitdown.stream_messages_to_markdown_async (cyclomatic 16) · ×1
  • markitdown.stream_messages_to_markdown_async (cyclomatic 16) omlx/api/markitdown.py:200 — markitdown.stream_messages_to_markdown_async has cyclomatic complexity 16 (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 · responses_utils.convert_responses_tools (cyclomatic 16) · ×1
  • responses_utils.convert_responses_tools (cyclomatic 16) omlx/api/responses_utils.py:434 — responses_utils.convert_responses_tools 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 · ToolCallStreamFilter._unwind_withheld_at_eof (cyclomatic 16) · ×1
  • ToolCallStreamFilter._unwind_withheld_at_eof (cyclomatic 16) omlx/api/tool_calling.py:3486 — ToolCallStreamFilter._unwind_withheld_at_eof 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 · PagedSSDCacheManager.close (cyclomatic 16) · ×1
  • PagedSSDCacheManager.close (cyclomatic 16) omlx/cache/paged_ssd_cache.py:5546 — PagedSSDCacheManager.close 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 · paged_ssd_cache.cachelist_subtypes_from_cache_list (cyclomatic 16) · ×1
  • paged_ssd_cache.cachelist_subtypes_from_cache_list (cyclomatic 16) omlx/cache/paged_ssd_cache.py:670 — paged_ssd_cache.cachelist_subtypes_from_cache_list 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 · autoconfigure.order_hosts_for_topology (cyclomatic 16) · ×1
  • autoconfigure.order_hosts_for_topology (cyclomatic 16) omlx/cluster/autoconfigure.py:492 — autoconfigure.order_hosts_for_topology 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 · inference_worker._think_token_ids (cyclomatic 16) · ×1
  • inference_worker._think_token_ids (cyclomatic 16) omlx/cluster/inference_worker.py:261 — inference_worker._think_token_ids 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 · ExecutionSettings.__post_init__ (cyclomatic 16) · ×1
  • ExecutionSettings.__post_init__ (cyclomatic 16) omlx/cluster/performance.py:187 — ExecutionSettings.__post_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 · SSDPromptSnapshotStore._load_manifest_or_reset (cyclomatic 16) · ×1
  • SSDPromptSnapshotStore._load_manifest_or_reset (cyclomatic 16) omlx/cluster/prompt_snapshot_cache.py:552 — SSDPromptSnapshotStore._load_manifest_or_reset 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 · DeviceRegistry._validate_paired (cyclomatic 16) · ×1
  • DeviceRegistry._validate_paired (cyclomatic 16) omlx/cluster/registry.py:268 — DeviceRegistry._validate_paired 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 · DeviceRegistry.merge (cyclomatic 16) · ×1
  • DeviceRegistry.merge (cyclomatic 16) omlx/cluster/registry.py:379 — DeviceRegistry.merge 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 · routes._reconcile_runtime_ownership (cyclomatic 16) · ×1
  • routes._reconcile_runtime_ownership (cyclomatic 16) omlx/cluster/routes.py:2022 — routes._reconcile_runtime_ownership 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 · telemetry.install_server_telemetry (cyclomatic 16) · ×1
  • telemetry.install_server_telemetry (cyclomatic 16) omlx/cluster/telemetry.py:1113 — telemetry.install_server_telemetry 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 · BatchedEngine._apply_chat_template (cyclomatic 16) · ×1
  • BatchedEngine._apply_chat_template (cyclomatic 16) REDACTED:936 — BatchedEngine._apply_chat_template 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 · RealtimeVoiceSession.update (cyclomatic 16) · ×1
  • RealtimeVoiceSession.update (cyclomatic 16) omlx/engine/realtime_voice.py:200 — RealtimeVoiceSession.update 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 · vlm._count_image_tokens_real (cyclomatic 16) · ×1
  • vlm._count_image_tokens_real (cyclomatic 16) omlx/engine/vlm.py:1575 — vlm._count_image_tokens_real 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 · EnginePool.register_cluster_model (cyclomatic 16) · ×1
  • EnginePool.register_cluster_model (cyclomatic 16) omlx/engine_pool.py:1801 — EnginePool.register_cluster_model 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 · copilot.copilot_provider_config (cyclomatic 16) · ×1
  • copilot.copilot_provider_config (cyclomatic 16) omlx/integrations/copilot.py:50 — copilot.copilot_provider_config 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 · MemoryMonitor.set_model_info (cyclomatic 16) · ×1
  • MemoryMonitor.set_model_info (cyclomatic 16) REDACTED:485 — MemoryMonitor.set_model_info 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 · _DeepSeekV4PrefillMemoryProfile.estimate_prefill_transient_bytes (cyclomatic 16) · ×1
  • _DeepSeekV4PrefillMemoryProfile.estimate_prefill_transient_bytes (cyclomatic 16) REDACTED:1238 — _DeepSeekV4PrefillMemoryProfile.estimate_prefill_transient_bytes 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 · oq._measure_sensitivity_from_model (cyclomatic 16) · ×1
  • oq._measure_sensitivity_from_model (cyclomatic 16) REDACTED:11404 — oq._measure_sensitivity_from_model 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 · deepseek_v32._use_load_fused_wk_weights_proj (cyclomatic 16) · ×1
  • deepseek_v32._use_load_fused_wk_weights_proj (cyclomatic 16) omlx/patches/glm_moe_dsa/deepseek_v32.py:28 — deepseek_v32._use_load_fused_wk_weights_proj has cyclomatic complexity 16 (threshold 15). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D1 · Cyclomatic Complexity · moe_offload.resolve_view (cyclomatic 16) · ×1
  • moe_offload.resolve_view (cyclomatic 16) omlx/patches/glm_moe_dsa/moe_offload.py:98 — moe_offload.resolve_view 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 · batch_generator._record_std_tax_sample (cyclomatic 16) · ×1
  • batch_generator._record_std_tax_sample (cyclomatic 16) REDACTED:2560 — batch_generator._record_std_tax_sample 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 · prompt_priming._take_primed (cyclomatic 16) · ×1
  • prompt_priming._take_primed (cyclomatic 16) REDACTED:1238 — prompt_priming._take_primed 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 · decode_kernels.multi_qmv (cyclomatic 16) · ×1
  • decode_kernels.multi_qmv (cyclomatic 16) omlx/patches/mlx_vlm_glm5_next_compat/decode_kernels.py:3577 — decode_kernels.multi_qmv 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 · moe_gate_up_fusion.can_fuse (cyclomatic 16) · ×1
  • moe_gate_up_fusion.can_fuse (cyclomatic 16) omlx/patches/moe_gate_up_fusion.py:74 — moe_gate_up_fusion.can_fuse 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 · ModelArgs.__post_init__ (cyclomatic 16) · ×1
  • ModelArgs.__post_init__ (cyclomatic 16) omlx/patches/raon1_mini/raon1_mini_model.py:860 — ModelArgs.__post_init__ has cyclomatic complexity 16 (threshold 15). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D1 · Cyclomatic Complexity · HelperServer._run_chunks (cyclomatic 16) · ×1
  • HelperServer._run_chunks (cyclomatic 16) omlx/prefill_helper/worker.py:228 — HelperServer._run_chunks 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 · ProcessMemoryEnforcer._propagate_memory_limit (cyclomatic 16) · ×1
  • ProcessMemoryEnforcer._propagate_memory_limit (cyclomatic 16) omlx/process_memory_enforcer.py:1460 — ProcessMemoryEnforcer._propagate_memory_limit 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 · Scheduler._insert_prefilled_request (cyclomatic 16) · ×1
  • Scheduler._insert_prefilled_request (cyclomatic 16) omlx/scheduler.py:7621 — Scheduler._insert_prefilled_request 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 · Scheduler._step_vlm_mtp (cyclomatic 16) · ×1
  • Scheduler._step_vlm_mtp (cyclomatic 16) omlx/scheduler.py:11909 — Scheduler._step_vlm_mtp 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 · Scheduler._reschedule_generation_overflow_requests (cyclomatic 16) · ×1
  • Scheduler._reschedule_generation_overflow_requests (cyclomatic 16) omlx/scheduler.py:15352 — Scheduler._reschedule_generation_overflow_requests 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 · Scheduler._process_pending_memory_requeue (cyclomatic 16) · ×1
  • Scheduler._process_pending_memory_requeue (cyclomatic 16) omlx/scheduler.py:15580 — Scheduler._process_pending_memory_requeue 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 · Scheduler.shutdown (cyclomatic 16) · ×1
  • Scheduler.shutdown (cyclomatic 16) omlx/scheduler.py:16370 — Scheduler.shutdown 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 · server._with_prompt_progress (cyclomatic 16) · ×1
  • server._with_prompt_progress (cyclomatic 16) REDACTED:2971 — server._with_prompt_progress 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 · server._build_format_element (cyclomatic 16) · ×1
  • server._build_format_element (cyclomatic 16) REDACTED:5668 — server._build_format_element 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 · server._render_chat_prompt_for_thinking_detection (cyclomatic 16) · ×1
  • server._render_chat_prompt_for_thinking_detection (cyclomatic 16) REDACTED:6307 — server._render_chat_prompt_for_thinking_detection 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 · ModelCardSheet.metadataRow (cyclomatic 16) · ×1
  • ModelCardSheet.metadataRow (cyclomatic 16) apps/omlx-mac/Sources/AppView/Screens/ModelCardSheet.swift:251 — ModelCardSheet.metadataRow 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 · PerformanceScreenVM.hasPendingChanges (cyclomatic 16) · ×1
  • PerformanceScreenVM.hasPendingChanges (cyclomatic 16) apps/omlx-mac/Sources/AppView/ViewModels/PerformanceScreenVM.swift:61 — PerformanceScreenVM.hasPendingChanges 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 · TurnView.body (cyclomatic 16) · ×1
  • TurnView.body (cyclomatic 16) apps/omlx-mac/Sources/AskAI/AskAIPanelView.swift:373 — TurnView.body 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 · AppUpdater.run (cyclomatic 16) · ×1
  • AppUpdater.run (cyclomatic 16) apps/omlx-mac/Sources/Updater/AppUpdater.swift:158 — AppUpdater.run 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 · cluster_v2.clusterV2Wizard.configuredDeployment (cyclomatic 16) · ×1
  • cluster_v2.clusterV2Wizard.configuredDeployment (cyclomatic 16) apps/omlx-web/omlx_web/static/js/cluster_v2.js:579 — cluster_v2.clusterV2Wizard.configuredDeployment has cyclomatic complexity 16 (threshold 15). Of this number, 12 points are the body's own statements and 4 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 · cluster_v2.clusterV2Wizard.deploymentRuntimeState (cyclomatic 16) · ×1
  • cluster_v2.clusterV2Wizard.deploymentRuntimeState (cyclomatic 16) apps/omlx-web/omlx_web/static/js/cluster_v2.js:889 — cluster_v2.clusterV2Wizard.deploymentRuntimeState has cyclomatic complexity 16 (threshold 15). 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, 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 · dashboard.dashboard.applyPresetToForm (cyclomatic 16) · ×1
  • dashboard.dashboard.applyPresetToForm (cyclomatic 16) REDACTED:2433 — dashboard.dashboard.applyPresetToForm 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. This is NOT this file's highest cyclomatic complexity: dashboard.dashboard.connectBenchSSE (cyclomatic 20) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · dashboard.dashboard.startANETuning (cyclomatic 16) · ×1
  • dashboard.dashboard.startANETuning (cyclomatic 16) REDACTED:2850 — dashboard.dashboard.startANETuning 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. This is NOT this file's highest cyclomatic complexity: dashboard.dashboard.connectBenchSSE (cyclomatic 20) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · clusterV2Wizard.configuredDeployment (cyclomatic 16) · ×1
  • clusterV2Wizard.configuredDeployment (cyclomatic 16) apps/omlx-web/omlx_web/static/js/cluster_v2.js:579 — clusterV2Wizard.configuredDeployment has cyclomatic complexity 16 (threshold 15). Of this number, 10 points are the body's own statements and 6 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 · clusterV2Wizard.deploymentRuntimeState (cyclomatic 16) · ×1
  • clusterV2Wizard.deploymentRuntimeState (cyclomatic 16) apps/omlx-web/omlx_web/static/js/cluster_v2.js:889 — clusterV2Wizard.deploymentRuntimeState has cyclomatic complexity 16 (threshold 15). Of this number, 12 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 · dashboard.createProfile (cyclomatic 16) · ×1
  • dashboard.createProfile (cyclomatic 16) REDACTED:2496 — dashboard.createProfile 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 · dashboard.applyProfileToForm (cyclomatic 16) · ×1
  • dashboard.applyProfileToForm (cyclomatic 16) REDACTED:2546 — dashboard.applyProfileToForm 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.
D2 · Cognitive Complexity · BlockAwarePrefixCache.reconstruct_cache (cognitive 653) · ×1
  • BlockAwarePrefixCache.reconstruct_cache (cognitive 653) omlx/cache/prefix_cache.py:3286 — BlockAwarePrefixCache.reconstruct_cache has cognitive complexity 653 (threshold 15). Drivers by points: if/else 145 (416 pts), ternaries 20 (84 pts), loops 26 (80 pts), boolean chains 69, error handling 2 (4 pts) (nesting depth added 391). 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 · routes.update_global_settings (cognitive 479) · ×1
  • routes.update_global_settings (cognitive 479) omlx/admin/routes.py:5014 — routes.update_global_settings has cognitive complexity 479 (threshold 15). Drivers by points: if/else 221 (352 pts), ternaries 21 (55 pts), boolean chains 43, loops 8 (18 pts), error handling 6 (11 pts) (nesting depth added 180). To reduce it, split the body into named stages: move each independent step or branch 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.html.chatApp (cognitive 459) · ×1
  • chat.html.chatApp (cognitive 459) apps/omlx-web/omlx_web/templates/chat.html:2841 — chat.html.chatApp has cognitive complexity 459 (threshold 15). Drivers by points: if/else 201 (259 pts), boolean chains 142, ternaries 26 (35 pts), loops 21 (22 pts), error handling 1 (nesting depth added 68). Of this number, 432 points are the body's own statements and 27 belong to 13 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 · routes.update_model_settings (cognitive 334) · ×1
  • routes.update_model_settings (cognitive 334) omlx/admin/routes.py:2959 — routes.update_model_settings has cognitive complexity 334 (threshold 15). Drivers by points: if/else 140 (207 pts), boolean chains 54, ternaries 26 (54 pts), loops 5 (13 pts), error handling 3 (6 pts) (nesting depth added 106). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · BlockAwarePrefixCache.store_cache (cognitive 314) · ×1
  • BlockAwarePrefixCache.store_cache (cognitive 314) omlx/cache/prefix_cache.py:950 — BlockAwarePrefixCache.store_cache has cognitive complexity 314 (threshold 15). Drivers by points: if/else 73 (219 pts), boolean chains 52, error handling 2 (17 pts), loops 5 (15 pts), ternaries 7 (11 pts) (nesting depth added 175). 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 · oq.quantize_oq_streaming (cognitive 278) · ×1
  • oq.quantize_oq_streaming (cognitive 278) REDACTED:6997 — oq.quantize_oq_streaming has cognitive complexity 278 (threshold 15). Drivers by points: if/else 92 (190 pts), boolean chains 39, loops 11 (21 pts), ternaries 8 (17 pts), error handling 5 (11 pts) (nesting depth added 123). 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 · BlockAwarePrefixCache._extract_block_tensor_slice (cognitive 252) · ×1
  • BlockAwarePrefixCache._extract_block_tensor_slice (cognitive 252) omlx/cache/prefix_cache.py:2471 — BlockAwarePrefixCache._extract_block_tensor_slice has cognitive complexity 252 (threshold 15). Drivers by points: if/else 48 (136 pts), ternaries 16 (69 pts), boolean chains 33, loops 4 (13 pts), error handling 1 (nesting depth added 150). 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 · VLMBatchedEngine._prepare_vision_inputs (cognitive 251) · ×1
  • VLMBatchedEngine._prepare_vision_inputs (cognitive 251) omlx/engine/vlm.py:4072 — VLMBatchedEngine._prepare_vision_inputs has cognitive complexity 251 (threshold 15). Drivers by points: if/else 64 (144 pts), loops 10 (34 pts), boolean chains 29, ternaries 12 (27 pts), error handling 7 (17 pts) (nesting depth added 129). 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 · Scheduler._process_batch_responses (cognitive 238) · ×1
  • Scheduler._process_batch_responses (cognitive 238) omlx/scheduler.py:14180 — Scheduler._process_batch_responses has cognitive complexity 238 (threshold 15). Drivers by points: if/else 59 (182 pts), ternaries 11 (31 pts), boolean chains 20, error handling 1 (4 pts), loops 1 (nesting depth added 146). 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 · server.stream_chat_completion (cognitive 236) · ×1
  • server.stream_chat_completion (cognitive 236) REDACTED:6631 — server.stream_chat_completion has cognitive complexity 236 (threshold 15). Drivers by points: if/else 61 (154 pts), ternaries 17 (34 pts), boolean chains 26, loops 7 (16 pts), error handling 3 (6 pts) (nesting depth added 122). 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 · Scheduler._cleanup_finished (cognitive 234) · ×1
  • Scheduler._cleanup_finished (cognitive 234) omlx/scheduler.py:14604 — Scheduler._cleanup_finished has cognitive complexity 234 (threshold 15). Drivers by points: if/else 46 (163 pts), ternaries 5 (29 pts), error handling 3 (16 pts), boolean chains 15, loops 5 (11 pts) (nesting depth added 160). 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 · oq._build_quant_plan (cognitive 231) · ×1
  • oq._build_quant_plan (cognitive 231) REDACTED:1359 — oq._build_quant_plan has cognitive complexity 231 (threshold 15). Drivers by points: if/else 67 (163 pts), loops 20 (37 pts), boolean chains 22, ternaries 4 (9 pts) (nesting depth added 118). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Scheduler._schedule_waiting (cognitive 225) · ×1
  • Scheduler._schedule_waiting (cognitive 225) omlx/scheduler.py:13314 — Scheduler._schedule_waiting has cognitive complexity 225 (threshold 15). Drivers by points: if/else 52 (135 pts), error handling 12 (40 pts), boolean chains 26, ternaries 8 (23 pts), loops 1 (nesting depth added 126). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · server.stream_responses_api (cognitive 223) · ×1
  • server.stream_responses_api (cognitive 223) REDACTED:9130 — server.stream_responses_api has cognitive complexity 223 (threshold 15). Drivers by points: if/else 55 (111 pts), loops 20 (62 pts), boolean chains 28, ternaries 10 (16 pts), error handling 3 (6 pts) (nesting depth added 107). To reduce it, split the body into named stages: move each independent step or branch 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_loading.maybe_apply_pre_load_patches (cognitive 205) · ×1
  • model_loading.maybe_apply_pre_load_patches (cognitive 205) omlx/utils/model_loading.py:519 — model_loading.maybe_apply_pre_load_patches has cognitive complexity 205 (threshold 15). Drivers by points: if/else 82 (133 pts), boolean chains 46, error handling 7 (14 pts), ternaries 7 (12 pts) (nesting depth added 63). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · server.stream_anthropic_messages (cognitive 188) · ×1
  • server.stream_anthropic_messages (cognitive 188) REDACTED:7354 — server.stream_anthropic_messages has cognitive complexity 188 (threshold 15). Drivers by points: if/else 60 (141 pts), boolean chains 21, ternaries 10 (14 pts), error handling 4 (7 pts), loops 3 (5 pts) (nesting depth added 90). 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 · anthropic_utils.convert_anthropic_to_internal (cognitive 173) · ×1
  • anthropic_utils.convert_anthropic_to_internal (cognitive 173) omlx/api/anthropic_utils.py:189 — anthropic_utils.convert_anthropic_to_internal has cognitive complexity 173 (threshold 15). Drivers by points: if/else 29 (131 pts), loops 5 (15 pts), boolean chains 13, error handling 1 (8 pts), ternaries 2 (6 pts) (nesting depth added 123). 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 · VLMBatchedEngine._format_messages_for_vlm_template (cognitive 166) · ×1
  • VLMBatchedEngine._format_messages_for_vlm_template (cognitive 166) omlx/engine/vlm.py:3180 — VLMBatchedEngine._format_messages_for_vlm_template has cognitive complexity 166 (threshold 15). Drivers by points: if/else 38 (125 pts), boolean chains 21, loops 5 (16 pts), ternaries 1 (4 pts) (nesting depth added 101). 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 · tool_calling._parse_tool_calls_impl (cognitive 163) · ×1
  • tool_calling._parse_tool_calls_impl (cognitive 163) omlx/api/tool_calling.py:2056 — tool_calling._parse_tool_calls_impl has cognitive complexity 163 (threshold 15). Drivers by points: if/else 38 (105 pts), loops 5 (21 pts), ternaries 4 (18 pts), error handling 2 (10 pts), boolean chains 9 (nesting depth added 105). 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 · Scheduler._do_external_prefill (cognitive 161) · ×1
  • Scheduler._do_external_prefill (cognitive 161) omlx/scheduler.py:4402 — Scheduler._do_external_prefill has cognitive complexity 161 (threshold 15). Drivers by points: if/else 55 (110 pts), ternaries 10 (26 pts), boolean chains 20, loops 2 (3 pts), error handling 1 (2 pts) (nesting depth added 73). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · routes._build_active_models_data (cognitive 152) · ×1
  • routes._build_active_models_data (cognitive 152) omlx/admin/routes.py:7154 — routes._build_active_models_data has cognitive complexity 152 (threshold 15). Drivers by points: if/else 31 (74 pts), ternaries 21 (42 pts), boolean chains 19, error handling 4 (14 pts), loops 2 (3 pts) (nesting depth added 75). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · PagedSSDCacheManager.save_block (cognitive 146) · ×1
  • PagedSSDCacheManager.save_block (cognitive 146) omlx/cache/paged_ssd_cache.py:3468 — PagedSSDCacheManager.save_block has cognitive complexity 146 (threshold 15). Drivers by points: if/else 34 (67 pts), ternaries 14 (33 pts), boolean chains 25, loops 6 (13 pts), error handling 5 (8 pts) (nesting depth added 62). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · dashboard.dashboard (cognitive 143) · ×1
  • dashboard.dashboard (cognitive 143) REDACTED:129 — dashboard.dashboard has cognitive complexity 143 (threshold 15). Drivers by points: boolean chains 72, if/else 36 (40 pts), ternaries 21 (27 pts), loops 2, match/switch 2 (nesting depth added 10). Of this number, 99 points are the body's own statements and 44 belong to 12 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 · routes._build_runtime_cache_observability (cognitive 138) · ×1
  • routes._build_runtime_cache_observability (cognitive 138) omlx/admin/routes.py:6719 — routes._build_runtime_cache_observability has cognitive complexity 138 (threshold 15). Drivers by points: if/else 32 (63 pts), boolean chains 41, error handling 7 (15 pts), ternaries 6 (10 pts), loops 5 (9 pts) (nesting depth added 47). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ProcessMemoryEnforcer._check_and_enforce (cognitive 137) · ×1
  • ProcessMemoryEnforcer._check_and_enforce (cognitive 137) omlx/process_memory_enforcer.py:1734 — ProcessMemoryEnforcer._check_and_enforce has cognitive complexity 137 (threshold 15). Drivers by points: if/else 44 (113 pts), boolean chains 12, loops 3 (9 pts), ternaries 3 (nesting depth added 75). 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 · DistributedBatchedEngine.stream_chat (cognitive 128) · ×1
  • DistributedBatchedEngine.stream_chat (cognitive 128) omlx/engine/distributed.py:1338 — DistributedBatchedEngine.stream_chat has cognitive complexity 128 (threshold 15). Drivers by points: if/else 32 (101 pts), boolean chains 12, loops 4 (8 pts), error handling 4 (6 pts), ternaries 1 (nesting depth added 75). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · qwen35_ane_prefill.enable_qwen35_ane_prefill (cognitive 128) · ×1
  • qwen35_ane_prefill.enable_qwen35_ane_prefill (cognitive 128) omlx/patches/qwen35_ane_prefill.py:3078 — qwen35_ane_prefill.enable_qwen35_ane_prefill has cognitive complexity 128 (threshold 15). Drivers by points: if/else 48 (77 pts), ternaries 9 (20 pts), boolean chains 18, loops 4 (7 pts), error handling 3 (6 pts) (nesting depth added 46). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ane_tuning._calibrate_fused_components_sync (cognitive 118) · ×1
  • ane_tuning._calibrate_fused_components_sync (cognitive 118) omlx/admin/ane_tuning.py:1080 — ane_tuning._calibrate_fused_components_sync has cognitive complexity 118 (threshold 15). Drivers by points: if/else 31 (65 pts), loops 16 (38 pts), boolean chains 8, ternaries 6 (7 pts) (nesting depth added 57). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · responses_utils.convert_responses_input_to_messages (cognitive 113) · ×1
  • responses_utils.convert_responses_input_to_messages (cognitive 113) omlx/api/responses_utils.py:176 — responses_utils.convert_responses_input_to_messages has cognitive complexity 113 (threshold 15). Drivers by points: if/else 26 (66 pts), ternaries 8 (24 pts), boolean chains 14, loops 3 (9 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 · tool_calling._gemma4_transcode_to_json (cognitive 113) · ×1
  • tool_calling._gemma4_transcode_to_json (cognitive 113) omlx/api/tool_calling.py:1567 — tool_calling._gemma4_transcode_to_json has cognitive complexity 113 (threshold 15). Drivers by points: if/else 29 (79 pts), ternaries 3 (11 pts), boolean chains 10, loops 3 (9 pts), error handling 1 (4 pts) (nesting depth added 67). 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 · EnginePool._load_engine (cognitive 112) · ×1
  • EnginePool._load_engine (cognitive 112) omlx/engine_pool.py:4113 — EnginePool._load_engine has cognitive complexity 112 (threshold 15). Drivers by points: if/else 38 (52 pts), error handling 13 (29 pts), boolean chains 24, ternaries 4 (6 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 · moe_offload_compat._inspect (cognitive 109) · ×1
  • moe_offload_compat._inspect (cognitive 109) omlx/patches/moe_offload_compat.py:46 — moe_offload_compat._inspect has cognitive complexity 109 (threshold 15). Drivers by points: if/else 24 (54 pts), ternaries 8 (29 pts), boolean chains 16, loops 4 (10 pts) (nesting depth added 57). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · dashboard.dashboard.buildModelSettingsPayload (cognitive 109) · ×1
  • dashboard.dashboard.buildModelSettingsPayload (cognitive 109) REDACTED:3538 — dashboard.dashboard.buildModelSettingsPayload has cognitive complexity 109 (threshold 15). Drivers by points: ternaries 37 (43 pts), boolean chains 35, if/else 14 (30 pts), 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 · anthropic_utils.convert_anthropic_to_internal_harmony (cognitive 108) · ×1
  • anthropic_utils.convert_anthropic_to_internal_harmony (cognitive 108) omlx/api/anthropic_utils.py:476 — anthropic_utils.convert_anthropic_to_internal_harmony has cognitive complexity 108 (threshold 15). Drivers by points: if/else 21 (67 pts), error handling 3 (19 pts), loops 4 (9 pts), ternaries 2 (8 pts), boolean chains 5 (nesting depth added 73). 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 · dashboard.buildModelSettingsPayload (cognitive 108) · ×1
  • dashboard.buildModelSettingsPayload (cognitive 108) REDACTED:3538 — dashboard.buildModelSettingsPayload has cognitive complexity 108 (threshold 15). Drivers by points: ternaries 37 (40 pts), boolean chains 36, if/else 14 (30 pts), loops 1, other 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 · oq.universal_quant_predicate (cognitive 105) · ×1
  • oq.universal_quant_predicate (cognitive 105) REDACTED:683 — oq.universal_quant_predicate has cognitive complexity 105 (threshold 15). Drivers by points: if/else 54 (76 pts), boolean chains 27, ternaries 1 (2 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 · ModelSettingsScreenVM.save (cognitive 105) · ×1
  • ModelSettingsScreenVM.save (cognitive 105) apps/omlx-mac/Sources/AppView/ViewModels/ModelSettingsScreenVM.swift:865 — ModelSettingsScreenVM.save has cognitive complexity 105 (threshold 15). Drivers by points: if/else 24 (41 pts), match/switch 15 (29 pts), ternaries 13 (26 pts), boolean chains 8, error handling 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 · Scheduler._extract_cache_states (cognitive 104) · ×1
  • Scheduler._extract_cache_states (cognitive 104) omlx/scheduler.py:10483 — Scheduler._extract_cache_states has cognitive complexity 104 (threshold 15). Drivers by points: if/else 23 (59 pts), ternaries 3 (13 pts), boolean chains 12, error handling 4 (11 pts), loops 3 (9 pts) (nesting depth added 59). 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 · accuracy_benchmark.run_accuracy_benchmark (cognitive 99) · ×1
  • accuracy_benchmark.run_accuracy_benchmark (cognitive 99) omlx/admin/accuracy_benchmark.py:374 — accuracy_benchmark.run_accuracy_benchmark has cognitive complexity 99 (threshold 15). Drivers by points: if/else 28 (65 pts), error handling 8 (16 pts), ternaries 3 (9 pts), loops 3 (6 pts), boolean chains 3 (nesting depth added 54). 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 · ServerScreenVM.applyServerSettings (cognitive 98) · ×1
  • ServerScreenVM.applyServerSettings (cognitive 98) apps/omlx-mac/Sources/AppView/ViewModels/ServerScreenVM.swift:241 — ServerScreenVM.applyServerSettings has cognitive complexity 98 (threshold 15). Drivers by points: if/else 36 (58 pts), boolean chains 30, ternaries 3 (7 pts), error handling 2 (3 pts) (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 · benchmark.run_benchmark (cognitive 97) · ×1
  • benchmark.run_benchmark (cognitive 97) omlx/admin/benchmark.py:2027 — benchmark.run_benchmark has cognitive complexity 97 (threshold 15). Drivers by points: if/else 22 (32 pts), ternaries 12 (22 pts), boolean chains 18, error handling 11 (18 pts), loops 5 (7 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 · VLMBatchedEngine.start (cognitive 96) · ×1
  • VLMBatchedEngine.start (cognitive 96) omlx/engine/vlm.py:1982 — VLMBatchedEngine.start has cognitive complexity 96 (threshold 15). Drivers by points: if/else 39 (50 pts), error handling 22 (36 pts), boolean chains 9, ternaries 1 (nesting depth added 25). 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 · oq._build_streaming_proxy_for_sensitivity (cognitive 96) · ×1
  • oq._build_streaming_proxy_for_sensitivity (cognitive 96) REDACTED:11754 — oq._build_streaming_proxy_for_sensitivity has cognitive complexity 96 (threshold 15). Drivers by points: if/else 23 (65 pts), loops 6 (11 pts), ternaries 3 (10 pts), boolean chains 8, error handling 1 (2 pts) (nesting depth added 55). 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 · routes.cluster_autoconfigure (cognitive 95) · ×1
  • routes.cluster_autoconfigure (cognitive 95) omlx/cluster/routes.py:1205 — routes.cluster_autoconfigure has cognitive complexity 95 (threshold 15). Drivers by points: if/else 28 (39 pts), boolean chains 26, error handling 10 (19 pts), loops 3 (6 pts), ternaries 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 · dashboard.formValuesForProfile (cognitive 95) · ×1
  • dashboard.formValuesForProfile (cognitive 95) REDACTED:1755 — dashboard.formValuesForProfile has cognitive complexity 95 (threshold 15). Drivers by points: if/else 31 (72 pts), boolean chains 15, ternaries 2 (6 pts), loops 2 (nesting depth added 45). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · gemma4.extract_gemma4_messages (cognitive 94) · ×1
  • gemma4.extract_gemma4_messages (cognitive 94) omlx/adapter/gemma4.py:73 — gemma4.extract_gemma4_messages has cognitive complexity 94 (threshold 15). Drivers by points: if/else 21 (54 pts), ternaries 4 (19 pts), loops 5 (12 pts), boolean chains 9 (nesting depth added 55). 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 · dashboard.dashboard.formValuesForProfile (cognitive 94) · ×1
  • dashboard.dashboard.formValuesForProfile (cognitive 94) REDACTED:1755 — dashboard.dashboard.formValuesForProfile has cognitive complexity 94 (threshold 15). Drivers by points: if/else 31 (72 pts), boolean chains 14, ternaries 2 (6 pts), loops 2 (nesting depth added 45). To reduce it, split the body into named stages: move each independent step or branch 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._extract_media (cognitive 89) · ×1
  • image._extract_media (cognitive 89) omlx/utils/image.py:352 — image._extract_media has cognitive complexity 89 (threshold 15). Drivers by points: if/else 17 (59 pts), ternaries 5 (18 pts), loops 5 (9 pts), boolean chains 3 (nesting depth added 59). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · oq._collect_imatrix_streaming (cognitive 88) · ×1
  • oq._collect_imatrix_streaming (cognitive 88) REDACTED:10673 — oq._collect_imatrix_streaming has cognitive complexity 88 (threshold 15). Drivers by points: if/else 26 (55 pts), ternaries 6 (18 pts), boolean chains 9, loops 3 (6 pts) (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 · Model.sanitize (cognitive 85) · ×1
  • Model.sanitize (cognitive 85) omlx/patches/glm_moe_dsa/deepseek_v32.py:844 — Model.sanitize has cognitive complexity 85 (threshold 15). Drivers by points: if/else 20 (56 pts), loops 10 (21 pts), boolean chains 8 (nesting depth added 47). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D2 · Cognitive Complexity · EnginePool.get_engine (cognitive 84) · ×1
  • EnginePool.get_engine (cognitive 84) omlx/engine_pool.py:2719 — EnginePool.get_engine has cognitive complexity 84 (threshold 15). Drivers by points: if/else 29 (58 pts), boolean chains 13, ternaries 5 (11 pts), loops 1 (2 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 · oq._forward_layer_result (cognitive 84) · ×1
  • oq._forward_layer_result (cognitive 84) REDACTED:8745 — oq._forward_layer_result has cognitive complexity 84 (threshold 15). Drivers by points: if/else 20 (27 pts), ternaries 10 (26 pts), error handling 10 (19 pts), boolean chains 12 (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 · qwen35_ane_prefill._enable_dual_procedure_banks (cognitive 84) · ×1
  • qwen35_ane_prefill._enable_dual_procedure_banks (cognitive 84) omlx/patches/qwen35_ane_prefill.py:2466 — qwen35_ane_prefill._enable_dual_procedure_banks has cognitive complexity 84 (threshold 15). Drivers by points: if/else 30 (45 pts), loops 10 (13 pts), error handling 5 (11 pts), ternaries 4 (8 pts), boolean chains 7 (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 · dashboard.buildModelSettingsState (cognitive 84) · ×1
  • dashboard.buildModelSettingsState (cognitive 84) REDACTED:2205 — dashboard.buildModelSettingsState has cognitive complexity 84 (threshold 15). Drivers by points: boolean chains 53, other 25, 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 · PagedSSDCacheManager._reconstruct_cache_data (cognitive 83) · ×1
  • PagedSSDCacheManager._reconstruct_cache_data (cognitive 83) omlx/cache/paged_ssd_cache.py:3992 — PagedSSDCacheManager._reconstruct_cache_data has cognitive complexity 83 (threshold 15). Drivers by points: if/else 16 (43 pts), ternaries 5 (13 pts), boolean chains 12, error handling 3 (10 pts), loops 2 (5 pts) (nesting depth added 45). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · server.list_models (cognitive 82) · ×1
  • server.list_models (cognitive 82) REDACTED:3807 — server.list_models has cognitive complexity 82 (threshold 15). Drivers by points: if/else 17 (51 pts), loops 6 (19 pts), boolean chains 12 (nesting depth added 47). 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 · tool_calling.parse_qwen_tool_calls (cognitive 81) · ×1
  • tool_calling.parse_qwen_tool_calls (cognitive 81) omlx/api/tool_calling.py:2353 — tool_calling.parse_qwen_tool_calls has cognitive complexity 81 (threshold 15). Drivers by points: if/else 18 (49 pts), boolean chains 13, loops 3 (8 pts), ternaries 3 (7 pts), error handling 1 (4 pts) (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 · GlobalSettings.validate (cognitive 81) · ×1
  • GlobalSettings.validate (cognitive 81) omlx/settings.py:1710 — GlobalSettings.validate has cognitive complexity 81 (threshold 15). Drivers by points: if/else 51 (59 pts), boolean chains 12, error handling 6 (7 pts), loops 1 (2 pts), ternaries 1 (nesting depth added 10). 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 · DFlashDrafter._draft_batched (cognitive 81) · ×1
  • DFlashDrafter._draft_batched (cognitive 81) omlx/speculative/dflash/drafter.py:596 — DFlashDrafter._draft_batched has cognitive complexity 81 (threshold 15). Drivers by points: if/else 34 (58 pts), ternaries 7 (12 pts), loops 6 (9 pts), boolean chains 2 (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 · oq.estimate_bpw_and_size (cognitive 78) · ×1
  • oq.estimate_bpw_and_size (cognitive 78) REDACTED:4031 — oq.estimate_bpw_and_size has cognitive complexity 78 (threshold 15). Drivers by points: if/else 29 (53 pts), boolean chains 10, loops 7 (10 pts), ternaries 2 (4 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.
D2 · Cognitive Complexity · StageServer._run_chunks (cognitive 77) · ×1
  • StageServer._run_chunks (cognitive 77) apps/omlx-cuda-helper/omlx_cuda_helper/worker.py:400 — StageServer._run_chunks has cognitive complexity 77 (threshold 15). Drivers by points: if/else 21 (45 pts), ternaries 6 (13 pts), boolean chains 11, loops 4 (8 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 · oq._build_model_sanitizer (cognitive 77) · ×1
  • oq._build_model_sanitizer (cognitive 77) REDACTED:4792 — oq._build_model_sanitizer has cognitive complexity 77 (threshold 15). Drivers by points: if/else 27 (41 pts), error handling 13 (24 pts), boolean chains 6, ternaries 3 (6 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 · Scheduler._prepare_prefix_cache_for_request (cognitive 77) · ×1
  • Scheduler._prepare_prefix_cache_for_request (cognitive 77) omlx/scheduler.py:11112 — Scheduler._prepare_prefix_cache_for_request has cognitive complexity 77 (threshold 15). Drivers by points: if/else 25 (66 pts), boolean chains 6, ternaries 2 (4 pts), error handling 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 · chat_template_v4.render_message (cognitive 76) · ×1
  • chat_template_v4.render_message (cognitive 76) omlx/patches/deepseek_v4/chat_template_v4.py:291 — chat_template_v4.render_message has cognitive complexity 76 (threshold 15). Drivers by points: if/else 28 (53 pts), boolean chains 11, loops 2 (9 pts), ternaries 1 (3 pts) (nesting depth added 34). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D2 · Cognitive Complexity · routes.list_models (cognitive 75) · ×1
  • routes.list_models (cognitive 75) omlx/admin/routes.py:2458 — routes.list_models has cognitive complexity 75 (threshold 15). Drivers by points: if/else 17 (44 pts), boolean chains 13, error handling 3 (8 pts), ternaries 4 (6 pts), loops 3 (4 pts) (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 · Model.sanitize (cognitive 75) · ×1
  • Model.sanitize (cognitive 75) omlx/patches/deepseek_v4/deepseek_v4_model.py:2414 — Model.sanitize has cognitive complexity 75 (threshold 15). Drivers by points: if/else 17 (41 pts), loops 14 (23 pts), boolean chains 6, error handling 1 (3 pts), ternaries 1 (2 pts) (nesting depth added 36). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D2 · Cognitive Complexity · batch_generator._run_verify_cycle_chain (cognitive 75) · ×1
  • batch_generator._run_verify_cycle_chain (cognitive 75) REDACTED:4433 — batch_generator._run_verify_cycle_chain has cognitive complexity 75 (threshold 15). Drivers by points: if/else 33 (50 pts), boolean chains 10, ternaries 5 (8 pts), loops 4 (7 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 · ane_tuning._calibrate_components_sync (cognitive 74) · ×1
  • ane_tuning._calibrate_components_sync (cognitive 74) omlx/admin/ane_tuning.py:1728 — ane_tuning._calibrate_components_sync has cognitive complexity 74 (threshold 15). Drivers by points: if/else 24 (37 pts), boolean chains 14, loops 8 (13 pts), ternaries 8 (10 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 · cli.launch_command (cognitive 74) · ×1
  • cli.launch_command (cognitive 74) REDACTED:473 — cli.launch_command has cognitive complexity 74 (threshold 15). Drivers by points: if/else 22 (34 pts), boolean chains 17, ternaries 8 (12 pts), loops 3 (6 pts), error handling 4 (5 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 · model_discovery.detect_model_type (cognitive 74) · ×1
  • model_discovery.detect_model_type (cognitive 74) omlx/model_discovery.py:711 — model_discovery.detect_model_type has cognitive complexity 74 (threshold 15). Drivers by points: if/else 33 (54 pts), boolean chains 10, loops 9, error handling 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 · BoundarySnapshotSSDStore._serialize_extracted (cognitive 73) · ×1
  • BoundarySnapshotSSDStore._serialize_extracted (cognitive 73) omlx/cache/boundary_snapshot_store.py:1212 — BoundarySnapshotSSDStore._serialize_extracted has cognitive complexity 73 (threshold 15). Drivers by points: if/else 17 (56 pts), loops 5 (13 pts), boolean chains 2, ternaries 1 (2 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 · SparseCompressedAttention.__call__ (cognitive 73) · ×1
  • SparseCompressedAttention.__call__ (cognitive 73) omlx/patches/deepseek_v4/deepseek_v4_model.py:2004 — SparseCompressedAttention.__call__ has cognitive complexity 73 (threshold 15). Drivers by points: if/else 26 (50 pts), ternaries 8 (10 pts), boolean chains 9, error handling 1 (4 pts) (nesting depth added 29). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D2 · Cognitive Complexity · launch._sweep_rank_processes (cognitive 71) · ×1
  • launch._sweep_rank_processes (cognitive 71) omlx/cluster/launch.py:651 — launch._sweep_rank_processes has cognitive complexity 71 (threshold 15). Drivers by points: if/else 26 (57 pts), boolean chains 6, loops 4 (6 pts), error handling 1, 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 · Scheduler.step (cognitive 71) · ×1
  • Scheduler.step (cognitive 71) omlx/scheduler.py:15836 — Scheduler.step has cognitive complexity 71 (threshold 15). Drivers by points: if/else 33 (48 pts), boolean chains 11, loops 2 (6 pts), error handling 4, ternaries 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 · ModelSettingsScreenVM.currentSettingsDict (cognitive 71) · ×1
  • ModelSettingsScreenVM.currentSettingsDict (cognitive 71) apps/omlx-mac/Sources/AppView/ViewModels/ModelSettingsScreenVM.swift:1755 — ModelSettingsScreenVM.currentSettingsDict has cognitive complexity 71 (threshold 15). Drivers by points: if/else 30 (58 pts), ternaries 4 (9 pts), boolean chains 4 (nesting depth added 33). Of this number, 66 points are the body's own statements and 5 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 · cluster_v2.clusterV2Wizard.checkRows (cognitive 70) · ×1
  • cluster_v2.clusterV2Wizard.checkRows (cognitive 70) apps/omlx-web/omlx_web/static/js/cluster_v2.js:2095 — cluster_v2.clusterV2Wizard.checkRows has cognitive complexity 70 (threshold 15). Drivers by points: ternaries 22 (44 pts), if/else 12 (16 pts), boolean chains 10 (nesting depth added 26). Of this number, 59 points are the body's own statements and 11 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 · ToolCallStreamFilter.feed (cognitive 69) · ×1
  • ToolCallStreamFilter.feed (cognitive 69) omlx/api/tool_calling.py:3581 — ToolCallStreamFilter.feed has cognitive complexity 69 (threshold 15). Drivers by points: if/else 27 (63 pts), boolean chains 4, loops 2 (nesting depth added 36). 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 · context_benchmark.run_context_benchmark (cognitive 68) · ×1
  • context_benchmark.run_context_benchmark (cognitive 68) omlx/admin/context_benchmark.py:401 — context_benchmark.run_context_benchmark has cognitive complexity 68 (threshold 15). Drivers by points: if/else 21 (35 pts), error handling 8 (13 pts), boolean chains 11, loops 4 (5 pts), ternaries 2 (4 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 · HFDownloader._run_download (cognitive 68) · ×1
  • HFDownloader._run_download (cognitive 68) REDACTED:2003 — HFDownloader._run_download has cognitive complexity 68 (threshold 15). Drivers by points: if/else 26 (34 pts), error handling 17 (24 pts), boolean chains 9, ternaries 1 (nesting depth added 15). 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 · server._with_sse_keepalive (cognitive 68) · ×1
  • server._with_sse_keepalive (cognitive 68) REDACTED:3076 — server._with_sse_keepalive has cognitive complexity 68 (threshold 15). Drivers by points: if/else 16 (42 pts), ternaries 4 (11 pts), error handling 3 (10 pts), loops 2 (3 pts), boolean chains 2 (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 · server.create_response (cognitive 68) · ×1
  • server.create_response (cognitive 68) REDACTED:8588 — server.create_response has cognitive complexity 68 (threshold 15). Drivers by points: if/else 29 (41 pts), boolean chains 20, ternaries 3, error handling 2, 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 · oq._measure_sensitivity_from_quantized_model (cognitive 67) · ×1
  • oq._measure_sensitivity_from_quantized_model (cognitive 67) REDACTED:11983 — oq._measure_sensitivity_from_quantized_model has cognitive complexity 67 (threshold 15). Drivers by points: if/else 22 (42 pts), boolean chains 7, ternaries 3 (7 pts), error handling 3 (6 pts), loops 3 (5 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 · DistributedBatchedEngine.stream_generate (cognitive 65) · ×1
  • DistributedBatchedEngine.stream_generate (cognitive 65) omlx/engine/distributed.py:1688 — DistributedBatchedEngine.stream_generate has cognitive complexity 65 (threshold 15). Drivers by points: if/else 17 (50 pts), boolean chains 6, error handling 4 (6 pts), loops 2 (3 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 · oq._collect_imatrix_from_model (cognitive 64) · ×1
  • oq._collect_imatrix_from_model (cognitive 64) REDACTED:9718 — oq._collect_imatrix_from_model has cognitive complexity 64 (threshold 15). Drivers by points: if/else 16 (33 pts), ternaries 5 (16 pts), boolean chains 9, loops 3 (6 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 · Indexer.__call__ (cognitive 64) · ×1
  • Indexer.__call__ (cognitive 64) omlx/patches/glm_moe_dsa/deepseek_v32.py:214 — Indexer.__call__ has cognitive complexity 64 (threshold 15). Drivers by points: if/else 20 (37 pts), ternaries 5 (12 pts), boolean chains 11, loops 1 (4 pts) (nesting depth added 27). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D2 · Cognitive Complexity · routes.clear_ssd_cache (cognitive 62) · ×1
  • routes.clear_ssd_cache (cognitive 62) omlx/admin/routes.py:7605 — routes.clear_ssd_cache has cognitive complexity 62 (threshold 15). Drivers by points: if/else 12 (26 pts), error handling 8 (25 pts), loops 4 (11 pts) (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 · probe.collect_cluster_status (cognitive 62) · ×1
  • probe.collect_cluster_status (cognitive 62) omlx/cluster/probe.py:409 — probe.collect_cluster_status has cognitive complexity 62 (threshold 15). Drivers by points: if/else 18 (21 pts), ternaries 14 (18 pts), boolean chains 16, error handling 3 (6 pts), loops 1 (nesting depth added 10). 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 · runtime._validated_marker (cognitive 62) · ×1
  • runtime._validated_marker (cognitive 62) omlx/cluster/runtime.py:418 — runtime._validated_marker has cognitive complexity 62 (threshold 15). Drivers by points: if/else 28 (45 pts), boolean chains 11, loops 2 (3 pts), ternaries 1 (2 pts), error handling 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 · ModelSettingsScreenVM.enabledFeatures (cognitive 62) · ×1
  • ModelSettingsScreenVM.enabledFeatures (cognitive 62) apps/omlx-mac/Sources/AppView/ViewModels/ModelSettingsScreenVM.swift:1597 — ModelSettingsScreenVM.enabledFeatures has cognitive complexity 62 (threshold 15). Drivers by points: if/else 22 (47 pts), boolean chains 14, match/switch 1 (nesting depth added 25). 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 · BlockAwarePrefixCache._get_cache_seq_len (cognitive 61) · ×1
  • BlockAwarePrefixCache._get_cache_seq_len (cognitive 61) omlx/cache/prefix_cache.py:2012 — BlockAwarePrefixCache._get_cache_seq_len has cognitive complexity 61 (threshold 15). Drivers by points: if/else 17 (38 pts), boolean chains 10, loops 5 (7 pts), error handling 2 (4 pts), ternaries 1 (2 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 · DistributedJobSupervisor._terminate (cognitive 61) · ×1
  • DistributedJobSupervisor._terminate (cognitive 61) omlx/cluster/launch.py:3083 — DistributedJobSupervisor._terminate has cognitive complexity 61 (threshold 15). Drivers by points: if/else 14 (27 pts), error handling 4 (14 pts), ternaries 4 (12 pts), loops 3 (6 pts), boolean chains 2 (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 · VLMBatchedEngine._compute_vision_features (cognitive 61) · ×1
  • VLMBatchedEngine._compute_vision_features (cognitive 61) omlx/engine/vlm.py:3485 — VLMBatchedEngine._compute_vision_features has cognitive complexity 61 (threshold 15). Drivers by points: if/else 19 (45 pts), boolean chains 7, error handling 2 (7 pts), ternaries 1 (2 pts) (nesting depth added 32). 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 · oq._discover_sanitize_plan (cognitive 60) · ×1
  • oq._discover_sanitize_plan (cognitive 60) REDACTED:3236 — oq._discover_sanitize_plan has cognitive complexity 60 (threshold 15). Drivers by points: if/else 19 (46 pts), loops 4 (6 pts), boolean chains 4, ternaries 1 (4 pts) (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 · Model.sanitize (cognitive 60) · ×1
  • Model.sanitize (cognitive 60) omlx/patches/raon1_mini/raon1_mini_model.py:1932 — Model.sanitize has cognitive complexity 60 (threshold 15). Drivers by points: if/else 15 (40 pts), loops 5 (11 pts), boolean chains 5, ternaries 1 (4 pts) (nesting depth added 34). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D2 · Cognitive Complexity · GlobalSettings._apply_cli_overrides (cognitive 60) · ×1
  • GlobalSettings._apply_cli_overrides (cognitive 60) omlx/settings.py:1415 — GlobalSettings._apply_cli_overrides has cognitive complexity 60 (threshold 15). Drivers by points: if/else 32 (34 pts), boolean chains 24, ternaries 1 (2 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 · Scheduler._advance_chunked_prefills (cognitive 59) · ×1
  • Scheduler._advance_chunked_prefills (cognitive 59) omlx/scheduler.py:8007 — Scheduler._advance_chunked_prefills has cognitive complexity 59 (threshold 15). Drivers by points: if/else 17 (31 pts), error handling 6 (14 pts), boolean chains 7, ternaries 1 (4 pts), 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.
D2 · Cognitive Complexity · dashboard.dashboard.accDownloadResult (cognitive 59) · ×1
  • dashboard.dashboard.accDownloadResult (cognitive 59) REDACTED:6588 — dashboard.dashboard.accDownloadResult has cognitive complexity 59 (threshold 15). Drivers by points: if/else 13 (25 pts), boolean chains 21, ternaries 3 (9 pts), loops 2 (4 pts) (nesting depth added 20). Of this number, 56 points are the body's own statements and 3 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 · dashboard.accDownloadResult (cognitive 59) · ×1
  • dashboard.accDownloadResult (cognitive 59) REDACTED:6588 — dashboard.accDownloadResult has cognitive complexity 59 (threshold 15). Drivers by points: if/else 13 (25 pts), boolean chains 21, ternaries 3 (8 pts), loops 2 (4 pts), other 1 (nesting depth added 19). Of this number, 56 points are the body's own statements and 3 belong to 12 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 · server.get_engine (cognitive 58) · ×1
  • server.get_engine (cognitive 58) REDACTED:1470 — server.get_engine has cognitive complexity 58 (threshold 15). Drivers by points: if/else 18 (29 pts), error handling 9 (11 pts), ternaries 4 (10 pts), boolean chains 5, loops 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 · GlobalSettings._apply_env_overrides (cognitive 58) · ×1
  • GlobalSettings._apply_env_overrides (cognitive 58) omlx/settings.py:1249 — GlobalSettings._apply_env_overrides has cognitive complexity 58 (threshold 15). Drivers by points: if/else 36 (37 pts), error handling 8 (16 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 10). 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 · dashboard.dashboard.buildModelSettingsState (cognitive 58) · ×1
  • dashboard.dashboard.buildModelSettingsState (cognitive 58) REDACTED:2205 — dashboard.dashboard.buildModelSettingsState has cognitive complexity 58 (threshold 15). Drivers by points: boolean chains 52, 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 · routes.list_hf_models (cognitive 57) · ×1
  • routes.list_hf_models (cognitive 57) omlx/admin/routes.py:8393 — routes.list_hf_models has cognitive complexity 57 (threshold 15). Drivers by points: if/else 12 (35 pts), boolean chains 10, loops 5 (9 pts), ternaries 2, error handling 1 (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 · cli.serve_command (cognitive 57) · ×1
  • cli.serve_command (cognitive 57) REDACTED:173 — cli.serve_command has cognitive complexity 57 (threshold 15). Drivers by points: if/else 33 (39 pts), loops 9 (10 pts), error handling 4 (5 pts), ternaries 2, boolean chains 1 (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, 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 · model_discovery._missing_weight_shards (cognitive 57) · ×1
  • model_discovery._missing_weight_shards (cognitive 57) omlx/model_discovery.py:1271 — model_discovery._missing_weight_shards has cognitive complexity 57 (threshold 15). Drivers by points: if/else 18 (42 pts), boolean chains 4, loops 3 (4 pts), ternaries 2 (4 pts), error handling 2 (3 pts) (nesting depth added 28). 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 · planner.inspect_safetensors_layout (cognitive 56) · ×1
  • planner.inspect_safetensors_layout (cognitive 56) omlx/cluster/planner.py:1251 — planner.inspect_safetensors_layout has cognitive complexity 56 (threshold 15). Drivers by points: if/else 18 (41 pts), boolean chains 8, loops 3 (5 pts), ternaries 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 · planner._partition_layers (cognitive 56) · ×1
  • planner._partition_layers (cognitive 56) omlx/cluster/planner.py:1547 — planner._partition_layers has cognitive complexity 56 (threshold 15). Drivers by points: if/else 12 (32 pts), ternaries 6 (14 pts), loops 4 (7 pts), boolean chains 3 (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 · server.lifespan (cognitive 55) · ×1
  • server.lifespan (cognitive 55) REDACTED:509 — server.lifespan has cognitive complexity 55 (threshold 15). Drivers by points: if/else 24 (26 pts), error handling 9 (17 pts), boolean chains 8, ternaries 2 (4 pts) (nesting depth added 12). 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 · ane_tuning.run_tuning (cognitive 54) · ×1
  • ane_tuning.run_tuning (cognitive 54) omlx/admin/ane_tuning.py:2102 — ane_tuning.run_tuning has cognitive complexity 54 (threshold 15). Drivers by points: if/else 16 (21 pts), boolean chains 15, ternaries 5 (9 pts), error handling 5 (6 pts), 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 · deepseek_v41_delta.restore_chain (cognitive 54) · ×1
  • deepseek_v41_delta.restore_chain (cognitive 54) omlx/cache/deepseek_v41_delta.py:87 — deepseek_v41_delta.restore_chain has cognitive complexity 54 (threshold 15). Drivers by points: if/else 12 (28 pts), boolean chains 14, loops 4 (7 pts), ternaries 2 (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 · BatchedEngine.start (cognitive 54) · ×1
  • BatchedEngine.start (cognitive 54) REDACTED:300 — BatchedEngine.start has cognitive complexity 54 (threshold 15). Drivers by points: if/else 23 (28 pts), error handling 10 (20 pts), boolean chains 5, ternaries 1 (nesting depth added 15). 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 · Scheduler.__init__ (cognitive 54) · ×1
  • Scheduler.__init__ (cognitive 54) omlx/scheduler.py:2222 — Scheduler.__init__ has cognitive complexity 54 (threshold 15). Drivers by points: if/else 22 (32 pts), error handling 5 (10 pts), boolean chains 9, ternaries 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 · server.get_sampling_params (cognitive 54) · ×1
  • server.get_sampling_params (cognitive 54) REDACTED:1896 — server.get_sampling_params has cognitive complexity 54 (threshold 15). Drivers by points: if/else 25 (31 pts), boolean chains 19, ternaries 4 (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 · Scheduler._do_abort_request (cognitive 53) · ×1
  • Scheduler._do_abort_request (cognitive 53) omlx/scheduler.py:12386 — Scheduler._do_abort_request has cognitive complexity 53 (threshold 15). Drivers by points: if/else 26 (42 pts), boolean chains 9, error handling 1 (2 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 · server.init_server (cognitive 53) · ×1
  • server.init_server (cognitive 53) REDACTED:2483 — server.init_server has cognitive complexity 53 (threshold 15). Drivers by points: if/else 27 (33 pts), ternaries 8 (9 pts), error handling 4 (6 pts), boolean chains 4, loops 1 (nesting depth added 9). 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 · model_loading.expand_per_layer_quant_keys (cognitive 53) · ×1
  • model_loading.expand_per_layer_quant_keys (cognitive 53) omlx/utils/model_loading.py:185 — model_loading.expand_per_layer_quant_keys has cognitive complexity 53 (threshold 15). Drivers by points: if/else 13 (39 pts), loops 4 (9 pts), boolean chains 5 (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 · benchmark._run_single_test (cognitive 52) · ×1
  • benchmark._run_single_test (cognitive 52) omlx/admin/benchmark.py:922 — benchmark._run_single_test has cognitive complexity 52 (threshold 15). Drivers by points: if/else 21 (31 pts), boolean chains 13, ternaries 2 (4 pts), error handling 3, 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 · audio_routes._split_tts_text (cognitive 52) · ×1
  • audio_routes._split_tts_text (cognitive 52) omlx/api/audio_routes.py:285 — audio_routes._split_tts_text has cognitive complexity 52 (threshold 15). Drivers by points: if/else 13 (33 pts), loops 3 (8 pts), ternaries 2 (6 pts), boolean chains 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.
D2 · Cognitive Complexity · autoconfigure.choose_parallelism (cognitive 52) · ×1
  • autoconfigure.choose_parallelism (cognitive 52) omlx/cluster/autoconfigure.py:142 — autoconfigure.choose_parallelism has cognitive complexity 52 (threshold 15). Drivers by points: if/else 21 (34 pts), boolean chains 9, ternaries 2 (6 pts), error handling 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 · VLMBatchedEngine._iter_diffusion_outputs_sync (cognitive 52) · ×1
  • VLMBatchedEngine._iter_diffusion_outputs_sync (cognitive 52) omlx/engine/vlm.py:5895 — VLMBatchedEngine._iter_diffusion_outputs_sync has cognitive complexity 52 (threshold 15). Drivers by points: if/else 15 (26 pts), boolean chains 19, error handling 3 (4 pts), loops 2, ternaries 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 · IntegrationsScreenVM.save (cognitive 52) · ×1
  • IntegrationsScreenVM.save (cognitive 52) apps/omlx-mac/Sources/AppView/ViewModels/IntegrationsScreenVM.swift:354 — IntegrationsScreenVM.save has cognitive complexity 52 (threshold 15). Drivers by points: if/else 18 (38 pts), match/switch 4 (6 pts), boolean chains 5, ternaries 1 (2 pts), 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 · clusterV2Wizard.checkRows (cognitive 52) · ×1
  • clusterV2Wizard.checkRows (cognitive 52) apps/omlx-web/omlx_web/static/js/cluster_v2.js:2095 — clusterV2Wizard.checkRows has cognitive complexity 52 (threshold 15). Drivers by points: ternaries 22 (25 pts), if/else 12 (16 pts), boolean chains 11 (nesting depth added 7). Of this number, 40 points are the body's own statements and 12 belong to 14 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 · launch.stop_deployment_processes (cognitive 51) · ×1
  • launch.stop_deployment_processes (cognitive 51) omlx/cluster/launch.py:827 — launch.stop_deployment_processes has cognitive complexity 51 (threshold 15). Drivers by points: if/else 15 (44 pts), boolean chains 4, error handling 1 (2 pts), ternaries 1 (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 · planner.plan_hybrid (cognitive 51) · ×1
  • planner.plan_hybrid (cognitive 51) omlx/cluster/planner.py:2267 — planner.plan_hybrid has cognitive complexity 51 (threshold 15). Drivers by points: if/else 16 (23 pts), ternaries 9 (22 pts), loops 3 (4 pts), boolean chains 1, error handling 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 · Scheduler._set_model_info_for_monitor (cognitive 51) · ×1
  • Scheduler._set_model_info_for_monitor (cognitive 51) omlx/scheduler.py:16511 — Scheduler._set_model_info_for_monitor has cognitive complexity 51 (threshold 15). Drivers by points: if/else 16 (19 pts), boolean chains 16, ternaries 6 (10 pts), error handling 3 (5 pts), loops 1 (nesting depth added 9). 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 · routes.delete_hf_model (cognitive 50) · ×1
  • routes.delete_hf_model (cognitive 50) omlx/admin/routes.py:8535 — routes.delete_hf_model has cognitive complexity 50 (threshold 15). Drivers by points: if/else 18 (31 pts), boolean chains 8, error handling 4 (7 pts), loops 2 (3 pts), ternaries 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 · tool_calling._coerce_param_value (cognitive 50) · ×1
  • tool_calling._coerce_param_value (cognitive 50) omlx/api/tool_calling.py:348 — tool_calling._coerce_param_value has cognitive complexity 50 (threshold 15). Drivers by points: if/else 16 (27 pts), error handling 6 (11 pts), ternaries 4 (8 pts), boolean chains 4 (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 · paged_ssd_cache._block_cachelist_subtypes (cognitive 50) · ×1
  • paged_ssd_cache._block_cachelist_subtypes (cognitive 50) omlx/cache/paged_ssd_cache.py:599 — paged_ssd_cache._block_cachelist_subtypes has cognitive complexity 50 (threshold 15). Drivers by points: if/else 12 (30 pts), boolean chains 10, ternaries 2 (7 pts), 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 · BlockAwarePrefixCache._maybe_backfill_dedup_block_payload (cognitive 50) · ×1
  • BlockAwarePrefixCache._maybe_backfill_dedup_block_payload (cognitive 50) omlx/cache/prefix_cache.py:2333 — BlockAwarePrefixCache._maybe_backfill_dedup_block_payload has cognitive complexity 50 (threshold 15). Drivers by points: if/else 15 (30 pts), boolean chains 12, ternaries 2 (4 pts), loops 3, 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 · transport.detect_transports (cognitive 50) · ×1
  • transport.detect_transports (cognitive 50) omlx/cluster/transport.py:236 — transport.detect_transports has cognitive complexity 50 (threshold 15). Drivers by points: if/else 9 (28 pts), loops 7 (17 pts), boolean chains 3, error handling 2 (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 · server.create_chat_completion (cognitive 50) · ×1
  • server.create_chat_completion (cognitive 50) REDACTED:5037 — server.create_chat_completion has cognitive complexity 50 (threshold 15). Drivers by points: if/else 27 (32 pts), boolean chains 10, ternaries 2 (4 pts), error handling 2, loops 1 (2 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 · MenubarIconRecovery.fixStatusKitPermission (cognitive 50) · ×1
  • MenubarIconRecovery.fixStatusKitPermission (cognitive 50) apps/omlx-mac/Sources/Menubar/MenubarVisibilityWatcher.swift:368 — MenubarIconRecovery.fixStatusKitPermission has cognitive complexity 50 (threshold 15). Drivers by points: if/else 23 (37 pts), boolean chains 5, error handling 3 (4 pts), ternaries 2 (3 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 · ClusterDeployment.__post_init__ (cognitive 49) · ×1
  • ClusterDeployment.__post_init__ (cognitive 49) omlx/cluster/deployment.py:369 — ClusterDeployment.__post_init__ has cognitive complexity 49 (threshold 15). Drivers by points: if/else 24 (39 pts), boolean chains 5, loops 3 (5 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 · decode_kernels.moe_gate_up_swiglu (cognitive 49) · ×1
  • decode_kernels.moe_gate_up_swiglu (cognitive 49) omlx/patches/mlx_vlm_glm5_next_compat/decode_kernels.py:798 — decode_kernels.moe_gate_up_swiglu has cognitive complexity 49 (threshold 15). Drivers by points: if/else 23 (33 pts), boolean chains 13, ternaries 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 · Scheduler._plan_prefill_rows (cognitive 49) · ×1
  • Scheduler._plan_prefill_rows (cognitive 49) omlx/scheduler.py:7824 — Scheduler._plan_prefill_rows has cognitive complexity 49 (threshold 15). Drivers by points: if/else 13 (23 pts), boolean chains 10, ternaries 4 (9 pts), loops 4 (5 pts), error handling 1 (2 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 · tool_calling._parse_hermes_tool_calls (cognitive 48) · ×1
  • tool_calling._parse_hermes_tool_calls (cognitive 48) omlx/api/tool_calling.py:1180 — tool_calling._parse_hermes_tool_calls has cognitive complexity 48 (threshold 15). Drivers by points: if/else 9 (23 pts), error handling 5 (17 pts), loops 3 (6 pts), ternaries 1 (2 pts) (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 · BoundarySnapshotSSDStore._read_state_tuple_raw (cognitive 48) · ×1
  • BoundarySnapshotSSDStore._read_state_tuple_raw (cognitive 48) omlx/cache/boundary_snapshot_store.py:1786 — BoundarySnapshotSSDStore._read_state_tuple_raw has cognitive complexity 48 (threshold 15). Drivers by points: if/else 16 (33 pts), error handling 3 (7 pts), loops 3 (7 pts), ternaries 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.
D2 · Cognitive Complexity · routes._activate_and_report (cognitive 48) · ×1
  • routes._activate_and_report (cognitive 48) omlx/cluster/routes.py:3479 — routes._activate_and_report has cognitive complexity 48 (threshold 15). Drivers by points: if/else 13 (21 pts), error handling 10 (14 pts), ternaries 5 (10 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 · runtime._validated_metrics (cognitive 48) · ×1
  • runtime._validated_metrics (cognitive 48) omlx/cluster/runtime.py:196 — runtime._validated_metrics has cognitive complexity 48 (threshold 15). Drivers by points: if/else 19 (32 pts), loops 5 (9 pts), boolean chains 6, ternaries 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 · prompt_priming._capture_single (cognitive 48) · ×1
  • prompt_priming._capture_single (cognitive 48) REDACTED:1100 — prompt_priming._capture_single has cognitive complexity 48 (threshold 15). Drivers by points: if/else 19 (26 pts), ternaries 8 (16 pts), boolean chains 4, loops 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 · ThinkingParser.feed (cognitive 47) · ×1
  • ThinkingParser.feed (cognitive 47) omlx/api/thinking.py:321 — ThinkingParser.feed has cognitive complexity 47 (threshold 15). Drivers by points: if/else 18 (42 pts), boolean chains 4, loops 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 · tool_calling._parse_xml_tool_calls (cognitive 47) · ×1
  • tool_calling._parse_xml_tool_calls (cognitive 47) omlx/api/tool_calling.py:944 — tool_calling._parse_xml_tool_calls has cognitive complexity 47 (threshold 15). Drivers by points: if/else 11 (26 pts), loops 4 (11 pts), ternaries 2 (7 pts), error handling 1 (2 pts), boolean chains 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 · cli.cluster_command (cognitive 47) · ×1
  • cli.cluster_command (cognitive 47) REDACTED:955 — cli.cluster_command has cognitive complexity 47 (threshold 15). Drivers by points: if/else 20 (31 pts), error handling 5 (10 pts), boolean chains 4, loops 1 (2 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 · Indexer.__call__ (cognitive 47) · ×1
  • Indexer.__call__ (cognitive 47) omlx/patches/deepseek_v4/deepseek_v4_model.py:1364 — Indexer.__call__ has cognitive complexity 47 (threshold 15). Drivers by points: if/else 17 (29 pts), ternaries 5 (11 pts), boolean chains 5, error handling 1 (2 pts) (nesting depth added 19). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D2 · Cognitive Complexity · Scheduler._buffer_stop_sequence_output (cognitive 47) · ×1
  • Scheduler._buffer_stop_sequence_output (cognitive 47) omlx/scheduler.py:8261 — Scheduler._buffer_stop_sequence_output has cognitive complexity 47 (threshold 15). Drivers by points: if/else 17 (30 pts), loops 7 (11 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 · audio_routes._run_realtime_voice (cognitive 46) · ×1
  • audio_routes._run_realtime_voice (cognitive 46) omlx/api/audio_routes.py:1143 — audio_routes._run_realtime_voice has cognitive complexity 46 (threshold 15). Drivers by points: if/else 9 (22 pts), error handling 4 (8 pts), ternaries 2 (6 pts), boolean chains 5, loops 2 (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 · progressive_loading.progressive_sharded_load (cognitive 46) · ×1
  • progressive_loading.progressive_sharded_load (cognitive 46) omlx/cluster/progressive_loading.py:74 — progressive_loading.progressive_sharded_load has cognitive complexity 46 (threshold 15). Drivers by points: if/else 24 (36 pts), boolean chains 8, 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 · Scheduler._validate_cache (cognitive 46) · ×1
  • Scheduler._validate_cache (cognitive 46) omlx/scheduler.py:10283 — Scheduler._validate_cache has cognitive complexity 46 (threshold 15). Drivers by points: if/else 13 (33 pts), loops 3 (7 pts), boolean chains 4, error handling 1 (2 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 · ExperimentalSection.body (cognitive 46) · ×1
  • ExperimentalSection.body (cognitive 46) apps/omlx-mac/Sources/AppView/Screens/ModelSettingsScreen.swift:2503 — ExperimentalSection.body has cognitive complexity 46 (threshold 15). Drivers by points: if/else 19 (36 pts), boolean chains 5, ternaries 2 (5 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 · routes._feature_problem (cognitive 45) · ×1
  • routes._feature_problem (cognitive 45) omlx/admin/routes.py:4137 — routes._feature_problem has cognitive complexity 45 (threshold 15). Drivers by points: if/else 17 (28 pts), boolean chains 7, error handling 2 (4 pts), ternaries 2 (4 pts), loops 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 · paged_ssd_cache._load_nstate_flat (cognitive 45) · ×1
  • paged_ssd_cache._load_nstate_flat (cognitive 45) omlx/cache/paged_ssd_cache.py:837 — paged_ssd_cache._load_nstate_flat has cognitive complexity 45 (threshold 15). Drivers by points: if/else 17 (34 pts), boolean chains 7, error handling 1 (2 pts), loops 1 (2 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 · PairingManager.complete_join (cognitive 45) · ×1
  • PairingManager.complete_join (cognitive 45) REDACTED:1093 — PairingManager.complete_join has cognitive complexity 45 (threshold 15). Drivers by points: if/else 18 (26 pts), error handling 6 (10 pts), boolean chains 7, 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 · VLMModelAdapter.__call__ (cognitive 45) · ×1
  • VLMModelAdapter.__call__ (cognitive 45) omlx/models/vlm.py:613 — VLMModelAdapter.__call__ has cognitive complexity 45 (threshold 15). Drivers by points: if/else 17 (32 pts), boolean chains 9, 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 · BatchPoolingCache.accumulate_windows (cognitive 45) · ×1
  • BatchPoolingCache.accumulate_windows (cognitive 45) omlx/patches/deepseek_v4/cache_extras.py:515 — BatchPoolingCache.accumulate_windows has cognitive complexity 45 (threshold 15). Drivers by points: if/else 14 (27 pts), ternaries 3 (9 pts), loops 3 (4 pts), boolean chains 3, error handling 1 (2 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 · Model.sanitize (cognitive 45) · ×1
  • Model.sanitize (cognitive 45) omlx/patches/mimo_v2/mimo_v2_model.py:598 — Model.sanitize has cognitive complexity 45 (threshold 15). Drivers by points: if/else 13 (26 pts), loops 7 (12 pts), boolean chains 7 (nesting depth added 18). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D2 · Cognitive Complexity · decode_kernels.kda_decode_step (cognitive 45) · ×1
  • decode_kernels.kda_decode_step (cognitive 45) omlx/patches/mlx_vlm_glm5_next_compat/decode_kernels.py:2373 — decode_kernels.kda_decode_step has cognitive complexity 45 (threshold 15). Drivers by points: if/else 20 (27 pts), boolean chains 18 (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 · ToolCallStreamFilter._advance_json_scan (cognitive 44) · ×1
  • ToolCallStreamFilter._advance_json_scan (cognitive 44) omlx/api/tool_calling.py:2921 — ToolCallStreamFilter._advance_json_scan has cognitive complexity 44 (threshold 15). Drivers by points: if/else 16 (33 pts), loops 3 (6 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 21). 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 · BoundarySnapshotSSDStore._read_state_tuple_arrays (cognitive 44) · ×1
  • BoundarySnapshotSSDStore._read_state_tuple_arrays (cognitive 44) omlx/cache/boundary_snapshot_store.py:1948 — BoundarySnapshotSSDStore._read_state_tuple_arrays has cognitive complexity 44 (threshold 15). Drivers by points: if/else 12 (27 pts), error handling 3 (7 pts), loops 3 (7 pts), boolean chains 2, ternaries 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 · transport.assess_link (cognitive 44) · ×1
  • transport.assess_link (cognitive 44) omlx/cluster/transport.py:890 — transport.assess_link has cognitive complexity 44 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 12, ternaries 6 (12 pts), error handling 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 · moe_expert_offload.estimate_offload_admission_bytes (cognitive 44) · ×1
  • moe_expert_offload.estimate_offload_admission_bytes (cognitive 44) omlx/patches/moe_expert_offload.py:1172 — moe_expert_offload.estimate_offload_admission_bytes has cognitive complexity 44 (threshold 15). Drivers by points: if/else 15 (34 pts), loops 4 (5 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 · Scheduler._collect_arrays_from_extracted_cache (cognitive 44) · ×1
  • Scheduler._collect_arrays_from_extracted_cache (cognitive 44) omlx/scheduler.py:2874 — Scheduler._collect_arrays_from_extracted_cache has cognitive complexity 44 (threshold 15). Drivers by points: if/else 7 (26 pts), loops 5 (17 pts), boolean chains 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 · Scheduler._run_prefill_chunks (cognitive 44) · ×1
  • Scheduler._run_prefill_chunks (cognitive 44) omlx/scheduler.py:7286 — Scheduler._run_prefill_chunks has cognitive complexity 44 (threshold 15). Drivers by points: if/else 14 (23 pts), ternaries 4 (9 pts), boolean chains 5, loops 5, 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 · clusterV2Wizard.acceleratorRows (cognitive 44) · ×1
  • clusterV2Wizard.acceleratorRows (cognitive 44) apps/omlx-web/omlx_web/static/js/cluster_v2.js:1906 — clusterV2Wizard.acceleratorRows has cognitive complexity 44 (threshold 15). Drivers by points: ternaries 7 (18 pts), if/else 13 (15 pts), boolean chains 11 (nesting depth added 13). Most of this is not in the body itself: 1 of the 44 points is its own statement and the rest belongs to 4 function items inside it that branch (a function literal at line 1913, size, t, …). 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 · BoundarySnapshotSSDStore._process_write_item (cognitive 43) · ×1
  • BoundarySnapshotSSDStore._process_write_item (cognitive 43) omlx/cache/boundary_snapshot_store.py:1072 — BoundarySnapshotSSDStore._process_write_item has cognitive complexity 43 (threshold 15). Drivers by points: if/else 15 (23 pts), error handling 6 (12 pts), boolean chains 6, 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 · BlockAwarePrefixCache._validate_block_cache_data (cognitive 43) · ×1
  • BlockAwarePrefixCache._validate_block_cache_data (cognitive 43) omlx/cache/prefix_cache.py:5242 — BlockAwarePrefixCache._validate_block_cache_data has cognitive complexity 43 (threshold 15). Drivers by points: if/else 14 (30 pts), boolean chains 7, ternaries 1 (3 pts), error handling 1 (2 pts), loops 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 · launch.preflight_remote_hosts (cognitive 43) · ×1
  • launch.preflight_remote_hosts (cognitive 43) omlx/cluster/launch.py:2402 — launch.preflight_remote_hosts has cognitive complexity 43 (threshold 15). Drivers by points: if/else 13 (25 pts), boolean chains 6, ternaries 3 (6 pts), error handling 3 (5 pts), 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 · EnginePool.resolve_model_id (cognitive 43) · ×1
  • EnginePool.resolve_model_id (cognitive 43) omlx/engine_pool.py:2000 — EnginePool.resolve_model_id has cognitive complexity 43 (threshold 15). Drivers by points: if/else 17 (33 pts), loops 2 (5 pts), error handling 1 (3 pts), boolean chains 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 · qwen38_modelopt_mixed.transform_weights_exact (cognitive 43) · ×1
  • qwen38_modelopt_mixed.transform_weights_exact (cognitive 43) omlx/patches/qwen38_modelopt_mixed.py:283 — qwen38_modelopt_mixed.transform_weights_exact has cognitive complexity 43 (threshold 15). Drivers by points: if/else 15 (39 pts), boolean chains 3, loops 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 · ane_tuning._measure_candidate (cognitive 42) · ×1
  • ane_tuning._measure_candidate (cognitive 42) omlx/admin/ane_tuning.py:591 — ane_tuning._measure_candidate has cognitive complexity 42 (threshold 15). Drivers by points: if/else 16 (22 pts), boolean chains 11, ternaries 3 (5 pts), error handling 1 (2 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 · PairingManager.handle_join_request (cognitive 42) · ×1
  • PairingManager.handle_join_request (cognitive 42) REDACTED:1245 — PairingManager.handle_join_request has cognitive complexity 42 (threshold 15). Drivers by points: if/else 18 (21 pts), boolean chains 16, error handling 2 (3 pts), loops 1, ternaries 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 · planner._tensor_parallel_divisors (cognitive 42) · ×1
  • planner._tensor_parallel_divisors (cognitive 42) omlx/cluster/planner.py:734 — planner._tensor_parallel_divisors has cognitive complexity 42 (threshold 15). Drivers by points: if/else 11 (24 pts), loops 3 (12 pts), ternaries 2 (4 pts), boolean chains 2 (nesting depth added 24). 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 · ModelSettingsManager._load_profiles (cognitive 42) · ×1
  • ModelSettingsManager._load_profiles (cognitive 42) omlx/model_settings.py:1126 — ModelSettingsManager._load_profiles has cognitive complexity 42 (threshold 15). Drivers by points: if/else 12 (28 pts), boolean chains 6, error handling 2 (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 · server._prepare_anthropic_prompt (cognitive 42) · ×1
  • server._prepare_anthropic_prompt (cognitive 42) REDACTED:7831 — server._prepare_anthropic_prompt has cognitive complexity 42 (threshold 15). Drivers by points: if/else 16 (24 pts), boolean chains 10, loops 1 (3 pts), ternaries 3, 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 · OQManager.start_quantization (cognitive 41) · ×1
  • OQManager.start_quantization (cognitive 41) omlx/admin/oq_manager.py:304 — OQManager.start_quantization has cognitive complexity 41 (threshold 15). Drivers by points: if/else 20 (29 pts), boolean chains 7, ternaries 2 (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.
D2 · Cognitive Complexity · routes.replan_cluster_deployment (cognitive 41) · ×1
  • routes.replan_cluster_deployment (cognitive 41) omlx/cluster/routes.py:3842 — routes.replan_cluster_deployment has cognitive complexity 41 (threshold 15). Drivers by points: if/else 14 (18 pts), ternaries 10 (11 pts), boolean chains 7, error handling 4 (5 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 · LFM3VoiceBackend._slot (cognitive 41) · ×1
  • LFM3VoiceBackend._slot (cognitive 41) omlx/engine/lfm3_realtime.py:311 — LFM3VoiceBackend._slot has cognitive complexity 41 (threshold 15). Drivers by points: if/else 14 (24 pts), ternaries 5 (13 pts), boolean chains 4 (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 · EnginePool._engine_runtime_signature (cognitive 41) · ×1
  • EnginePool._engine_runtime_signature (cognitive 41) omlx/engine_pool.py:1260 — EnginePool._engine_runtime_signature has cognitive complexity 41 (threshold 15). Drivers by points: if/else 20 (26 pts), boolean chains 12, ternaries 3 (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 · model_discovery.discover_models (cognitive 41) · ×1
  • model_discovery.discover_models (cognitive 41) omlx/model_discovery.py:1995 — model_discovery.discover_models has cognitive complexity 41 (threshold 15). Drivers by points: if/else 13 (32 pts), boolean chains 5, loops 2 (4 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 · SwitchGLU.__call__ (cognitive 41) · ×1
  • SwitchGLU.__call__ (cognitive 41) omlx/patches/deepseek_v4/switch_layers.py:482 — SwitchGLU.__call__ has cognitive complexity 41 (threshold 15). Drivers by points: if/else 18 (26 pts), boolean chains 9, ternaries 3 (6 pts) (nesting depth added 11). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D2 · Cognitive Complexity · moe_offload.resolve_view (cognitive 41) · ×1
  • moe_offload.resolve_view (cognitive 41) omlx/patches/glm_moe_dsa/moe_offload.py:98 — moe_offload.resolve_view has cognitive complexity 41 (threshold 15). Drivers by points: if/else 8 (27 pts), loops 5 (11 pts), ternaries 2, boolean chains 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.
D2 · Cognitive Complexity · Scheduler._get_boundary_store_override (cognitive 41) · ×1
  • Scheduler._get_boundary_store_override (cognitive 41) omlx/scheduler.py:9673 — Scheduler._get_boundary_store_override has cognitive complexity 41 (threshold 15). Drivers by points: if/else 17 (25 pts), boolean chains 9, ternaries 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 · PerformanceScreenVM.save (cognitive 41) · ×1
  • PerformanceScreenVM.save (cognitive 41) apps/omlx-mac/Sources/AppView/ViewModels/PerformanceScreenVM.swift:232 — PerformanceScreenVM.save has cognitive complexity 41 (threshold 15). Drivers by points: if/else 27 (31 pts), boolean chains 6, match/switch 2 (3 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 · UpdateController.runCheck (cognitive 41) · ×1
  • UpdateController.runCheck (cognitive 41) apps/omlx-mac/Sources/Updater/UpdateController.swift:312 — UpdateController.runCheck has cognitive complexity 41 (threshold 15). Drivers by points: if/else 16 (34 pts), boolean chains 5, error handling 2 (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 · dashboard.validateQwenAneSettings (cognitive 41) · ×1
  • dashboard.validateQwenAneSettings (cognitive 41) REDACTED:3461 — dashboard.validateQwenAneSettings has cognitive complexity 41 (threshold 15). Drivers by points: if/else 24 (33 pts), boolean chains 8 (nesting depth added 9). Of this number, 30 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 · ane_tuning._profile_refinement (cognitive 40) · ×1
  • ane_tuning._profile_refinement (cognitive 40) omlx/admin/ane_tuning.py:802 — ane_tuning._profile_refinement has cognitive complexity 40 (threshold 15). Drivers by points: if/else 8 (16 pts), ternaries 7 (15 pts), boolean chains 9 (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 · routes._delete_gguf_model (cognitive 40) · ×1
  • routes._delete_gguf_model (cognitive 40) omlx/admin/routes.py:8693 — routes._delete_gguf_model has cognitive complexity 40 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 8, loops 3 (7 pts), error handling 2 (3 pts), ternaries 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 · stage_transport.install_stage_links (cognitive 40) · ×1
  • stage_transport.install_stage_links (cognitive 40) omlx/cluster/rdma/stage_transport.py:218 — stage_transport.install_stage_links has cognitive complexity 40 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 9, error handling 3 (7 pts), ternaries 3 (5 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 · ModelSettingsManager._repair_profile_references (cognitive 40) · ×1
  • ModelSettingsManager._repair_profile_references (cognitive 40) omlx/model_settings.py:733 — ModelSettingsManager._repair_profile_references has cognitive complexity 40 (threshold 15). Drivers by points: if/else 12 (22 pts), loops 8 (10 pts), boolean chains 4, error handling 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 · deepseek_v4_model._sparse_pooled_attention (cognitive 40) · ×1
  • deepseek_v4_model._sparse_pooled_attention (cognitive 40) omlx/patches/deepseek_v4/deepseek_v4_model.py:789 — deepseek_v4_model._sparse_pooled_attention has cognitive complexity 40 (threshold 15). Drivers by points: if/else 17 (24 pts), ternaries 4 (7 pts), boolean chains 6, error handling 1 (3 pts) (nesting depth added 12). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D2 · Cognitive Complexity · _DepthController.observe (cognitive 40) · ×1
  • _DepthController.observe (cognitive 40) REDACTED:2790 — _DepthController.observe has cognitive complexity 40 (threshold 15). Drivers by points: if/else 18 (31 pts), ternaries 2 (5 pts), boolean chains 2, loops 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 · prompt_priming.maybe_capture (cognitive 40) · ×1
  • prompt_priming.maybe_capture (cognitive 40) REDACTED:877 — prompt_priming.maybe_capture has cognitive complexity 40 (threshold 15). Drivers by points: if/else 16 (31 pts), boolean chains 4, ternaries 2 (3 pts), loops 1 (2 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 · PrefillHelperManager._run (cognitive 40) · ×1
  • PrefillHelperManager._run (cognitive 40) omlx/prefill_helper/manager.py:613 — PrefillHelperManager._run has cognitive complexity 40 (threshold 15). Drivers by points: if/else 11 (26 pts), error handling 3 (6 pts), ternaries 1 (4 pts), boolean chains 3, 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 · defaults (cognitive 40) · ×1
  • defaults (cognitive 40) apps/omlx-web/omlx_web/static/js/custom_theme.js:299 — defaults has cognitive complexity 40 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 6 (13 pts), boolean chains 3, ternaries 1 (3 pts), 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 · benchmark._upload_to_omlx_ai (cognitive 39) · ×1
  • benchmark._upload_to_omlx_ai (cognitive 39) omlx/admin/benchmark.py:1746 — benchmark._upload_to_omlx_ai has cognitive complexity 39 (threshold 15). Drivers by points: if/else 16 (22 pts), boolean chains 8, ternaries 2 (4 pts), loops 2 (3 pts), 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 · MSDownloader._run_download (cognitive 39) · ×1
  • MSDownloader._run_download (cognitive 39) omlx/admin/ms_downloader.py:902 — MSDownloader._run_download has cognitive complexity 39 (threshold 15). Drivers by points: if/else 13 (20 pts), error handling 7 (12 pts), boolean chains 5, 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 · pooling_delta.compact_pooling_cache_snapshot (cognitive 39) · ×1
  • pooling_delta.compact_pooling_cache_snapshot (cognitive 39) omlx/cache/pooling_delta.py:22 — pooling_delta.compact_pooling_cache_snapshot has cognitive complexity 39 (threshold 15). Drivers by points: if/else 10 (24 pts), boolean chains 7, error handling 1 (3 pts), loops 2 (3 pts), ternaries 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 · discovery_routes._enrich_paired_row (cognitive 39) · ×1
  • discovery_routes._enrich_paired_row (cognitive 39) omlx/cluster/discovery_routes.py:213 — discovery_routes._enrich_paired_row has cognitive complexity 39 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 13, loops 3 (4 pts), ternaries 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 · MLXRerankerModel._rerank_jina (cognitive 39) · ×1
  • MLXRerankerModel._rerank_jina (cognitive 39) omlx/models/reranker.py:1149 — MLXRerankerModel._rerank_jina has cognitive complexity 39 (threshold 15). Drivers by points: if/else 16 (25 pts), loops 4 (8 pts), ternaries 2 (5 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 · glm5_next_batch_rollback.rollback_rows (cognitive 39) · ×1
  • glm5_next_batch_rollback.rollback_rows (cognitive 39) omlx/patches/mlx_vlm_mtp/glm5_next_batch_rollback.py:10 — glm5_next_batch_rollback.rollback_rows has cognitive complexity 39 (threshold 15). Drivers by points: if/else 14 (25 pts), boolean chains 6, loops 4, ternaries 2 (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 · Scheduler._detect_needs_think_prefix (cognitive 39) · ×1
  • Scheduler._detect_needs_think_prefix (cognitive 39) omlx/scheduler.py:8928 — Scheduler._detect_needs_think_prefix has cognitive complexity 39 (threshold 15). Drivers by points: if/else 13 (24 pts), boolean chains 7, loops 3 (6 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 · dashboard.dashboard.validateQwenAneSettings (cognitive 39) · ×1
  • dashboard.dashboard.validateQwenAneSettings (cognitive 39) REDACTED:3461 — dashboard.dashboard.validateQwenAneSettings has cognitive complexity 39 (threshold 15). Drivers by points: if/else 24 (33 pts), boolean chains 6 (nesting depth added 9). Of this number, 30 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 · HFDownloader.search_models (cognitive 38) · ×1
  • HFDownloader.search_models (cognitive 38) REDACTED:1463 — HFDownloader.search_models has cognitive complexity 38 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 14, ternaries 2 (4 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 · HFDownloader._poll_progress (cognitive 38) · ×1
  • HFDownloader._poll_progress (cognitive 38) REDACTED:2376 — HFDownloader._poll_progress has cognitive complexity 38 (threshold 15). Drivers by points: if/else 12 (25 pts), ternaries 3 (8 pts), boolean chains 3, 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 · PeerWatchdog.run (cognitive 38) · ×1
  • PeerWatchdog.run (cognitive 38) omlx/cluster/liveness.py:511 — PeerWatchdog.run has cognitive complexity 38 (threshold 15). Drivers by points: if/else 11 (22 pts), loops 3 (7 pts), boolean chains 3, error handling 1 (3 pts), ternaries 1 (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 · PairingManager.approve (cognitive 38) · ×1
  • PairingManager.approve (cognitive 38) REDACTED:1371 — PairingManager.approve has cognitive complexity 38 (threshold 15). Drivers by points: if/else 16 (23 pts), error handling 5 (8 pts), boolean chains 4, ternaries 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 · EnginePool._evict_idle_lru_for_prefill (cognitive 38) · ×1
  • EnginePool._evict_idle_lru_for_prefill (cognitive 38) omlx/engine_pool.py:3259 — EnginePool._evict_idle_lru_for_prefill has cognitive complexity 38 (threshold 15). Drivers by points: if/else 12 (29 pts), boolean chains 7, loops 2 (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 · MLXRerankerModel._resolve_token_id (cognitive 38) · ×1
  • MLXRerankerModel._resolve_token_id (cognitive 38) omlx/models/reranker.py:549 — MLXRerankerModel._resolve_token_id has cognitive complexity 38 (threshold 15). Drivers by points: if/else 12 (21 pts), error handling 5 (10 pts), boolean chains 6, 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 · fused_batch._advance_group (cognitive 38) · ×1
  • fused_batch._advance_group (cognitive 38) omlx/patches/mlx_lm_mtp/fused_batch.py:205 — fused_batch._advance_group has cognitive complexity 38 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 10, ternaries 4 (7 pts), 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 · server.stream_completion (cognitive 38) · ×1
  • server.stream_completion (cognitive 38) REDACTED:6088 — server.stream_completion has cognitive complexity 38 (threshold 15). Drivers by points: if/else 13 (18 pts), ternaries 5 (11 pts), boolean chains 7, error handling 1, 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 · harmony.parse_tool_calls_from_tokens (cognitive 37) · ×1
  • harmony.parse_tool_calls_from_tokens (cognitive 37) omlx/adapter/harmony.py:429 — harmony.parse_tool_calls_from_tokens has cognitive complexity 37 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 6 (12 pts), boolean chains 2, error handling 2, ternaries 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 · accuracy_upload.trim_question_results (cognitive 37) · ×1
  • accuracy_upload.trim_question_results (cognitive 37) omlx/admin/accuracy_upload.py:147 — accuracy_upload.trim_question_results has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (25 pts), boolean chains 6, loops 3 (4 pts), ternaries 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 · routes.probe_cache (cognitive 37) · ×1
  • routes.probe_cache (cognitive 37) omlx/admin/routes.py:7922 — routes.probe_cache has cognitive complexity 37 (threshold 15). Drivers by points: if/else 16 (20 pts), ternaries 6, boolean chains 5, error handling 3 (5 pts), 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, 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 · VLMBatchedEngine._try_build_cached_vision_inputs (cognitive 37) · ×1
  • VLMBatchedEngine._try_build_cached_vision_inputs (cognitive 37) omlx/engine/vlm.py:3706 — VLMBatchedEngine._try_build_cached_vision_inputs has cognitive complexity 37 (threshold 15). Drivers by points: if/else 17 (24 pts), boolean chains 6, loops 3 (4 pts), ternaries 2, 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 · BaseBenchmark.run (cognitive 37) · ×1
  • BaseBenchmark.run (cognitive 37) omlx/eval/base.py:364 — BaseBenchmark.run has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (19 pts), loops 7 (10 pts), ternaries 2 (4 pts), boolean chains 2, 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 · batch_generator._chain_next_drafts (cognitive 37) · ×1
  • batch_generator._chain_next_drafts (cognitive 37) REDACTED:3252 — batch_generator._chain_next_drafts has cognitive complexity 37 (threshold 15). Drivers by points: if/else 18 (25 pts), ternaries 4 (6 pts), boolean chains 5, 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 · moe_expert_offload._resolve_store_view (cognitive 37) · ×1
  • moe_expert_offload._resolve_store_view (cognitive 37) omlx/patches/moe_expert_offload.py:979 — moe_expert_offload._resolve_store_view has cognitive complexity 37 (threshold 15). Drivers by points: if/else 9 (23 pts), loops 4 (7 pts), ternaries 4 (6 pts), boolean chains 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 · Scheduler._build_sampler_and_processors (cognitive 37) · ×1
  • Scheduler._build_sampler_and_processors (cognitive 37) omlx/scheduler.py:8551 — Scheduler._build_sampler_and_processors has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (23 pts), ternaries 5 (8 pts), boolean chains 4, 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 · Scheduler._prepare_prompt_boundary_cache_store (cognitive 37) · ×1
  • Scheduler._prepare_prompt_boundary_cache_store (cognitive 37) omlx/scheduler.py:10137 — Scheduler._prepare_prompt_boundary_cache_store has cognitive complexity 37 (threshold 15). Drivers by points: if/else 16 (29 pts), boolean chains 4, 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 · ServerScreenVM.restart (cognitive 37) · ×1
  • ServerScreenVM.restart (cognitive 37) apps/omlx-mac/Sources/AppView/ViewModels/ServerScreenVM.swift:644 — ServerScreenVM.restart has cognitive complexity 37 (threshold 15). Drivers by points: if/else 10 (25 pts), ternaries 2 (6 pts), boolean chains 5, error handling 1 (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 · benchmark._log_ane_benchmark_trace (cognitive 36) · ×1
  • benchmark._log_ane_benchmark_trace (cognitive 36) omlx/admin/benchmark.py:1112 — benchmark._log_ane_benchmark_trace has cognitive complexity 36 (threshold 15). Drivers by points: boolean chains 16, ternaries 9 (16 pts), if/else 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 · routes.clear_hot_cache (cognitive 36) · ×1
  • routes.clear_hot_cache (cognitive 36) omlx/admin/routes.py:7732 — routes.clear_hot_cache has cognitive complexity 36 (threshold 15). Drivers by points: if/else 10 (20 pts), error handling 4 (10 pts), loops 3 (4 pts), boolean chains 2 (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 · launch.build_mlx_launch_argv (cognitive 36) · ×1
  • launch.build_mlx_launch_argv (cognitive 36) omlx/cluster/launch.py:1188 — launch.build_mlx_launch_argv has cognitive complexity 36 (threshold 15). Drivers by points: if/else 23 (27 pts), boolean chains 4, error handling 2 (4 pts), 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 · oq._load_hf_calibration (cognitive 36) · ×1
  • oq._load_hf_calibration (cognitive 36) REDACTED:8310 — oq._load_hf_calibration has cognitive complexity 36 (threshold 15). Drivers by points: if/else 14 (22 pts), error handling 4 (9 pts), loops 2 (4 pts), boolean chains 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 · deepseek_v4_model._batch_indexer_rows (cognitive 36) · ×1
  • deepseek_v4_model._batch_indexer_rows (cognitive 36) omlx/patches/deepseek_v4/deepseek_v4_model.py:1549 — deepseek_v4_model._batch_indexer_rows has cognitive complexity 36 (threshold 15). Drivers by points: if/else 10 (22 pts), error handling 2 (6 pts), loops 3 (5 pts), boolean chains 3 (nesting depth added 18). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D2 · Cognitive Complexity · GlmMoeDsaAttention.__call__ (cognitive 36) · ×1
  • GlmMoeDsaAttention.__call__ (cognitive 36) omlx/patches/glm_moe_dsa/glm_moe_dsa_model.py:185 — GlmMoeDsaAttention.__call__ has cognitive complexity 36 (threshold 15). Drivers by points: if/else 20 (29 pts), boolean chains 6, ternaries 1 (nesting depth added 9). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D2 · Cognitive Complexity · Scheduler._normalize_rotating_snapshot_state (cognitive 36) · ×1
  • Scheduler._normalize_rotating_snapshot_state (cognitive 36) omlx/scheduler.py:10353 — Scheduler._normalize_rotating_snapshot_state has cognitive complexity 36 (threshold 15). Drivers by points: ternaries 10 (14 pts), boolean chains 9, if/else 7 (8 pts), error handling 3 (5 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, 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 · Scheduler._route_to_vlm_mtp (cognitive 36) · ×1
  • Scheduler._route_to_vlm_mtp (cognitive 36) omlx/scheduler.py:11588 — Scheduler._route_to_vlm_mtp has cognitive complexity 36 (threshold 15). Drivers by points: if/else 21 (24 pts), boolean chains 7, error handling 2, 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 · dashboard.saveGlobalSettings (cognitive 36) · ×1
  • dashboard.saveGlobalSettings (cognitive 36) REDACTED:1407 — dashboard.saveGlobalSettings has cognitive complexity 36 (threshold 15). Drivers by points: if/else 21 (25 pts), boolean chains 7, ternaries 2, error handling 1, other 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 · ToolCallStreamFilter._unwind_withheld_at_eof (cognitive 35) · ×1
  • ToolCallStreamFilter._unwind_withheld_at_eof (cognitive 35) omlx/api/tool_calling.py:3486 — ToolCallStreamFilter._unwind_withheld_at_eof has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (28 pts), loops 3 (4 pts), ternaries 1 (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 · PagedSSDCacheManager.load_block_with_metadata (cognitive 35) · ×1
  • PagedSSDCacheManager.load_block_with_metadata (cognitive 35) omlx/cache/paged_ssd_cache.py:4379 — PagedSSDCacheManager.load_block_with_metadata has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (18 pts), error handling 4 (8 pts), boolean chains 6, ternaries 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 · base._run_scheduler_preflight_with_cleanup_retry (cognitive 35) · ×1
  • base._run_scheduler_preflight_with_cleanup_retry (cognitive 35) omlx/engine/base.py:87 — base._run_scheduler_preflight_with_cleanup_retry has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (24 pts), boolean chains 8, ternaries 1 (2 pts), 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 · BatchedEngine._apply_chat_template (cognitive 35) · ×1
  • BatchedEngine._apply_chat_template (cognitive 35) REDACTED:936 — BatchedEngine._apply_chat_template has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (21 pts), loops 2 (7 pts), error handling 2 (4 pts), ternaries 1 (2 pts), boolean chains 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 · VLMBatchedEngine._apply_chat_template (cognitive 35) · ×1
  • VLMBatchedEngine._apply_chat_template (cognitive 35) omlx/engine/vlm.py:4747 — VLMBatchedEngine._apply_chat_template has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (24 pts), loops 2 (7 pts), error handling 2 (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 · vlm._gemma4_global_kv_from_per_layer_config (cognitive 35) · ×1
  • vlm._gemma4_global_kv_from_per_layer_config (cognitive 35) omlx/engine/vlm.py:784 — vlm._gemma4_global_kv_from_per_layer_config has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (22 pts), error handling 2 (7 pts), boolean chains 3, 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 · EnginePool._entry_runtime_resident_size (cognitive 35) · ×1
  • EnginePool._entry_runtime_resident_size (cognitive 35) omlx/engine_pool.py:603 — EnginePool._entry_runtime_resident_size has cognitive complexity 35 (threshold 15). Drivers by points: if/else 15 (22 pts), ternaries 4 (8 pts), boolean chains 5 (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 · EnginePool._stop_and_unload_engine (cognitive 35) · ×1
  • EnginePool._stop_and_unload_engine (cognitive 35) omlx/engine_pool.py:3779 — EnginePool._stop_and_unload_engine has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 6, ternaries 5 (6 pts), loops 3 (4 pts), error handling 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 · MLXEmbeddingModel._embed_batch (cognitive 35) · ×1
  • MLXEmbeddingModel._embed_batch (cognitive 35) omlx/models/embedding.py:1092 — MLXEmbeddingModel._embed_batch has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (25 pts), loops 2 (6 pts), error handling 1 (3 pts), boolean chains 1 (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 · oq._quantize_chunked (cognitive 35) · ×1
  • oq._quantize_chunked (cognitive 35) REDACTED:6888 — oq._quantize_chunked has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 7, loops 4 (6 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 · BatchPoolingCache.merge (cognitive 35) · ×1
  • BatchPoolingCache.merge (cognitive 35) omlx/patches/deepseek_v4/cache_extras.py:1147 — BatchPoolingCache.merge has cognitive complexity 35 (threshold 15). Drivers by points: if/else 15 (28 pts), loops 3 (6 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 · batch_generator._run_verify_cycle_batched (cognitive 35) · ×1
  • batch_generator._run_verify_cycle_batched (cognitive 35) REDACTED:3643 — batch_generator._run_verify_cycle_batched has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (14 pts), ternaries 5 (9 pts), loops 5 (8 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 · fused_batch.advance (cognitive 35) · ×1
  • fused_batch.advance (cognitive 35) omlx/patches/mlx_lm_mtp/fused_batch.py:57 — fused_batch.advance has cognitive complexity 35 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 5 (9 pts), boolean chains 8, 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 · decode_kernels.moe_down_combine (cognitive 35) · ×1
  • decode_kernels.moe_down_combine (cognitive 35) omlx/patches/mlx_vlm_glm5_next_compat/decode_kernels.py:936 — decode_kernels.moe_down_combine has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 11, ternaries 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 · Scheduler._drain_pending_async_removes (cognitive 35) · ×1
  • Scheduler._drain_pending_async_removes (cognitive 35) omlx/scheduler.py:3093 — Scheduler._drain_pending_async_removes has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (26 pts), error handling 2 (6 pts), boolean chains 2, 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 · cluster_v2.clusterV2Wizard.acceleratorRows (cognitive 35) · ×1
  • cluster_v2.clusterV2Wizard.acceleratorRows (cognitive 35) apps/omlx-web/omlx_web/static/js/cluster_v2.js:1906 — cluster_v2.clusterV2Wizard.acceleratorRows has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 11, ternaries 3 (9 pts) (nesting depth added 8). Most of this is not in the body itself: 1 of the 35 points is its own statement and the rest belongs to 2 function items inside it that branch (a function literal at line 1913, size). 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 · dashboard.dashboard.saveGlobalSettings (cognitive 35) · ×1
  • dashboard.dashboard.saveGlobalSettings (cognitive 35) REDACTED:1407 — dashboard.dashboard.saveGlobalSettings has cognitive complexity 35 (threshold 15). Drivers by points: if/else 21 (25 pts), boolean chains 7, ternaries 2, 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 · Gemma4OutputParserSession._consume_text (cognitive 34) · ×1
  • Gemma4OutputParserSession._consume_text (cognitive 34) omlx/adapter/gemma4.py:373 — Gemma4OutputParserSession._consume_text has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (30 pts), boolean chains 3, 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 · PagedSSDCacheManager._is_compatible_cache_signature (cognitive 34) · ×1
  • PagedSSDCacheManager._is_compatible_cache_signature (cognitive 34) omlx/cache/paged_ssd_cache.py:2874 — PagedSSDCacheManager._is_compatible_cache_signature has cognitive complexity 34 (threshold 15). Drivers by points: if/else 15 (20 pts), boolean chains 7, error handling 3 (5 pts), 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 · vlm._audio_feature_cache_key_ranges (cognitive 34) · ×1
  • vlm._audio_feature_cache_key_ranges (cognitive 34) omlx/engine/vlm.py:1630 — vlm._audio_feature_cache_key_ranges has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (20 pts), loops 4 (6 pts), boolean chains 5, ternaries 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 · batched_head.draft (cognitive 34) · ×1
  • batched_head.draft (cognitive 34) omlx/patches/mlx_lm_mtp/batched_head.py:90 — batched_head.draft has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (17 pts), loops 6 (10 pts), ternaries 3 (4 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 · qwen35_ane_prefill._backend_exact (cognitive 34) · ×1
  • qwen35_ane_prefill._backend_exact (cognitive 34) omlx/patches/qwen35_ane_prefill.py:1765 — qwen35_ane_prefill._backend_exact has cognitive complexity 34 (threshold 15). Drivers by points: if/else 18 (26 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 · dashboard.applyANETuningRecommendation (cognitive 34) · ×1
  • dashboard.applyANETuningRecommendation (cognitive 34) REDACTED:2968 — dashboard.applyANETuningRecommendation has cognitive complexity 34 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 11, error handling 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 · dashboard.accBuildText (cognitive 34) · ×1
  • dashboard.accBuildText (cognitive 34) REDACTED:6466 — dashboard.accBuildText has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 5 (13 pts), loops 8 (11 pts), if/else 4 (7 pts), boolean chains 3 (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 · benchmark._filter_uploaded_settings (cognitive 33) · ×1
  • benchmark._filter_uploaded_settings (cognitive 33) omlx/admin/benchmark.py:432 — benchmark._filter_uploaded_settings has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (21 pts), loops 4 (8 pts), boolean chains 3, 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 · markitdown.stream_messages_to_markdown_async (cognitive 33) · ×1
  • markitdown.stream_messages_to_markdown_async (cognitive 33) omlx/api/markitdown.py:200 — markitdown.stream_messages_to_markdown_async has cognitive complexity 33 (threshold 15). Drivers by points: loops 6 (16 pts), if/else 7 (15 pts), boolean chains 2 (nesting depth added 18). 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 · tool_calling.extract_tool_calls_with_thinking (cognitive 33) · ×1
  • tool_calling.extract_tool_calls_with_thinking (cognitive 33) omlx/api/tool_calling.py:2473 — tool_calling.extract_tool_calls_with_thinking has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (30 pts), boolean chains 3 (nesting depth added 18). 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 · staging.stage_files_from_source (cognitive 33) · ×1
  • staging.stage_files_from_source (cognitive 33) omlx/cluster/staging.py:1000 — staging.stage_files_from_source has cognitive complexity 33 (threshold 15). Drivers by points: if/else 14 (23 pts), boolean chains 4, ternaries 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 · PipelinedTextModel.__call__ (cognitive 33) · ×1
  • PipelinedTextModel.__call__ (cognitive 33) omlx/patches/glm5_next_mlx_lm/model.py:86 — PipelinedTextModel.__call__ has cognitive complexity 33 (threshold 15). Drivers by points: if/else 14 (17 pts), ternaries 8 (11 pts), boolean chains 4, 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, 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 · norm_repair.repair_legacy_head_norms (cognitive 33) · ×1
  • norm_repair.repair_legacy_head_norms (cognitive 33) omlx/patches/mlx_lm_mtp/norm_repair.py:51 — norm_repair.repair_legacy_head_norms has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 5 (7 pts), error handling 2 (6 pts), boolean chains 2, ternaries 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 · qwen35_fa256_attention.apply_qwen35_fa256_attention_patch (cognitive 33) · ×1
  • qwen35_fa256_attention.apply_qwen35_fa256_attention_patch (cognitive 33) omlx/patches/qwen35_fa256_attention.py:323 — qwen35_fa256_attention.apply_qwen35_fa256_attention_patch has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 4, error handling 3 (4 pts), loops 2 (3 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 · server._build_format_element (cognitive 33) · ×1
  • server._build_format_element (cognitive 33) REDACTED:5668 — server._build_format_element has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (24 pts), ternaries 3 (9 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 · target.run_specprefill_target_prefill (cognitive 33) · ×1
  • target.run_specprefill_target_prefill (cognitive 33) omlx/specprefill/target.py:57 — target.run_specprefill_target_prefill has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 5, ternaries 3 (5 pts), error handling 2 (4 pts), 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 · TalkAIController.handle (cognitive 33) · ×1
  • TalkAIController.handle (cognitive 33) apps/omlx-mac/Sources/AskAI/TalkAIController.swift:331 — TalkAIController.handle has cognitive complexity 33 (threshold 15). Drivers by points: if/else 14 (26 pts), boolean chains 4, ternaries 1 (2 pts), match/switch 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 · dashboard.dashboard.applyANETuningRecommendation (cognitive 33) · ×1
  • dashboard.dashboard.applyANETuningRecommendation (cognitive 33) REDACTED:2968 — dashboard.dashboard.applyANETuningRecommendation has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 11, 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 · InklingOutputParserSession.finalize (cognitive 32) · ×1
  • InklingOutputParserSession.finalize (cognitive 32) omlx/adapter/output_parser.py:1077 — InklingOutputParserSession.finalize has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (17 pts), error handling 3 (9 pts), ternaries 2 (3 pts), boolean chains 2, 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 · MSDownloader.get_model_info (cognitive 32) · ×1
  • MSDownloader.get_model_info (cognitive 32) omlx/admin/ms_downloader.py:588 — MSDownloader.get_model_info has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 7, error handling 4 (7 pts), ternaries 2 (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 · anthropic_utils._normalize_in_messages_system (cognitive 32) · ×1
  • anthropic_utils._normalize_in_messages_system (cognitive 32) omlx/api/anthropic_utils.py:737 — anthropic_utils._normalize_in_messages_system has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (25 pts), loops 2 (4 pts), ternaries 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 · responses_utils.convert_responses_tools (cognitive 32) · ×1
  • responses_utils.convert_responses_tools (cognitive 32) omlx/api/responses_utils.py:434 — responses_utils.convert_responses_tools has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (23 pts), boolean chains 4, loops 2 (4 pts), ternaries 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 · tool_calling._scan_gemma4_args_span (cognitive 32) · ×1
  • tool_calling._scan_gemma4_args_span (cognitive 32) omlx/api/tool_calling.py:1442 — tool_calling._scan_gemma4_args_span has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (27 pts), loops 2 (4 pts), boolean chains 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 · PagedSSDCacheManager._scan_existing_files (cognitive 32) · ×1
  • PagedSSDCacheManager._scan_existing_files (cognitive 32) omlx/cache/paged_ssd_cache.py:2460 — PagedSSDCacheManager._scan_existing_files has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (19 pts), error handling 2 (7 pts), boolean chains 3, 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 · VisionFeatureSSDCache._writer_loop (cognitive 32) · ×1
  • VisionFeatureSSDCache._writer_loop (cognitive 32) omlx/cache/vision_feature_cache.py:544 — VisionFeatureSSDCache._writer_loop has cognitive complexity 32 (threshold 15). Drivers by points: if/else 7 (18 pts), error handling 3 (8 pts), loops 2 (4 pts), boolean chains 2 (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 · DiscoveryService._probe_candidate (cognitive 32) · ×1
  • DiscoveryService._probe_candidate (cognitive 32) REDACTED:1854 — DiscoveryService._probe_candidate has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14 (20 pts), boolean chains 9, 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 · VLMBatchedEngine._split_vision_features (cognitive 32) · ×1
  • VLMBatchedEngine._split_vision_features (cognitive 32) omlx/engine/vlm.py:3855 — VLMBatchedEngine._split_vision_features has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (21 pts), loops 3 (7 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 · _TrackedTensor.__getitem__ (cognitive 32) · ×1
  • _TrackedTensor.__getitem__ (cognitive 32) REDACTED:2982 — _TrackedTensor.__getitem__ has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (22 pts), ternaries 3 (6 pts), loops 2 (4 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 · oq._lookup_imatrix_importance (cognitive 32) · ×1
  • oq._lookup_imatrix_importance (cognitive 32) REDACTED:6480 — oq._lookup_imatrix_importance has cognitive complexity 32 (threshold 15). Drivers by points: if/else 15 (22 pts), boolean chains 8, 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 · m5_gather_qmm_a8._self_test_extended (cognitive 32) · ×1
  • m5_gather_qmm_a8._self_test_extended (cognitive 32) omlx/patches/m5_gather_qmm_a8.py:1367 — m5_gather_qmm_a8._self_test_extended has cognitive complexity 32 (threshold 15). Drivers by points: if/else 16 (22 pts), ternaries 6 (8 pts), boolean chains 1, 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 · m5_gather_qmm_nax.supports (cognitive 32) · ×1
  • m5_gather_qmm_nax.supports (cognitive 32) omlx/patches/m5_gather_qmm_nax.py:1402 — m5_gather_qmm_nax.supports has cognitive complexity 32 (threshold 15). Drivers by points: if/else 16 (23 pts), boolean chains 9 (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 · batch_generator._post_init_mtp (cognitive 32) · ×1
  • batch_generator._post_init_mtp (cognitive 32) REDACTED:3426 — batch_generator._post_init_mtp has cognitive complexity 32 (threshold 15). Drivers by points: if/else 16 (23 pts), boolean chains 4, error handling 1 (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 · moe_expert_offload.apply_moe_expert_offload (cognitive 32) · ×1
  • moe_expert_offload.apply_moe_expert_offload (cognitive 32) omlx/patches/moe_expert_offload.py:1045 — moe_expert_offload.apply_moe_expert_offload has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (19 pts), loops 3 (6 pts), ternaries 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 · model_loading._add_glm5_next_nextn_quant_keys (cognitive 32) · ×1
  • model_loading._add_glm5_next_nextn_quant_keys (cognitive 32) omlx/utils/model_loading.py:128 — model_loading._add_glm5_next_nextn_quant_keys has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (22 pts), loops 3 (6 pts), boolean chains 4 (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 · dashboard.dashboard.handleMainTabChange (cognitive 32) · ×1
  • dashboard.dashboard.handleMainTabChange (cognitive 32) REDACTED:895 — dashboard.dashboard.handleMainTabChange has cognitive complexity 32 (threshold 15). Drivers by points: if/else 17 (26 pts), boolean chains 6 (nesting depth added 9). Of this number, 30 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 · clusterV2Wizard.submitPairApproval (cognitive 32) · ×1
  • clusterV2Wizard.submitPairApproval (cognitive 32) apps/omlx-web/omlx_web/static/js/cluster_v2.js:1427 — clusterV2Wizard.submitPairApproval has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 7, ternaries 2 (6 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 · dashboard.handleMainTabChange (cognitive 32) · ×1
  • dashboard.handleMainTabChange (cognitive 32) REDACTED:895 — dashboard.handleMainTabChange has cognitive complexity 32 (threshold 15). Drivers by points: if/else 17 (26 pts), boolean chains 6 (nesting depth added 9). Of this number, 30 points are the body's own statements and 2 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 · dashboard.sortedModels (cognitive 32) · ×1
  • dashboard.sortedModels (cognitive 32) REDACTED:7249 — dashboard.sortedModels has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 12 (22 pts), boolean chains 6, if/else 3, match/switch 1 (nesting depth added 10). None of this is in the body itself: all 32 points belong to one function literal inside it that branches (line 7250). 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 · model_recommender.kv_cache_cost (cognitive 31) · ×1
  • model_recommender.kv_cache_cost (cognitive 31) omlx/admin/model_recommender.py:647 — model_recommender.kv_cache_cost has cognitive complexity 31 (threshold 15). Drivers by points: boolean chains 15, if/else 9 (11 pts), ternaries 2 (4 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 · PagedSSDCacheManager.close (cognitive 31) · ×1
  • PagedSSDCacheManager.close (cognitive 31) omlx/cache/paged_ssd_cache.py:5546 — PagedSSDCacheManager.close has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (24 pts), error handling 1 (2 pts), loops 1 (2 pts), ternaries 1 (2 pts), boolean chains 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 · catalogue.assess_model (cognitive 31) · ×1
  • catalogue.assess_model (cognitive 31) omlx/cluster/catalogue.py:345 — catalogue.assess_model has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 5, loops 2 (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 · DiscoveryService._multicast_loop (cognitive 31) · ×1
  • DiscoveryService._multicast_loop (cognitive 31) REDACTED:1569 — DiscoveryService._multicast_loop has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (20 pts), error handling 5 (10 pts), 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 · discovery_routes.cluster_devices (cognitive 31) · ×1
  • discovery_routes.cluster_devices (cognitive 31) omlx/cluster/discovery_routes.py:305 — discovery_routes.cluster_devices has cognitive complexity 31 (threshold 15). Drivers by points: loops 7 (11 pts), if/else 7 (10 pts), ternaries 5, error handling 4, 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.
D2 · Cognitive Complexity · ModelSyncManager.resolve_local_model_path (cognitive 31) · ×1
  • ModelSyncManager.resolve_local_model_path (cognitive 31) REDACTED:415 — ModelSyncManager.resolve_local_model_path has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 2 (4 pts), ternaries 3 (4 pts), boolean chains 2 (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 · routes._run_staging_job (cognitive 31) · ×1
  • routes._run_staging_job (cognitive 31) omlx/cluster/routes.py:1728 — routes._run_staging_job has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 4, ternaries 2 (4 pts), error handling 1, 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 · runtime._validated_assignments (cognitive 31) · ×1
  • runtime._validated_assignments (cognitive 31) omlx/cluster/runtime.py:91 — runtime._validated_assignments has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (19 pts), loops 5 (7 pts), boolean chains 5 (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 · d3.decode_video (cognitive 31) · ×1
  • d3.decode_video (cognitive 31) omlx/models/d3.py:302 — d3.decode_video has cognitive complexity 31 (threshold 15). Drivers by points: if/else 15 (21 pts), boolean chains 5, loops 2 (3 pts), error handling 2 (nesting depth added 7). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D2 · Cognitive Complexity · Model._sanitize_layers (cognitive 31) · ×1
  • Model._sanitize_layers (cognitive 31) omlx/patches/bailing_hybrid/bailing_hybrid_model.py:905 — Model._sanitize_layers has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 4 (11 pts), boolean chains 2 (nesting depth added 18). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D2 · Cognitive Complexity · m5_gather_qmm_a8._launch (cognitive 31) · ×1
  • m5_gather_qmm_a8._launch (cognitive 31) omlx/patches/m5_gather_qmm_a8.py:845 — m5_gather_qmm_a8._launch has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 14 (16 pts), if/else 9 (11 pts), boolean chains 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 · batch_generator._call_backbone_impl (cognitive 31) · ×1
  • batch_generator._call_backbone_impl (cognitive 31) REDACTED:2222 — batch_generator._call_backbone_impl has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 4, ternaries 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 · Scheduler.shutdown (cognitive 31) · ×1
  • Scheduler.shutdown (cognitive 31) omlx/scheduler.py:16370 — Scheduler.shutdown has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (16 pts), error handling 5 (10 pts), ternaries 2 (5 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 · BatchTurboQuantKVCache.merge (cognitive 31) · ×1
  • BatchTurboQuantKVCache.merge (cognitive 31) omlx/turboquant_kv.py:585 — BatchTurboQuantKVCache.merge has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (15 pts), ternaries 4 (10 pts), loops 4, boolean chains 2 (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 · AdvancedPage.body (cognitive 31) · ×1
  • AdvancedPage.body (cognitive 31) apps/omlx-mac/Sources/AppView/Screens/ModelSettingsScreen.swift:1221 — AdvancedPage.body has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 6, ternaries 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 · audio_routes.create_transcription (cognitive 30) · ×1
  • audio_routes.create_transcription (cognitive 30) omlx/api/audio_routes.py:514 — audio_routes.create_transcription has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (14 pts), error handling 6 (9 pts), boolean chains 5, 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 · _XmlFunctionBoundary.feed (cognitive 30) · ×1
  • _XmlFunctionBoundary.feed (cognitive 30) omlx/api/tool_calling.py:562 — _XmlFunctionBoundary.feed has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (26 pts), boolean chains 3, 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 · paged_ssd_cache.cachelist_subtypes_from_cache_list (cognitive 30) · ×1
  • paged_ssd_cache.cachelist_subtypes_from_cache_list (cognitive 30) omlx/cache/paged_ssd_cache.py:670 — paged_ssd_cache.cachelist_subtypes_from_cache_list has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (15 pts), ternaries 2 (8 pts), boolean chains 4, 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 · BlockAwarePrefixCache._drop_superseded_arrays_snapshots (cognitive 30) · ×1
  • BlockAwarePrefixCache._drop_superseded_arrays_snapshots (cognitive 30) omlx/cache/prefix_cache.py:4915 — BlockAwarePrefixCache._drop_superseded_arrays_snapshots has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 4 (7 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 · discovery.local_addr_dicts (cognitive 30) · ×1
  • discovery.local_addr_dicts (cognitive 30) REDACTED:892 — discovery.local_addr_dicts has cognitive complexity 30 (threshold 15). Drivers by points: if/else 6 (19 pts), ternaries 1 (4 pts), loops 1 (3 pts), boolean chains 2, error handling 1 (2 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 · DistributedJobSupervisor._drain (cognitive 30) · ×1
  • DistributedJobSupervisor._drain (cognitive 30) omlx/cluster/launch.py:2902 — DistributedJobSupervisor._drain has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (21 pts), boolean chains 5, error handling 1 (3 pts), 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 · launch.probe_remote_host (cognitive 30) · ×1
  • launch.probe_remote_host (cognitive 30) omlx/cluster/launch.py:2222 — launch.probe_remote_host has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (17 pts), ternaries 3 (6 pts), error handling 3 (5 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 · runtime_optimizations.install_runtime_optimizations (cognitive 30) · ×1
  • runtime_optimizations.install_runtime_optimizations (cognitive 30) omlx/cluster/runtime_optimizations.py:274 — runtime_optimizations.install_runtime_optimizations has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 10, ternaries 9 (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 · tensor_strategies.native_shard_is_layer_local (cognitive 30) · ×1
  • tensor_strategies.native_shard_is_layer_local (cognitive 30) omlx/cluster/tensor_strategies.py:186 — tensor_strategies.native_shard_is_layer_local has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (22 pts), boolean chains 3, ternaries 1 (3 pts), error handling 1, 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 · splash.scan_ssd_cache (cognitive 30) · ×1
  • splash.scan_ssd_cache (cognitive 30) REDACTED:56 — splash.scan_ssd_cache has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (20 pts), error handling 3 (7 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 · vlm._count_image_tokens_real (cognitive 30) · ×1
  • vlm._count_image_tokens_real (cognitive 30) omlx/engine/vlm.py:1575 — vlm._count_image_tokens_real has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 3 (6 pts), boolean chains 5, 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 · model_discovery._read_model_context_length (cognitive 30) · ×1
  • model_discovery._read_model_context_length (cognitive 30) omlx/model_discovery.py:1016 — model_discovery._read_model_context_length has cognitive complexity 30 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 3 (8 pts), error handling 2 (4 pts), boolean chains 3 (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 · MLXEmbeddingModel.embed (cognitive 30) · ×1
  • MLXEmbeddingModel.embed (cognitive 30) omlx/models/embedding.py:957 — MLXEmbeddingModel.embed has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 9, 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, 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 · _DiscoveredPlan.pop (cognitive 30) · ×1
  • _DiscoveredPlan.pop (cognitive 30) REDACTED:3835 — _DiscoveredPlan.pop has cognitive complexity 30 (threshold 15). Drivers by points: if/else 18 (21 pts), loops 2 (5 pts), boolean chains 4 (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 · oq.import_mtplx_sidecar (cognitive 30) · ×1
  • oq.import_mtplx_sidecar (cognitive 30) REDACTED:2345 — oq.import_mtplx_sidecar has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 6, 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 · chat_template_v4.sort_tool_results_by_call_order (cognitive 30) · ×1
  • chat_template_v4.sort_tool_results_by_call_order (cognitive 30) omlx/patches/deepseek_v4/chat_template_v4.py:569 — chat_template_v4.sort_tool_results_by_call_order has cognitive complexity 30 (threshold 15). Drivers by points: if/else 6 (18 pts), loops 3 (8 pts), boolean chains 4 (nesting depth added 17). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D2 · Cognitive Complexity · chat_template_v4.relocate_mid_system_messages (cognitive 30) · ×1
  • chat_template_v4.relocate_mid_system_messages (cognitive 30) omlx/patches/deepseek_v4/chat_template_v4.py:776 — chat_template_v4.relocate_mid_system_messages has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 3 (6 pts), ternaries 2 (4 pts), boolean chains 3 (nesting depth added 15). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D2 · Cognitive Complexity · CompressedAttention.__call__ (cognitive 30) · ×1
  • CompressedAttention.__call__ (cognitive 30) omlx/patches/deepseek_v4/deepseek_v4_model.py:1833 — CompressedAttention.__call__ has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (14 pts), ternaries 7 (10 pts), boolean chains 6 (nesting depth added 6). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D2 · Cognitive Complexity · ModelArgs.__post_init__ (cognitive 30) · ×1
  • ModelArgs.__post_init__ (cognitive 30) omlx/patches/laguna/laguna_model.py:144 — ModelArgs.__post_init__ has cognitive complexity 30 (threshold 15). Drivers by points: if/else 18 (22 pts), boolean chains 4, ternaries 3 (4 pts) (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 · sdpa_flash.sdpa_flash (cognitive 30) · ×1
  • sdpa_flash.sdpa_flash (cognitive 30) omlx/patches/mimo_v2/sdpa_flash.py:418 — sdpa_flash.sdpa_flash has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 10, error handling 1 (2 pts) (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 · mlx_audio_ming3._onnx_float_initializers (cognitive 30) · ×1
  • mlx_audio_ming3._onnx_float_initializers (cognitive 30) omlx/patches/mlx_audio_ming3.py:469 — mlx_audio_ming3._onnx_float_initializers has cognitive complexity 30 (threshold 15). Drivers by points: if/else 6 (18 pts), loops 3 (6 pts), ternaries 1 (4 pts), boolean chains 2 (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 · websearch.run_fetch_url (cognitive 30) · ×1
  • websearch.run_fetch_url (cognitive 30) omlx/websearch.py:591 — websearch.run_fetch_url has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (16 pts), error handling 5 (6 pts), boolean chains 5, 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 · ModelSettingsScreenVM.load (cognitive 30) · ×1
  • ModelSettingsScreenVM.load (cognitive 30) apps/omlx-mac/Sources/AppView/ViewModels/ModelSettingsScreenVM.swift:704 — ModelSettingsScreenVM.load has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 7, ternaries 1 (3 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 · ThroughputBenchScreenVM.pollResults (cognitive 30) · ×1
  • ThroughputBenchScreenVM.pollResults (cognitive 30) apps/omlx-mac/Sources/AppView/ViewModels/ThroughputBenchScreenVM.swift:290 — ThroughputBenchScreenVM.pollResults has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (18 pts), boolean chains 6, ternaries 1 (3 pts), error handling 1 (2 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 · ChatCompletionClient.stream (cognitive 30) · ×1
  • ChatCompletionClient.stream (cognitive 30) apps/omlx-mac/Sources/AskAI/ChatCompletionStream.swift:274 — ChatCompletionClient.stream has cognitive complexity 30 (threshold 15). Drivers by points: if/else 5 (16 pts), loops 3 (9 pts), match/switch 1 (3 pts), error handling 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 · dashboard.openModelSettings (cognitive 30) · ×1
  • dashboard.openModelSettings (cognitive 30) REDACTED:3060 — dashboard.openModelSettings has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 7, error handling 2 (5 pts), ternaries 1 (nesting depth added 7). Of this number, 29 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 · ExternalAPIClient.stream_chat_completion (cognitive 29) · ×1
  • ExternalAPIClient.stream_chat_completion (cognitive 29) omlx/admin/external_api.py:363 — ExternalAPIClient.stream_chat_completion has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 6, error handling 2 (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 · OQManager._run_quantization (cognitive 29) · ×1
  • OQManager._run_quantization (cognitive 29) omlx/admin/oq_manager.py:599 — OQManager._run_quantization has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (18 pts), error handling 5 (8 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 · PagedSSDCacheManager.invalidate_stale_layer_signature (cognitive 29) · ×1
  • PagedSSDCacheManager.invalidate_stale_layer_signature (cognitive 29) omlx/cache/paged_ssd_cache.py:4850 — PagedSSDCacheManager.invalidate_stale_layer_signature has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 4, error handling 1 (2 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 · routes._reconcile_runtime_ownership (cognitive 29) · ×1
  • routes._reconcile_runtime_ownership (cognitive 29) omlx/cluster/routes.py:2022 — routes._reconcile_runtime_ownership has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 4 (5 pts), ternaries 2 (4 pts), error handling 2 (3 pts), boolean chains 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 · claude_desktop.restore (cognitive 29) · ×1
  • claude_desktop.restore (cognitive 29) omlx/integrations/claude_desktop.py:226 — claude_desktop.restore has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (25 pts), boolean chains 2, loops 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 · OpenJevModel.encode (cognitive 29) · ×1
  • OpenJevModel.encode (cognitive 29) omlx/models/openjev.py:260 — OpenJevModel.encode has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 7, 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 · openjev.split_state (cognitive 29) · ×1
  • openjev.split_state (cognitive 29) omlx/models/openjev.py:57 — openjev.split_state has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (14 pts), ternaries 3 (10 pts), boolean chains 3, 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 · omnimodal.export_sidecars (cognitive 29) · ×1
  • omnimodal.export_sidecars (cognitive 29) omlx/patches/mimo_v2/omnimodal.py:30 — omnimodal.export_sidecars has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 3 (7 pts), ternaries 1 (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 · ProcessMemoryEnforcer._propagate_memory_limit (cognitive 29) · ×1
  • ProcessMemoryEnforcer._propagate_memory_limit (cognitive 29) omlx/process_memory_enforcer.py:1460 — ProcessMemoryEnforcer._propagate_memory_limit has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (22 pts), ternaries 4, boolean chains 2, 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 · server._render_chat_prompt_for_thinking_detection (cognitive 29) · ×1
  • server._render_chat_prompt_for_thinking_detection (cognitive 29) REDACTED:6307 — server._render_chat_prompt_for_thinking_detection has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (19 pts), loops 2 (6 pts), error handling 2 (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 · embedding_utils._item_from_content_parts (cognitive 28) · ×1
  • embedding_utils._item_from_content_parts (cognitive 28) omlx/api/embedding_utils.py:195 — embedding_utils._item_from_content_parts has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (23 pts), ternaries 1 (3 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 · tool_calling.enrich_tool_params_for_gemma4 (cognitive 28) · ×1
  • tool_calling.enrich_tool_params_for_gemma4 (cognitive 28) omlx/api/tool_calling.py:3846 — tool_calling.enrich_tool_params_for_gemma4 has cognitive complexity 28 (threshold 15). Drivers by points: if/else 5 (14 pts), ternaries 2 (9 pts), loops 2 (4 pts), boolean chains 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 · autoconfigure.preflight_issues (cognitive 28) · ×1
  • autoconfigure.preflight_issues (cognitive 28) omlx/cluster/autoconfigure.py:657 — autoconfigure.preflight_issues has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 8, loops 2 (4 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 · backends.members_from_host_records (cognitive 28) · ×1
  • backends.members_from_host_records (cognitive 28) omlx/cluster/backends.py:118 — backends.members_from_host_records has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (20 pts), loops 2 (4 pts), boolean chains 2, ternaries 1 (2 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 · DiscoveryService._handle_mdns_service (cognitive 28) · ×1
  • DiscoveryService._handle_mdns_service (cognitive 28) REDACTED:2118 — DiscoveryService._handle_mdns_service has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 8, loops 2 (3 pts), error handling 2, ternaries 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 · inference_worker.run_worker (cognitive 28) · ×1
  • inference_worker.run_worker (cognitive 28) omlx/cluster/inference_worker.py:1405 — inference_worker.run_worker has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (15 pts), ternaries 6, boolean chains 5, error handling 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 · base.chat_models (cognitive 28) · ×1
  • base.chat_models (cognitive 28) omlx/integrations/base.py:71 — base.chat_models has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 7, 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 · memory_monitor.set_model_info_from_model (cognitive 28) · ×1
  • memory_monitor.set_model_info_from_model (cognitive 28) REDACTED:2125 — memory_monitor.set_model_info_from_model has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 11, error handling 2 (3 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 · qwen35_ane_prefill._compile_gdn (cognitive 28) · ×1
  • qwen35_ane_prefill._compile_gdn (cognitive 28) omlx/patches/qwen35_ane_prefill.py:1112 — qwen35_ane_prefill._compile_gdn has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (15 pts), ternaries 8, 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 · Scheduler._insert_prefilled_request (cognitive 28) · ×1
  • Scheduler._insert_prefilled_request (cognitive 28) omlx/scheduler.py:7621 — Scheduler._insert_prefilled_request has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (17 pts), ternaries 3 (4 pts), loops 1 (3 pts), boolean chains 2, 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 · server.server_status (cognitive 28) · ×1
  • server.server_status (cognitive 28) REDACTED:3432 — server.server_status has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 2 (4 pts), error handling 1 (3 pts), ternaries 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 · dashboard.dashboard.openModelSettings (cognitive 28) · ×1
  • dashboard.dashboard.openModelSettings (cognitive 28) REDACTED:3060 — dashboard.dashboard.openModelSettings has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 6, error handling 2 (5 pts) (nesting depth added 7). Of this number, 27 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 · logs.aggregateLogRows (cognitive 28) · ×1
  • logs.aggregateLogRows (cognitive 28) REDACTED:71 — logs.aggregateLogRows has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 6, loops 1 (nesting depth added 9). Of this number, 24 points are the body's own statements and 4 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 · output_parser.detect_output_parser (cognitive 27) · ×1
  • output_parser.detect_output_parser (cognitive 27) omlx/adapter/output_parser.py:1369 — output_parser.detect_output_parser has cognitive complexity 27 (threshold 15). Drivers by points: if/else 16 (23 pts), loops 1 (2 pts), boolean chains 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 · ToolCallStreamFilter._should_drop_tail_at_finish (cognitive 27) · ×1
  • ToolCallStreamFilter._should_drop_tail_at_finish (cognitive 27) omlx/api/tool_calling.py:3373 — ToolCallStreamFilter._should_drop_tail_at_finish has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (22 pts), loops 4, 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 · paged_ssd_cache._clamp_rotating_meta_states (cognitive 27) · ×1
  • paged_ssd_cache._clamp_rotating_meta_states (cognitive 27) omlx/cache/paged_ssd_cache.py:713 — paged_ssd_cache._clamp_rotating_meta_states has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (17 pts), boolean chains 5, error handling 1 (4 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 · BlockAwarePrefixCache.fetch_cache (cognitive 27) · ×1
  • BlockAwarePrefixCache.fetch_cache (cognitive 27) omlx/cache/prefix_cache.py:811 — BlockAwarePrefixCache.fetch_cache has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (20 pts), loops 3 (7 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 · launch.run_cuda_fabric_probe (cognitive 27) · ×1
  • launch.run_cuda_fabric_probe (cognitive 27) omlx/cluster/launch.py:1536 — launch.run_cuda_fabric_probe has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 6, error handling 2 (3 pts), ternaries 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.
D2 · Cognitive Complexity · DeviceRegistry._coerce (cognitive 27) · ×1
  • DeviceRegistry._coerce (cognitive 27) omlx/cluster/registry.py:438 — DeviceRegistry._coerce has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (15 pts), ternaries 3 (7 pts), boolean chains 5 (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 · routes.cluster_cuda_fabric_verify (cognitive 27) · ×1
  • routes.cluster_cuda_fabric_verify (cognitive 27) omlx/cluster/routes.py:2681 — routes.cluster_cuda_fabric_verify has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 11, if/else 6 (11 pts), error handling 3 (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 · DistributedBatchedEngine._write_rank_cancel_request (cognitive 27) · ×1
  • DistributedBatchedEngine._write_rank_cancel_request (cognitive 27) omlx/engine/distributed.py:1099 — DistributedBatchedEngine._write_rank_cancel_request has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 4, ternaries 3 (4 pts), error handling 3 (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 · engine_pool._qwen35_cpu_share_estimated_bytes (cognitive 27) · ×1
  • engine_pool._qwen35_cpu_share_estimated_bytes (cognitive 27) omlx/engine_pool.py:203 — engine_pool._qwen35_cpu_share_estimated_bytes has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 11, error handling 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 · memory_monitor._make_deepseek_v41_prefill_memory_profile (cognitive 27) · ×1
  • memory_monitor._make_deepseek_v41_prefill_memory_profile (cognitive 27) REDACTED:1754 — memory_monitor._make_deepseek_v41_prefill_memory_profile has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (18 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 · PoolingCache.accumulate_windows (cognitive 27) · ×1
  • PoolingCache.accumulate_windows (cognitive 27) omlx/patches/deepseek_v4/cache_extras.py:141 — PoolingCache.accumulate_windows has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (16 pts), ternaries 2 (6 pts), boolean chains 3, error handling 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 · ane_prefill.enable_ane_prefill (cognitive 27) · ×1
  • ane_prefill.enable_ane_prefill (cognitive 27) omlx/patches/k2_horizon/ane_prefill.py:277 — ane_prefill.enable_ane_prefill has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 5, ternaries 2 (5 pts), 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 · qwen35_ane_prefill.ane_prefill_transient_bytes (cognitive 27) · ×1
  • qwen35_ane_prefill.ane_prefill_transient_bytes (cognitive 27) omlx/patches/qwen35_ane_prefill.py:3490 — qwen35_ane_prefill.ane_prefill_transient_bytes has cognitive complexity 27 (threshold 15). Drivers by points: if/else 4 (14 pts), loops 4 (8 pts), error handling 1 (4 pts), ternaries 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 · Scheduler._find_relevant_inflight_store (cognitive 27) · ×1
  • Scheduler._find_relevant_inflight_store (cognitive 27) omlx/scheduler.py:10898 — Scheduler._find_relevant_inflight_store has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 6, 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 · Scheduler._init_tiered_cache (cognitive 27) · ×1
  • Scheduler._init_tiered_cache (cognitive 27) omlx/scheduler.py:16914 — Scheduler._init_tiered_cache has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (15 pts), ternaries 4 (6 pts), boolean chains 3, error handling 2 (3 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 · draft.run_specprefill_draft_scoring (cognitive 27) · ×1
  • draft.run_specprefill_draft_scoring (cognitive 27) omlx/specprefill/draft.py:92 — draft.run_specprefill_draft_scoring has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (15 pts), error handling 4 (7 pts), boolean chains 4, 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 · UsageHistoryView.body (cognitive 27) · ×1
  • UsageHistoryView.body (cognitive 27) apps/omlx-mac/Sources/AppView/Screens/UsageHistoryView.swift:16 — UsageHistoryView.body has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (17 pts), error handling 2 (4 pts), ternaries 1 (4 pts), boolean chains 1, 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 · IntegrationsScreenVM.saveWebSearch (cognitive 27) · ×1
  • IntegrationsScreenVM.saveWebSearch (cognitive 27) apps/omlx-mac/Sources/AppView/ViewModels/IntegrationsScreenVM.swift:483 — IntegrationsScreenVM.saveWebSearch has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (21 pts), match/switch 2 (3 pts), boolean chains 2, 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 · dashboard.dashboard.updateModelSetting (cognitive 27) · ×1
  • dashboard.dashboard.updateModelSetting (cognitive 27) REDACTED:1647 — dashboard.dashboard.updateModelSetting has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (25 pts), boolean chains 1, error handling 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 · clusterV2Wizard.runPlan (cognitive 27) · ×1
  • clusterV2Wizard.runPlan (cognitive 27) apps/omlx-web/omlx_web/static/js/cluster_v2.js:2845 — clusterV2Wizard.runPlan has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 14, if/else 9 (10 pts), ternaries 2, error handling 1 (nesting depth added 1). Of this number, 24 points are the body's own statements and 3 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 · dashboard.updateModelSetting (cognitive 27) · ×1
  • dashboard.updateModelSetting (cognitive 27) REDACTED:1647 — dashboard.updateModelSetting has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (25 pts), boolean chains 1, error handling 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 · affine4._native_attention (cognitive 26) · ×1
  • affine4._native_attention (cognitive 26) omlx/affine4.py:796 — affine4._native_attention has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 8, ternaries 4, 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 · BoundarySnapshotSSDStore._write_inline (cognitive 26) · ×1
  • BoundarySnapshotSSDStore._write_inline (cognitive 26) omlx/cache/boundary_snapshot_store.py:939 — BoundarySnapshotSSDStore._write_inline has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 5, error handling 2 (4 pts), loops 1 (2 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.
D2 · Cognitive Complexity · BlockAwarePrefixCache._block_token_count_matches_slices (cognitive 26) · ×1
  • BlockAwarePrefixCache._block_token_count_matches_slices (cognitive 26) omlx/cache/prefix_cache.py:1960 — BlockAwarePrefixCache._block_token_count_matches_slices has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 7, 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 · VisionFeatureSSDCache._scan_existing_files (cognitive 26) · ×1
  • VisionFeatureSSDCache._scan_existing_files (cognitive 26) omlx/cache/vision_feature_cache.py:474 — VisionFeatureSSDCache._scan_existing_files has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (14 pts), error handling 2 (7 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 · cli.diagnose_menubar (cognitive 26) · ×1
  • cli.diagnose_menubar (cognitive 26) REDACTED:854 — cli.diagnose_menubar has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 3 (5 pts), ternaries 3 (4 pts), boolean chains 3, error handling 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 · VLMBatchedEngine._diffusion_apply_chat_template (cognitive 26) · ×1
  • VLMBatchedEngine._diffusion_apply_chat_template (cognitive 26) omlx/engine/vlm.py:5758 — VLMBatchedEngine._diffusion_apply_chat_template has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 2 (7 pts), error handling 4 (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 · Integration.select_model (cognitive 26) · ×1
  • Integration.select_model (cognitive 26) omlx/integrations/base.py:173 — Integration.select_model has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (12 pts), error handling 3 (6 pts), ternaries 2 (4 pts), loops 3, 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 · copilot.copilot_provider_config (cognitive 26) · ×1
  • copilot.copilot_provider_config (cognitive 26) omlx/integrations/copilot.py:50 — copilot.copilot_provider_config has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (19 pts), boolean chains 6, 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 · d3.normalize_question (cognitive 26) · ×1
  • d3.normalize_question (cognitive 26) omlx/models/d3.py:112 — d3.normalize_question has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 7, ternaries 1 (2 pts) (nesting depth added 8). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D2 · Cognitive Complexity · _LazyTensorIndex._discover_fp8_pairs (cognitive 26) · ×1
  • _LazyTensorIndex._discover_fp8_pairs (cognitive 26) REDACTED:5640 — _LazyTensorIndex._discover_fp8_pairs has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 7, 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 · oq._plan_mtp_head (cognitive 26) · ×1
  • oq._plan_mtp_head (cognitive 26) REDACTED:1891 — oq._plan_mtp_head has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (20 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 · oq._collect_mtp_head_imatrix (cognitive 26) · ×1
  • oq._collect_mtp_head_imatrix (cognitive 26) REDACTED:9611 — oq._collect_mtp_head_imatrix has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15 (18 pts), boolean chains 5, ternaries 1 (2 pts), 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 · BatchPoolingCache.extend (cognitive 26) · ×1
  • BatchPoolingCache.extend (cognitive 26) omlx/patches/deepseek_v4/cache_extras.py:1017 — BatchPoolingCache.extend has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (11 pts), ternaries 5 (11 pts), boolean chains 4 (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 · agent._fastest_link (cognitive 26) · ×1
  • agent._fastest_link (cognitive 26) REDACTED:183 — agent._fastest_link has cognitive complexity 26 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 4 (7 pts), boolean chains 4, error handling 3 (4 pts), 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 · Scheduler._step_vlm_mtp (cognitive 26) · ×1
  • Scheduler._step_vlm_mtp (cognitive 26) omlx/scheduler.py:11909 — Scheduler._step_vlm_mtp has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (17 pts), error handling 2 (4 pts), loops 2, ternaries 1 (2 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 · network._local_ipv4_addresses (cognitive 26) · ×1
  • network._local_ipv4_addresses (cognitive 26) omlx/utils/network.py:166 — network._local_ipv4_addresses has cognitive complexity 26 (threshold 15). Drivers by points: if/else 4 (11 pts), error handling 4 (10 pts), loops 3 (5 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 · build._lock_with_sdist_retry (cognitive 26) · ×1
  • build._lock_with_sdist_retry (cognitive 26) REDACTED:332 — build._lock_with_sdist_retry has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (23 pts), boolean chains 2, 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 · cluster_v2.clusterV2Wizard.submitPairApproval (cognitive 26) · ×1
  • cluster_v2.clusterV2Wizard.submitPairApproval (cognitive 26) apps/omlx-web/omlx_web/static/js/cluster_v2.js:1427 — cluster_v2.clusterV2Wizard.submitPairApproval has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 7, 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 · cluster_v2.clusterV2Wizard.runPlan (cognitive 26) · ×1
  • cluster_v2.clusterV2Wizard.runPlan (cognitive 26) apps/omlx-web/omlx_web/static/js/cluster_v2.js:2845 — cluster_v2.clusterV2Wizard.runPlan has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 14, if/else 9 (10 pts), error handling 1, ternaries 1 (nesting depth added 1). Of this number, 23 points are the body's own statements and 3 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 · dashboard.prefillHelperStatusText (cognitive 26) · ×1
  • dashboard.prefillHelperStatusText (cognitive 26) REDACTED:3330 — dashboard.prefillHelperStatusText has cognitive complexity 26 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 6, ternaries 3 (6 pts), other 4, match/switch 1 (nesting depth added 7). Of this number, 25 points are the body's own statements and 1 belongs 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 · auth.require_admin (cognitive 25) · ×1
  • auth.require_admin (cognitive 25) REDACTED:386 — auth.require_admin has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (18 pts), ternaries 2 (4 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 · HFUploader._run_upload (cognitive 25) · ×1
  • HFUploader._run_upload (cognitive 25) omlx/admin/hf_uploader.py:673 — HFUploader._run_upload has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (17 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 · audio_routes.create_speech (cognitive 25) · ×1
  • audio_routes.create_speech (cognitive 25) omlx/api/audio_routes.py:1533 — audio_routes.create_speech has cognitive complexity 25 (threshold 15). Drivers by points: error handling 8 (12 pts), if/else 8 (9 pts), boolean chains 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 · decisions.decisions_request (cognitive 25) · ×1
  • decisions.decisions_request (cognitive 25) omlx/api/decisions.py:465 — decisions.decisions_request has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 6, error handling 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 · PagedSSDCacheManager.preload_matched_blocks (cognitive 25) · ×1
  • PagedSSDCacheManager.preload_matched_blocks (cognitive 25) omlx/cache/paged_ssd_cache.py:4636 — PagedSSDCacheManager.preload_matched_blocks has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (16 pts), error handling 2 (5 pts), loops 3, 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 · BlockAwarePrefixCache.fetch_exact_prefix (cognitive 25) · ×1
  • BlockAwarePrefixCache.fetch_exact_prefix (cognitive 25) omlx/cache/prefix_cache.py:1877 — BlockAwarePrefixCache.fetch_exact_prefix has cognitive complexity 25 (threshold 15). Drivers by points: loops 5 (13 pts), if/else 5 (11 pts), boolean chains 1 (nesting depth added 14). 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 · PairingSession._begin (cognitive 25) · ×1
  • PairingSession._begin (cognitive 25) omlx/cluster/pairing_session.py:198 — PairingSession._begin has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 6 (9 pts), if/else 6 (8 pts), boolean chains 4, error handling 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 · _DeepSeekV4PrefillMemoryProfile.estimate_prefill_transient_bytes (cognitive 25) · ×1
  • _DeepSeekV4PrefillMemoryProfile.estimate_prefill_transient_bytes (cognitive 25) REDACTED:1238 — _DeepSeekV4PrefillMemoryProfile.estimate_prefill_transient_bytes has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14 (20 pts), boolean chains 5 (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 · oq._load_builtin_calibration (cognitive 25) · ×1
  • oq._load_builtin_calibration (cognitive 25) REDACTED:8241 — oq._load_builtin_calibration has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (11 pts), loops 5 (9 pts), ternaries 2 (4 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 · _SlotCache.ensure_ids (cognitive 25) · ×1
  • _SlotCache.ensure_ids (cognitive 25) omlx/patches/glm_moe_dsa/moe_offload.py:198 — _SlotCache.ensure_ids has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (19 pts), loops 4 (5 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 · batch_generator._dspark_draft_jobs (cognitive 25) · ×1
  • batch_generator._dspark_draft_jobs (cognitive 25) REDACTED:3191 — batch_generator._dspark_draft_jobs has cognitive complexity 25 (threshold 15). Drivers by points: loops 6 (9 pts), if/else 4 (8 pts), ternaries 3 (7 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 · batch_generator._emit_ragged_responses (cognitive 25) · ×1
  • batch_generator._emit_ragged_responses (cognitive 25) REDACTED:3755 — batch_generator._emit_ragged_responses has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (21 pts), loops 3 (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 · qwen35_ane_prefill._enable_fused_down_banks (cognitive 25) · ×1
  • qwen35_ane_prefill._enable_fused_down_banks (cognitive 25) omlx/patches/qwen35_ane_prefill.py:2814 — qwen35_ane_prefill._enable_fused_down_banks has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 3 (5 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 · specprefill.sparse_prefill (cognitive 25) · ×1
  • specprefill.sparse_prefill (cognitive 25) omlx/patches/specprefill.py:975 — specprefill.sparse_prefill has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (18 pts), loops 4 (6 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 · sampling.make_sampler (cognitive 25) · ×1
  • sampling.make_sampler (cognitive 25) omlx/utils/sampling.py:202 — sampling.make_sampler has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 4 (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 · dashboard.dashboard.saveModelSettings (cognitive 25) · ×1
  • dashboard.dashboard.saveModelSettings (cognitive 25) REDACTED:3776 — dashboard.dashboard.saveModelSettings has cognitive complexity 25 (threshold 15). Drivers by points: if/else 15 (20 pts), boolean chains 2, loops 1 (2 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 · dashboard.dashboard.accBuildText (cognitive 25) · ×1
  • dashboard.dashboard.accBuildText (cognitive 25) REDACTED:6466 — dashboard.dashboard.accBuildText has cognitive complexity 25 (threshold 15). Drivers by points: loops 8 (11 pts), if/else 4 (7 pts), ternaries 2 (4 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 · dashboard.saveModelSettings (cognitive 25) · ×1
  • dashboard.saveModelSettings (cognitive 25) REDACTED:3776 — dashboard.saveModelSettings has cognitive complexity 25 (threshold 15). Drivers by points: if/else 15 (20 pts), boolean chains 2, loops 1 (2 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 · ane_tuning._settings_for_candidate (cognitive 24) · ×1
  • ane_tuning._settings_for_candidate (cognitive 24) omlx/admin/ane_tuning.py:445 — ane_tuning._settings_for_candidate has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13, boolean chains 9, 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 · HFDownloader.get_model_info (cognitive 24) · ×1
  • HFDownloader.get_model_info (cognitive 24) REDACTED:1590 — HFDownloader.get_model_info has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 6 (7 pts), boolean chains 6, 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 · MSDownloader._poll_progress (cognitive 24) · ×1
  • MSDownloader._poll_progress (cognitive 24) omlx/admin/ms_downloader.py:1066 — MSDownloader._poll_progress 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 · audio_routes.realtime_voice (cognitive 24) · ×1
  • audio_routes.realtime_voice (cognitive 24) omlx/api/audio_routes.py:1002 — audio_routes.realtime_voice has cognitive complexity 24 (threshold 15). Drivers by points: error handling 8 (9 pts), if/else 8 (9 pts), ternaries 3 (4 pts), boolean chains 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 · RankControlPlane.broadcast_owned_bytes (cognitive 24) · ×1
  • RankControlPlane.broadcast_owned_bytes (cognitive 24) REDACTED:436 — RankControlPlane.broadcast_owned_bytes has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (20 pts), boolean chains 2, 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 · DistributedJobSupervisor._wait_for_ready (cognitive 24) · ×1
  • DistributedJobSupervisor._wait_for_ready (cognitive 24) omlx/cluster/launch.py:2955 — DistributedJobSupervisor._wait_for_ready has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 4 (5 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 · launch.probe_remote_admission_ceiling (cognitive 24) · ×1
  • launch.probe_remote_admission_ceiling (cognitive 24) omlx/cluster/launch.py:2097 — launch.probe_remote_admission_ceiling has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (7 pts), ternaries 3 (7 pts), boolean chains 6, error handling 3 (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 · liveness.check_peers (cognitive 24) · ×1
  • liveness.check_peers (cognitive 24) omlx/cluster/liveness.py:317 — liveness.check_peers has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 4 (11 pts), if/else 5 (9 pts), boolean chains 3, 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 · staging.stage_remote_files (cognitive 24) · ×1
  • staging.stage_remote_files (cognitive 24) omlx/cluster/staging.py:1291 — staging.stage_remote_files has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (18 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.
D2 · Cognitive Complexity · STTEngine._transcribe_stream_token_ids (cognitive 24) · ×1
  • STTEngine._transcribe_stream_token_ids (cognitive 24) REDACTED:1053 — STTEngine._transcribe_stream_token_ids has cognitive complexity 24 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 3 (6 pts), ternaries 2 (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 · MLXEmbeddingModel._count_prepared_tokens (cognitive 24) · ×1
  • MLXEmbeddingModel._count_prepared_tokens (cognitive 24) omlx/models/embedding.py:1237 — MLXEmbeddingModel._count_prepared_tokens has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (17 pts), ternaries 1 (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 · ModelArgs.__post_init__ (cognitive 24) · ×1
  • ModelArgs.__post_init__ (cognitive 24) omlx/patches/glm_moe_dsa/glm_moe_dsa_model.py:142 — ModelArgs.__post_init__ has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (16 pts), ternaries 2 (7 pts), boolean chains 1 (nesting depth added 13). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D2 · Cognitive Complexity · m5_gather_qmm_nax._launch (cognitive 24) · ×1
  • m5_gather_qmm_nax._launch (cognitive 24) omlx/patches/m5_gather_qmm_nax.py:1463 — m5_gather_qmm_nax._launch has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (15 pts), ternaries 5 (7 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 · decode_fast.run_layers (cognitive 24) · ×1
  • decode_fast.run_layers (cognitive 24) omlx/patches/mimo_v2/decode_fast.py:974 — decode_fast.run_layers has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 4, ternaries 2 (4 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 · sdpa256_attention.apply_sdpa256_attention_patch (cognitive 24) · ×1
  • sdpa256_attention.apply_sdpa256_attention_patch (cognitive 24) omlx/patches/sdpa256_attention.py:414 — sdpa256_attention.apply_sdpa256_attention_patch has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 2 (4 pts), boolean chains 2, 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.
D2 · Cognitive Complexity · ProcessMemoryEnforcer._shrink_hot_cache_by (cognitive 24) · ×1
  • ProcessMemoryEnforcer._shrink_hot_cache_by (cognitive 24) omlx/process_memory_enforcer.py:1282 — ProcessMemoryEnforcer._shrink_hot_cache_by has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (19 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 · Scheduler._adaptive_chunk_size (cognitive 24) · ×1
  • Scheduler._adaptive_chunk_size (cognitive 24) omlx/scheduler.py:5462 — Scheduler._adaptive_chunk_size has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (19 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 · Scheduler._reserve_prefill_capacity (cognitive 24) · ×1
  • Scheduler._reserve_prefill_capacity (cognitive 24) omlx/scheduler.py:5753 — Scheduler._reserve_prefill_capacity has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (18 pts), ternaries 1 (3 pts), loops 2, 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 · server._with_json_keepalive (cognitive 24) · ×1
  • server._with_json_keepalive (cognitive 24) REDACTED:3236 — server._with_json_keepalive has cognitive complexity 24 (threshold 15). Drivers by points: error handling 6 (12 pts), if/else 6 (11 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 · model_loading.materialize_lazy_state (cognitive 24) · ×1
  • model_loading.materialize_lazy_state (cognitive 24) omlx/utils/model_loading.py:1512 — model_loading.materialize_lazy_state has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 4 (9 pts), boolean chains 2, ternaries 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 · build._generate_venvstacks_toml (cognitive 24) · ×1
  • build._generate_venvstacks_toml (cognitive 24) REDACTED:468 — build._generate_venvstacks_toml has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 4 (8 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 · Stage._forward (cognitive 23) · ×1
  • Stage._forward (cognitive 23) apps/omlx-cuda-helper/omlx_cuda_helper/families/deepseek_v41/stage.py:201 — Stage._forward has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (15 pts), ternaries 2 (5 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 · recipe.decode_recipe (cognitive 23) · ×1
  • recipe.decode_recipe (cognitive 23) omlx/admin/recipe.py:60 — recipe.decode_recipe has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 6, error handling 3, 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 · routes._validate_model_settings (cognitive 23) · ×1
  • routes._validate_model_settings (cognitive 23) omlx/admin/routes.py:3802 — routes._validate_model_settings has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (16 pts), error handling 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 · ModelCacheConfig.from_cache_list (cognitive 23) · ×1
  • ModelCacheConfig.from_cache_list (cognitive 23) omlx/cache/hybrid_cache.py:64 — ModelCacheConfig.from_cache_list has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (19 pts), 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 · PagedSSDCacheManager.load_block (cognitive 23) · ×1
  • PagedSSDCacheManager.load_block (cognitive 23) omlx/cache/paged_ssd_cache.py:4221 — PagedSSDCacheManager.load_block has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (13 pts), error handling 4 (6 pts), boolean chains 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.
D2 · Cognitive Complexity · cli.lifecycle_command (cognitive 23) · ×1
  • cli.lifecycle_command (cognitive 23) REDACTED:798 — cli.lifecycle_command has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (16 pts), error handling 2 (5 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 · autoconfigure._walk_dispatch (cognitive 23) · ×1
  • autoconfigure._walk_dispatch (cognitive 23) omlx/cluster/autoconfigure.py:895 — autoconfigure._walk_dispatch has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 2 (4 pts), boolean chains 2 (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 · autoconfigure._walk_imports (cognitive 23) · ×1
  • autoconfigure._walk_imports (cognitive 23) omlx/cluster/autoconfigure.py:974 — autoconfigure._walk_imports has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 3 (7 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 · collective.run_local_pipeline_smoke (cognitive 23) · ×1
  • collective.run_local_pipeline_smoke (cognitive 23) omlx/cluster/collective.py:188 — collective.run_local_pipeline_smoke has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (11 pts), ternaries 2 (4 pts), boolean chains 3, error handling 2 (3 pts), 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. This shape REPEATS in the file: one other method here (collective._run_local_minimax_decode_smoke) 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 · collective._run_local_minimax_decode_smoke (cognitive 23) · ×1
  • collective._run_local_minimax_decode_smoke (cognitive 23) omlx/cluster/collective.py:279 — collective._run_local_minimax_decode_smoke has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (11 pts), ternaries 2 (4 pts), boolean chains 3, error handling 2 (3 pts), 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. This shape REPEATS in the file: one other method here (collective.run_local_pipeline_smoke) 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 · probe.parse_linux_interface_address (cognitive 23) · ×1
  • probe.parse_linux_interface_address (cognitive 23) omlx/cluster/probe.py:223 — probe.parse_linux_interface_address has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (13 pts), error handling 2 (4 pts), loops 2 (3 pts), boolean chains 2, 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 · RealtimeVoiceSession._respond (cognitive 23) · ×1
  • RealtimeVoiceSession._respond (cognitive 23) omlx/engine/realtime_voice.py:312 — RealtimeVoiceSession._respond has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 2 (4 pts), error handling 3, 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 · VLMBatchedEngine._apply_ocr_prompt (cognitive 23) · ×1
  • VLMBatchedEngine._apply_ocr_prompt (cognitive 23) omlx/engine/vlm.py:5537 — VLMBatchedEngine._apply_ocr_prompt has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (18 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 · ModelSettingsManager._validate_exposed_profile_ids_available_locked (cognitive 23) · ×1
  • ModelSettingsManager._validate_exposed_profile_ids_available_locked (cognitive 23) omlx/model_settings.py:1397 — ModelSettingsManager._validate_exposed_profile_ids_available_locked has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 4 (6 pts), boolean chains 3 (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 · oq.validate_quantizable (cognitive 23) · ×1
  • oq.validate_quantizable (cognitive 23) REDACTED:3960 — oq.validate_quantizable has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (21 pts), boolean chains 2 (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 · oq._prepare_gemma4_layer_inputs (cognitive 23) · ×1
  • oq._prepare_gemma4_layer_inputs (cognitive 23) REDACTED:8510 — oq._prepare_gemma4_layer_inputs has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15 (19 pts), boolean chains 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 · chat_template_v4.merge_tool_messages (cognitive 23) · ×1
  • chat_template_v4.merge_tool_messages (cognitive 23) omlx/patches/deepseek_v4/chat_template_v4.py:499 — chat_template_v4.merge_tool_messages has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 2 (5 pts), boolean chains 2 (nesting depth added 12). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D2 · Cognitive Complexity · qwen35_verify_attention.verify_attention (cognitive 23) · ×1
  • qwen35_verify_attention.verify_attention (cognitive 23) omlx/patches/mlx_vlm_mtp/qwen35_verify_attention.py:178 — qwen35_verify_attention.verify_attention has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 7 (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 · qwen35_q4_mlp._is_supported_affine_linear_shape (cognitive 23) · ×1
  • qwen35_q4_mlp._is_supported_affine_linear_shape (cognitive 23) omlx/patches/qwen35_q4_mlp.py:140 — qwen35_q4_mlp._is_supported_affine_linear_shape has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15, boolean chains 8. 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 · Scheduler._detect_qwen35_prefill_floor (cognitive 23) · ×1
  • Scheduler._detect_qwen35_prefill_floor (cognitive 23) omlx/scheduler.py:3380 — Scheduler._detect_qwen35_prefill_floor has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 5, 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 · Scheduler._apply_turboquant_kv_convert (cognitive 23) · ×1
  • Scheduler._apply_turboquant_kv_convert (cognitive 23) omlx/scheduler.py:4171 — Scheduler._apply_turboquant_kv_convert has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 2 (4 pts), ternaries 2 (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 · Scheduler._align_minimax_m3_partial_cache_to_prefill_step (cognitive 23) · ×1
  • Scheduler._align_minimax_m3_partial_cache_to_prefill_step (cognitive 23) omlx/scheduler.py:12119 — Scheduler._align_minimax_m3_partial_cache_to_prefill_step has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 8, loops 2 (3 pts), ternaries 1 (2 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.
D2 · Cognitive Complexity · ProfileGroup.chip (cognitive 23) · ×1
  • ProfileGroup.chip (cognitive 23) apps/omlx-mac/Sources/AppView/Screens/ProfileViews.swift:181 — ProfileGroup.chip has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 9 (11 pts), if/else 6 (7 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, 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 · TalkAIPanelView.body (cognitive 23) · ×1
  • TalkAIPanelView.body (cognitive 23) apps/omlx-mac/Sources/AskAI/TalkAIPanel.swift:152 — TalkAIPanelView.body has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 7 (12 pts), if/else 8, boolean chains 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 · clusterV2Wizard.wizardState (cognitive 23) · ×1
  • clusterV2Wizard.wizardState (cognitive 23) apps/omlx-web/omlx_web/static/js/cluster_v2.js:1049 — clusterV2Wizard.wizardState has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 12, if/else 11. 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 · routes._apply_settings_snapshot (cognitive 22) · ×1
  • routes._apply_settings_snapshot (cognitive 22) omlx/admin/routes.py:4224 — routes._apply_settings_snapshot has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (14 pts), error handling 2 (4 pts), loops 1 (2 pts), boolean chains 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 · audio_routes._stream_speech_response (cognitive 22) · ×1
  • audio_routes._stream_speech_response (cognitive 22) omlx/api/audio_routes.py:342 — audio_routes._stream_speech_response has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 3, loops 2 (3 pts), 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 · audio_routes.realtime_transcription (cognitive 22) · ×1
  • audio_routes.realtime_transcription (cognitive 22) omlx/api/audio_routes.py:694 — audio_routes.realtime_transcription has cognitive complexity 22 (threshold 15). Drivers by points: error handling 9, if/else 8 (9 pts), boolean chains 3, loops 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 · responses_utils.normalize_response_output_to_messages (cognitive 22) · ×1
  • responses_utils.normalize_response_output_to_messages (cognitive 22) omlx/api/responses_utils.py:800 — responses_utils.normalize_response_output_to_messages has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 2 (4 pts), ternaries 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 · BlockAwarePrefixCache._find_walk_back_truncation_point (cognitive 22) · ×1
  • BlockAwarePrefixCache._find_walk_back_truncation_point (cognitive 22) omlx/cache/prefix_cache.py:3037 — BlockAwarePrefixCache._find_walk_back_truncation_point has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (14 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 · autoconfigure.order_hosts_for_topology (cognitive 22) · ×1
  • autoconfigure.order_hosts_for_topology (cognitive 22) omlx/cluster/autoconfigure.py:492 — autoconfigure.order_hosts_for_topology has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 3 (4 pts), ternaries 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 · DiscoveryService._rehydrate_paired_candidates (cognitive 22) · ×1
  • DiscoveryService._rehydrate_paired_candidates (cognitive 22) REDACTED:1354 — DiscoveryService._rehydrate_paired_candidates has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 4, error handling 2 (4 pts), 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 · staging.stage_manifest (cognitive 22) · ×1
  • staging.stage_manifest (cognitive 22) omlx/cluster/staging.py:493 — staging.stage_manifest has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 3 (5 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 · staging.scp_copy (cognitive 22) · ×1
  • staging.scp_copy (cognitive 22) omlx/cluster/staging.py:864 — staging.scp_copy has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 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 · codex.write_codex_config (cognitive 22) · ×1
  • codex.write_codex_config (cognitive 22) omlx/integrations/codex.py:283 — codex.write_codex_config has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 3, error handling 1 (2 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 · MLXEmbeddingModel._count_tokens (cognitive 22) · ×1
  • MLXEmbeddingModel._count_tokens (cognitive 22) omlx/models/embedding.py:1201 — MLXEmbeddingModel._count_tokens has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 4 (12 pts), if/else 5 (9 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 · oq._normalize_sensitivity_map_override (cognitive 22) · ×1
  • oq._normalize_sensitivity_map_override (cognitive 22) REDACTED:515 — oq._normalize_sensitivity_map_override has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 5, error handling 2 (4 pts), 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 · oq._oqe_calibration_batch_plan (cognitive 22) · ×1
  • oq._oqe_calibration_batch_plan (cognitive 22) REDACTED:4514 — oq._oqe_calibration_batch_plan has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 6, ternaries 4 (6 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 · oq._prepare_layer_inputs (cognitive 22) · ×1
  • oq._prepare_layer_inputs (cognitive 22) REDACTED:9126 — oq._prepare_layer_inputs has cognitive complexity 22 (threshold 15). Drivers by points: if/else 15 (17 pts), boolean chains 3, ternaries 1 (2 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.
D2 · Cognitive Complexity · _SlotCache.ensure_ids (cognitive 22) · ×1
  • _SlotCache.ensure_ids (cognitive 22) omlx/patches/deepseek_v4/moe_offload.py:159 — _SlotCache.ensure_ids has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 5 (7 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 · loader.sanitize_weights (cognitive 22) · ×1
  • loader.sanitize_weights (cognitive 22) omlx/patches/inkling2/loader.py:46 — loader.sanitize_weights has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 3 (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 · tool_parser._parse_group_body (cognitive 22) · ×1
  • tool_parser._parse_group_body (cognitive 22) omlx/patches/k2_horizon/tool_parser.py:62 — tool_parser._parse_group_body has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 4 (8 pts), boolean chains 3 (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 · batch_generator._run_verify_cycle_legacy (cognitive 22) · ×1
  • batch_generator._run_verify_cycle_legacy (cognitive 22) REDACTED:4942 — batch_generator._run_verify_cycle_legacy has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (15 pts), ternaries 3 (4 pts), boolean chains 3 (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 · qwen35_ane_prefill._compile_pair (cognitive 22) · ×1
  • qwen35_ane_prefill._compile_pair (cognitive 22) omlx/patches/qwen35_ane_prefill.py:597 — qwen35_ane_prefill._compile_pair has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11, ternaries 6, boolean chains 5. 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 · Scheduler._reschedule_generation_overflow_requests (cognitive 22) · ×1
  • Scheduler._reschedule_generation_overflow_requests (cognitive 22) omlx/scheduler.py:15352 — Scheduler._reschedule_generation_overflow_requests has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 6, 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 · Scheduler._process_pending_memory_requeue (cognitive 22) · ×1
  • Scheduler._process_pending_memory_requeue (cognitive 22) omlx/scheduler.py:15580 — Scheduler._process_pending_memory_requeue has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 5, error handling 1 (2 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 · server.list_models_status (cognitive 22) · ×1
  • server.list_models_status (cognitive 22) REDACTED:3977 — server.list_models_status has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (16 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 · GlobalSettings._load_from_file (cognitive 22) · ×1
  • GlobalSettings._load_from_file (cognitive 22) omlx/settings.py:1170 — GlobalSettings._load_from_file has cognitive complexity 22 (threshold 15). Drivers by points: if/else 18, error handling 3 (4 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 · PerformanceScreenVM.resetDefaults (cognitive 22) · ×1
  • PerformanceScreenVM.resetDefaults (cognitive 22) apps/omlx-mac/Sources/AppView/ViewModels/PerformanceScreenVM.swift:80 — PerformanceScreenVM.resetDefaults has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 2 (6 pts), boolean chains 2, 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 · AppConfig.load (cognitive 22) · ×1
  • AppConfig.load (cognitive 22) apps/omlx-mac/Sources/Config/AppConfig.swift:287 — AppConfig.load has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 5 (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 · dashboard.connectBenchSSE · ×1
  • dashboard.connectBenchSSE::onmessage (cognitive 22) REDACTED:5487 — dashboard.connectBenchSSE::onmessage has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (18 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.
D2 · Cognitive Complexity · markitdown.preprocess_markitdown_file_parts (cognitive 21) · ×1
  • markitdown.preprocess_markitdown_file_parts (cognitive 21) omlx/api/markitdown.py:291 — markitdown.preprocess_markitdown_file_parts has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 2 (3 pts), ternaries 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. This shape REPEATS in the file: one other method here (markitdown.preprocess_markitdown_file_parts_async) 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 · markitdown.preprocess_markitdown_file_parts_async (cognitive 21) · ×1
  • markitdown.preprocess_markitdown_file_parts_async (cognitive 21) omlx/api/markitdown.py:372 — markitdown.preprocess_markitdown_file_parts_async has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 2 (3 pts), ternaries 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. This shape REPEATS in the file: one other method here (markitdown.preprocess_markitdown_file_parts) 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 · ToolCallStreamFilter.__init__ (cognitive 21) · ×1
  • ToolCallStreamFilter.__init__ (cognitive 21) omlx/api/tool_calling.py:2647 — ToolCallStreamFilter.__init__ has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (14 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 · PagedSSDCacheManager.signature_mismatch_reason (cognitive 21) · ×1
  • PagedSSDCacheManager.signature_mismatch_reason (cognitive 21) omlx/cache/paged_ssd_cache.py:2983 — PagedSSDCacheManager.signature_mismatch_reason has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 6, ternaries 2 (3 pts), 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 · VisionFeatureSSDCache._load_from_ssd (cognitive 21) · ×1
  • VisionFeatureSSDCache._load_from_ssd (cognitive 21) omlx/cache/vision_feature_cache.py:406 — VisionFeatureSSDCache._load_from_ssd has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (15 pts), error handling 2 (3 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 · autoconfigure.build_rdma_matrix (cognitive 21) · ×1
  • autoconfigure.build_rdma_matrix (cognitive 21) omlx/cluster/autoconfigure.py:391 — autoconfigure.build_rdma_matrix has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (12 pts), ternaries 2 (6 pts), 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 · probe.detect_accelerator_hardware (cognitive 21) · ×1
  • probe.detect_accelerator_hardware (cognitive 21) omlx/cluster/probe.py:72 — probe.detect_accelerator_hardware has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 9, boolean chains 5, error handling 3 (4 pts), if/else 1 (2 pts), loops 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 · DeviceRegistry.merge (cognitive 21) · ×1
  • DeviceRegistry.merge (cognitive 21) omlx/cluster/registry.py:379 — DeviceRegistry.merge has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 4, 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 · transport.verify_link_reachability (cognitive 21) · ×1
  • transport.verify_link_reachability (cognitive 21) omlx/cluster/transport.py:1614 — transport.verify_link_reachability has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (12 pts), ternaries 2 (5 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 · VLMBatchedEngine.stream_generate (cognitive 21) · ×1
  • VLMBatchedEngine.stream_generate (cognitive 21) omlx/engine/vlm.py:5014 — VLMBatchedEngine.stream_generate has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 5, ternaries 2 (4 pts), loops 2 (3 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 · memory_monitor.estimate_mla_kv_bytes_per_token (cognitive 21) · ×1
  • memory_monitor.estimate_mla_kv_bytes_per_token (cognitive 21) REDACTED:2044 — memory_monitor.estimate_mla_kv_bytes_per_token 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 · MLXLanguageModel.stream_generate (cognitive 21) · ×1
  • MLXLanguageModel.stream_generate (cognitive 21) omlx/models/llm.py:190 — MLXLanguageModel.stream_generate has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (11 pts), ternaries 2 (5 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 · oq._measure_sensitivity_from_model (cognitive 21) · ×1
  • oq._measure_sensitivity_from_model (cognitive 21) REDACTED:11404 — oq._measure_sensitivity_from_model has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 4, 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 · deepseek_v4_model._stage_full_rotating_verify_view (cognitive 21) · ×1
  • deepseek_v4_model._stage_full_rotating_verify_view (cognitive 21) omlx/patches/deepseek_v4/deepseek_v4_model.py:1175 — deepseek_v4_model._stage_full_rotating_verify_view has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 9). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D2 · Cognitive Complexity · ane_prefill.prefill_memory_reservation (cognitive 21) · ×1
  • ane_prefill.prefill_memory_reservation (cognitive 21) omlx/patches/k2_horizon/ane_prefill.py:240 — ane_prefill.prefill_memory_reservation has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 4 (10 pts), if/else 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 · prompt_priming._prepare_prefix_context (cognitive 21) · ×1
  • prompt_priming._prepare_prefix_context (cognitive 21) REDACTED:601 — prompt_priming._prepare_prefix_context has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9, boolean chains 8, error handling 3, 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 · inkling_vlm_runtime._inkling_prime_capture (cognitive 21) · ×1
  • inkling_vlm_runtime._inkling_prime_capture (cognitive 21) omlx/patches/mlx_vlm_mtp/inkling_vlm_runtime.py:813 — inkling_vlm_runtime._inkling_prime_capture has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 5, 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 · qwen35_ane_prefill._gdn_backend (cognitive 21) · ×1
  • qwen35_ane_prefill._gdn_backend (cognitive 21) omlx/patches/qwen35_ane_prefill.py:1684 — qwen35_ane_prefill._gdn_backend has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (17 pts), ternaries 2, 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. This shape REPEATS in the file: one other method here (qwen35_ane_prefill._backend) 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 · qwen35_ane_prefill._backend (cognitive 21) · ×1
  • qwen35_ane_prefill._backend (cognitive 21) omlx/patches/qwen35_ane_prefill.py:2036 — qwen35_ane_prefill._backend has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (17 pts), ternaries 2, 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. This shape REPEATS in the file: one other method here (qwen35_ane_prefill._gdn_backend) 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 · qwen35_ane_prefill._bank_split_ladder (cognitive 21) · ×1
  • qwen35_ane_prefill._bank_split_ladder (cognitive 21) omlx/patches/qwen35_ane_prefill.py:2184 — qwen35_ane_prefill._bank_split_ladder has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (3 pts), error handling 1 (2 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. This shape REPEATS in the file: one other method here (qwen35_ane_prefill._compile_single_banks) 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 · qwen35_ane_prefill._compile_single_banks (cognitive 21) · ×1
  • qwen35_ane_prefill._compile_single_banks (cognitive 21) omlx/patches/qwen35_ane_prefill.py:2312 — qwen35_ane_prefill._compile_single_banks has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (3 pts), error handling 1 (2 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. This shape REPEATS in the file: one other method here (qwen35_ane_prefill._bank_split_ladder) 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 · qwen35_verify_qmm._pack_block (cognitive 21) · ×1
  • qwen35_verify_qmm._pack_block (cognitive 21) omlx/patches/qwen35_verify_qmm.py:267 — qwen35_verify_qmm._pack_block has cognitive complexity 21 (threshold 15). Drivers by points: loops 9 (19 pts), if/else 2 (nesting depth added 10). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D2 · Cognitive Complexity · qwen35_verify_sdpa_split._vector_plan (cognitive 21) · ×1
  • qwen35_verify_sdpa_split._vector_plan (cognitive 21) omlx/patches/qwen35_verify_sdpa_split.py:103 — qwen35_verify_sdpa_split._vector_plan has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 5, 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 · HelperServer._run_chunks (cognitive 21) · ×1
  • HelperServer._run_chunks (cognitive 21) omlx/prefill_helper/worker.py:228 — HelperServer._run_chunks has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 7, 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 · scheduler._realigned_rows (cognitive 21) · ×1
  • scheduler._realigned_rows (cognitive 21) omlx/scheduler.py:811 — scheduler._realigned_rows has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (13 pts), ternaries 2 (6 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 · model_loading.expand_glm_moe_dsa_fused_quant_keys (cognitive 21) · ×1
  • model_loading.expand_glm_moe_dsa_fused_quant_keys (cognitive 21) omlx/utils/model_loading.py:272 — model_loading.expand_glm_moe_dsa_fused_quant_keys has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 2 (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 · ContextBenchScreenVM.pollStatus (cognitive 21) · ×1
  • ContextBenchScreenVM.pollStatus (cognitive 21) apps/omlx-mac/Sources/AppView/ViewModels/ContextBenchScreenVM.swift:181 — ContextBenchScreenVM.pollStatus has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 3, error handling 1 (2 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 · ModelSettingsScreenVM.validateAneWorkingSettings (cognitive 21) · ×1
  • ModelSettingsScreenVM.validateAneWorkingSettings (cognitive 21) apps/omlx-mac/Sources/AppView/ViewModels/ModelSettingsScreenVM.swift:2292 — ModelSettingsScreenVM.validateAneWorkingSettings has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 8, match/switch 6, if/else 4 (5 pts), ternaries 2 (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 · ServerProcess.tickHealth (cognitive 21) · ×1
  • ServerProcess.tickHealth (cognitive 21) apps/omlx-mac/Sources/Server/ServerProcess.swift:501 — ServerProcess.tickHealth has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 5, match/switch 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 · cluster_v2.clusterV2Wizard.wizardState (cognitive 21) · ×1
  • cluster_v2.clusterV2Wizard.wizardState (cognitive 21) apps/omlx-web/omlx_web/static/js/cluster_v2.js:1049 — cluster_v2.clusterV2Wizard.wizardState 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 · cluster_v2.clusterV2Wizard.previewMembershipExpansion (cognitive 21) · ×1
  • cluster_v2.clusterV2Wizard.previewMembershipExpansion (cognitive 21) apps/omlx-web/omlx_web/static/js/cluster_v2.js:3543 — cluster_v2.clusterV2Wizard.previewMembershipExpansion has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 16, if/else 3, error handling 1, ternaries 1. Of this number, 16 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 · kernels._pointwise_check (cognitive 20) · ×1
  • kernels._pointwise_check (cognitive 20) apps/omlx-cuda-helper/omlx_cuda_helper/families/deepseek_v41/kernels.py:1537 — kernels._pointwise_check has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (12 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 · Stage.load_prefix (cognitive 20) · ×1
  • Stage.load_prefix (cognitive 20) apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen4_exp/stage.py:128 — Stage.load_prefix has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 2 (4 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 · ModelStore.probe (cognitive 20) · ×1
  • ModelStore.probe (cognitive 20) apps/omlx-cuda-helper/omlx_cuda_helper/files.py:38 — ModelStore.probe has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 4, ternaries 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 · OQManager.cancel_quantization (cognitive 20) · ×1
  • OQManager.cancel_quantization (cognitive 20) omlx/admin/oq_manager.py:507 — OQManager.cancel_quantization has cognitive complexity 20 (threshold 15). Drivers by points: error handling 4 (10 pts), if/else 6, boolean chains 2, 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 · routes._mtp_compat_for_model (cognitive 20) · ×1
  • routes._mtp_compat_for_model (cognitive 20) omlx/admin/routes.py:1230 — routes._mtp_compat_for_model has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 2, 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.
D2 · Cognitive Complexity · routes._scan_offline_gdn_sidecars (cognitive 20) · ×1
  • routes._scan_offline_gdn_sidecars (cognitive 20) omlx/admin/routes.py:6682 — routes._scan_offline_gdn_sidecars has cognitive complexity 20 (threshold 15). Drivers by points: if/else 3 (9 pts), error handling 4 (8 pts), 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 · Affine4KVCache.attention (cognitive 20) · ×1
  • Affine4KVCache.attention (cognitive 20) omlx/affine4.py:1343 — Affine4KVCache.attention has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 5, 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 · ThinkingBudgetProcessor._update_state (cognitive 20) · ×1
  • ThinkingBudgetProcessor._update_state (cognitive 20) omlx/api/thinking.py:572 — ThinkingBudgetProcessor._update_state has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (18 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 · ToolCallStreamFilter.finish (cognitive 20) · ×1
  • ToolCallStreamFilter.finish (cognitive 20) omlx/api/tool_calling.py:3711 — ToolCallStreamFilter.finish has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 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 · tool_calling._merge_json_fragments (cognitive 20) · ×1
  • tool_calling._merge_json_fragments (cognitive 20) omlx/api/tool_calling.py:227 — tool_calling._merge_json_fragments has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (6 pts), ternaries 4 (5 pts), boolean chains 4, loops 2 (3 pts), 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.
D2 · Cognitive Complexity · tool_calling._find_marker_span_end (cognitive 20) · ×1
  • tool_calling._find_marker_span_end (cognitive 20) omlx/api/tool_calling.py:844 — tool_calling._find_marker_span_end has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 2, 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 · PagedSSDCacheManager._scan_existing_gdn_sidecars (cognitive 20) · ×1
  • PagedSSDCacheManager._scan_existing_gdn_sidecars (cognitive 20) omlx/cache/paged_ssd_cache.py:2562 — PagedSSDCacheManager._scan_existing_gdn_sidecars has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (9 pts), error handling 2 (5 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 · autoconfigure.peer_import_issues (cognitive 20) · ×1
  • autoconfigure.peer_import_issues (cognitive 20) omlx/cluster/autoconfigure.py:1215 — autoconfigure.peer_import_issues has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 4, 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 · SSDPromptSnapshotStore._load_manifest_or_reset (cognitive 20) · ×1
  • SSDPromptSnapshotStore._load_manifest_or_reset (cognitive 20) omlx/cluster/prompt_snapshot_cache.py:552 — SSDPromptSnapshotStore._load_manifest_or_reset has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (13 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 · link_probe_service.serve_probe (cognitive 20) · ×1
  • link_probe_service.serve_probe (cognitive 20) omlx/cluster/rdma/link_probe_service.py:32 — link_probe_service.serve_probe has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (19 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 · oq._apply_routed_layer_boosts (cognitive 20) · ×1
  • oq._apply_routed_layer_boosts (cognitive 20) REDACTED:1262 — oq._apply_routed_layer_boosts has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 3 (4 pts), boolean chains 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 · oq.combine_mtp_donor (cognitive 20) · ×1
  • oq.combine_mtp_donor (cognitive 20) REDACTED:2642 — oq.combine_mtp_donor has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 3 (5 pts), boolean chains 2, 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 · moe_offload.apply_deepseek_v4_moe_expert_offload (cognitive 20) · ×1
  • moe_offload.apply_deepseek_v4_moe_expert_offload (cognitive 20) omlx/patches/deepseek_v4/moe_offload.py:324 — moe_offload.apply_deepseek_v4_moe_expert_offload has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 2, 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 · deepseek_v32._use_load_fused_wk_weights_proj (cognitive 20) · ×1
  • deepseek_v32._use_load_fused_wk_weights_proj (cognitive 20) omlx/patches/glm_moe_dsa/deepseek_v32.py:28 — deepseek_v32._use_load_fused_wk_weights_proj has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 3, loops 2 (nesting depth added 5). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D2 · Cognitive Complexity · m5_gather_qmm.fused_gate_up_activation (cognitive 20) · ×1
  • m5_gather_qmm.fused_gate_up_activation (cognitive 20) omlx/patches/m5_gather_qmm.py:253 — m5_gather_qmm.fused_gate_up_activation has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 5, 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 · m5_gather_qmm_a8.supports (cognitive 20) · ×1
  • m5_gather_qmm_a8.supports (cognitive 20) omlx/patches/m5_gather_qmm_a8.py:784 — m5_gather_qmm_a8.supports has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11, 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 · prompt_priming._take_primed (cognitive 20) · ×1
  • prompt_priming._take_primed (cognitive 20) REDACTED:1238 — prompt_priming._take_primed has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 4, error handling 1, 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 · qwen35_ane_prefill._enable_fused_gdn_banks (cognitive 20) · ×1
  • qwen35_ane_prefill._enable_fused_gdn_banks (cognitive 20) omlx/patches/qwen35_ane_prefill.py:3006 — qwen35_ane_prefill._enable_fused_gdn_banks has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 2, error handling 1 (2 pts), 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 · launcher.resolve_target (cognitive 20) · ×1
  • launcher.resolve_target (cognitive 20) omlx/prefill_helper/launcher.py:107 — launcher.resolve_target has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (8 pts), error handling 2 (4 pts), ternaries 4, boolean chains 3, 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 · Scheduler._get_stop_tokens (cognitive 20) · ×1
  • Scheduler._get_stop_tokens (cognitive 20) omlx/scheduler.py:3635 — Scheduler._get_stop_tokens has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 3, error handling 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 · Scheduler._apply_turboquant_kv_empty (cognitive 20) · ×1
  • Scheduler._apply_turboquant_kv_empty (cognitive 20) omlx/scheduler.py:4125 — Scheduler._apply_turboquant_kv_empty has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (4 pts), ternaries 2 (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 · Scheduler.fail_all_requests (cognitive 20) · ×1
  • Scheduler.fail_all_requests (cognitive 20) omlx/scheduler.py:12729 — Scheduler.fail_all_requests has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 7, 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 · model_loading._checkpoint_weight_prefix (cognitive 20) · ×1
  • model_loading._checkpoint_weight_prefix (cognitive 20) omlx/utils/model_loading.py:1269 — model_loading._checkpoint_weight_prefix has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (9 pts), error handling 3 (5 pts), loops 3 (5 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 · build._strip_unused_packages (cognitive 20) · ×1
  • build._strip_unused_packages (cognitive 20) REDACTED:980 — build._strip_unused_packages has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (14 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 · ModelCardSheet.metadataRow (cognitive 20) · ×1
  • ModelCardSheet.metadataRow (cognitive 20) apps/omlx-mac/Sources/AppView/Screens/ModelCardSheet.swift:251 — ModelCardSheet.metadataRow has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 9 (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 · IntegrationsScreenVM.load (cognitive 20) · ×1
  • IntegrationsScreenVM.load (cognitive 20) apps/omlx-mac/Sources/AppView/ViewModels/IntegrationsScreenVM.swift:279 — IntegrationsScreenVM.load has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 2, 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 · MenubarStatsPoller.refreshOnce (cognitive 20) · ×1
  • MenubarStatsPoller.refreshOnce (cognitive 20) apps/omlx-mac/Sources/Menubar/MenubarStatsPoller.swift:322 — MenubarStatsPoller.refreshOnce has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (14 pts), error handling 2 (4 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 · dashboard.dashboard.addToAccQueue (cognitive 20) · ×1
  • dashboard.dashboard.addToAccQueue (cognitive 20) REDACTED:6234 — dashboard.dashboard.addToAccQueue has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (9 pts), error handling 3 (5 pts), boolean chains 4, ternaries 2 (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 · clusterV2Wizard.previewMembershipExpansion (cognitive 20) · ×1
  • clusterV2Wizard.previewMembershipExpansion (cognitive 20) apps/omlx-web/omlx_web/static/js/cluster_v2.js:3543 — clusterV2Wizard.previewMembershipExpansion has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 15, if/else 3, error handling 1, ternaries 1. Of this number, 16 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 · dashboard.loadGlobalSettings (cognitive 20) · ×1
  • dashboard.loadGlobalSettings (cognitive 20) REDACTED:1289 — dashboard.loadGlobalSettings has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 4 (8 pts), boolean chains 3, 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 · dashboard.applyProfileToForm (cognitive 20) · ×1
  • dashboard.applyProfileToForm (cognitive 20) REDACTED:2546 — dashboard.applyProfileToForm has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 5, error handling 2 (3 pts), 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 · dashboard.addToAccQueue (cognitive 20) · ×1
  • dashboard.addToAccQueue (cognitive 20) REDACTED:6234 — dashboard.addToAccQueue has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (9 pts), error handling 3 (5 pts), boolean chains 4, ternaries 2 (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 · hf_uploader._storage_summary (cognitive 19) · ×1
  • hf_uploader._storage_summary (cognitive 19) omlx/admin/hf_uploader.py:182 — hf_uploader._storage_summary has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (4 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 · OQManager._estimate_progress (cognitive 19) · ×1
  • OQManager._estimate_progress (cognitive 19) omlx/admin/oq_manager.py:738 — OQManager._estimate_progress has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (15 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 · ToolCallStreamFilter._could_be_partial_attr_function_open (cognitive 19) · ×1
  • ToolCallStreamFilter._could_be_partial_attr_function_open (cognitive 19) omlx/api/tool_calling.py:3282 — ToolCallStreamFilter._could_be_partial_attr_function_open has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (14 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 · discovery._default_interface_lister (cognitive 19) · ×1
  • discovery._default_interface_lister (cognitive 19) REDACTED:857 — discovery._default_interface_lister has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 1 (3 pts), error handling 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 · inference_worker._think_token_ids (cognitive 19) · ×1
  • inference_worker._think_token_ids (cognitive 19) omlx/cluster/inference_worker.py:261 — inference_worker._think_token_ids has cognitive complexity 19 (threshold 15). Drivers by points: error handling 4 (6 pts), if/else 5 (6 pts), boolean chains 5, 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 · DistributedJobSupervisor._reap_remote_ranks (cognitive 19) · ×1
  • DistributedJobSupervisor._reap_remote_ranks (cognitive 19) omlx/cluster/launch.py:3225 — DistributedJobSupervisor._reap_remote_ranks has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (9 pts), error handling 2 (5 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 · launch.run_cluster_performance_probe (cognitive 19) · ×1
  • launch.run_cluster_performance_probe (cognitive 19) omlx/cluster/launch.py:1424 — launch.run_cluster_performance_probe has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (7 pts), boolean chains 4, error handling 3 (4 pts), ternaries 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.
D2 · Cognitive Complexity · PairingManager.unpair (cognitive 19) · ×1
  • PairingManager.unpair (cognitive 19) REDACTED:1655 — PairingManager.unpair has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 10, if/else 6 (7 pts), error handling 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 · prefill_guard.rank_monitor (cognitive 19) · ×1
  • prefill_guard.rank_monitor (cognitive 19) omlx/cluster/prefill_guard.py:37 — prefill_guard.rank_monitor has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 9, if/else 4 (6 pts), ternaries 2, error handling 1, 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 · DistributedBatchedEngine._backend_chat_messages (cognitive 19) · ×1
  • DistributedBatchedEngine._backend_chat_messages (cognitive 19) omlx/engine/distributed.py:840 — DistributedBatchedEngine._backend_chat_messages has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (15 pts), loops 2 (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 · SplashEngine._stream (cognitive 19) · ×1
  • SplashEngine._stream (cognitive 19) REDACTED:1533 — SplashEngine._stream has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 6, 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 · splash._check_model (cognitive 19) · ×1
  • splash._check_model (cognitive 19) REDACTED:594 — splash._check_model has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (14 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, 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 · sts._detect_sts_family (cognitive 19) · ×1
  • sts._detect_sts_family (cognitive 19) omlx/engine/sts.py:54 — sts._detect_sts_family has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 2, error handling 1 (2 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 · VLMBatchedEngine._encode_missing_vision_features (cognitive 19) · ×1
  • VLMBatchedEngine._encode_missing_vision_features (cognitive 19) omlx/engine/vlm.py:3615 — VLMBatchedEngine._encode_missing_vision_features has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 5, loops 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 · humaneval._extract_code (cognitive 19) · ×1
  • humaneval._extract_code (cognitive 19) omlx/eval/humaneval.py:59 — humaneval._extract_code has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (16 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 · ClaudeCodeIntegration.launch (cognitive 19) · ×1
  • ClaudeCodeIntegration.launch (cognitive 19) omlx/integrations/claude.py:86 — ClaudeCodeIntegration.launch has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (14 pts), 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 · ModelSettingsManager.update_profile (cognitive 19) · ×1
  • ModelSettingsManager.update_profile (cognitive 19) omlx/model_settings.py:1538 — ModelSettingsManager.update_profile has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 4, 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 · _LazyTensorIndex._classify_pair (cognitive 19) · ×1
  • _LazyTensorIndex._classify_pair (cognitive 19) REDACTED:5692 — _LazyTensorIndex._classify_pair has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (11 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 · Compressor.consume (cognitive 19) · ×1
  • Compressor.consume (cognitive 19) omlx/patches/deepseek_v4/deepseek_v4_model.py:1081 — Compressor.consume has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (12 pts), ternaries 2 (5 pts), boolean chains 2 (nesting depth added 6). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D2 · Cognitive Complexity · DeepseekV32Attention.__call__ (cognitive 19) · ×1
  • DeepseekV32Attention.__call__ (cognitive 19) omlx/patches/glm_moe_dsa/deepseek_v32.py:493 — DeepseekV32Attention.__call__ has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 1, ternaries 1 (nesting depth added 5). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D2 · Cognitive Complexity · ane_prefill._projection_part (cognitive 19) · ×1
  • ane_prefill._projection_part (cognitive 19) omlx/patches/k2_horizon/ane_prefill.py:97 — ane_prefill._projection_part has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 5 (11 pts), if/else 5 (8 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 · m5_gather_qmm_nax.sorted_gather_qmm_swiglu_oai (cognitive 19) · ×1
  • m5_gather_qmm_nax.sorted_gather_qmm_swiglu_oai (cognitive 19) omlx/patches/m5_gather_qmm_nax.py:1958 — m5_gather_qmm_nax.sorted_gather_qmm_swiglu_oai 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.
D2 · Cognitive Complexity · MiMoV2Model.__call__ (cognitive 19) · ×1
  • MiMoV2Model.__call__ (cognitive 19) omlx/patches/mimo_v2/mimo_v2_model.py:425 — MiMoV2Model.__call__ has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (12 pts), ternaries 5 (6 pts), loops 1 (nesting depth added 3). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D2 · Cognitive Complexity · pipeline_patch._pipelined_call (cognitive 19) · ×1
  • pipeline_patch._pipelined_call (cognitive 19) omlx/patches/minimax_m3_mlx_lm/pipeline_patch.py:154 — pipeline_patch._pipelined_call has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (11 pts), ternaries 3 (4 pts), boolean chains 3, 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 · ContextCopy.propose (cognitive 19) · ×1
  • ContextCopy.propose (cognitive 19) omlx/patches/mlx_lm_mtp/context_copy.py:114 — ContextCopy.propose has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 3, loops 2 (3 pts), ternaries 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 · prompt_priming._cache_at_offset (cognitive 19) · ×1
  • prompt_priming._cache_at_offset (cognitive 19) REDACTED:348 — prompt_priming._cache_at_offset has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 3, 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 · prompt_priming._capture_boundary_candidate (cognitive 19) · ×1
  • prompt_priming._capture_boundary_candidate (cognitive 19) REDACTED:742 — prompt_priming._capture_boundary_candidate has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 7, 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 · decode_kernels.mla_head_qmv (cognitive 19) · ×1
  • decode_kernels.mla_head_qmv (cognitive 19) omlx/patches/mlx_vlm_glm5_next_compat/decode_kernels.py:3452 — decode_kernels.mla_head_qmv has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (10 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 · ExpertCache._ensure_ids (cognitive 19) · ×1
  • ExpertCache._ensure_ids (cognitive 19) omlx/patches/moe_expert_offload.py:520 — ExpertCache._ensure_ids has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (15 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 · qwen35_ane_prefill._prepare_gdn_for_bank (cognitive 19) · ×1
  • qwen35_ane_prefill._prepare_gdn_for_bank (cognitive 19) omlx/patches/qwen35_ane_prefill.py:1367 — qwen35_ane_prefill._prepare_gdn_for_bank has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 4, ternaries 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 · qwen35_ane_prefill.release_qwen35_ane_prefill (cognitive 19) · ×1
  • qwen35_ane_prefill.release_qwen35_ane_prefill (cognitive 19) omlx/patches/qwen35_ane_prefill.py:3553 — qwen35_ane_prefill.release_qwen35_ane_prefill has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 4 (7 pts), boolean chains 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 · DeepseekV41Adapter.apply_state (cognitive 19) · ×1
  • DeepseekV41Adapter.apply_state (cognitive 19) omlx/prefill_helper/adapters/deepseek_v41.py:248 — DeepseekV41Adapter.apply_state has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 2 (8 pts), if/else 3 (7 pts), loops 2 (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 · routes._check (cognitive 19) · ×1
  • routes._check (cognitive 19) omlx/prefill_helper/routes.py:156 — routes._check has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (8 pts), ternaries 4 (5 pts), boolean chains 4, error handling 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 · Scheduler._predicted_chunk_transient (cognitive 19) · ×1
  • Scheduler._predicted_chunk_transient (cognitive 19) omlx/scheduler.py:5003 — Scheduler._predicted_chunk_transient has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (17 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 · Scheduler._infer_live_layer_cache_types (cognitive 19) · ×1
  • Scheduler._infer_live_layer_cache_types (cognitive 19) omlx/scheduler.py:16792 — Scheduler._infer_live_layer_cache_types has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 5, error handling 4, 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 · server._with_prompt_progress (cognitive 19) · ×1
  • server._with_prompt_progress (cognitive 19) REDACTED:2971 — server._with_prompt_progress has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 5, loops 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 · GlobalSettings.ensure_directories (cognitive 19) · ×1
  • GlobalSettings.ensure_directories (cognitive 19) omlx/settings.py:1653 — GlobalSettings.ensure_directories has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (10 pts), error handling 3 (7 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 · settings.get_auto_ssd_cache_size (cognitive 19) · ×1
  • settings.get_auto_ssd_cache_size (cognitive 19) omlx/settings.py:134 — settings.get_auto_ssd_cache_size has cognitive complexity 19 (threshold 15). Drivers by points: loops 4 (7 pts), if/else 2 (6 pts), error handling 1 (4 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 · nax_attention.nax_mixed_head_dim_attention (cognitive 19) · ×1
  • nax_attention.nax_mixed_head_dim_attention (cognitive 19) omlx/utils/nax_attention.py:970 — nax_attention.nax_mixed_head_dim_attention has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 6, error handling 1 (2 pts) (nesting depth added 4). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D2 · Cognitive Complexity · AppServices.applyStorageChanges (cognitive 19) · ×1
  • AppServices.applyStorageChanges (cognitive 19) apps/omlx-mac/Sources/AppView/AppServices.swift:195 — AppServices.applyStorageChanges has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (14 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 · dashboard.dashboard.prefillHelperStatusText (cognitive 19) · ×1
  • dashboard.dashboard.prefillHelperStatusText (cognitive 19) REDACTED:3330 — dashboard.dashboard.prefillHelperStatusText has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 5, ternaries 2 (4 pts), match/switch 1 (nesting depth added 6). 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 · dashboard.dashboard.sortModels (cognitive 19) · ×1
  • dashboard.dashboard.sortModels (cognitive 19) REDACTED:8938 — dashboard.dashboard.sortModels has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 12, if/else 6, ternaries 1. Most of this is not in the body itself: 1 of the 19 points is its own statement and the rest belongs to one function literal inside it that branches (line 8941). 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 · dashboard.applyPresetToForm (cognitive 19) · ×1
  • dashboard.applyPresetToForm (cognitive 19) REDACTED:2433 — dashboard.applyPresetToForm has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 4, ternaries 1 (3 pts), loops 1, other 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 · minimax_m3_vl.read_config (cognitive 18) · ×1
  • minimax_m3_vl.read_config (cognitive 18) apps/omlx-cuda-helper/omlx_cuda_helper/families/minimax_m3_vl/__init__.py:93 — minimax_m3_vl.read_config has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 9, if/else 6, ternaries 2 (3 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 · routes._apply_cache_settings_runtime (cognitive 18) · ×1
  • routes._apply_cache_settings_runtime (cognitive 18) omlx/admin/routes.py:1545 — routes._apply_cache_settings_runtime has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (7 pts), ternaries 2 (6 pts), boolean chains 2, error handling 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 · routes._vlm_mtp_recipe_problem (cognitive 18) · ×1
  • routes._vlm_mtp_recipe_problem (cognitive 18) omlx/admin/routes.py:4096 — routes._vlm_mtp_recipe_problem has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 6, ternaries 1 (2 pts), 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, 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 · routes._load_fallback_commits (cognitive 18) · ×1
  • routes._load_fallback_commits (cognitive 18) omlx/admin/routes.py:6581 — routes._load_fallback_commits has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 pts), error handling 2 (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 · anthropic_utils.request_has_cache_control (cognitive 18) · ×1
  • anthropic_utils.request_has_cache_control (cognitive 18) omlx/api/anthropic_utils.py:32 — anthropic_utils.request_has_cache_control has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 4 (6 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 · anthropic_utils._extract_tool_result_content (cognitive 18) · ×1
  • anthropic_utils._extract_tool_result_content (cognitive 18) omlx/api/anthropic_utils.py:835 — anthropic_utils._extract_tool_result_content has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 1 (2 pts), ternaries 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 · tool_calling._repair_json_value (cognitive 18) · ×1
  • tool_calling._repair_json_value (cognitive 18) omlx/api/tool_calling.py:267 — tool_calling._repair_json_value has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), ternaries 1 (3 pts), loops 2, 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 · BlockAwarePrefixCache._gdn_split_layout_supported (cognitive 18) · ×1
  • BlockAwarePrefixCache._gdn_split_layout_supported (cognitive 18) omlx/cache/prefix_cache.py:408 — BlockAwarePrefixCache._gdn_split_layout_supported has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 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 · BlockAwarePrefixCache._validated_gdn_snapshot_layers (cognitive 18) · ×1
  • BlockAwarePrefixCache._validated_gdn_snapshot_layers (cognitive 18) omlx/cache/prefix_cache.py:449 — BlockAwarePrefixCache._validated_gdn_snapshot_layers has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 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 · BlockAwarePrefixCache._detect_window_padding_from_blocks (cognitive 18) · ×1
  • BlockAwarePrefixCache._detect_window_padding_from_blocks (cognitive 18) omlx/cache/prefix_cache.py:748 — BlockAwarePrefixCache._detect_window_padding_from_blocks has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 5, 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 · BlockAwarePrefixCache._strip_rotating_payload (cognitive 18) · ×1
  • BlockAwarePrefixCache._strip_rotating_payload (cognitive 18) omlx/cache/prefix_cache.py:2197 — BlockAwarePrefixCache._strip_rotating_payload has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 7, if/else 6 (7 pts), ternaries 1 (2 pts), 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, 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 · BlockAwarePrefixCache._tq_block_params (cognitive 18) · ×1
  • BlockAwarePrefixCache._tq_block_params (cognitive 18) omlx/cache/prefix_cache.py:5076 — BlockAwarePrefixCache._tq_block_params has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 4, error handling 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 · DiscoveryService._sync_interfaces (cognitive 18) · ×1
  • DiscoveryService._sync_interfaces (cognitive 18) REDACTED:1510 — DiscoveryService._sync_interfaces has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (9 pts), error handling 4 (7 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 · inference_worker.main (cognitive 18) · ×1
  • inference_worker.main (cognitive 18) omlx/cluster/inference_worker.py:1916 — inference_worker.main has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 4, loops 2, 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 · ModelLayout.__post_init__ (cognitive 18) · ×1
  • ModelLayout.__post_init__ (cognitive 18) omlx/cluster/planner.py:130 — ModelLayout.__post_init__ has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, boolean chains 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 · planner._kv_bytes_per_token_per_layer (cognitive 18) · ×1
  • planner._kv_bytes_per_token_per_layer (cognitive 18) omlx/cluster/planner.py:1017 — planner._kv_bytes_per_token_per_layer has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (9 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 · DeviceRegistry.mark_paired (cognitive 18) · ×1
  • DeviceRegistry.mark_paired (cognitive 18) omlx/cluster/registry.py:485 — DeviceRegistry.mark_paired has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 10, if/else 4, ternaries 3, 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 · ssh_keys.generate_ssh_key_pair (cognitive 18) · ×1
  • ssh_keys.generate_ssh_key_pair (cognitive 18) omlx/cluster/ssh_keys.py:107 — ssh_keys.generate_ssh_key_pair has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 2, error handling 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 · tensor_strategies._shard_nemotron_h (cognitive 18) · ×1
  • tensor_strategies._shard_nemotron_h (cognitive 18) omlx/cluster/tensor_strategies.py:496 — tensor_strategies._shard_nemotron_h has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (17 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 · tensor_strategies._shard_glm5_next (cognitive 18) · ×1
  • tensor_strategies._shard_glm5_next (cognitive 18) omlx/cluster/tensor_strategies.py:684 — tensor_strategies._shard_glm5_next has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 3 (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 · BaseEngine._system_prefix_ids (cognitive 18) · ×1
  • BaseEngine._system_prefix_ids (cognitive 18) omlx/engine/base.py:326 — BaseEngine._system_prefix_ids has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 3, 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 · EnginePool.moe_offload_fit (cognitive 18) · ×1
  • EnginePool.moe_offload_fit (cognitive 18) omlx/engine_pool.py:781 — EnginePool.moe_offload_fit has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (11 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 · EnginePool.discover_models (cognitive 18) · ×1
  • EnginePool.discover_models (cognitive 18) omlx/engine_pool.py:1547 — EnginePool.discover_models has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 4, 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 · ModelSettingsManager.update_template (cognitive 18) · ×1
  • ModelSettingsManager.update_template (cognitive 18) omlx/model_settings.py:1889 — ModelSettingsManager.update_template has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 2 (5 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 · model_settings.validate_ane_prefill (cognitive 18) · ×1
  • model_settings.validate_ane_prefill (cognitive 18) omlx/model_settings.py:97 — model_settings.validate_ane_prefill has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 4, ternaries 3 (4 pts), loops 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 · openjev.render_prompt (cognitive 18) · ×1
  • openjev.render_prompt (cognitive 18) omlx/models/openjev.py:124 — openjev.render_prompt has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 6 (10 pts), if/else 4 (7 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 · oq._block_dequant_fp8 (cognitive 18) · ×1
  • oq._block_dequant_fp8 (cognitive 18) REDACTED:3172 — oq._block_dequant_fp8 has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 6 (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 · oq._calibration_resident_checkpoint_bytes (cognitive 18) · ×1
  • oq._calibration_resident_checkpoint_bytes (cognitive 18) REDACTED:4424 — oq._calibration_resident_checkpoint_bytes has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (9 pts), error handling 2 (5 pts), loops 2 (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 · oq._copy_model_sidecars (cognitive 18) · ×1
  • oq._copy_model_sidecars (cognitive 18) REDACTED:5256 — oq._copy_model_sidecars has cognitive complexity 18 (threshold 15). Drivers by points: loops 6 (9 pts), if/else 3 (7 pts), boolean chains 2 (nesting depth added 7). 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 · oq._load_or_collect_imatrix (cognitive 18) · ×1
  • oq._load_or_collect_imatrix (cognitive 18) REDACTED:11246 — oq._load_or_collect_imatrix has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 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 · LinearAttention.__call__ (cognitive 18) · ×1
  • LinearAttention.__call__ (cognitive 18) omlx/patches/bailing_hybrid/bailing_hybrid_model.py:500 — LinearAttention.__call__ has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 1 (2 pts), boolean chains 1, ternaries 1 (nesting depth added 6). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D2 · Cognitive Complexity · Model.mtp_partial_rollback (cognitive 18) · ×1
  • Model.mtp_partial_rollback (cognitive 18) omlx/patches/bailing_hybrid/bailing_hybrid_model.py:849 — Model.mtp_partial_rollback has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 4 (5 pts), boolean chains 2 (nesting depth added 6). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D2 · Cognitive Complexity · deepseek_v4_model._materialize_cache_arrays (cognitive 18) · ×1
  • deepseek_v4_model._materialize_cache_arrays (cognitive 18) omlx/patches/deepseek_v4/deepseek_v4_model.py:191 — deepseek_v4_model._materialize_cache_arrays has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 9). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D2 · Cognitive Complexity · moe_offload.resolve_view (cognitive 18) · ×1
  • moe_offload.resolve_view (cognitive 18) omlx/patches/deepseek_v4/moe_offload.py:82 — moe_offload.resolve_view has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 3 (4 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 · kernels._masked_attention (cognitive 18) · ×1
  • kernels._masked_attention (cognitive 18) omlx/patches/inkling2/kernels.py:408 — kernels._masked_attention has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 3 (5 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 · m5_gather_qmm_a8._supports_mx (cognitive 18) · ×1
  • m5_gather_qmm_a8._supports_mx (cognitive 18) omlx/patches/m5_gather_qmm_a8.py:1111 — m5_gather_qmm_a8._supports_mx has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 8, if/else 8, 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 · audio.audio_cache_key_ranges (cognitive 18) · ×1
  • audio.audio_cache_key_ranges (cognitive 18) omlx/patches/mimo_v2/audio.py:17 — audio.audio_cache_key_ranges has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 3 (4 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 · decode_fast._attention (cognitive 18) · ×1
  • decode_fast._attention (cognitive 18) omlx/patches/mimo_v2/decode_fast.py:875 — decode_fast._attention has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 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 · batch_generator._reconcile_mtp_batch_to_standard (cognitive 18) · ×1
  • batch_generator._reconcile_mtp_batch_to_standard (cognitive 18) REDACTED:1498 — batch_generator._reconcile_mtp_batch_to_standard has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (15 pts), 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 · glm_moe_dsa_model._infer_mtp_quant_overrides (cognitive 18) · ×1
  • glm_moe_dsa_model._infer_mtp_quant_overrides (cognitive 18) omlx/patches/mlx_lm_mtp/glm_moe_dsa_model.py:137 — glm_moe_dsa_model._infer_mtp_quant_overrides has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 4, 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 · mlx_vlm_minimax_m3_compat._normalize_quantization_config (cognitive 18) · ×1
  • mlx_vlm_minimax_m3_compat._normalize_quantization_config (cognitive 18) omlx/patches/mlx_vlm_minimax_m3_compat/__init__.py:308 — mlx_vlm_minimax_m3_compat._normalize_quantization_config has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 2 (5 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 · sdpa256_attention._array_tiled_sdpa256 (cognitive 18) · ×1
  • sdpa256_attention._array_tiled_sdpa256 (cognitive 18) omlx/patches/sdpa256_attention.py:101 — sdpa256_attention._array_tiled_sdpa256 has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (3 pts), ternaries 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 · turboquant_attention.apply_turboquant_attention_patch (cognitive 18) · ×1
  • turboquant_attention.apply_turboquant_attention_patch (cognitive 18) omlx/patches/turboquant_attention.py:970 — turboquant_attention.apply_turboquant_attention_patch has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), error handling 4, boolean chains 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 · Scheduler._align_block_size_with_rotating_window (cognitive 18) · ×1
  • Scheduler._align_block_size_with_rotating_window (cognitive 18) omlx/scheduler.py:3307 — Scheduler._align_block_size_with_rotating_window has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (14 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 · Scheduler._model_uses_mla (cognitive 18) · ×1
  • Scheduler._model_uses_mla (cognitive 18) omlx/scheduler.py:3913 — Scheduler._model_uses_mla has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 3, loops 2 (3 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 · ProfilesTab.detailCard (cognitive 18) · ×1
  • ProfilesTab.detailCard (cognitive 18) apps/omlx-mac/Sources/AppView/Screens/ModelSettingsScreen.swift:730 — ProfilesTab.detailCard has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 4 (9 pts), if/else 4 (5 pts), boolean chains 2, match/switch 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 · AskAIConversation.streamRound (cognitive 18) · ×1
  • AskAIConversation.streamRound (cognitive 18) apps/omlx-mac/Sources/AskAI/AskAIConversation.swift:162 — AskAIConversation.streamRound has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (12 pts), match/switch 1 (3 pts), loops 1 (2 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 · TalkAIController.captionLines (cognitive 18) · ×1
  • TalkAIController.captionLines (cognitive 18) apps/omlx-mac/Sources/AskAI/TalkAIController.swift:708 — TalkAIController.captionLines has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 8, if/else 3 (6 pts), loops 2 (3 pts), 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 · dashboard.dashboard.applyProfileToForm (cognitive 18) · ×1
  • dashboard.dashboard.applyProfileToForm (cognitive 18) REDACTED:2546 — dashboard.dashboard.applyProfileToForm has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 5, error handling 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 · dashboard.matchedPreset (cognitive 18) · ×1
  • dashboard.matchedPreset (cognitive 18) REDACTED:1860 — dashboard.matchedPreset has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 6, loops 2 (3 pts) (nesting depth added 4). Of this number, 14 points are the body's own statements and 4 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 · dashboard.createProfile (cognitive 18) · ×1
  • dashboard.createProfile (cognitive 18) REDACTED:2496 — dashboard.createProfile has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 5, error handling 2 (3 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 · dashboard.searchHFModels (cognitive 18) · ×1
  • dashboard.searchHFModels (cognitive 18) REDACTED:9014 — dashboard.searchHFModels has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (13 pts), error handling 2 (3 pts), boolean chains 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 · Config.validate (cognitive 17) · ×1
  • Config.validate (cognitive 17) apps/omlx-cuda-helper/omlx_cuda_helper/families/deepseek_v41/config.py:90 — Config.validate has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 5, 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 · HarmonyStreamingParser.process_token (cognitive 17) · ×1
  • HarmonyStreamingParser.process_token (cognitive 17) omlx/adapter/harmony.py:274 — HarmonyStreamingParser.process_token has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 4, 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 · hf_downloader._resolve_endpoint (cognitive 17) · ×1
  • hf_downloader._resolve_endpoint (cognitive 17) REDACTED:149 — hf_downloader._resolve_endpoint has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 1 (3 pts), error handling 2, 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 · hf_uploader._generate_model_card (cognitive 17) · ×1
  • hf_uploader._generate_model_card (cognitive 17) omlx/admin/hf_uploader.py:226 — hf_uploader._generate_model_card has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8, boolean chains 4, ternaries 3, loops 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 · model_recommender.build_sections (cognitive 17) · ×1
  • model_recommender.build_sections (cognitive 17) omlx/admin/model_recommender.py:368 — model_recommender.build_sections has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (12 pts), 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 · ms_downloader._enrich_ms_entry (cognitive 17) · ×1
  • ms_downloader._enrich_ms_entry (cognitive 17) omlx/admin/ms_downloader.py:262 — ms_downloader._enrich_ms_entry has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 7, 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 · routes._apply_model_dirs_runtime (cognitive 17) · ×1
  • routes._apply_model_dirs_runtime (cognitive 17) omlx/admin/routes.py:1370 — routes._apply_model_dirs_runtime has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (11 pts), error handling 2 (3 pts), loops 2, 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 · tool_calling._parse_attribute_function_tool_calls (cognitive 17) · ×1
  • tool_calling._parse_attribute_function_tool_calls (cognitive 17) omlx/api/tool_calling.py:1103 — tool_calling._parse_attribute_function_tool_calls has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 3 (4 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 · PagedSSDCacheManager.commit_gdn_checkpoint_file (cognitive 17) · ×1
  • PagedSSDCacheManager.commit_gdn_checkpoint_file (cognitive 17) omlx/cache/paged_ssd_cache.py:2620 — PagedSSDCacheManager.commit_gdn_checkpoint_file has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 6, 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 · PagedSSDCacheManager._is_compatible_block (cognitive 17) · ×1
  • PagedSSDCacheManager._is_compatible_block (cognitive 17) omlx/cache/paged_ssd_cache.py:2848 — PagedSSDCacheManager._is_compatible_block has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 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 · PagedSSDCacheManager._evict_tracked_until_size (cognitive 17) · ×1
  • PagedSSDCacheManager._evict_tracked_until_size (cognitive 17) omlx/cache/paged_ssd_cache.py:5053 — PagedSSDCacheManager._evict_tracked_until_size 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 · PagedSSDCacheManager.shrink_hot_cache_to (cognitive 17) · ×1
  • PagedSSDCacheManager.shrink_hot_cache_to (cognitive 17) omlx/cache/paged_ssd_cache.py:5274 — PagedSSDCacheManager.shrink_hot_cache_to has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3 (4 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 · paged_ssd_cache._store_nstate_elements_flat (cognitive 17) · ×1
  • paged_ssd_cache._store_nstate_elements_flat (cognitive 17) omlx/cache/paged_ssd_cache.py:779 — paged_ssd_cache._store_nstate_elements_flat has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (9 pts), ternaries 2 (6 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 · CacheListHandler.reconstruct_cache (cognitive 17) · ×1
  • CacheListHandler.reconstruct_cache (cognitive 17) omlx/cache/type_handlers.py:1092 — CacheListHandler.reconstruct_cache has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), error handling 3 (4 pts), boolean chains 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 · Qwen4QSAKVCacheHandler.concatenate_states (cognitive 17) · ×1
  • Qwen4QSAKVCacheHandler.concatenate_states (cognitive 17) omlx/cache/type_handlers.py:1743 — Qwen4QSAKVCacheHandler.concatenate_states has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 3 (4 pts), boolean chains 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 · cli.main (cognitive 17) · ×1
  • cli.main (cognitive 17) REDACTED:1121 — cli.main has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 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 · collective.run_local_collective_smoke (cognitive 17) · ×1
  • collective.run_local_collective_smoke (cognitive 17) omlx/cluster/collective.py:104 — collective.run_local_collective_smoke has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (8 pts), ternaries 2 (4 pts), boolean chains 2, error handling 2, 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 · DiscoveryService._handle_hello (cognitive 17) · ×1
  • DiscoveryService._handle_hello (cognitive 17) REDACTED:1715 — DiscoveryService._handle_hello has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 3 (5 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 · model_inventory.engine_pool_model_inventory (cognitive 17) · ×1
  • model_inventory.engine_pool_model_inventory (cognitive 17) omlx/cluster/model_inventory.py:92 — model_inventory.engine_pool_model_inventory has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (8 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 · ExecutionSettings.__post_init__ (cognitive 17) · ×1
  • ExecutionSettings.__post_init__ (cognitive 17) omlx/cluster/performance.py:187 — ExecutionSettings.__post_init__ has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 5, loops 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 · DeviceRegistry._validate_paired (cognitive 17) · ×1
  • DeviceRegistry._validate_paired (cognitive 17) omlx/cluster/registry.py:268 — DeviceRegistry._validate_paired has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 4, 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 · RuntimeTelemetry.poll_cancel_requests (cognitive 17) · ×1
  • RuntimeTelemetry.poll_cancel_requests (cognitive 17) omlx/cluster/telemetry.py:742 — RuntimeTelemetry.poll_cancel_requests has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 1 (3 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 · BatchedEngine.model_type (cognitive 17) · ×1
  • BatchedEngine.model_type (cognitive 17) REDACTED:160 — BatchedEngine.model_type has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 3 (9 pts), if/else 5 (7 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 · _WhisperRealtimeBackend._emit_stable_delta (cognitive 17) · ×1
  • _WhisperRealtimeBackend._emit_stable_delta (cognitive 17) REDACTED:318 — _WhisperRealtimeBackend._emit_stable_delta has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 2 (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 · MemoryMonitor.set_model_info (cognitive 17) · ×1
  • MemoryMonitor.set_model_info (cognitive 17) REDACTED:485 — MemoryMonitor.set_model_info has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 6 (8 pts), boolean chains 7, if/else 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 · model_discovery._vision_weight_bytes (cognitive 17) · ×1
  • model_discovery._vision_weight_bytes (cognitive 17) omlx/model_discovery.py:1200 — model_discovery._vision_weight_bytes has cognitive complexity 17 (threshold 15). Drivers by points: loops 3 (6 pts), error handling 2 (5 pts), if/else 2 (5 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 · D3Model.encode (cognitive 17) · ×1
  • D3Model.encode (cognitive 17) omlx/models/d3.py:523 — D3Model.encode has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 6, if/else 3 (5 pts), ternaries 2 (3 pts), error handling 1 (2 pts), loops 1 (nesting depth added 4). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D2 · Cognitive Complexity · OQImatrixCollector.collect_switch (cognitive 17) · ×1
  • OQImatrixCollector.collect_switch (cognitive 17) REDACTED:9505 — OQImatrixCollector.collect_switch has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 2, 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 · oq._synthesize_mtp_quant_entries (cognitive 17) · ×1
  • oq._synthesize_mtp_quant_entries (cognitive 17) REDACTED:2222 — oq._synthesize_mtp_quant_entries has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 pts), 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 · swiglu_clamp.bind_limits (cognitive 17) · ×1
  • swiglu_clamp.bind_limits (cognitive 17) omlx/patches/bailing_hybrid/swiglu_clamp.py:98 — swiglu_clamp.bind_limits has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (15 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 · BatchPoolingCache._trim_rows_from_undo (cognitive 17) · ×1
  • BatchPoolingCache._trim_rows_from_undo (cognitive 17) omlx/patches/deepseek_v4/cache_extras.py:851 — BatchPoolingCache._trim_rows_from_undo has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 pts), ternaries 2, 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 · Inkling2Processor.__call__ (cognitive 17) · ×1
  • Inkling2Processor.__call__ (cognitive 17) omlx/patches/inkling2/processing.py:127 — Inkling2Processor.__call__ has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (8 pts), loops 2 (5 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 · m5_gather_qmm_nax.sorted_gather_qmm_swiglu (cognitive 17) · ×1
  • m5_gather_qmm_nax.sorted_gather_qmm_swiglu (cognitive 17) omlx/patches/m5_gather_qmm_nax.py:1884 — m5_gather_qmm_nax.sorted_gather_qmm_swiglu has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 4, 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 · mlx_audio_ming3._pipelined_sample (cognitive 17) · ×1
  • mlx_audio_ming3._pipelined_sample (cognitive 17) omlx/patches/mlx_audio_ming3.py:597 — mlx_audio_ming3._pipelined_sample has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 3, 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 · batch_generator._mtp_common_eligible (cognitive 17) · ×1
  • batch_generator._mtp_common_eligible (cognitive 17) REDACTED:620 — batch_generator._mtp_common_eligible has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 5 (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 · batch_generator._prepare_mtp_batch_state_for_next (cognitive 17) · ×1
  • batch_generator._prepare_mtp_batch_state_for_next (cognitive 17) REDACTED:1393 — batch_generator._prepare_mtp_batch_state_for_next has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 3 (4 pts), 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 · mlx_vlm_minimax_m3_compat._build_minimax_messages (cognitive 17) · ×1
  • mlx_vlm_minimax_m3_compat._build_minimax_messages (cognitive 17) omlx/patches/mlx_vlm_minimax_m3_compat/__init__.py:536 — mlx_vlm_minimax_m3_compat._build_minimax_messages has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 2 (8 pts), if/else 5 (7 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 · mlx_vlm_minimax_m3_compat._extract_text_from_content (cognitive 17) · ×1
  • mlx_vlm_minimax_m3_compat._extract_text_from_content (cognitive 17) omlx/patches/mlx_vlm_minimax_m3_compat/__init__.py:617 — mlx_vlm_minimax_m3_compat._extract_text_from_content has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 2, loops 1 (2 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 · moe_gate_up_fusion.can_fuse (cognitive 17) · ×1
  • moe_gate_up_fusion.can_fuse (cognitive 17) omlx/patches/moe_gate_up_fusion.py:74 — moe_gate_up_fusion.can_fuse has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 6, 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 · qwen35_ane_prefill.configure_qwen35_ane_prefill_scheduler (cognitive 17) · ×1
  • qwen35_ane_prefill.configure_qwen35_ane_prefill_scheduler (cognitive 17) omlx/patches/qwen35_ane_prefill.py:322 — qwen35_ane_prefill.configure_qwen35_ane_prefill_scheduler has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 6, 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 · RDA.__call__ (cognitive 17) · ×1
  • RDA.__call__ (cognitive 17) omlx/patches/raon1_mini/raon1_mini_model.py:1284 — RDA.__call__ has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 5 (8 pts), if/else 7, boolean chains 2 (nesting depth added 3). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D2 · Cognitive Complexity · DeepseekV41Adapter.run_first (cognitive 17) · ×1
  • DeepseekV41Adapter.run_first (cognitive 17) omlx/prefill_helper/adapters/deepseek_v41.py:173 — DeepseekV41Adapter.run_first has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 4 (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 · qwen3_5._run_layers (cognitive 17) · ×1
  • qwen3_5._run_layers (cognitive 17) omlx/prefill_helper/adapters/qwen3_5.py:102 — qwen3_5._run_layers has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), 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 · agent.resolve_target (cognitive 17) · ×1
  • agent.resolve_target (cognitive 17) REDACTED:126 — agent.resolve_target has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (6 pts), boolean chains 5, error handling 2 (4 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 · HelperServer._read (cognitive 17) · ×1
  • HelperServer._read (cognitive 17) omlx/prefill_helper/worker.py:141 — HelperServer._read has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (14 pts), boolean chains 1, 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 · reasoning_effort.apply_chat_template_with_reasoning_effort_fallback (cognitive 17) · ×1
  • reasoning_effort.apply_chat_template_with_reasoning_effort_fallback (cognitive 17) omlx/reasoning_effort.py:81 — reasoning_effort.apply_chat_template_with_reasoning_effort_fallback has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), error handling 3 (6 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 · Scheduler._check_post_prefill_memory (cognitive 17) · ×1
  • Scheduler._check_post_prefill_memory (cognitive 17) omlx/scheduler.py:6458 — Scheduler._check_post_prefill_memory has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (8 pts), ternaries 2 (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 · Scheduler._forward_helper_chunk (cognitive 17) · ×1
  • Scheduler._forward_helper_chunk (cognitive 17) omlx/scheduler.py:7063 — Scheduler._forward_helper_chunk has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (13 pts), ternaries 2 (3 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 · Scheduler._plan_prefill_chunk (cognitive 17) · ×1
  • Scheduler._plan_prefill_chunk (cognitive 17) omlx/scheduler.py:7176 — Scheduler._plan_prefill_chunk has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 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 · Scheduler._merge_boundary_with_full_cache (cognitive 17) · ×1
  • Scheduler._merge_boundary_with_full_cache (cognitive 17) omlx/scheduler.py:9860 — Scheduler._merge_boundary_with_full_cache has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (6 pts), boolean chains 5, 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 · scheduler._compact_boundary_snapshot_value (cognitive 17) · ×1
  • scheduler._compact_boundary_snapshot_value (cognitive 17) omlx/scheduler.py:147 — scheduler._compact_boundary_snapshot_value has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 2 (5 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 · vlm_mtp.run_vlm_mtp_decode (cognitive 17) · ×1
  • vlm_mtp.run_vlm_mtp_decode (cognitive 17) omlx/speculative/vlm_mtp.py:266 — vlm_mtp.run_vlm_mtp_decode has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (10 pts), loops 2 (3 pts), boolean chains 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 · UsageHistory.flush (cognitive 17) · ×1
  • UsageHistory.flush (cognitive 17) omlx/usage_history.py:242 — UsageHistory.flush has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 3, 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 · model_loading.maybe_load_custom_quantization (cognitive 17) · ×1
  • model_loading.maybe_load_custom_quantization (cognitive 17) omlx/utils/model_loading.py:1710 — model_loading.maybe_load_custom_quantization has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), error handling 2 (3 pts), boolean chains 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 · tokenizer.create_streaming_detokenizer (cognitive 17) · ×1
  • tokenizer.create_streaming_detokenizer (cognitive 17) omlx/utils/tokenizer.py:477 — tokenizer.create_streaming_detokenizer has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), error handling 6 (7 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 · video.expand_video_parts (cognitive 17) · ×1
  • video.expand_video_parts (cognitive 17) omlx/utils/video.py:164 — video.expand_video_parts has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (3 pts), ternaries 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 · PerformanceScreenVM.load (cognitive 17) · ×1
  • PerformanceScreenVM.load (cognitive 17) apps/omlx-mac/Sources/AppView/ViewModels/PerformanceScreenVM.swift:171 — PerformanceScreenVM.load has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), ternaries 2 (6 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 · AskAIConversation.send (cognitive 17) · ×1
  • AskAIConversation.send (cognitive 17) apps/omlx-mac/Sources/AskAI/AskAIConversation.swift:118 — AskAIConversation.send has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (7 pts), ternaries 2 (4 pts), boolean chains 3, 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 · TurnView.body (cognitive 17) · ×1
  • TurnView.body (cognitive 17) apps/omlx-mac/Sources/AskAI/AskAIPanelView.swift:373 — TurnView.body has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (12 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 · AppUpdater.run (cognitive 17) · ×1
  • AppUpdater.run (cognitive 17) apps/omlx-mac/Sources/Updater/AppUpdater.swift:158 — AppUpdater.run has cognitive complexity 17 (threshold 15). Drivers by points: error handling 9 (10 pts), if/else 6 (7 pts) (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 · AppUpdater.downloadDMG (cognitive 17) · ×1
  • AppUpdater.downloadDMG (cognitive 17) apps/omlx-mac/Sources/Updater/AppUpdater.swift:269 — AppUpdater.downloadDMG has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), ternaries 1 (3 pts), error handling 1 (2 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 · dashboard.dashboard.loadGlobalSettings (cognitive 17) · ×1
  • dashboard.dashboard.loadGlobalSettings (cognitive 17) REDACTED:1289 — dashboard.dashboard.loadGlobalSettings has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 2 (5 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.
D2 · Cognitive Complexity · dashboard.dashboard.buildCtKwargEntries (cognitive 17) · ×1
  • dashboard.dashboard.buildCtKwargEntries (cognitive 17) REDACTED:2169 — dashboard.dashboard.buildCtKwargEntries has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (6 pts), ternaries 2 (6 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 · dashboard.dashboard.createProfile (cognitive 17) · ×1
  • dashboard.dashboard.createProfile (cognitive 17) REDACTED:2496 — dashboard.dashboard.createProfile 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, 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 · clusterV2Wizard.pollStagingJob (cognitive 17) · ×1
  • clusterV2Wizard.pollStagingJob (cognitive 17) apps/omlx-web/omlx_web/static/js/cluster_v2.js:3190 — clusterV2Wizard.pollStagingJob has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 5, ternaries 1 (2 pts), 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 · dashboard.buildCtKwargEntries (cognitive 17) · ×1
  • dashboard.buildCtKwargEntries (cognitive 17) REDACTED:2169 — dashboard.buildCtKwargEntries has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (6 pts), ternaries 2 (6 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 · dashboard.cacheObsCumulative (cognitive 17) · ×1
  • dashboard.cacheObsCumulative (cognitive 17) REDACTED:5082 — dashboard.cacheObsCumulative has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 8, if/else 3 (4 pts), loops 2 (3 pts), ternaries 2 (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 · ControlServer._handle (cognitive 16) · ×1
  • ControlServer._handle (cognitive 16) apps/omlx-cuda-helper/omlx_cuda_helper/control.py:136 — ControlServer._handle has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 6 (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 · Stage.load_prefix (cognitive 16) · ×1
  • Stage.load_prefix (cognitive 16) apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen3_5/stage.py:114 — Stage.load_prefix has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), 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 · Attention.__call__ (cognitive 16) · ×1
  • Attention.__call__ (cognitive 16) apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen4_exp/attention.py:427 — Attention.__call__ has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (13 pts), ternaries 1 (2 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 · supervisor.plan_stages (cognitive 16) · ×1
  • supervisor.plan_stages (cognitive 16) apps/omlx-cuda-helper/omlx_cuda_helper/supervisor.py:34 — supervisor.plan_stages has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 3 (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 · StageServer._accept_job (cognitive 16) · ×1
  • StageServer._accept_job (cognitive 16) apps/omlx-cuda-helper/omlx_cuda_helper/worker.py:257 — StageServer._accept_job has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (16 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 · _MuseChannelSplitter._handle_marker (cognitive 16) · ×1
  • _MuseChannelSplitter._handle_marker (cognitive 16) omlx/adapter/muse_glimmer.py:120 — _MuseChannelSplitter._handle_marker has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 pts), ternaries 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 · BailingHybridOutputParserSession.finalize (cognitive 16) · ×1
  • BailingHybridOutputParserSession.finalize (cognitive 16) omlx/adapter/output_parser.py:290 — BailingHybridOutputParserSession.finalize has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 2, error handling 1 (2 pts), loops 1 (2 pts), 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 · ExternalAPIClient.chat_completion (cognitive 16) · ×1
  • ExternalAPIClient.chat_completion (cognitive 16) omlx/admin/external_api.py:287 — ExternalAPIClient.chat_completion has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, error handling 3, boolean chains 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 · hf_downloader._remove_deleted_files (cognitive 16) · ×1
  • hf_downloader._remove_deleted_files (cognitive 16) REDACTED:840 — hf_downloader._remove_deleted_files has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), error handling 2 (4 pts), boolean chains 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 · hf_downloader._describe_repo_files (cognitive 16) · ×1
  • hf_downloader._describe_repo_files (cognitive 16) REDACTED:889 — hf_downloader._describe_repo_files has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (7 pts), boolean chains 4, ternaries 3 (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 · model_recommender._fetch_families (cognitive 16) · ×1
  • model_recommender._fetch_families (cognitive 16) omlx/admin/model_recommender.py:821 — model_recommender._fetch_families has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 2, 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 · routes._clear_cold_remote_cluster_cache_roots (cognitive 16) · ×1
  • routes._clear_cold_remote_cluster_cache_roots (cognitive 16) omlx/admin/routes.py:172 — routes._clear_cold_remote_cluster_cache_roots has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (7 pts), loops 3 (4 pts), error handling 2 (3 pts), boolean chains 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 · routes.get_generation_config (cognitive 16) · ×1
  • routes.get_generation_config (cognitive 16) omlx/admin/routes.py:4563 — routes.get_generation_config has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 3, error handling 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 · routes._iter_loaded_engine_records (cognitive 16) · ×1
  • routes._iter_loaded_engine_records (cognitive 16) omlx/admin/routes.py:7555 — routes._iter_loaded_engine_records has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (7 pts), ternaries 3 (6 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 · Affine4Codec.dequantize_rotated (cognitive 16) · ×1
  • Affine4Codec.dequantize_rotated (cognitive 16) omlx/affine4.py:182 — Affine4Codec.dequantize_rotated has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), ternaries 2 (3 pts), error handling 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 · audio_routes._parse_session_update (cognitive 16) · ×1
  • audio_routes._parse_session_update (cognitive 16) omlx/api/audio_routes.py:900 — audio_routes._parse_session_update has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 7, 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 · audio_routes._realtime_images (cognitive 16) · ×1
  • audio_routes._realtime_images (cognitive 16) omlx/api/audio_routes.py:967 — audio_routes._realtime_images has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 3, 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 · embedding_utils.count_tokens (cognitive 16) · ×1
  • embedding_utils.count_tokens (cognitive 16) omlx/api/embedding_utils.py:89 — embedding_utils.count_tokens has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 1 (4 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 · responses_utils._extract_tool_output_text (cognitive 16) · ×1
  • responses_utils._extract_tool_output_text (cognitive 16) omlx/api/responses_utils.py:53 — responses_utils._extract_tool_output_text has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 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 · thinking.extract_thinking (cognitive 16) · ×1
  • thinking.extract_thinking (cognitive 16) omlx/api/thinking.py:156 — thinking.extract_thinking has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 4, 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 · tool_calling._copy_schema_with_template_defaults (cognitive 16) · ×1
  • tool_calling._copy_schema_with_template_defaults (cognitive 16) omlx/api/tool_calling.py:53 — tool_calling._copy_schema_with_template_defaults has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 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 · tool_calling._find_attr_function_span (cognitive 16) · ×1
  • tool_calling._find_attr_function_span (cognitive 16) omlx/api/tool_calling.py:788 — tool_calling._find_attr_function_span 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 · tool_calling.convert_tools_for_template (cognitive 16) · ×1
  • tool_calling.convert_tools_for_template (cognitive 16) omlx/api/tool_calling.py:3775 — tool_calling.convert_tools_for_template has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 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 · tool_calling.parse_json_output (cognitive 16) · ×1
  • tool_calling.parse_json_output (cognitive 16) omlx/api/tool_calling.py:4009 — tool_calling.parse_json_output has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 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 · BoundarySnapshotSSDStore.save (cognitive 16) · ×1
  • BoundarySnapshotSSDStore.save (cognitive 16) omlx/cache/boundary_snapshot_store.py:221 — BoundarySnapshotSSDStore.save has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 2, error handling 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 · BoundarySnapshotSSDStore.load (cognitive 16) · ×1
  • BoundarySnapshotSSDStore.load (cognitive 16) omlx/cache/boundary_snapshot_store.py:378 — BoundarySnapshotSSDStore.load has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (9 pts), error handling 3 (5 pts), boolean chains 2 (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 · RotatingKVCacheHandler.reconstruct_cache (cognitive 16) · ×1
  • RotatingKVCacheHandler.reconstruct_cache (cognitive 16) omlx/cache/type_handlers.py:625 — RotatingKVCacheHandler.reconstruct_cache has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 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 · RankControlPlane.broadcast_object (cognitive 16) · ×1
  • RankControlPlane.broadcast_object (cognitive 16) REDACTED:329 — RankControlPlane.broadcast_object has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (9 pts), ternaries 3 (4 pts), loops 1 (2 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 · deployment.validate_model_path_map (cognitive 16) · ×1
  • deployment.validate_model_path_map (cognitive 16) omlx/cluster/deployment.py:150 — deployment.validate_model_path_map has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 3, 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 · deployment._assignment_from_dict (cognitive 16) · ×1
  • deployment._assignment_from_dict (cognitive 16) omlx/cluster/deployment.py:256 — deployment._assignment_from_dict has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 1, 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 · DiscoveryService._send_hello (cognitive 16) · ×1
  • DiscoveryService._send_hello (cognitive 16) REDACTED:1655 — DiscoveryService._send_hello has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 2, error handling 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 · DiscoveryService._tailscale_sweep (cognitive 16) · ×1
  • DiscoveryService._tailscale_sweep (cognitive 16) REDACTED:2029 — DiscoveryService._tailscale_sweep has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 2 (3 pts), boolean chains 1, 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 · pairing.default_revocation_driver (cognitive 16) · ×1
  • pairing.default_revocation_driver (cognitive 16) REDACTED:680 — pairing.default_revocation_driver has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), error handling 2 (4 pts), boolean chains 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 · probe.parse_thunderbolt_ports (cognitive 16) · ×1
  • probe.parse_thunderbolt_ports (cognitive 16) omlx/cluster/probe.py:300 — probe.parse_thunderbolt_ports has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (7 pts), boolean chains 5, loops 2 (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 · link_probe.probe_link (cognitive 16) · ×1
  • link_probe.probe_link (cognitive 16) omlx/cluster/rdma/link_probe.py:68 — link_probe.probe_link has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 3, boolean chains 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 · routes._create_cluster_plan (cognitive 16) · ×1
  • routes._create_cluster_plan (cognitive 16) omlx/cluster/routes.py:878 — routes._create_cluster_plan has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 5, 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 · routes._resolve_fabric (cognitive 16) · ×1
  • routes._resolve_fabric (cognitive 16) omlx/cluster/routes.py:1059 — routes._resolve_fabric has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 6, if/else 5, ternaries 5. 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 · RuntimeTelemetry._sample_snapshot (cognitive 16) · ×1
  • RuntimeTelemetry._sample_snapshot (cognitive 16) omlx/cluster/telemetry.py:888 — RuntimeTelemetry._sample_snapshot has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, ternaries 7, 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 · transport._interface_ip (cognitive 16) · ×1
  • transport._interface_ip (cognitive 16) omlx/cluster/transport.py:620 — transport._interface_ip has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (7 pts), error handling 2 (4 pts), boolean chains 2, 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 · transport._authorized_ifconfig (cognitive 16) · ×1
  • transport._authorized_ifconfig (cognitive 16) omlx/cluster/transport.py:761 — transport._authorized_ifconfig has cognitive complexity 16 (threshold 15). Drivers by points: error handling 5 (7 pts), if/else 5, boolean chains 3, 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 · DistributedBatchedEngine._ensure_available (cognitive 16) · ×1
  • DistributedBatchedEngine._ensure_available (cognitive 16) omlx/engine/distributed.py:598 — DistributedBatchedEngine._ensure_available has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (7 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 · DistributedBatchedEngine._transport_failure_error (cognitive 16) · ×1
  • DistributedBatchedEngine._transport_failure_error (cognitive 16) omlx/engine/distributed.py:642 — DistributedBatchedEngine._transport_failure_error 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 · DistributedBatchedEngine.chat (cognitive 16) · ×1
  • DistributedBatchedEngine.chat (cognitive 16) omlx/engine/distributed.py:1223 — DistributedBatchedEngine.chat has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (6 pts), error handling 4, boolean chains 3, loops 1 (2 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 · VLMBatchedEngine.stop (cognitive 16) · ×1
  • VLMBatchedEngine.stop (cognitive 16) omlx/engine/vlm.py:2954 — VLMBatchedEngine.stop has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (8 pts), error handling 2 (5 pts), boolean chains 2, loops 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 · VLMBatchedEngine._inject_tool_calling (cognitive 16) · ×1
  • VLMBatchedEngine._inject_tool_calling (cognitive 16) omlx/engine/vlm.py:3017 — VLMBatchedEngine._inject_tool_calling has cognitive complexity 16 (threshold 15). Drivers by points: error handling 4 (6 pts), if/else 5 (6 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 · EnginePool.register_cluster_model (cognitive 16) · ×1
  • EnginePool.register_cluster_model (cognitive 16) omlx/engine_pool.py:1801 — EnginePool.register_cluster_model has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 4, 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 · model_discovery.model_display_name (cognitive 16) · ×1
  • model_discovery.model_display_name (cognitive 16) omlx/model_discovery.py:1928 — model_discovery.model_display_name has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (6 pts), ternaries 2 (4 pts), error handling 2 (3 pts), boolean chains 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 · ModelSettings.__post_init__ (cognitive 16) · ×1
  • ModelSettings.__post_init__ (cognitive 16) omlx/model_settings.py:596 — ModelSettings.__post_init__ has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 3, loops 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 · _TrackedTensor.as_expr (cognitive 16) · ×1
  • _TrackedTensor.as_expr (cognitive 16) REDACTED:2929 — _TrackedTensor.as_expr has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), ternaries 2 (4 pts), boolean chains 2, 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 · oq._temporary_quantize_block (cognitive 16) · ×1
  • oq._temporary_quantize_block (cognitive 16) REDACTED:9083 — oq._temporary_quantize_block has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 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 · bonsai_t5_load._patched_load_weights (cognitive 16) · ×1
  • bonsai_t5_load._patched_load_weights (cognitive 16) omlx/patches/bonsai_t5_load.py:106 — bonsai_t5_load._patched_load_weights 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 · chat_template_v4.apply_chat_template (cognitive 16) · ×1
  • chat_template_v4.apply_chat_template (cognitive 16) omlx/patches/deepseek_v4/chat_template_v4.py:860 — chat_template_v4.apply_chat_template has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7, boolean chains 5, ternaries 2 (4 pts) (nesting depth added 2). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D2 · Cognitive Complexity · LocalAttention.__call__ (cognitive 16) · ×1
  • LocalAttention.__call__ (cognitive 16) omlx/patches/deepseek_v4/deepseek_v4_model.py:1721 — LocalAttention.__call__ has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 3, ternaries 2 (nesting depth added 3). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D2 · Cognitive Complexity · Inkling2Layer.__call__ (cognitive 16) · ×1
  • Inkling2Layer.__call__ (cognitive 16) omlx/patches/inkling2/model.py:565 — Inkling2Layer.__call__ has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (7 pts), ternaries 5 (6 pts), loops 2 (3 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 · decode_fast._expert_kind (cognitive 16) · ×1
  • decode_fast._expert_kind (cognitive 16) omlx/patches/mimo_v2/decode_fast.py:702 — decode_fast._expert_kind has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 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.
D2 · Cognitive Complexity · virtual_qkv.register (cognitive 16) · ×1
  • virtual_qkv.register (cognitive 16) omlx/patches/mimo_v2/virtual_qkv.py:163 — virtual_qkv.register has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (7 pts), loops 3 (4 pts), boolean chains 3, 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 · batch_generator._reconcile_mtp_to_standard (cognitive 16) · ×1
  • batch_generator._reconcile_mtp_to_standard (cognitive 16) REDACTED:1620 — batch_generator._reconcile_mtp_to_standard has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), ternaries 2 (3 pts), boolean chains 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 · batch_generator._record_std_tax_sample (cognitive 16) · ×1
  • batch_generator._record_std_tax_sample (cognitive 16) REDACTED:2560 — batch_generator._record_std_tax_sample has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8, error handling 3 (4 pts), boolean chains 2, 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 · BatchPolicy.observe_mtp (cognitive 16) · ×1
  • BatchPolicy.observe_mtp (cognitive 16) omlx/patches/mlx_lm_mtp/batch_policy.py:93 — BatchPolicy.observe_mtp has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 3, ternaries 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.
D2 · Cognitive Complexity · decode_kernels.multi_qmv (cognitive 16) · ×1
  • decode_kernels.multi_qmv (cognitive 16) omlx/patches/mlx_vlm_glm5_next_compat/decode_kernels.py:3577 — decode_kernels.multi_qmv has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 3, loops 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 · qwen35_ane_prefill._gdn_backend_exact (cognitive 16) · ×1
  • qwen35_ane_prefill._gdn_backend_exact (cognitive 16) omlx/patches/qwen35_ane_prefill.py:1583 — qwen35_ane_prefill._gdn_backend_exact has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (11 pts), error handling 2 (3 pts), boolean chains 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 · qwen35_oq_a8._classify_uncached (cognitive 16) · ×1
  • qwen35_oq_a8._classify_uncached (cognitive 16) omlx/patches/qwen35_oq_a8.py:166 — qwen35_oq_a8._classify_uncached has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, boolean chains 5. 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 · raon1_mini_model._merged_decode (cognitive 16) · ×1
  • raon1_mini_model._merged_decode (cognitive 16) omlx/patches/raon1_mini/raon1_mini_model.py:901 — raon1_mini_model._merged_decode has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 1 (3 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 9). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D2 · Cognitive Complexity · PrefillProgressTracker.update (cognitive 16) · ×1
  • PrefillProgressTracker.update (cognitive 16) omlx/prefill_progress.py:33 — PrefillProgressTracker.update has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 5, 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 · ProcessMemoryEnforcer._find_lru_busy_non_pinned_victim_locked (cognitive 16) · ×1
  • ProcessMemoryEnforcer._find_lru_busy_non_pinned_victim_locked (cognitive 16) omlx/process_memory_enforcer.py:1620 — ProcessMemoryEnforcer._find_lru_busy_non_pinned_victim_locked has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), error handling 1 (4 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 · Scheduler._guard_prefill_chunk (cognitive 16) · ×1
  • Scheduler._guard_prefill_chunk (cognitive 16) omlx/scheduler.py:5237 — Scheduler._guard_prefill_chunk has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (9 pts), ternaries 3 (6 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 · Scheduler._extract_snapshot_cache_states (cognitive 16) · ×1
  • Scheduler._extract_snapshot_cache_states (cognitive 16) omlx/scheduler.py:9274 — Scheduler._extract_snapshot_cache_states has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 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 · Scheduler._extract_boundary_snapshot (cognitive 16) · ×1
  • Scheduler._extract_boundary_snapshot (cognitive 16) omlx/scheduler.py:9484 — Scheduler._extract_boundary_snapshot has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 1 (2 pts), 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 · Scheduler.get_ssd_cache_stats (cognitive 16) · ×1
  • Scheduler.get_ssd_cache_stats (cognitive 16) omlx/scheduler.py:17330 — Scheduler.get_ssd_cache_stats has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), ternaries 4 (7 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 · server._patch_output_format (cognitive 16) · ×1
  • server._patch_output_format (cognitive 16) REDACTED:5722 — server._patch_output_format has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 2 (4 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 · generation_config.load_sampling_defaults (cognitive 16) · ×1
  • generation_config.load_sampling_defaults (cognitive 16) omlx/utils/generation_config.py:111 — generation_config.load_sampling_defaults has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 6, if/else 5 (6 pts), loops 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 · AppServices.relocateOrphanPaths (cognitive 16) · ×1
  • AppServices.relocateOrphanPaths (cognitive 16) apps/omlx-mac/Sources/AppView/AppServices.swift:357 — AppServices.relocateOrphanPaths has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (13 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 · PrefillAcceleratorGroup.body (cognitive 16) · ×1
  • PrefillAcceleratorGroup.body (cognitive 16) apps/omlx-mac/Sources/AppView/Screens/ModelSettingsScreen.swift:1462 — PrefillAcceleratorGroup.body has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 3, 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 · AccelerationSection.body (cognitive 16) · ×1
  • AccelerationSection.body (cognitive 16) apps/omlx-mac/Sources/AppView/Screens/ModelSettingsScreen.swift:2199 — AccelerationSection.body has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 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 · ThroughputBenchScreenVM.pendingFeatureFlags (cognitive 16) · ×1
  • ThroughputBenchScreenVM.pendingFeatureFlags (cognitive 16) apps/omlx-mac/Sources/AppView/ViewModels/ThroughputBenchScreenVM.swift:86 — ThroughputBenchScreenVM.pendingFeatureFlags has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (9 pts), ternaries 3 (7 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 · MenubarController.refreshMenuState (cognitive 16) · ×1
  • MenubarController.refreshMenuState (cognitive 16) apps/omlx-mac/Sources/Menubar/MenubarController.swift:382 — MenubarController.refreshMenuState has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9, boolean chains 6, 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 · ReleasesChecker.numberAfterShortMarker (cognitive 16) · ×1
  • ReleasesChecker.numberAfterShortMarker (cognitive 16) apps/omlx-mac/Sources/Updater/ReleasesChecker.swift:212 — ReleasesChecker.numberAfterShortMarker has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 7, if/else 2 (4 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 · UpdateController.startDownload (cognitive 16) · ×1
  • UpdateController.startDownload (cognitive 16) apps/omlx-mac/Sources/Updater/UpdateController.swift:385 — UpdateController.startDownload has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 3, match/switch 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 · WelcomeViewModel.startServer (cognitive 16) · ×1
  • WelcomeViewModel.startServer (cognitive 16) apps/omlx-mac/Sources/Welcome/WelcomeWindow.swift:257 — WelcomeViewModel.startServer has cognitive complexity 16 (threshold 15). Drivers by points: error handling 4 (5 pts), ternaries 3 (5 pts), if/else 4, match/switch 1 (2 pts) (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 · cluster_v2.clusterV2Wizard.wizardSteps (cognitive 16) · ×1
  • cluster_v2.clusterV2Wizard.wizardSteps (cognitive 16) apps/omlx-web/omlx_web/static/js/cluster_v2.js:1090 — cluster_v2.clusterV2Wizard.wizardSteps has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 4 (8 pts), boolean chains 7, if/else 1 (nesting depth added 4). Most of this is not in the body itself: 5 of the 16 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 1127, 1107). 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 · cluster_v2.clusterV2Wizard.pollStagingJob (cognitive 16) · ×1
  • cluster_v2.clusterV2Wizard.pollStagingJob (cognitive 16) apps/omlx-web/omlx_web/static/js/cluster_v2.js:3190 — cluster_v2.clusterV2Wizard.pollStagingJob has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 4, ternaries 1 (2 pts), 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 · dashboard.dashboard.matchedPreset (cognitive 16) · ×1
  • dashboard.dashboard.matchedPreset (cognitive 16) REDACTED:1860 — dashboard.dashboard.matchedPreset has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 4). Of this number, 13 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 · dashboard.dashboard.cacheObsCumulative (cognitive 16) · ×1
  • dashboard.dashboard.cacheObsCumulative (cognitive 16) REDACTED:5082 — dashboard.dashboard.cacheObsCumulative has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 9, if/else 3 (4 pts), loops 2 (3 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 · dashboard.dashboard.searchHFModels (cognitive 16) · ×1
  • dashboard.dashboard.searchHFModels (cognitive 16) REDACTED:9014 — dashboard.dashboard.searchHFModels has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 2, 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 · logs.parseLogText (cognitive 16) · ×1
  • logs.parseLogText (cognitive 16) REDACTED:40 — logs.parseLogText has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 5 (9 pts), boolean chains 3, if/else 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 · dashboard.resetGlobalSettingsDefaults (cognitive 16) · ×1
  • dashboard.resetGlobalSettingsDefaults (cognitive 16) REDACTED:1231 — dashboard.resetGlobalSettingsDefaults has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), boolean chains 3, 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 · dashboard.startANETuning (cognitive 16) · ×1
  • dashboard.startANETuning (cognitive 16) REDACTED:2850 — dashboard.startANETuning has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 10, if/else 4, error handling 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 · dashboard.pollANETuning (cognitive 16) · ×1
  • dashboard.pollANETuning (cognitive 16) REDACTED:2908 — dashboard.pollANETuning has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 6, error handling 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 · dashboard.sortedManagerModels (cognitive 16) · ×1
  • dashboard.sortedManagerModels (cognitive 16) REDACTED:7369 — dashboard.sortedManagerModels has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 6, ternaries 4 (6 pts), if/else 3, match/switch 1 (nesting depth added 2). None of this is in the body itself: all 16 points belong to one function literal inside it that branches (line 7371). 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.
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
D35 · Change Coupling · Change-coupling hub · ×1
  • Change-coupling hub: REDACTED → ModelSettingsScreen.swift, PerformanceScreen.swift, ModelSettingsScreenVM.swift, ModelsDTO.swift, accuracy_benchmark.py, routes.py, config.py, settings.py REDACTED — `REDACTED` changes together with 8 other files — `apps/omlx-mac/Sources/AppView/Screens/ModelSettingsScreen.swift`, `apps/omlx-mac/Sources/AppView/Screens/PerformanceScreen.swift`, `apps/omlx-mac/Sources/AppView/ViewModels/ModelSettingsScreenVM.swift`, `apps/omlx-mac/Sources/Net/DTO/ModelsDTO.swift`, `omlx/admin/accuracy_benchmark.py`, `omlx/admin/routes.py`, `omlx/config.py`, `omlx/settings.py` — none of which declares a dependency on it: one file is the hub of 8 separate couplings, not 8 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 8.
D4 · Code Duplication · Near-duplicate member pair (217 shared lines) · ×1
  • Near-duplicate member pair (217 shared lines) REDACTED:301 — REDACTED:301-854 | omlx/engine/vlm.py:1983-2873 — These two members are variants of one another: 217 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 (91 shared lines) · ×1
  • Near-duplicate member pair (91 shared lines) omlx/patches/deepseek_v4/chat_template_v4.py:298 — omlx/patches/deepseek_v4/chat_template_v4.py:298-491 | omlx/patches/deepseek_v41/encoding.py:584-734 — These two members are variants of one another: 91 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 (78 shared lines) · ×1
  • Near-duplicate member pair (78 shared lines) omlx/patches/qwen35_ane_prefill.py:1113 — omlx/patches/qwen35_ane_prefill.py:1113-1271 | omlx/patches/qwen35_ane_prefill.py:1370-1488 — These two members are variants of one another: 78 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 (63 shared lines) · ×1
  • Near-duplicate member pair (63 shared lines) omlx/patches/deepseek_v4/moe_offload.py:160 — omlx/patches/deepseek_v4/moe_offload.py:160-233 | omlx/patches/glm_moe_dsa/moe_offload.py:199-283 — These two members are variants of one another: 63 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 (48 shared lines) · ×1
  • Near-duplicate member pair (48 shared lines) omlx/patches/glm_moe_dsa/deepseek_v32.py:499 — omlx/patches/glm_moe_dsa/deepseek_v32.py:499-575 | omlx/patches/glm_moe_dsa/glm_moe_dsa_model.py:192-411 — These two members are variants of one another: 48 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 (29 shared lines) · ×1
  • Near-duplicate member pair (29 shared lines) omlx/patches/deepseek_v4/deepseek_v4_model.py:1729 — omlx/patches/deepseek_v4/deepseek_v4_model.py:1729-1783 | omlx/patches/deepseek_v4/deepseek_v4_model.py:1841-1954 — These two members are variants of one another: 29 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 · Members sharing a duplicated core (7 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (7 members, 50+ identical tokens) omlx/cluster/enrollment.py:164 — omlx/cluster/enrollment.py:164-183 | omlx/cluster/identity.py:140-155 | omlx/cluster/incidents.py:164-187 | REDACTED:233-248 | omlx/cluster/rdma/store.py:50-68 | omlx/cluster/registry.py:87-111 | omlx/cluster/registry.py:310-329 — 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 · Members sharing a duplicated core (6 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (6 members, 50+ identical tokens) apps/omlx-mac/Sources/AppView/Screens/AccuracyBenchScreen.swift:581 — apps/omlx-mac/Sources/AppView/Screens/AccuracyBenchScreen.swift:581-610 | apps/omlx-mac/Sources/AppView/Screens/AskAIScreen.swift:1271-1311 | apps/omlx-mac/Sources/AppView/Screens/DownloadsScreen.swift:622-698 | apps/omlx-mac/Sources/AppView/Screens/DownloadsScreen.swift:751-798 | apps/omlx-mac/Sources/AppView/Screens/DownloadsScreen.swift:817-914 | apps/omlx-mac/Sources/AppView/Screens/ModelsScreen.swift:104-161 — These 6 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 6 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 6 times.
D4 · Code Duplication · Edited copy of a member (162 corresponding lines) · ×1
  • Edited copy of a member (162 corresponding lines) omlx/patches/mlx_vlm_mtp/qwen35_moe_vlm_runtime.py:206 — omlx/patches/mlx_vlm_mtp/qwen35_moe_vlm_runtime.py:206-367 | omlx/patches/mlx_vlm_mtp/qwen35_vlm_runtime.py:266-433 — These two members are one piece of code written twice and then edited apart: 162 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 · Edited copy of a member (105 corresponding lines) · ×1
  • Edited copy of a member (105 corresponding lines) omlx/patches/qwen35_ane_prefill.py:598 — omlx/patches/qwen35_ane_prefill.py:598-738 | omlx/patches/qwen35_ane_prefill.py:744-848 — These two members are one piece of code written twice and then edited apart: 105 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 · Edited copy of a member (156 corresponding lines) · ×1
  • Edited copy of a member (156 corresponding lines) omlx/cache/paged_ssd_cache.py:4222 — omlx/cache/paged_ssd_cache.py:4222-4377 | omlx/cache/paged_ssd_cache.py:4384-4586 — These two members are one piece of code written twice and then edited apart: 156 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 · Edited copy of a member (68 corresponding lines) · ×1
  • Edited copy of a member (68 corresponding lines) apps/omlx-mac/Sources/AppView/Screens/QuantizationScreen.swift:545 — apps/omlx-mac/Sources/AppView/Screens/QuantizationScreen.swift:545-612 | apps/omlx-mac/Sources/AppView/Screens/QuantizationScreen.swift:729-798 — These two members are one piece of code written twice and then edited apart: 68 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 · Edited copies of one member (3 members, 64+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 64+ corresponding lines) omlx/patches/mlx_lm_mtp/qwen35_model.py:148 — omlx/patches/mlx_lm_mtp/qwen35_model.py:148-224 | omlx/patches/mlx_vlm_mtp/qwen35_moe_vlm_runtime.py:121-197 | omlx/patches/mlx_vlm_mtp/qwen35_vlm_runtime.py:195-258 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 64 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (73 corresponding lines) · ×1
  • Edited copy of a member (73 corresponding lines) omlx/engine/distributed.py:1236 — omlx/engine/distributed.py:1236-1336 | omlx/engine/distributed.py:1614-1686 — These two members are one piece of code written twice and then edited apart: 73 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 · Edited copy of a member (123 corresponding lines) · ×1
  • Edited copy of a member (123 corresponding lines) omlx/engine/tts.py:289 — omlx/engine/tts.py:289-415 | omlx/engine/tts.py:434-556 — These two members are one piece of code written twice and then edited apart: 123 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 · Edited copy of a member (83 corresponding lines) · ×1
  • Edited copy of a member (83 corresponding lines) omlx/cluster/collective.py:194 — omlx/cluster/collective.py:194-276 | omlx/cluster/collective.py:285-374 — These two members are one piece of code written twice and then edited apart: 83 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 · Edited copy of a member (96 corresponding lines) · ×1
  • Edited copy of a member (96 corresponding lines) omlx/admin/routes.py:9307 — omlx/admin/routes.py:9307-9423 | omlx/admin/routes.py:9576-9671 — These two members are one piece of code written twice and then edited apart: 96 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 · Edited copy of a member (58 corresponding lines) · ×1
  • Edited copy of a member (58 corresponding lines) omlx/patches/bailing_hybrid/bailing_hybrid_model.py:196 — omlx/patches/bailing_hybrid/bailing_hybrid_model.py:196-266 | omlx/patches/glm_moe_dsa/deepseek_v32.py:434-491 — These two members are one piece of code written twice and then edited apart: 58 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 · Edited copy of a member (99 corresponding lines) · ×1
  • Edited copy of a member (99 corresponding lines) REDACTED:11106 — REDACTED:11106-11217 | REDACTED:11519-11617 — These two members are one piece of code written twice and then edited apart: 99 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 · Edited copies of one member (3 members, 40+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 40+ corresponding lines) omlx/patches/deepseek_v4/deepseek_v4_model.py:1680 — omlx/patches/deepseek_v4/deepseek_v4_model.py:1680-1719 | omlx/patches/deepseek_v4/deepseek_v4_model.py:1790-1831 | omlx/patches/deepseek_v4/deepseek_v4_model.py:1961-2002 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 40 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (67 corresponding lines) · ×1
  • Edited copy of a member (67 corresponding lines) omlx/patches/qwen35_ane_prefill.py:2188 — omlx/patches/qwen35_ane_prefill.py:2188-2283 | omlx/patches/qwen35_ane_prefill.py:2316-2382 — These two members are one piece of code written twice and then edited apart: 67 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 · Edited copy of a member (55 corresponding lines) · ×1
  • Edited copy of a member (55 corresponding lines) omlx/patches/glm_moe_dsa/deepseek_v32.py:1051 — omlx/patches/glm_moe_dsa/deepseek_v32.py:1051-1126 | omlx/patches/hy_v3/hy_v3_model.py:319-373 — These two members are one piece of code written twice and then edited apart: 55 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 · Edited copy of a member (79 corresponding lines) · ×1
  • Edited copy of a member (79 corresponding lines) omlx/engine/vlm.py:5187 — omlx/engine/vlm.py:5187-5265 | omlx/engine/vlm.py:5443-5524 — These two members are one piece of code written twice and then edited apart: 79 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 · Edited copy of a member (48 corresponding lines) · ×1
  • Edited copy of a member (48 corresponding lines) omlx/admin/routes.py:3876 — omlx/admin/routes.py:3876-3923 | omlx/admin/routes.py:3933-3985 — These two members are one piece of code written twice and then edited apart: 48 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 · Edited copy of a member (71 corresponding lines) · ×1
  • Edited copy of a member (71 corresponding lines) REDACTED:1408 — REDACTED:1408-1478 | REDACTED:1575-1646 — These two members are one piece of code written twice and then edited apart: 71 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 · Edited copy of a member (49 corresponding lines) · ×1
  • Edited copy of a member (49 corresponding lines) omlx/cache/boundary_snapshot_store.py:1732 — omlx/cache/boundary_snapshot_store.py:1732-1784 | omlx/cache/boundary_snapshot_store.py:1898-1946 — These two members are one piece of code written twice and then edited apart: 49 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 · Edited copy of a member (39 corresponding lines) · ×1
  • Edited copy of a member (39 corresponding lines) apps/omlx-mac/Sources/Theme/Components/Row.swift:179 — apps/omlx-mac/Sources/Theme/Components/Row.swift:179-219 | apps/omlx-mac/Sources/Theme/Components/Row.swift:252-290 — These two members are one piece of code written twice and then edited apart: 39 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 · Edited copies of one member (3 members, 30+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 30+ corresponding lines) omlx/patches/glm_moe_dsa/deepseek_v32.py:796 — omlx/patches/glm_moe_dsa/deepseek_v32.py:796-825 | omlx/patches/glm_moe_dsa/glm_moe_dsa_model.py:447-478 | omlx/patches/mlx_lm_mtp/glm_moe_dsa_model.py:273-316 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 30 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (42 corresponding lines) · ×1
  • Edited copy of a member (42 corresponding lines) omlx/patches/deepseek_v4/chat_template_v4.py:500 — omlx/patches/deepseek_v4/chat_template_v4.py:500-566 | omlx/patches/deepseek_v41/encoding.py:192-233 — These two members are one piece of code written twice and then edited apart: 42 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 · Edited copies of one member (3 members, 50+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 50+ corresponding lines) omlx/admin/routes.py:9115 — omlx/admin/routes.py:9115-9166 | omlx/admin/routes.py:9431-9480 | omlx/admin/routes.py:9679-9728 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 50 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (46 corresponding lines) · ×1
  • Edited copy of a member (46 corresponding lines) omlx/engine/distributed.py:720 — omlx/engine/distributed.py:720-765 | omlx/engine/distributed.py:783-837 — These two members are one piece of code written twice and then edited apart: 46 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 · Edited copies of one member (3 members, 17+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 17+ corresponding lines) omlx/patches/deepseek_v4/moe_offload.py:305 — omlx/patches/deepseek_v4/moe_offload.py:305-321 | omlx/patches/glm_moe_dsa/moe_offload.py:350-366 | omlx/patches/moe_expert_offload.py:942-965 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 20+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 20+ corresponding lines) apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen4_exp/kernels.py:747 — apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen4_exp/kernels.py:747-768 | apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen4_exp/kernels.py:1045-1064 | apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen4_exp/kernels.py:1337-1363 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 20 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 26+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 26+ corresponding lines) omlx/admin/routes.py:2748 — omlx/admin/routes.py:2748-2774 | omlx/admin/routes.py:2783-2808 | REDACTED:4030-4056 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 26 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (40 corresponding lines) · ×1
  • Edited copy of a member (40 corresponding lines) omlx/admin/accuracy_benchmark.py:243 — omlx/admin/accuracy_benchmark.py:243-285 | omlx/admin/accuracy_benchmark.py:289-328 — These two members are one piece of code written twice and then edited apart: 40 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 · Edited copies of one member (3 members, 21+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 21+ corresponding lines) apps/omlx-cuda-helper/omlx_cuda_helper/families/deepseek_v41/kernels.py:1002 — apps/omlx-cuda-helper/omlx_cuda_helper/families/deepseek_v41/kernels.py:1002-1028 | apps/omlx-cuda-helper/omlx_cuda_helper/families/deepseek_v41/kernels.py:1094-1117 | apps/omlx-cuda-helper/omlx_cuda_helper/families/glm5_next/kernels.py:109-129 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 21 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 10+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 10+ corresponding lines) omlx/cluster/enrollment.py:132 — omlx/cluster/enrollment.py:132-144 | REDACTED:302-313 | REDACTED:379-388 | omlx/cluster/registry.py:36-49 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 10 lines, 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 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (6 members, 14+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 14+ corresponding lines) apps/omlx-mac/Sources/AppView/ViewModels/AccuracyBenchScreenVM.swift:157 — apps/omlx-mac/Sources/AppView/ViewModels/AccuracyBenchScreenVM.swift:157-170 | apps/omlx-mac/Sources/AppView/ViewModels/AccuracyBenchScreenVM.swift:172-186 | apps/omlx-mac/Sources/AppView/ViewModels/QuantizationScreenVM.swift:308-321 | apps/omlx-mac/Sources/AppView/ViewModels/QuantizationScreenVM.swift:323-336 | apps/omlx-mac/Sources/AppView/ViewModels/QuantizationScreenVM.swift:404-417 | apps/omlx-mac/Sources/AppView/ViewModels/QuantizationScreenVM.swift:419-432 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 14 lines, 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 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. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 5+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 5+ corresponding lines) omlx/models/qwen2_embedding.py:209 — omlx/models/qwen2_embedding.py:209-215 | omlx/patches/deepseek_v4/deepseek_v4_model.py:2303-2311 | omlx/patches/hy_v3/hy_v3_model.py:229-233 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 6+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 6+ corresponding lines) omlx/adapter/muse_glimmer.py:83 — omlx/adapter/muse_glimmer.py:83-88 | omlx/adapter/output_parser.py:515-520 | omlx/adapter/output_parser.py:914-919 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 9+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 9+ corresponding lines) omlx/admin/routes.py:8118 — omlx/admin/routes.py:8118-8128 | omlx/admin/routes.py:8161-8169 | omlx/admin/routes.py:8787-8799 | omlx/admin/routes.py:8836-8846 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 9 lines, 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 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 4+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 4+ corresponding lines) omlx/patches/deepseek_v4/deepseek_v4_model.py:990 — omlx/patches/deepseek_v4/deepseek_v4_model.py:990-997 | omlx/patches/hy_v3/hy_v3_model.py:109-112 | omlx/patches/inkling2/dspark.py:139-142 | omlx/patches/k2_horizon/k2_horizon_model.py:347-350 | omlx/patches/mimo_v2/mimo_v2_model.py:222-226 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 4 lines, 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 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. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 2+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 2+ corresponding lines) apps/omlx-cuda-helper/omlx_cuda_helper/families/deepseek_v41/kernels.py:1471 — apps/omlx-cuda-helper/omlx_cuda_helper/families/deepseek_v41/kernels.py:1471-1473 | apps/omlx-cuda-helper/omlx_cuda_helper/families/glm5_next/kernels.py:56-58 | apps/omlx-cuda-helper/omlx_cuda_helper/families/inkling2/kernels.py:681-682 | apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen3_5/kernels.py:22-36 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 2 lines, 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 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. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 13+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 13+ corresponding lines) omlx/custom_kernels/attention/fast.py:102 — omlx/custom_kernels/attention/fast.py:102-115 | omlx/custom_kernels/quant_matmul/fast.py:652-665 | omlx/custom_kernels/sparse_index/fast.py:275-287 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 3+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 3+ corresponding lines) omlx/custom_kernels/attention/fast.py:312 — omlx/custom_kernels/attention/fast.py:312-314 | omlx/custom_kernels/quant_matmul/fast.py:736-738 | omlx/custom_kernels/sparse_index/fast.py:291-293 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 3 lines, 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 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. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (1 corresponding lines) · ×1
  • Edited copy of a member (1 corresponding lines) apps/omlx-cuda-helper/omlx_cuda_helper/families/deepseek_v41/ops.py:172 — apps/omlx-cuda-helper/omlx_cuda_helper/families/deepseek_v41/ops.py:172-174 | omlx/patches/deepseek_v41/language.py:897-897 — These two members are one piece of code written twice and then edited apart: 1 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 · Duplicated block (100 lines × 2) · ×1
  • Duplicated block (100 lines × 2) omlx/patches/mlx_vlm_mtp/qwen35_moe_vlm_runtime.py:268 — omlx/patches/mlx_vlm_mtp/qwen35_moe_vlm_runtime.py:268-367 | omlx/patches/mlx_vlm_mtp/qwen35_vlm_runtime.py:334-433 — before extracting anything, compare `omlx/patches/mlx_vlm_mtp/qwen35_moe_vlm_runtime.py` and `omlx/patches/mlx_vlm_mtp/qwen35_vlm_runtime.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 282 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 `omlx/patches/mlx_vlm_mtp/qwen35_moe_vlm_runtime.py:268` 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 (92 lines × 2) · ×1
  • Duplicated block (92 lines × 2) REDACTED:598 — REDACTED:598-689 | omlx/engine/vlm.py:2302-2393 — before extracting anything, compare `REDACTED` and `omlx/engine/vlm.py` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 480 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 (63–66 lines × 2) · ×1
  • Duplicated block (63–66 lines × 2) omlx/engine/distributed.py:1396 — omlx/engine/distributed.py:1396-1461 | omlx/engine/distributed.py:1727-1789 — 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 `omlx/engine/distributed.py:1396` 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 (55–65 lines × 2) · ×1
  • Duplicated block (55–65 lines × 2) omlx/patches/mlx_vlm_mtp/qwen35_moe_vlm_runtime.py:376 — omlx/patches/mlx_vlm_mtp/qwen35_moe_vlm_runtime.py:376-440 | omlx/patches/mlx_vlm_mtp/qwen35_vlm_runtime.py:495-549 — before extracting anything, compare `omlx/patches/mlx_vlm_mtp/qwen35_moe_vlm_runtime.py` and `omlx/patches/mlx_vlm_mtp/qwen35_vlm_runtime.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 282 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 (37–60 lines × 2) · ×1
  • Duplicated block (37–60 lines × 2) omlx/patches/deepseek_v4/chat_template_v4.py:628 — omlx/patches/deepseek_v4/chat_template_v4.py:628-687 | omlx/patches/deepseek_v41/encoding.py:770-806 — before extracting anything, compare `omlx/patches/deepseek_v4/chat_template_v4.py` and `omlx/patches/deepseek_v41/encoding.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 210 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 `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 (55–60 lines × 2) · ×1
  • Duplicated block (55–60 lines × 2) omlx/patches/deepseek_v4/deepseek_v4_model.py:2420 — omlx/patches/deepseek_v4/deepseek_v4_model.py:2420-2474 | omlx/patches/mlx_lm_mtp/deepseek_v4_model.py:720-779 — 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `weights` to `Dict[str, mx.array]` in one and `Dict[str, Any]` 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 (58 lines × 2) · ×1
  • Duplicated block (58 lines × 2) REDACTED:1408 — REDACTED:1408-1465 | REDACTED:1575-1632 — 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 (55 lines × 2) · ×1
  • Duplicated block (55 lines × 2) omlx/api/markitdown.py:298 — omlx/api/markitdown.py:298-352 | omlx/api/markitdown.py:382-436 — 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 (45–54 lines × 2) · ×1
  • Duplicated block (45–54 lines × 2) REDACTED:1333 — REDACTED:1333-1386 | omlx/engine/vlm.py:5126-5170 — before extracting anything, compare `REDACTED` and `omlx/engine/vlm.py` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 480 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 `REDACTED:1333` 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 (43–49 lines × 2) · ×1
  • Duplicated block (43–49 lines × 2) omlx/patches/mlx_vlm_mtp/qwen35_moe_vlm_runtime.py:219 — omlx/patches/mlx_vlm_mtp/qwen35_moe_vlm_runtime.py:219-267 | omlx/patches/mlx_vlm_mtp/qwen35_vlm_runtime.py:285-327 — before extracting anything, compare `omlx/patches/mlx_vlm_mtp/qwen35_moe_vlm_runtime.py` and `omlx/patches/mlx_vlm_mtp/qwen35_vlm_runtime.py` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 282 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 (45–46 lines × 2) · ×1
  • Duplicated block (45–46 lines × 2) omlx/engine/distributed.py:720 — omlx/engine/distributed.py:720-765 | omlx/engine/distributed.py:793-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 `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 (42–46 lines × 2) · ×1
  • Duplicated block (42–46 lines × 2) omlx/patches/deepseek_v4/chat_template_v4.py:367 — omlx/patches/deepseek_v4/chat_template_v4.py:367-412 | omlx/patches/deepseek_v41/encoding.py:623-664 — before extracting anything, compare `omlx/patches/deepseek_v4/chat_template_v4.py` and `omlx/patches/deepseek_v41/encoding.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 210 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. Read the line range as the matched WINDOW rather than a finished unit: at `omlx/patches/deepseek_v4/chat_template_v4.py:367` 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 (43–45 lines × 3) · ×1
  • Duplicated block (43–45 lines × 3) omlx/admin/routes.py:9122 — omlx/admin/routes.py:9122-9166 | omlx/admin/routes.py:9438-9480 | omlx/admin/routes.py:9686-9728 — 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 (43 lines × 2) · ×1
  • Duplicated block (43 lines × 2) omlx/engine/distributed.py:1268 — omlx/engine/distributed.py:1268-1310 | omlx/engine/distributed.py:1628-1670 — 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 `omlx/engine/distributed.py:1268` 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, `omlx/engine/distributed.py:1267` calls `pop` and `omlx/engine/distributed.py:1627` 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 (27–43 lines × 2) · ×1
  • Duplicated block (27–43 lines × 2) omlx/scheduler.py:15244 — omlx/scheduler.py:15244-15286 | omlx/scheduler.py:15356-15382 — 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 `omlx/scheduler.py:15244` 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 (40–42 lines × 2) · ×1
  • Duplicated block (40–42 lines × 2) omlx/cluster/collective.py:201 — omlx/cluster/collective.py:201-240 | omlx/cluster/collective.py:292-333 — 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 `omlx/cluster/collective.py:201` 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 (40–41 lines × 2) · ×1
  • Duplicated block (40–41 lines × 2) REDACTED:9226 — REDACTED:9226-9265 | REDACTED:9321-9361 — 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 (35–39 lines × 2) · ×1
  • Duplicated block (35–39 lines × 2) omlx/engine/distributed.py:1535 — omlx/engine/distributed.py:1535-1569 | omlx/engine/distributed.py:1810-1848 — 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 (13–39 lines × 2) · ×1
  • Duplicated block (13–39 lines × 2) omlx/engine_pool.py:3511 — omlx/engine_pool.py:3511-3549 | omlx/engine_pool.py:3581-3593 — 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 `omlx/engine_pool.py:3511` 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 (38 lines × 2) · ×1
  • Duplicated block (38 lines × 2) omlx/patches/deepseek_v4/moe_offload.py:179 — omlx/patches/deepseek_v4/moe_offload.py:179-216 | omlx/patches/glm_moe_dsa/moe_offload.py:226-263 — `omlx/patches/deepseek_v4/moe_offload.py` and `omlx/patches/glm_moe_dsa/moe_offload.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 9 separate duplicated blocks between them, totalling at least 157 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.
D4 · Code Duplication · Duplicated block (29–37 lines × 2) · ×1
  • Duplicated block (29–37 lines × 2) omlx/cluster/launch.py:1478 — omlx/cluster/launch.py:1478-1506 | omlx/cluster/launch.py:1610-1646 — 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 (32–37 lines × 2) · ×1
  • Duplicated block (32–37 lines × 2) omlx/engine/tts.py:336 — omlx/engine/tts.py:336-372 | omlx/engine/tts.py:466-497 — 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 (34–36 lines × 3) · ×1
  • Duplicated block (34–36 lines × 3) omlx/cluster/collective.py:110 — omlx/cluster/collective.py:110-144 | omlx/cluster/collective.py:194-227 | omlx/cluster/collective.py:285-320 — 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. 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 (25–36 lines × 3) · ×1
  • Duplicated block (25–36 lines × 3) REDACTED:4710 — REDACTED:4710-4735 | REDACTED:5202-5237 | REDACTED:6111-6135 — 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. 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, `REDACTED:6107` calls `prompt_opens_thinking`, `getattr` and `REDACTED:4708` 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 (30–36 lines × 2) · ×1
  • Duplicated block (30–36 lines × 2) REDACTED:381 — REDACTED:381-410 | omlx/engine/vlm.py:2157-2192 — before extracting anything, compare `REDACTED` and `omlx/engine/vlm.py` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 480 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 `REDACTED: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.
D4 · Code Duplication · Duplicated block (35–36 lines × 2) · ×1
  • Duplicated block (35–36 lines × 2) REDACTED:8186 — REDACTED:8186-8221 | REDACTED:8953-8987 — 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 `REDACTED:8186` 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 (35 lines × 2) · ×1
  • Duplicated block (35 lines × 2) omlx/patches/qwen35_ane_prefill.py:653 — omlx/patches/qwen35_ane_prefill.py:653-687 | omlx/patches/qwen35_ane_prefill.py:774-808 — 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 `omlx/patches/qwen35_ane_prefill.py:653` 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 (32–35 lines × 2) · ×1
  • Duplicated block (32–35 lines × 2) REDACTED:4361 — REDACTED:4361-4395 | REDACTED:4477-4508 — 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 `REDACTED:4361` 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 `request` to `SystemOneRequest` in one and `DecisionRequest` 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 (30–34 lines × 2) · ×1
  • Duplicated block (30–34 lines × 2) omlx/patches/qwen35_ane_prefill.py:2244 — omlx/patches/qwen35_ane_prefill.py:2244-2277 | omlx/patches/qwen35_ane_prefill.py:2349-2378 — 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 `omlx/patches/qwen35_ane_prefill.py:2244` 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 (32–34 lines × 2) · ×1
  • Duplicated block (32–34 lines × 2) REDACTED:737 — REDACTED:737-770 | REDACTED:778-809 — 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 (20–33 lines × 2) · ×1
  • Duplicated block (20–33 lines × 2) REDACTED:11119 — REDACTED:11119-11138 | REDACTED:11520-11552 — 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 (32 lines × 3) · ×1
  • Duplicated block (32 lines × 3) omlx/patches/mlx_lm_mtp/qwen35_model.py:184 — omlx/patches/mlx_lm_mtp/qwen35_model.py:184-215 | omlx/patches/mlx_vlm_mtp/qwen35_moe_vlm_runtime.py:157-188 | omlx/patches/mlx_vlm_mtp/qwen35_vlm_runtime.py:218-249 — 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.
D4 · Code Duplication · Duplicated block (30–32 lines × 2) · ×1
  • Duplicated block (30–32 lines × 2) omlx/scheduler.py:3792 — omlx/scheduler.py:3792-3823 | omlx/scheduler.py:8558-8587 — 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 `omlx/scheduler.py:3792` 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 (23–31 lines × 2) · ×1
  • Duplicated block (23–31 lines × 2) REDACTED:1919 — REDACTED:1919-1949 | omlx/admin/ms_downloader.py:839-861 — 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 `REDACTED:1919` 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.
D4 · Code Duplication · Duplicated block (28–30 lines × 2) · ×1
  • Duplicated block (28–30 lines × 2) REDACTED:11164 — REDACTED:11164-11193 | REDACTED:11569-11596 — 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 (16–29 lines × 3) · ×1
  • Duplicated block (16–29 lines × 3) REDACTED:11123 — REDACTED:11123-11138 | REDACTED:11524-11552 | REDACTED:12006-12025 — 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 `REDACTED:11123` 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 before the matched lines, `REDACTED:12004` calls `import` and `REDACTED:11122` 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 (24–29 lines × 2) · ×1
  • Duplicated block (24–29 lines × 2) omlx/cache/boundary_snapshot_store.py:1792 — omlx/cache/boundary_snapshot_store.py:1792-1820 | omlx/cache/boundary_snapshot_store.py:1954-1977 — 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 (25–29 lines × 2) · ×1
  • Duplicated block (25–29 lines × 2) omlx/eval/livecodebench.py:36 — omlx/eval/livecodebench.py:36-64 | omlx/eval/mbpp.py:32-56 — 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 (21–28 lines × 2) · ×1
  • Duplicated block (21–28 lines × 2) omlx/patches/deepseek_v4/chat_template_v4.py:572 — omlx/patches/deepseek_v4/chat_template_v4.py:572-599 | omlx/patches/deepseek_v41/encoding.py:237-257 — before extracting anything, compare `omlx/patches/deepseek_v4/chat_template_v4.py` and `omlx/patches/deepseek_v41/encoding.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 210 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. Read the line range as the matched WINDOW rather than a finished unit: at `omlx/patches/deepseek_v4/chat_template_v4.py:572` 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.
D4 · Code Duplication · Duplicated block (27–28 lines × 2) · ×1
  • Duplicated block (27–28 lines × 2) omlx/patches/mlx_vlm_mtp/qwen35_moe_vlm_model.py:133 — omlx/patches/mlx_vlm_mtp/qwen35_moe_vlm_model.py:133-160 | omlx/patches/mlx_vlm_mtp/qwen35_moe_vlm_runtime.py:542-568 — 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 `omlx/patches/mlx_vlm_mtp/qwen35_moe_vlm_model.py:133` 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 (27 lines × 2) · ×1
  • Duplicated block (27 lines × 2) omlx/cache/boundary_snapshot_store.py:1757 — omlx/cache/boundary_snapshot_store.py:1757-1784 | omlx/cache/boundary_snapshot_store.py:1920-1946 — 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 (25–26 lines × 2) · ×1
  • Duplicated block (25–26 lines × 2) omlx/engine_pool.py:947 — omlx/engine_pool.py:947-972 | omlx/engine_pool.py:1039-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 `omlx/engine_pool.py:947` 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 (26 lines × 2) · ×1
  • Duplicated block (26 lines × 2) omlx/patches/inkling2/loader.py:95 — omlx/patches/inkling2/loader.py:95-120 | omlx/patches/inkling2/oq_layout.py:125-150 — before extracting anything, compare `omlx/patches/inkling2/loader.py` and `omlx/patches/inkling2/oq_layout.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 51 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 `omlx/patches/inkling2/loader.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. 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 (21–25 lines × 2) · ×1
  • Duplicated block (21–25 lines × 2) REDACTED:1119 — REDACTED:1119-1139 | omlx/engine/vlm.py:4858-4882 — before extracting anything, compare `REDACTED` and `omlx/engine/vlm.py` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 480 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 (23–25 lines × 2) · ×1
  • Duplicated block (23–25 lines × 2) omlx/scheduler.py:4126 — omlx/scheduler.py:4126-4150 | omlx/scheduler.py:4172-4194 — 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 (17–25 lines × 2) · ×1
  • Duplicated block (17–25 lines × 2) REDACTED:7483 — REDACTED:7483-7507 | REDACTED:7583-7599 — 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 (18–25 lines × 2) · ×1
  • Duplicated block (18–25 lines × 2) REDACTED:7480 — REDACTED:7480-7504 | REDACTED:7564-7581 — 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 `REDACTED:7564` 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 (24–25 lines × 2) · ×1
  • Duplicated block (24–25 lines × 2) REDACTED:9433 — REDACTED:9433-9457 | REDACTED:9505-9528 — 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 (22–24 lines × 5) · ×1
  • Duplicated block (22–24 lines × 5) omlx/eval/arc.py:29 — omlx/eval/arc.py:29-50 | omlx/eval/bbq.py:29-52 | omlx/eval/mathqa.py:28-50 | omlx/eval/mmlu_pro.py:31-53 | omlx/eval/safetybench.py:29-51 — 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 5 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 before the matched lines, `omlx/eval/mmlu_pro.py:27` calls `get_max_tokens` and `omlx/eval/arc.py:26` 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–24 lines × 2) · ×1
  • Duplicated block (18–24 lines × 2) omlx/patches/deepseek_v4/chat_template_v4.py:691 — omlx/patches/deepseek_v4/chat_template_v4.py:691-714 | omlx/patches/deepseek_v41/encoding.py:742-759 — before extracting anything, compare `omlx/patches/deepseek_v4/chat_template_v4.py` and `omlx/patches/deepseek_v41/encoding.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 210 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 `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 (23–24 lines × 2) · ×1
  • Duplicated block (23–24 lines × 2) omlx/patches/deepseek_v4/switch_layers.py:205 — omlx/patches/deepseek_v4/switch_layers.py:205-227 | omlx/patches/glm_moe_dsa/switch_layers.py:59-82 — `omlx/patches/deepseek_v4/switch_layers.py` and `omlx/patches/glm_moe_dsa/switch_layers.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 75 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.
D4 · Code Duplication · Duplicated block (20–23 lines × 2) · ×1
  • Duplicated block (20–23 lines × 2) omlx/api/anthropic_utils.py:269 — omlx/api/anthropic_utils.py:269-291 | omlx/api/anthropic_utils.py:542-561 — 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 (22–23 lines × 2) · ×1
  • Duplicated block (22–23 lines × 2) REDACTED:4441 — REDACTED:4441-4462 | REDACTED:4589-4611 — 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 first that the copies are not typed on the same thing: the declarations holding them bind `request` to `SystemOneRequest` in one and `DecisionRequest` 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 (20–22 lines × 2) · ×1
  • Duplicated block (20–22 lines × 2) omlx/models/reranker.py:318 — omlx/models/reranker.py:318-339 | omlx/models/reranker.py:506-525 — 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 `omlx/models/reranker.py:318` 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 (17–22 lines × 2) · ×1
  • Duplicated block (17–22 lines × 2) omlx/patches/deepseek_v4/deepseek_v4_model.py:2515 — omlx/patches/deepseek_v4/deepseek_v4_model.py:2515-2531 | omlx/patches/mlx_lm_mtp/deepseek_v4_model.py:896-917 — 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 `omlx/patches/deepseek_v4/deepseek_v4_model.py:2515` 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 (12–22 lines × 2) · ×1
  • Duplicated block (12–22 lines × 2) omlx/patches/deepseek_v4/moe_offload.py:160 — omlx/patches/deepseek_v4/moe_offload.py:160-171 | omlx/patches/glm_moe_dsa/moe_offload.py:199-220 — `omlx/patches/deepseek_v4/moe_offload.py` and `omlx/patches/glm_moe_dsa/moe_offload.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 9 separate duplicated blocks between them, totalling at least 157 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. 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–22 lines × 2) · ×1
  • Duplicated block (16–22 lines × 2) omlx/patches/mlx_vlm_mtp/qwen35_moe_vlm_model.py:126 — omlx/patches/mlx_vlm_mtp/qwen35_moe_vlm_model.py:126-141 | omlx/patches/mlx_vlm_mtp/qwen35_vlm_model.py:81-102 — before extracting anything, compare `omlx/patches/mlx_vlm_mtp/qwen35_moe_vlm_model.py` and `omlx/patches/mlx_vlm_mtp/qwen35_vlm_model.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 52 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 before the matched lines, `omlx/patches/mlx_vlm_mtp/qwen35_vlm_model.py:80` calls `base_layout_key` and `omlx/patches/mlx_vlm_mtp/qwen35_moe_vlm_model.py:125` 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 (21–22 lines × 2) · ×1
  • Duplicated block (21–22 lines × 2) REDACTED:5197 — REDACTED:5197-5217 | REDACTED:8807-8828 — 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 `REDACTED:5197` 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 (15–21 lines × 2) · ×1
  • Duplicated block (15–21 lines × 2) omlx/cluster/node_role.py:233 — omlx/cluster/node_role.py:233-253 | omlx/cluster/node_role.py:260-274 — 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 (19–21 lines × 2) · ×1
  • Duplicated block (19–21 lines × 2) omlx/patches/qwen35_ane_prefill.py:2208 — omlx/patches/qwen35_ane_prefill.py:2208-2228 | omlx/patches/qwen35_ane_prefill.py:2323-2341 — 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 (18–21 lines × 2) · ×1
  • Duplicated block (18–21 lines × 2) omlx/patches/specprefill.py:498 — omlx/patches/specprefill.py:498-515 | omlx/patches/specprefill.py:1068-1088 — 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 (16–21 lines × 2) · ×1
  • Duplicated block (16–21 lines × 2) omlx/scheduler.py:12513 — omlx/scheduler.py:12513-12528 | omlx/scheduler.py:15040-15060 — 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 after the matched lines, `omlx/scheduler.py:12531` calls `get_prefill_tracker`, `remove`, `set_finished` and `omlx/scheduler.py:15063` 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–20 lines × 3) · ×1
  • Duplicated block (18–20 lines × 3) omlx/patches/qwen35_ane_prefill.py:677 — omlx/patches/qwen35_ane_prefill.py:677-696 | omlx/patches/qwen35_ane_prefill.py:798-815 | omlx/patches/qwen35_ane_prefill.py:893-910 — 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. 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 (18–20 lines × 2) · ×1
  • Duplicated block (18–20 lines × 2) REDACTED:1727 — REDACTED:1727-1744 | REDACTED:1776-1795 — 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 (17–20 lines × 2) · ×1
  • Duplicated block (17–20 lines × 2) omlx/patches/deepseek_v4/chat_template_v4.py:435 — omlx/patches/deepseek_v4/chat_template_v4.py:435-454 | omlx/patches/deepseek_v41/encoding.py:686-702 — before extracting anything, compare `omlx/patches/deepseek_v4/chat_template_v4.py` and `omlx/patches/deepseek_v41/encoding.py` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 210 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. Read the line range as the matched WINDOW rather than a finished unit: at `omlx/patches/deepseek_v4/chat_template_v4.py:435` 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 (10–20 lines × 2) · ×1
  • Duplicated block (10–20 lines × 2) omlx/scheduler.py:13926 — omlx/scheduler.py:13926-13945 | omlx/scheduler.py:14010-14019 — 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 `omlx/scheduler.py:13926` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `omlx/scheduler.py:14008` calls `pop`, `_release_paged_cache_for_request` and `omlx/scheduler.py:13926` 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 (16–19 lines × 3) · ×1
  • Duplicated block (16–19 lines × 3) omlx/eval/cmmlu.py:76 — omlx/eval/cmmlu.py:76-91 | omlx/eval/kmmlu.py:80-96 | omlx/eval/mmlu.py:102-120 — 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. 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 (28–29 lines × 3) · ×1
  • Duplicated block (28–29 lines × 3) omlx/patches/deepseek_v4/deepseek_v4_model.py:1686 — omlx/patches/deepseek_v4/deepseek_v4_model.py:1686-1713 | omlx/patches/deepseek_v4/deepseek_v4_model.py:1796-1824 | omlx/patches/deepseek_v4/deepseek_v4_model.py:1967-1994 — 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 `omlx/patches/deepseek_v4/deepseek_v4_model.py:1686` 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 (12–19 lines × 2) · ×1
  • Duplicated block (12–19 lines × 2) omlx/cluster/planner.py:629 — omlx/cluster/planner.py:629-647 | omlx/cluster/planner.py:655-666 — 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 `omlx/cluster/planner.py:629` 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 (15–19 lines × 2) · ×1
  • Duplicated block (15–19 lines × 2) omlx/patches/qwen35_fa256_attention.py:395 — omlx/patches/qwen35_fa256_attention.py:395-409 | omlx/patches/qwen35_fa256_attention.py:436-454 — 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 (15–18 lines × 2) · ×1
  • Duplicated block (15–18 lines × 2) omlx/cache/paged_ssd_cache.py:4243 — omlx/cache/paged_ssd_cache.py:4243-4260 | omlx/cache/paged_ssd_cache.py:4266-4280 — 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–18 lines × 2) · ×1
  • Duplicated block (11–18 lines × 2) omlx/cluster/planner.py:587 — omlx/cluster/planner.py:587-597 | omlx/cluster/planner.py:1110-1127 — 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 (13–18 lines × 2) · ×1
  • Duplicated block (13–18 lines × 2) omlx/patches/mlx_vlm_glm5_next_compat/decode_kernels.py:2639 — omlx/patches/mlx_vlm_glm5_next_compat/decode_kernels.py:2639-2651 | omlx/patches/mlx_vlm_glm5_next_compat/decode_kernels.py:2674-2691 — 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 (12–17 lines × 3) · ×1
  • Duplicated block (12–17 lines × 3) omlx/api/anthropic_utils.py:257 — omlx/api/anthropic_utils.py:257-268 | omlx/api/anthropic_utils.py:320-331 | omlx/api/anthropic_utils.py:381-397 — 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 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 × 3) · ×1
  • Duplicated block (16–17 lines × 3) REDACTED:1514 — REDACTED:1514-1529 | REDACTED:1544-1559 | omlx/engine/vlm.py:5410-5426 — before extracting anything, compare `REDACTED` and `omlx/engine/vlm.py` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 480 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 `REDACTED:1514` 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.
D4 · Code Duplication · Duplicated block (17 lines × 3) · ×1
  • Duplicated block (17 lines × 3) REDACTED:5202 — REDACTED:5202-5218 | REDACTED:6109-6127 | REDACTED:8813-8829 — 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 `REDACTED:5202` 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 (15–17 lines × 2) · ×1
  • Duplicated block (15–17 lines × 2) omlx/admin/ane_tuning.py:1380 — omlx/admin/ane_tuning.py:1380-1396 | omlx/admin/ane_tuning.py:1565-1579 — 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 (16–17 lines × 2) · ×1
  • Duplicated block (16–17 lines × 2) omlx/cluster/staging.py:1132 — omlx/cluster/staging.py:1132-1148 | omlx/cluster/staging.py:1376-1391 — 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 `omlx/cluster/staging.py:1132` 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–18 lines × 2) · ×1
  • Duplicated block (16–18 lines × 2) omlx/patches/mlx_lm_mtp/deepseek_v4_model.py:848 — omlx/patches/mlx_lm_mtp/deepseek_v4_model.py:848-865 | omlx/patches/mlx_lm_mtp/deepseek_v4_model.py:866-881 — 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 × 5) · ×1
  • Duplicated block (15–16 lines × 5) omlx/eval/arc.py:56 — omlx/eval/arc.py:56-70 | omlx/eval/bbq.py:59-74 | omlx/eval/mathqa.py:56-70 | omlx/eval/mmlu_pro.py:59-73 | omlx/eval/safetybench.py:57-72 — 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 5 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.
D4 · Code Duplication · Duplicated block (16 lines × 4) · ×1
  • Duplicated block (16 lines × 4) REDACTED:1202 — REDACTED:1202-1217 | REDACTED:1292-1307 | omlx/engine/vlm.py:4955-4970 | omlx/engine/vlm.py:5079-5094 — before extracting anything, compare `REDACTED` and `omlx/engine/vlm.py` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 480 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 `REDACTED:1202` 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 (15–16 lines × 3) · ×1
  • Duplicated block (15–16 lines × 3) omlx/eval/cmmlu.py:59 — omlx/eval/cmmlu.py:59-73 | omlx/eval/kmmlu.py:63-77 | omlx/eval/mmlu.py:83-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 all 3 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 before the matched lines, `omlx/eval/kmmlu.py:61` calls `get`, `str` and `omlx/eval/cmmlu.py:58` 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 (16 lines × 3) · ×1
  • Duplicated block (16 lines × 3) REDACTED:6653 — REDACTED:6653-6668 | REDACTED:7389-7404 | REDACTED:9156-9171 — 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 (9–16 lines × 2) · ×1
  • Duplicated block (9–16 lines × 2) omlx/scheduler.py:17425 — omlx/scheduler.py:17425-17433 | omlx/utils/formatting.py:6-21 — 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 (13–15 lines × 3) · ×1
  • Duplicated block (13–15 lines × 3) omlx/eval/base.py:188 — omlx/eval/base.py:188-202 | omlx/eval/livecodebench.py:50-62 | omlx/eval/mbpp.py:42-54 — 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. 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.
D4 · Code Duplication · Duplicated block (10–15 lines × 2) · ×1
  • Duplicated block (10–15 lines × 2) omlx/patches/mlx_lm_mtp/qwen35_model.py:162 — omlx/patches/mlx_lm_mtp/qwen35_model.py:162-176 | omlx/patches/mlx_vlm_mtp/qwen35_vlm_runtime.py:204-213 — 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.
D4 · Code Duplication · Duplicated block (12–15 lines × 2) · ×1
  • Duplicated block (12–15 lines × 2) REDACTED:4627 — REDACTED:4627-4638 | REDACTED:5081-5095 — 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 (14 lines × 3) · ×1
  • Duplicated block (14 lines × 3) omlx/cluster/enrollment.py:164 — omlx/cluster/enrollment.py:164-177 | omlx/cluster/rdma/store.py:50-63 | omlx/cluster/registry.py:310-323 — 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, `omlx/cluster/registry.py:326` calls `chmod` and `omlx/cluster/rdma/store.py:66` 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 (12–14 lines × 2) · ×1
  • Duplicated block (12–14 lines × 2) omlx/engine/vlm.py:1692 — omlx/engine/vlm.py:1692-1703 | omlx/patches/mimo_v2/audio.py:48-61 — 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.
D4 · Code Duplication · Duplicated block (22–24 lines × 2) · ×1
  • Duplicated block (22–24 lines × 2) omlx/patches/deepseek_v4/moe_offload.py:270 — omlx/patches/deepseek_v4/moe_offload.py:270-293 | omlx/patches/glm_moe_dsa/moe_offload.py:320-341 — `omlx/patches/deepseek_v4/moe_offload.py` and `omlx/patches/glm_moe_dsa/moe_offload.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 9 separate duplicated blocks between them, totalling at least 157 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 `omlx/patches/deepseek_v4/moe_offload.py:270` 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.
D4 · Code Duplication · Duplicated block (12–13 lines × 4) · ×1
  • Duplicated block (12–13 lines × 4) REDACTED:1218 — REDACTED:1218-1230 | REDACTED:1308-1319 | omlx/engine/vlm.py:4972-4984 | omlx/engine/vlm.py:5096-5107 — before extracting anything, compare `REDACTED` and `omlx/engine/vlm.py` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 480 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 `REDACTED:1218` 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–13 lines × 3) · ×1
  • Duplicated block (11–13 lines × 3) omlx/patches/glm_moe_dsa/deepseek_v32.py:525 — omlx/patches/glm_moe_dsa/deepseek_v32.py:525-535 | omlx/patches/glm_moe_dsa/glm_moe_dsa_model.py:223-233 | omlx/patches/index_cache.py:153-165 — 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.
D4 · Code Duplication · Duplicated block (3–13 lines × 3) · ×1
  • Duplicated block (3–13 lines × 3) omlx/patches/bailing_hybrid/bailing_hybrid_model.py:284 — omlx/patches/bailing_hybrid/bailing_hybrid_model.py:284-286 | omlx/patches/glm_moe_dsa/deepseek_v32.py:508-520 | omlx/patches/glm_moe_dsa/glm_moe_dsa_model.py:201-213 — 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. 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, `omlx/patches/glm_moe_dsa/deepseek_v32.py:507` calls `split`, `reshape`, `transpose` and `omlx/patches/bailing_hybrid/bailing_hybrid_model.py:284` 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 (12–13 lines × 2) · ×1
  • Duplicated block (12–13 lines × 2) omlx/server_metrics.py:300 — omlx/server_metrics.py:300-311 | omlx/server_metrics.py:324-336 — 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 `omlx/server_metrics.py:300` 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 (9–12 lines × 3) · ×1
  • Duplicated block (9–12 lines × 3) omlx/cache/prefix_cache.py:1149 — omlx/cache/prefix_cache.py:1149-1157 | omlx/cache/prefix_cache.py:2413-2421 | omlx/cache/prefix_cache.py:2714-2725 — 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 (11–12 lines × 3) · ×1
  • Duplicated block (11–12 lines × 3) REDACTED:758 — REDACTED:758-769 | REDACTED:797-808 | REDACTED:872-882 — 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 `REDACTED:758` 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 (8–12 lines × 2) · ×1
  • Duplicated block (8–12 lines × 2) omlx/cache/paged_ssd_cache.py:628 — omlx/cache/paged_ssd_cache.py:628-635 | omlx/cache/prefix_cache.py:4054-4065 — 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.
D4 · Code Duplication · Duplicated block (9–11 lines × 3) · ×1
  • Duplicated block (9–11 lines × 3) omlx/engine/vlm.py:3301 — omlx/engine/vlm.py:3301-3310 | omlx/engine/vlm.py:3352-3362 | omlx/engine/vlm.py:3405-3413 — 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 `omlx/engine/vlm.py:3352` 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.
D4 · Code Duplication · Duplicated block (9–11 lines × 2) · ×1
  • Duplicated block (9–11 lines × 2) REDACTED:7905 — REDACTED:7905-7915 | REDACTED:11833-11841 — 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 (10–11 lines × 2) · ×1
  • Duplicated block (10–11 lines × 2) REDACTED:8775 — REDACTED:8775-8785 | REDACTED:8808-8817 — 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 `REDACTED:8775` 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 (6–10 lines × 3) · ×1
  • Duplicated block (6–10 lines × 3) omlx/patches/deepseek_v4/__init__.py:94 — omlx/patches/deepseek_v4/__init__.py:94-99 | omlx/patches/minimax_m3_mlx_lm/__init__.py:59-68 | omlx/patches/step3p7/__init__.py:32-38 — 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.
D4 · Code Duplication · Duplicated block (8–10 lines × 2) · ×1
  • Duplicated block (8–10 lines × 2) omlx/admin/routes.py:8437 — omlx/admin/routes.py:8437-8444 | omlx/admin/routes.py:8463-8472 — 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 `omlx/admin/routes.py:8463` 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.
D4 · Code Duplication · Duplicated block (7–10 lines × 2) · ×1
  • Duplicated block (7–10 lines × 2) omlx/patches/glm_moe_dsa/deepseek_v32.py:553 — omlx/patches/glm_moe_dsa/deepseek_v32.py:553-559 | omlx/patches/glm_moe_dsa/glm_moe_dsa_model.py:241-250 — 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 `omlx/patches/glm_moe_dsa/glm_moe_dsa_model.py:241` 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 × 7) · ×1
  • Duplicated block (8 lines × 7) omlx/cluster/enrollment.py:171 — omlx/cluster/enrollment.py:171-178 | omlx/cluster/identity.py:143-150 | omlx/cluster/incidents.py:175-182 | REDACTED:236-243 | omlx/cluster/rdma/store.py:57-64 | omlx/cluster/registry.py:99-106 | omlx/cluster/registry.py:317-324 — there are 7 copies across 6 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 7 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `omlx/cluster/enrollment.py:171` 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, `omlx/cluster/enrollment.py:180` calls `chmod` and `omlx/cluster/rdma/store.py:66` 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 (24 lines × 2) · ×1
  • Duplicated block (24 lines × 2) apps/omlx-cuda-helper/omlx_cuda_helper/families/inkling2/layers.py:280 — apps/omlx-cuda-helper/omlx_cuda_helper/families/inkling2/layers.py:280-303 | omlx/patches/inkling2/kernels.py:430-453 — 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 after the matched lines, `omlx/patches/inkling2/kernels.py:455` calls `where` and `apps/omlx-cuda-helper/omlx_cuda_helper/families/inkling2/layers.py:304` 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 (7–8 lines × 2) · ×1
  • Duplicated block (7–8 lines × 2) omlx/eval/humaneval.py:71 — omlx/eval/humaneval.py:71-78 | omlx/eval/humaneval.py:81-87 — 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 (6–8 lines × 2) · ×1
  • Duplicated block (6–8 lines × 2) omlx/patches/bailing_hybrid/bailing_hybrid_model.py:928 — omlx/patches/bailing_hybrid/bailing_hybrid_model.py:928-935 | omlx/patches/hy_v3/hy_v3_model.py:306-311 — 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 (6–7 lines × 2) · ×1
  • Duplicated block (6–7 lines × 2) omlx/patches/glm_moe_dsa/deepseek_v32.py:568 — omlx/patches/glm_moe_dsa/deepseek_v32.py:568-574 | omlx/patches/raon1_mini/raon1_mini_model.py:1491-1496 — 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.
D4 · Code Duplication · Duplicated block (10–14 lines × 3) · ×1
  • Duplicated block (10–14 lines × 3) omlx/patches/glm_moe_dsa/deepseek_v32.py:816 — omlx/patches/glm_moe_dsa/deepseek_v32.py:816-825 | omlx/patches/glm_moe_dsa/glm_moe_dsa_model.py:465-478 | omlx/patches/mlx_lm_mtp/glm_moe_dsa_model.py:299-308 — 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 `omlx/patches/glm_moe_dsa/glm_moe_dsa_model.py:465` 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.
D4 · Code Duplication · Duplicated block (10–12 lines × 3) · ×1
  • Duplicated block (10–12 lines × 3) omlx/patches/bailing_hybrid/bailing_hybrid_model.py:589 — omlx/patches/bailing_hybrid/bailing_hybrid_model.py:589-598 | omlx/patches/glm_moe_dsa/deepseek_v32.py:627-638 | omlx/patches/mimo_v2/mimo_v2_model.py:242-253 — 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.
D4 · Code Duplication · Duplicated block (4–5 lines × 3) · ×1
  • Duplicated block (4–5 lines × 3) REDACTED:1829 — REDACTED:1829-1833 | REDACTED:4231-4235 | omlx/utils/sampling.py:124-127 — 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. 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 lines × 3) · ×1
  • Duplicated block (23 lines × 3) omlx/models/embedding.py:1274 — omlx/models/embedding.py:1274-1298 | omlx/models/llm.py:333-355 | omlx/models/reranker.py:1541-1564 — 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. 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 (6 lines × 6) · ×1
  • Duplicated block (6 lines × 6) omlx/patches/mlx_vlm_glm5_next_compat/__init__.py:21 — omlx/patches/mlx_vlm_glm5_next_compat/__init__.py:21-26 | omlx/patches/mlx_vlm_inkling_compat/__init__.py:62-67 | omlx/patches/mlx_vlm_minimax_m3_compat/__init__.py:75-80 | omlx/patches/mlx_vlm_muse_glimmer_compat/__init__.py:57-62 | omlx/patches/mlx_vlm_muse_spark_compat/__init__.py:61-66 | omlx/patches/mlx_vlm_qwen4_exp_compat/__init__.py:20-25 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 6 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 6 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `omlx/patches/mlx_vlm_minimax_m3_compat/__init__.py:71` calls `_append_package_path` and `omlx/patches/mlx_vlm_inkling_compat/__init__.py:58` 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 (5 lines × 4) · ×1
  • Duplicated block (5 lines × 4) omlx/prefill_helper/adapters/inkling2.py:230 — omlx/prefill_helper/adapters/inkling2.py:230-234 | omlx/prefill_helper/adapters/minimax_m3.py:159-163 | omlx/prefill_helper/adapters/qwen3_5.py:322-326 | omlx/prefill_helper/adapters/qwen4_exp.py:419-423 — 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 4 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.
D4 · Code Duplication · Duplicated block (51 lines × 2) · ×1
  • Duplicated block (51 lines × 2) apps/omlx-mac/Sources/AppView/Screens/DownloadsScreen.swift:199 — apps/omlx-mac/Sources/AppView/Screens/DownloadsScreen.swift:199-249 | apps/omlx-mac/Sources/AppView/Screens/DownloadsScreen.swift:355-405 — 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 (36 lines × 2) · ×1
  • Duplicated block (36 lines × 2) apps/omlx-mac/Sources/AppView/Screens/DownloadsScreen.swift:287 — apps/omlx-mac/Sources/AppView/Screens/DownloadsScreen.swift:287-322 | apps/omlx-mac/Sources/AppView/Screens/DownloadsScreen.swift:443-478 — 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 (23 lines × 2) · ×1
  • Duplicated block (23 lines × 2) apps/omlx-mac/Sources/App/AppDelegate.swift:647 — apps/omlx-mac/Sources/App/AppDelegate.swift:647-669 | apps/omlx-mac/Sources/App/AppDelegate.swift:682-704 — 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 (10–18 lines × 2) · ×1
  • Duplicated block (10–18 lines × 2) apps/omlx-mac/Sources/Updater/AppUpdater.swift:549 — apps/omlx-mac/Sources/Updater/AppUpdater.swift:549-558 | apps/omlx-mac/Sources/Updater/UpdateInstaller.swift:299-316 — 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 `apps/omlx-mac/Sources/Updater/UpdateInstaller.swift:299` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with 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 (12–13 lines × 3) · ×1
  • Duplicated block (12–13 lines × 3) apps/omlx-mac/Sources/AppView/Screens/NetworkScreen.swift:47 — apps/omlx-mac/Sources/AppView/Screens/NetworkScreen.swift:47-58 | apps/omlx-mac/Sources/AppView/Screens/PerformanceScreen.swift:49-60 | apps/omlx-mac/Sources/AppView/Screens/ServerScreen.swift:210-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 all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `apps/omlx-mac/Sources/AppView/Screens/NetworkScreen.swift:47` 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 (7–9 lines × 3) · ×1
  • Duplicated block (7–9 lines × 3) apps/omlx-mac/Sources/AppView/Screens/StatusScreen.swift:154 — apps/omlx-mac/Sources/AppView/Screens/StatusScreen.swift:154-162 | apps/omlx-mac/Sources/AppView/Screens/StatusScreen.swift:172-180 | apps/omlx-mac/Sources/AppView/Screens/StatusScreen.swift:188-194 — 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 `apps/omlx-mac/Sources/AppView/Screens/StatusScreen.swift:154` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with 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 (8 lines × 5) · ×1
  • Duplicated block (8 lines × 5) apps/omlx-mac/Sources/AppView/Screens/AccuracyBenchScreen.swift:768 — apps/omlx-mac/Sources/AppView/Screens/AccuracyBenchScreen.swift:768-775 | apps/omlx-mac/Sources/AppView/Screens/DownloadsScreen.swift:253-260 | apps/omlx-mac/Sources/AppView/Screens/DownloadsScreen.swift:409-416 | apps/omlx-mac/Sources/AppView/Screens/ThroughputBenchScreen.swift:878-885 | apps/omlx-mac/Sources/AppView/Screens/ThroughputBenchScreen.swift:901-908 — there are 5 copies across 3 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.
D4 · Code Duplication · Duplicated block (7 lines × 6) · ×1
  • Duplicated block (7 lines × 6) apps/omlx-mac/Sources/AppView/Screens/AccuracyBenchScreen.swift:602 — apps/omlx-mac/Sources/AppView/Screens/AccuracyBenchScreen.swift:602-608 | apps/omlx-mac/Sources/AppView/Screens/AskAIScreen.swift:1292-1298 | apps/omlx-mac/Sources/AppView/Screens/DownloadsScreen.swift:675-681 | apps/omlx-mac/Sources/AppView/Screens/DownloadsScreen.swift:779-785 | apps/omlx-mac/Sources/AppView/Screens/DownloadsScreen.swift:892-898 | apps/omlx-mac/Sources/AppView/Screens/ModelsScreen.swift:149-155 — there are 6 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 6 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `apps/omlx-mac/Sources/AppView/Screens/AccuracyBenchScreen.swift:602` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (7 lines × 4) · ×1
  • Duplicated block (7 lines × 4) apps/omlx-mac/Sources/AppView/ViewModels/IntegrationsScreenVM.swift:254 — apps/omlx-mac/Sources/AppView/ViewModels/IntegrationsScreenVM.swift:254-260 | apps/omlx-mac/Sources/AppView/ViewModels/ServerScreenVM.swift:527-533 | apps/omlx-mac/Sources/Welcome/WelcomeWindow.swift:227-233 | apps/omlx-mac/Sources/Welcome/WelcomeWindow.swift:244-250 — there are 4 copies across 3 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. Read the line range as the matched WINDOW rather than a finished unit: at `apps/omlx-mac/Sources/AppView/ViewModels/IntegrationsScreenVM.swift:254` 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 (5–6 lines × 2) · ×1
  • Duplicated block (5–6 lines × 2) apps/omlx-mac/Sources/AppView/Utils/PresetBundleStore.swift:62 — apps/omlx-mac/Sources/AppView/Utils/PresetBundleStore.swift:62-66 | apps/omlx-mac/Sources/Config/AppConfig.swift:271-276 — 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.
R1 · Type Safety · Type Safety · ×1
  • Type Safety — 0 typed · 20 plain JS — the untyped files are apps/omlx-web/omlx_web/static/js/cluster_v2.js, apps/omlx-web/omlx_web/static/js/count_format.js, apps/omlx-web/omlx_web/static/js/custom_theme.js, REDACTED, apps/omlx-web/omlx_web/static/js/dashboard_layout.js, REDACTED (+14 more).
R10 · Code Duplication · Duplicated block with local edits (96 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (96 matched lines × 2 locations) REDACTED:8181 — REDACTED:8181 · REDACTED:8479 — the two spans are one implementation copied and then locally edited — 607 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 (45 lines × 2 locations) · ×1
  • Duplicated block (45 lines × 2 locations) REDACTED:7945 — REDACTED:7945 · REDACTED:9308 — all 2 copies are in the same file, 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 (35 lines × 2 locations) · ×1
  • Duplicated block (35 lines × 2 locations) REDACTED:8067 — REDACTED:8067 · REDACTED:9358 — 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.
R10 · Code Duplication · Duplicated block (32 lines × 2 locations) · ×1
  • Duplicated block (32 lines × 2 locations) REDACTED:7284 — REDACTED:7284 · REDACTED:7389 — all 2 copies are in the same file, 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 (20 lines × 5 locations) · ×1
  • Duplicated block (20 lines × 5 locations) REDACTED:8622 — REDACTED:8622 · REDACTED:9056 · REDACTED:9434 · REDACTED:9499 · +1 more site(s) not listed — all 5 copies are in the same file, 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 (19 lines × 2 locations) · ×1
  • Duplicated block (19 lines × 2 locations) REDACTED:8996 — REDACTED:8996 · REDACTED:9462 — all 2 copies are in the same file, 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 (17 lines × 3 locations) · ×1
  • Duplicated block (17 lines × 3 locations) apps/omlx-web/omlx_web/static/js/cluster_v2.js:3453 — apps/omlx-web/omlx_web/static/js/cluster_v2.js:3453 · apps/omlx-web/omlx_web/static/js/cluster_v2.js:3766 · apps/omlx-web/omlx_web/static/js/cluster_v2.js:3790 — all 3 copies are in the same file, 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 (16 lines × 4 locations) · ×1
  • Duplicated block (16 lines × 4 locations) REDACTED:8128 — REDACTED:8128 · REDACTED:8278 · REDACTED:8571 · REDACTED:9398 — all 4 copies are in the same file, 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 (13 lines × 2 locations) · ×1
  • Duplicated block (13 lines × 2 locations) apps/omlx-web/omlx_web/static/js/cluster_v2.js:647 — apps/omlx-web/omlx_web/static/js/cluster_v2.js:647 · apps/omlx-web/omlx_web/static/js/cluster_v2.js:662 — all 2 copies are in the same file, 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 (13 lines × 3 locations) · ×1
  • Duplicated block (13 lines × 3 locations) REDACTED:1925 — REDACTED:1925 · REDACTED:1938 · REDACTED:7987 — all 3 copies are in the same file, 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 (12 lines × 4 locations) · ×1
  • Duplicated block (12 lines × 4 locations) REDACTED:2535 — REDACTED:2535 · REDACTED:2662 · REDACTED:2703 · REDACTED:2729 — all 4 copies are in the same file, 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 (12 lines × 3 locations) · ×1
  • Duplicated block (12 lines × 3 locations) REDACTED:6298 — REDACTED:6298 · REDACTED:8260 · REDACTED:8553 — all 3 copies are in the same file, 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 (8 lines × 4 locations) · ×1
  • Duplicated block (8 lines × 4 locations) REDACTED:2890 — REDACTED:2890 · REDACTED:2914 · REDACTED:2952 · REDACTED:3026 — all 4 copies are in the same file, 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 (7 lines × 4 locations) · ×1
  • Duplicated block (7 lines × 4 locations) REDACTED:2579 — REDACTED:2579 · REDACTED:7949 · REDACTED:8706 · REDACTED:9312 — all 4 copies are in the same file, 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 (6 lines × 3 locations) · ×1
  • Duplicated block (6 lines × 3 locations) REDACTED:5060 — REDACTED:5060 · REDACTED:5124 · REDACTED:8927 — all 3 copies are in the same file, 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 (5 lines × 2 locations) · ×1
  • Duplicated block (5 lines × 2 locations) REDACTED:6117 — REDACTED:6117 · REDACTED:6391 — all 2 copies are in the same file, 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 buildModelSettingsPayload (cyclomatic 91, cognitive 108) · ×1
  • Complex function buildModelSettingsPayload (cyclomatic 91, cognitive 108) REDACTED:3538 — buildModelSettingsPayload has cyclomatic complexity 91 and cognitive complexity 108; 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 buildModelSettingsState (cyclomatic 87, cognitive 84) · ×1
  • Complex function buildModelSettingsState (cyclomatic 87, cognitive 84) REDACTED:2205 — buildModelSettingsState has cyclomatic complexity 87 and cognitive complexity 84; 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 formValuesForProfile (cyclomatic 52, cognitive 95) · ×1
  • Complex function formValuesForProfile (cyclomatic 52, cognitive 95) REDACTED:1755 — formValuesForProfile has cyclomatic complexity 52 and cognitive complexity 95; 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 accDownloadResult (cyclomatic 36, cognitive 56) · ×1
  • Complex function accDownloadResult (cyclomatic 36, cognitive 56) REDACTED:6588 — accDownloadResult has cyclomatic complexity 36 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 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 checkRows (cyclomatic 33, cognitive 40) · ×1
  • Complex function checkRows (cyclomatic 33, cognitive 40) apps/omlx-web/omlx_web/static/js/cluster_v2.js:2095 — checkRows has cyclomatic complexity 33 and cognitive complexity 40; 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 saveGlobalSettings (cyclomatic 32, cognitive 36) · ×1
  • Complex function saveGlobalSettings (cyclomatic 32, cognitive 36) REDACTED:1407 — saveGlobalSettings has cyclomatic complexity 32 and cognitive complexity 36; 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 31, cognitive 32) · ×1
  • Complex function (anonymous) (cyclomatic 31, cognitive 32) REDACTED:7250 — (anonymous) has cyclomatic complexity 31 and cognitive complexity 32; 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 prefillHelperStatusText (cyclomatic 30, cognitive 25) · ×1
  • Complex function prefillHelperStatusText (cyclomatic 30, cognitive 25) REDACTED:3330 — prefillHelperStatusText has cyclomatic complexity 30 and cognitive complexity 25; 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 29, cognitive 42) · ×1
  • Complex function (anonymous) (cyclomatic 29, cognitive 42) apps/omlx-web/omlx_web/static/js/cluster_v2.js:1913 — (anonymous) has cyclomatic complexity 29 and cognitive complexity 42; 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 applyANETuningRecommendation (cyclomatic 26, cognitive 34) · ×1
  • Complex function applyANETuningRecommendation (cyclomatic 26, cognitive 34) REDACTED:2968 — applyANETuningRecommendation has cyclomatic complexity 26 and cognitive complexity 34; 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 runPlan (cyclomatic 25, cognitive 24) · ×1
  • Complex function runPlan (cyclomatic 25, cognitive 24) apps/omlx-web/omlx_web/static/js/cluster_v2.js:2845 — runPlan has cyclomatic complexity 25 and cognitive complexity 24; 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 wizardState (cyclomatic 24, cognitive 23) · ×1
  • Complex function wizardState (cyclomatic 24, cognitive 23) apps/omlx-web/omlx_web/static/js/cluster_v2.js:1049 — wizardState has cyclomatic complexity 24 and cognitive complexity 23; 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 validateQwenAneSettings (cyclomatic 22, cognitive 30) · ×1
  • Complex function validateQwenAneSettings (cyclomatic 22, cognitive 30) REDACTED:3461 — validateQwenAneSettings has cyclomatic complexity 22 and cognitive complexity 30; 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 openModelSettings (cyclomatic 22, cognitive 29) · ×1
  • Complex function openModelSettings (cyclomatic 22, cognitive 29) REDACTED:3060 — openModelSettings has cyclomatic complexity 22 and cognitive complexity 29; 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 accBuildText (cyclomatic 21, cognitive 34) · ×1
  • Complex function accBuildText (cyclomatic 21, cognitive 34) REDACTED:6466 — accBuildText has cyclomatic complexity 21 and cognitive complexity 34; 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 submitPairApproval (cyclomatic 21, cognitive 32) · ×1
  • Complex function submitPairApproval (cyclomatic 21, cognitive 32) apps/omlx-web/omlx_web/static/js/cluster_v2.js:1427 — submitPairApproval has cyclomatic complexity 21 and cognitive complexity 32; 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 aggregateLogRows (cyclomatic 20, cognitive 24) · ×1
  • Complex function aggregateLogRows (cyclomatic 20, cognitive 24) REDACTED:71 — aggregateLogRows has cyclomatic complexity 20 and cognitive complexity 24; 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 defaults (cyclomatic 19, cognitive 40) · ×1
  • Complex function defaults (cyclomatic 19, cognitive 40) apps/omlx-web/omlx_web/static/js/custom_theme.js:299 — defaults has cyclomatic complexity 19 and cognitive complexity 40; 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 handleMainTabChange (cyclomatic 19, cognitive 30) · ×1
  • Complex function handleMainTabChange (cyclomatic 19, cognitive 30) REDACTED:895 — handleMainTabChange has cyclomatic complexity 19 and cognitive complexity 30; 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 previewMembershipExpansion (cyclomatic 19, cognitive 16) · ×1
  • Complex function previewMembershipExpansion (cyclomatic 19, cognitive 16) apps/omlx-web/omlx_web/static/js/cluster_v2.js:3543 — previewMembershipExpansion has cyclomatic complexity 19 and cognitive complexity 16; 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 19, cognitive 16) · ×1
  • Complex function (anonymous) (cyclomatic 19, cognitive 16) REDACTED:7371 — (anonymous) has cyclomatic complexity 19 and cognitive complexity 16; 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 19, cognitive 12) · ×1
  • Complex function (anonymous) (cyclomatic 19, cognitive 12) REDACTED:8941 — (anonymous) has cyclomatic complexity 19 and cognitive complexity 12; 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 saveModelSettings (cyclomatic 18, cognitive 25) · ×1
  • Complex function saveModelSettings (cyclomatic 18, cognitive 25) REDACTED:3776 — saveModelSettings has cyclomatic complexity 18 and cognitive complexity 25; 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 pollANETuning (cyclomatic 18, cognitive 16) · ×1
  • Complex function pollANETuning (cyclomatic 18, cognitive 16) REDACTED:2908 — pollANETuning has cyclomatic complexity 18 and cognitive complexity 16; 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 onmessage (cyclomatic 17, cognitive 22) · ×1
  • Complex function onmessage (cyclomatic 17, cognitive 22) REDACTED:5487 — onmessage has cyclomatic complexity 17 and cognitive complexity 22; 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 addToAccQueue (cyclomatic 17, cognitive 20) · ×1
  • Complex function addToAccQueue (cyclomatic 17, cognitive 20) REDACTED:6234 — addToAccQueue has cyclomatic complexity 17 and cognitive complexity 20; 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 applyPresetToForm (cyclomatic 17, cognitive 19) · ×1
  • Complex function applyPresetToForm (cyclomatic 17, cognitive 19) REDACTED:2433 — applyPresetToForm has cyclomatic complexity 17 and cognitive complexity 19; 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 cacheObsCumulative (cyclomatic 17, cognitive 17) · ×1
  • Complex function cacheObsCumulative (cyclomatic 17, cognitive 17) REDACTED:5082 — cacheObsCumulative has cyclomatic complexity 17 and cognitive complexity 17; 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 dashboard (cyclomatic 17, cognitive 16) · ×1
  • Complex function dashboard (cyclomatic 17, cognitive 16) REDACTED:129 — dashboard has cyclomatic complexity 17 and cognitive complexity 16; 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 startANETuning (cyclomatic 17, cognitive 16) · ×1
  • Complex function startANETuning (cyclomatic 17, cognitive 16) REDACTED:2850 — startANETuning has cyclomatic complexity 17 and cognitive complexity 16; 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 applyProfileToForm (cyclomatic 16, cognitive 20) · ×1
  • Complex function applyProfileToForm (cyclomatic 16, cognitive 20) REDACTED:2546 — applyProfileToForm has cyclomatic complexity 16 and cognitive complexity 20; 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 createProfile (cyclomatic 16, cognitive 18) · ×1
  • Complex function createProfile (cyclomatic 16, cognitive 18) REDACTED:2496 — createProfile has cyclomatic complexity 16 and cognitive complexity 18; 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 searchHFModels (cyclomatic 15, cognitive 18) · ×1
  • Complex function searchHFModels (cyclomatic 15, cognitive 18) REDACTED:9014 — searchHFModels has cyclomatic complexity 15 and cognitive complexity 18; 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 pollStagingJob (cyclomatic 15, cognitive 17) · ×1
  • Complex function pollStagingJob (cyclomatic 15, cognitive 17) apps/omlx-web/omlx_web/static/js/cluster_v2.js:3190 — pollStagingJob has cyclomatic complexity 15 and cognitive complexity 17; 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 aneTuningRecommendationText (cyclomatic 15, cognitive 15) · ×1
  • Complex function aneTuningRecommendationText (cyclomatic 15, cognitive 15) REDACTED:2773 — aneTuningRecommendationText has cyclomatic complexity 15 and cognitive complexity 15; 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 updateModelSetting (cyclomatic 14, cognitive 27) · ×1
  • Complex function updateModelSetting (cyclomatic 14, cognitive 27) REDACTED:1647 — updateModelSetting has cyclomatic complexity 14 and cognitive complexity 27; 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 loadGlobalSettings (cyclomatic 14, cognitive 20) · ×1
  • Complex function loadGlobalSettings (cyclomatic 14, cognitive 20) REDACTED:1289 — loadGlobalSettings has cyclomatic complexity 14 and cognitive complexity 20; 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 submitManualPeer (cyclomatic 14, cognitive 15) · ×1
  • Complex function submitManualPeer (cyclomatic 14, cognitive 15) apps/omlx-web/omlx_web/static/js/cluster_v2.js:1704 — submitManualPeer has cyclomatic complexity 14 and cognitive complexity 15; 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 refreshJoinState (cyclomatic 14, cognitive 14) · ×1
  • Complex function refreshJoinState (cyclomatic 14, cognitive 14) apps/omlx-web/omlx_web/static/js/cluster_v2.js:485 — refreshJoinState has cyclomatic complexity 14 and cognitive complexity 14; 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 startBenchmark (cyclomatic 14, cognitive 14) · ×1
  • Complex function startBenchmark (cyclomatic 14, cognitive 14) REDACTED:5395 — startBenchmark has cyclomatic complexity 14 and cognitive complexity 14; 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 · REDACTED · ×1
  • REDACTED: 8886 lines of code REDACTED:1 — REDACTED has 8886 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 · apps/omlx-web/omlx_web/static/js/cluster_v2.js · ×1
  • apps/omlx-web/omlx_web/static/js/cluster_v2.js: 3811 lines of code apps/omlx-web/omlx_web/static/js/cluster_v2.js:1 — apps/omlx-web/omlx_web/static/js/cluster_v2.js has 3811 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 · apps/omlx-web/omlx_web/static/js/theme_preview.js · ×1
  • apps/omlx-web/omlx_web/static/js/theme_preview.js: 420 lines of code apps/omlx-web/omlx_web/static/js/theme_preview.js:1 — apps/omlx-web/omlx_web/static/js/theme_preview.js has 420 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
X1 · Async correctness · Task from `asyncio.create_task` is not kept · ×1
  • Task from `asyncio.create_task` is not kept omlx/engine_core.py:1552 — 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 — 162 finding(s)
X10 · Duplicated predicate · Duplicated predicate · ×40
  • Duplicated predicate omlx/patches/deepseek_v4/deepseek_v4_model.py:2447 — `".ffn.experts." in wk and ".shared_experts." not in wk and weight.dtype in (mx.int8, mx.uint8) and v.shape[-1] * 16 == weight.shape[-1]` appears character-identically in 2 files — omlx/patches/deepseek_v4/deepseek_v4_model.py, omlx/patches/mlx_lm_mtp/deepseek_v4_model.py. 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 omlx/patches/deepseek_v4/deepseek_v4_model.py:2519 — `".ffn.switch_mlp." not in key or not key.endswith((".scales", ".biases")) or value.dtype != mx.bfloat16` appears character-identically in 2 files — omlx/patches/deepseek_v4/deepseek_v4_model.py, omlx/patches/mlx_lm_mtp/deepseek_v4_model.py. 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 omlx/patches/mlx_lm_mtp/qwen35_model.py:704 — `"conv1d.weight" in k and getattr(v, "shape", (1,))[-1] != 1` appears character-identically in 4 files — omlx/patches/mlx_lm_mtp/qwen35_model.py, omlx/patches/mlx_vlm_mtp/qwen35_moe_vlm_model.py, omlx/patches/mlx_vlm_mtp/qwen35_moe_vlm_runtime.py, omlx/patches/mlx_vlm_mtp/qwen35_vlm_model.py. 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 omlx/patches/mlx_vlm_mtp/qwen35_moe_vlm_model.py:141 — `"conv1d.weight" in key and value.shape[-1] != 1` appears character-identically in 3 files — omlx/patches/mlx_vlm_mtp/qwen35_moe_vlm_model.py, omlx/patches/mlx_vlm_mtp/qwen35_moe_vlm_runtime.py, omlx/patches/mlx_vlm_mtp/qwen35_vlm_model.py. 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 REDACTED:2196 — `_cfg_get(config, "num_attention_heads") or _cfg_get(config, "n_head") or num_kv_heads` appears character-identically in 2 files — REDACTED, omlx/scheduler.py. 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 REDACTED:2183 — `_cfg_get(config, "num_attention_heads") or num_kv_heads` appears character-identically in 2 files — REDACTED, omlx/scheduler.py. 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 REDACTED:2164 — `_cfg_get(sub, "num_hidden_layers") or _cfg_get(sub, "n_layer")` appears character-identically in 2 files — REDACTED, omlx/scheduler.py. 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 omlx/custom_kernels/attention/fast.py:312 — `_ext is not None and hasattr(_ext, name)` appears character-identically in 4 files — omlx/custom_kernels/attention/fast.py, omlx/custom_kernels/lowbit/fast.py, omlx/custom_kernels/quant_matmul/fast.py, omlx/custom_kernels/sparse_index/fast.py. 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 omlx/patches/glm_moe_dsa/generate_patch.py:65 — `adaptive_prefill is not None and processed_tokens >= adaptive_prefill.after and remaining_tokens >= adaptive_prefill.min_remaining` appears character-identically in 2 files — omlx/patches/glm_moe_dsa/generate_patch.py, omlx/patches/minimax_m3/generate_patch.py. 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 omlx/patches/deepseek_v4/chat_template_v4.py:661 — `add_default_bos_token and len(context) == 0` appears character-identically in 2 files — omlx/patches/deepseek_v4/chat_template_v4.py, omlx/patches/deepseek_v41/encoding.py. 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 REDACTED:88 — `address.is_private or address.is_link_local` appears character-identically in 2 files — REDACTED, omlx/cluster/routes.py. 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 omlx/cluster/liveness.py:89 — `age is not None and age > _DEFAULT_STALE_AFTER` appears character-identically in 2 files — omlx/cluster/liveness.py, omlx/engine/distributed.py. 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 omlx/patches/qwen35_ane_prefill.py:196 — `args and isinstance(args[0], bool) and args[0]` appears character-identically in 2 files — omlx/patches/qwen35_ane_prefill.py, omlx/patches/qwen35_moe_weighted_sum.py. 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 apps/omlx-cuda-helper/omlx_cuda_helper/families/deepseek_v41/quant.py:67 — `bits not in (4, 8) or x.shape[-1] % group_size` appears character-identically in 2 files — apps/omlx-cuda-helper/omlx_cuda_helper/families/deepseek_v41/quant.py, omlx/patches/deepseek_v41/quantization.py. 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 omlx/scheduler.py:11173 — `block_table and block_table.num_tokens > 0` appears character-identically in 2 files — omlx/scheduler.py, omlx/specprefill/draft.py. 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 omlx/patches/mlx_lm_mtp/nemotron_h_chain.py:120 — `cache is not None and 0 < n_confirmed < S` appears character-identically in 2 files — omlx/patches/mlx_lm_mtp/nemotron_h_chain.py, omlx/patches/mlx_lm_mtp/nemotron_h_model.py. 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 omlx/patches/glm_moe_dsa/deepseek_v32.py:550 — `cache is not None and cache[0] is not None` appears character-identically in 5 files — omlx/patches/glm_moe_dsa/deepseek_v32.py, omlx/patches/index_cache.py, omlx/patches/mlx_lm_mtp/qwen35_model.py, omlx/patches/mlx_vlm_mtp/glm5_next_vlm_runtime.py. 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 omlx/patches/qwen35_fa256_attention.py:115 — `cache is not None and hasattr(cache, "bits")` appears character-identically in 3 files — omlx/patches/qwen35_fa256_attention.py, omlx/patches/qwen35_verify_sdpa_split.py, omlx/patches/sdpa256_attention.py. 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 omlx/patches/mlx_lm_mtp/deepseek_v4_model.py:650 — `callable(is_trimmable) and is_trimmable()` appears character-identically in 2 files — omlx/patches/mlx_lm_mtp/deepseek_v4_model.py, omlx/patches/mlx_vlm_mtp/glm5_next_vlm_runtime.py. 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 omlx/patches/deepseek_v4/deepseek_v4_model.py:2488 — `candidate in weights or candidate in remapped` appears character-identically in 2 files — omlx/patches/deepseek_v4/deepseek_v4_model.py, omlx/patches/mlx_lm_mtp/deepseek_v4_model.py. 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 omlx/engine/distributed.py:120 — `candidate is not None and candidate != normalized` appears character-identically in 2 files — omlx/engine/distributed.py, omlx/reasoning_effort.py. 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 omlx/cluster/jaccl_side_channel.py:297 — `candidate.is_file() and os.access(candidate, os.X_OK)` appears character-identically in 2 files — omlx/cluster/jaccl_side_channel.py, omlx/cluster/system_socket_proxy.py. 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 apps/omlx-cuda-helper/omlx_cuda_helper/families/inkling2/stage.py:180 — `capture and start + h.shape[1] > capture["from"]` appears character-identically in 2 files — apps/omlx-cuda-helper/omlx_cuda_helper/families/inkling2/stage.py, apps/omlx-cuda-helper/omlx_cuda_helper/families/qwen3_5/stage.py. 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 omlx/patches/inkling2/model.py:729 — `capture_layer_ids is None and not return_hidden and scope and inputs is not None and inputs.ndim == 2 and tuple(inputs.shape) == (len(scope)…` appears character-identically in 3 files — omlx/patches/inkling2/model.py, omlx/patches/mlx_lm_mtp/drafter_target.py, omlx/patches/mlx_lm_mtp/qwen35_model.py. 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 omlx/patches/minimax_m3/generate_patch.py:64 — `child is not None and not isinstance( child, (str, bytes, int, float, bool) )` appears character-identically in 2 files — omlx/patches/minimax_m3/generate_patch.py, omlx/scheduler.py. 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.
  • + 15 more in this group — see findings.md.
X4 · Structured logging · Interpolated log message defeats structured logging · ×40
  • Interpolated log message defeats structured logging omlx/engine_core.py:455 — `debug` at line 455 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 omlx/engine_core.py:719 — `error` at line 719 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 omlx/engine_core.py:865 — `debug` at line 865 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 omlx/engine_core.py:1055 — `warning` at line 1055 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 omlx/engine_core.py:1135 — `debug` at line 1135 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 omlx/engine_core.py:1184 — `warning` at line 1184 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 omlx/engine_core.py:1239 — `info` at line 1239 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 omlx/engine_core.py:1344 — `debug` at line 1344 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 omlx/engine_core.py:1500 — `debug` at line 1500 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 omlx/engine_pool.py:1607 — `info` at line 1607 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 omlx/engine_pool.py:1633 — `warning` at line 1633 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 omlx/engine_pool.py:1635 — `info` at line 1635 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 omlx/engine_pool.py:1669 — `info` at line 1669 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 omlx/engine_pool.py:1686 — `warning` at line 1686 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 omlx/engine_pool.py:1689 — `info` at line 1689 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 omlx/engine_pool.py:2836 — `info` at line 2836 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 omlx/engine_pool.py:2943 — `info` at line 2943 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 omlx/engine_pool.py:2959 — `info` at line 2959 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 omlx/engine_pool.py:2989 — `info` at line 2989 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 omlx/engine_pool.py:3006 — `warning` at line 3006 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 omlx/engine_pool.py:3213 — `debug` at line 3213 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 omlx/engine_pool.py:3773 — `warning` at line 3773 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 omlx/engine_pool.py:3796 — `info` at line 3796 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 omlx/engine_pool.py:3820 — `error` at line 3820 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 omlx/engine_pool.py:3827 — `warning` at line 3827 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.
X7 · Silent fallback defaults · Silent fallback default on parse failure · ×21
  • Silent fallback default on parse failure apps/omlx-cuda-helper/omlx_cuda_helper/gpus.py:122 — `_interfaces` 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 apps/omlx-cuda-helper/omlx_cuda_helper/gpus.py:162 — `links` 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 apps/omlx-cuda-helper/omlx_cuda_helper/state.py:19 — `_read` returns `{}` when `(OSError, 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 omlx/admin/external_api.py:284 — `_usage_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 REDACTED:1162 — `_get_param_count` 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 omlx/admin/ms_downloader.py:156 — `_estimate_params_from_config` 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 omlx/cache/boundary_snapshot_store.py:1806 — `_read_state_tuple_raw` returns `[]` when `(ValueError, TypeError)` 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 omlx/cache/boundary_snapshot_store.py:1963 — `_read_state_tuple_arrays` returns `[]` when `(ValueError, TypeError)` 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 omlx/cache/paged_ssd_cache.py:3147 — `_gdn_state_dtype_from_signature` returns `'fp32'` 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 omlx/cluster/autoconfigure.py:946 — `_dispatch_rules` returns `()` when `(OSError, SyntaxError, 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 omlx/cluster/autoconfigure.py:1106 — `_model_config` returns `{}` when `(OSError, 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 REDACTED:416 — `_distribution_versions` returns `{}` when `(OSError, subprocess.SubprocessError, 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 omlx/cluster/inference_worker.py:661 — `_distributed_model_type` returns `''` when `(OSError, 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 omlx/cluster/probe.py:147 — `_system_memory_bytes` returns `0` when `(AttributeError, OSError, 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 omlx/cluster/probe.py:207 — `parse_linux_rdma_links` returns `{}` when `(TypeError, 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 omlx/cluster/probe.py:305 — `parse_thunderbolt_ports` returns `()` when `(TypeError, 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 omlx/engine/vlm.py:3142 — `_video_cache_key_ranges` returns `[]` when `(AttributeError, TypeError, ValueError, IndexError)` 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 omlx/engine/vlm.py:1082 — `matches` (in `_model_shard_matcher`) returns `False` when `(TypeError, OSError, RuntimeError)` 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 omlx/engine_pool.py:192 — `_positive_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 omlx/patches/mlx_vlm_glm5_next_compat/vendor/mlx_vlm/models/glm5_next/language.py:789 — `_small_selector_ok` returns `False` when `(AttributeError, RuntimeError, 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 omlx/prefill_helper/manager.py:826 — `_load_speeds` returns `{}` when `(OSError, 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.
X7 · Silent fallback defaults · Silent fallback default in catch · ×19
  • Silent fallback default in catch apps/omlx-web/omlx_web/routes.py:73 — `_load_locale` 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 omlx/admin/routes.py:9819 — `_read_update_channel` swallows every exception into `return 'stable'` — 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 omlx/cluster/autoconfigure.py:1078 — `_distributions_by_module` 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 REDACTED:2247 — `announced_caps` 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 REDACTED:802 — `_allowed_model_roots` 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 omlx/cluster/node_role.py:223 — `_enforcer_ceiling_bytes` 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 REDACTED:937 — `local_addrs` 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 omlx/cluster/probe.py:81 — `available` (in `detect_accelerator_hardware`) swallows every exception into `return False` — 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 omlx/engine_pool.py:1131 — `_current_ceiling` 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 omlx/engine_pool.py:1148 — `_fallback_admission_ceiling` 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 omlx/engine_pool.py:1164 — `_residency_ceiling` 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 omlx/engine_pool.py:1181 — `_admission_soft_target` 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 REDACTED:412 — `_get_process_rss` 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 REDACTED:2121 — `_ane_prefill_transient_bytes` 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 REDACTED:4363 — `_system_available_memory_bytes` 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 omlx/patches/mlx_vlm_qwen4_exp_compat/vendor/mlx_vlm/models/qwen4_exp/attn_fused.py:494 — `_gpu_class` 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 omlx/patches/mlx_vlm_qwen4_exp_compat/vendor/mlx_vlm/models/qwen4_exp/hc_fused.py:933 — `_gpu_class` 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 omlx/patches/mlx_vlm_qwen4_exp_compat/vendor/mlx_vlm/models/qwen4_exp/qsa_fast.py:533 — `_gpu_class` 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 omlx/patches/qwen35_verify_sdpa_split.py:99 — `_gpu_class` 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.
D29 · Static Analysis (SAST) · REDACTED · ×10
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D34 · Knowledge Freshness · Orphaned file · ×8
  • Orphaned file omlx/models/qwen2_embedding.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 apps/omlx-mac/Sources/AppView/ViewModels/AccuracyBenchScreenVM.swift: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 omlx/patches/mimo_v2/fused_qkv_layout.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 apps/omlx-mac/Sources/AppView/ViewModels/StatusScreenVM.swift: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 omlx/eval/bbq.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 omlx/eval/mmlu_pro.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 omlx/eval/safetybench.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 omlx/eval/mathqa.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.
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×3
  • Projects may be oversized for their cohesion REDACTED:1 — `(repository root)` (290487 LoC, 1827 module-visible types across 72 directories) overshoots its size bounds. 3 of 3 build unit(s) (Python, Xcode) overshoot their size bounds, lowering Project Cohesion to 0.0/10. 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.
  • Projects may be oversized for their cohesion apps/omlx-mac/oMLX.xcodeproj/project.pbxproj:1 — `apps/omlx-mac` (44016 LoC, 497 module-visible types across 16 directories) overshoots its size bounds. 3 of 3 build unit(s) (Python, Xcode) overshoot their size bounds, lowering Project Cohesion to 0.0/10. 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.
  • Projects may be oversized for their cohesion apps/omlx-cuda-helper/REDACTED:1 — `apps/omlx-cuda-helper` (13645 LoC, 121 module-visible types across 8 directories) overshoots its size bounds. 3 of 3 build unit(s) (Python, Xcode) overshoot their size bounds, lowering Project Cohesion to 0.0/10. 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.
D29 · Static Analysis (SAST) · REDACTED · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D16 · Bus Factor · Off-boarding risk · ×2
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 55 significant file(s) lose their only recent owner: omlx/patches/deepseek_v41/kernels.py, omlx/patches/mlx_vlm_mtp/inkling_vlm_runtime.py, omlx/admin/context_benchmark.py, apps/omlx-mac/Sources/App/AppDelegate.swift, omlx/patches/qwen35_packed_linear.py, omlx/admin/hf_uploader.py, omlx/models/d3.py, omlx/websearch.py (+47 more). Pair on, review, or document these before any departure.
  • Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 3 significant file(s) lose their only recent owner: omlx/custom_kernels/nax_tiles.py, omlx/utils/fast_attention.py, omlx/utils/layer_pipeline.py. Pair on, review, or document these before any departure.
X23 · Unguarded diagnostic materialisation · Diagnostic log message is built whether or not it is wanted · ×2
  • Diagnostic log message is built whether or not it is wanted omlx/cache/paged_ssd_cache.py:3205 — `debug` at line 3205 is called with an argument built by `sorted(_READABLE_CACHE_FORMAT_VERSIONS)` (line 3209), whose cost grows with the collection it walks. Python evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isEnabledFor(logging.DEBUG)` test, no debug flag, no `lambda` the logger calls only when the level is on.
  • Diagnostic log message is built whether or not it is wanted omlx/cache/vision_feature_cache.py:247 — `debug` at line 247 is called with an argument built by `{ k : v for k, v in self._stats.items() if v > 0 }` (line 249), whose cost grows with the collection it walks. Python evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isEnabledFor(logging.DEBUG)` test, no debug flag, no `lambda` the logger calls only when the level is on.
D16 · Bus Factor · Further sole-owners (lower concentration) · ×1
  • Further sole-owners (lower concentration) — 9 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 (69 single-owned of 600 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; 600 of the 694 production source files in this repository met that bar). They are anonymized user #3 (2 file(s)), anonymized user #4 (2 file(s)), anonymized user #5 (1 file(s)), anonymized user #6 (1 file(s)), anonymized user #7 (1 file(s)), anonymized user #8 (1 file(s)) (+3 more) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: omlx/cluster/node_role.py, omlx/cluster/ssh_policy.py, omlx/patches/mlx_lm_mtp/context_copy.py, omlx/patches/module_cache.py, omlx/patches/qwen38_modelopt_mixed.py, omlx/patches/mlx_lm_mtp/nemotron_h_model.py, omlx/patches/bailing_hybrid/swiglu_clamp.py, apps/omlx-mac/Scripts/check_custom_kernel_python_abi.py (+3 more).
D20 · ADR Quality · No ADRs found · ×1
  • No ADRs found REDACTED:225 — 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/`. ADRs are expected here because `REDACTED` makes this repository a deployable product (line 225).
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 — 8 of 600 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; 600 of the 694 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: omlx/models/qwen2_embedding.py, apps/omlx-mac/Sources/AppView/ViewModels/AccuracyBenchScreenVM.swift, omlx/patches/mimo_v2/fused_qkv_layout.py, apps/omlx-mac/Sources/AppView/ViewModels/StatusScreenVM.swift, omlx/eval/bbq.py, omlx/eval/mmlu_pro.py, omlx/eval/safetybench.py, omlx/eval/mathqa.py. 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
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
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.
P3 · Security & performance tooling · No SAST · ×1
  • No SAST REDACTED:6 — 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 5 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.
P4 · Deployment & Rollback · No release approval gate · ×1
  • No release approval gate — The release is automated and no gate that pauses it for a human is DECLARED IN THIS REPOSITORY'S PIPELINE FILES. What was read: every file under `.github/workflows/`, `.forgejo/workflows/`, `.gitea/workflows/`, `.azuredevops/` and `.azure-pipelines/`, plus `.gitlab-ci*` and `azure-pipelines*` — with comment text stripped, so documenting a gate is not declaring one. What would have counted: GitLab's `when: manual`, CircleCI's `type: approval`, an Azure `ManualValidation@` task or an `approvals:` block, a Jenkins `input` step, a `uses:` step naming an approval action, an `environment:` paired with `reviewers` / `required_reviewers` / `protection` / `wait-timer` / `deployment_branch_policy`, a draft-release step, a `workflow_dispatch` promotion, or a release-event gate. ★ What this cannot see, because none of it is a file: a GitHub environment whose required reviewers are configured in repo SETTINGS, a branch protection rule, or an organisation deployment policy — all of them real, enforced gates that live outside the repository. If yours is one of those, this row is wrong and nothing in the tree could have told us. Otherwise: whatever the release trigger points at is published to users unreviewed, so a mistagged or unverified commit ships and the only remedy is a follow-up release.
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.)
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/109 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 · Ruby's type checker does not check nil everywhere · ×1
  • Ruby's type checker does not check nil everywhere — This repository commits no Sorbet configuration (`sorbet/config`) and no `Steepfile`, so nothing type-checks its 1 Ruby product file(s): a nilable value reaches a method call silently and raises `NoMethodError: undefined method … for nil` the first time it is nil. A `# typed:` sigil does nothing without a `sorbet/config` beside the code; a Steep run configured only on a command line is not something this check can read.

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 --log-opts "--full-history --all --skip=0 --max-count=200" --report-format json --report-path /tmp/watchdog-gitleaks-0881dfc8240848deba4d33243506bbe0/history.json --exit-code 0 --source .0artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=200 --max-count=800" --report-format json --report-path /tmp/watchdog-gitleaks-0881dfc8240848deba4d33243506bbe0/history-1.json --exit-code 0 --source .0artifacts/raw/gitleaks-history-1.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=1000 --max-count=2465" --report-format json --report-path /tmp/watchdog-gitleaks-0881dfc8240848deba4d33243506bbe0/history-2.json --exit-code 0 --source .0artifacts/raw/gitleaks-history-2.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=3465 --max-count=106" --report-format json --report-path /tmp/watchdog-gitleaks-0881dfc8240848deba4d33243506bbe0/history-3.json --exit-code 0 --source .0artifacts/raw/gitleaks-history-3.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=3571 --max-count=106" --report-format json --report-path /tmp/watchdog-gitleaks-0881dfc8240848deba4d33243506bbe0/history-4.json --exit-code 0 --source .0artifacts/raw/gitleaks-history-4.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-0881dfc8240848deba4d33243506bbe0/tree.json --exit-code 0 --source .0artifacts/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 .57artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiesnone (dependency manifest found, not scanned for vulnerabilities here)—none (dependency manifest found, not scanned for vulnerabilities here): not applicable — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Python REDACTED/requirements.txt (pip/uv/Poetry) — not scanned yet).0—
D31 · IaC & Container Securitytrivy—trivy config --format json --quiet .6artifacts/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 26 file(s) — `apps/omlx-mac/Sources/AppView/AppView.swift`, `apps/omlx-mac/Sources/AppView/Screens/AppearanceScreen.swift`, `apps/omlx-mac/Sources/AppView/Screens/ModelSettingsScreen.swift`, `apps/omlx-mac/Sources/AppView/Utils/LogRecords.swift`, `apps/omlx-mac/Sources/AppView/ViewModels/IntegrationsScreenVM.swift`, … (+21 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.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 Dependenciesnone (dependency manifest found, not scanned for vulnerabilities here)—none (dependency manifest found, not scanned for vulnerabilities here): not applicable — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Python REDACTED/requirements.txt (pip/uv/Poetry) — not scanned yet).0—

Run 01a1e71c-af60-7036-9e30-aa7d89767b55 · 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