Public report of marimo-team/marimo, 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 reportMeasured 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, 13:45 UTC · Survey ID cd_1b4591b26d974244b71fb341606d402d
marimo-team/marimo
Measured 17 November 2026, 13:42 UTC, at code version 18a1747
Test reliability is not measured: The python executor ran against the .py half and did not finish re-running within its tier budget.
CAI scoreAt riskUp 4.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: 394,602 lines of product code in 11 projects, tests not counted · Estimated rebuild effort: about 4.9 person-years · Weakest lens: Production Readiness, 35.0
Findings by how serious they are
91 critical1981 serious363 minor
12 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
Canine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
17 November 2026, 13:42 UTC
A measurement, not a certificate. The Code Assurance Index records a number
together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee
the code. The standard was written by Canine Development, which also builds the Canine Code Analyzer. It is open to any tool that
implements it, and today the Canine Code Analyzer is the only one that does.
A critical security finding is open, such as a library with a known critical vulnerability or a password or key found in the code. The score itself is unchanged, but its band shows At risk until the finding is fixed. See the Security and Compliance lens.
The score is deterministic, which means the same code always gets the same score. We work it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸
82of 82 dimensions measured by tools.
2416of 2435 findings point to an exact file and line, so you can open each one in the code. The other 19 concern the repository as a whole, such as missing documentation.
82dimensions across 7 lenses, read from 394,602 lines of product code in 11 projects.
marimo-team/marimo is rated At risk because critical security findings are open. It scores 47.5 out of 100, which the At risk rating leaves unchanged. We judged it as a preview release, against a lower bar.
Production Readiness, at 35.0, is the weakest lens and counts most in the score. The best first step is fixing the password or key in the code, worth about 8.7 points. Tidying the declared packages would lift Production Readiness itself, worth about 5.5 points. Raising Production Readiness to 62 would lift the score to about 56.6.
Twenty-three known security holes in the packages the code depends on can be used by attackers. Fifteen places in the code run text as code, which an attacker could use, and twenty-four controls can't be used without a mouse. Updating the vulnerable packages, replacing text run as code with direct calls and making the controls work with a keyboard would close these risks. Limiting each secret to its own step would fix the three secrets exposed to more of the pipeline than needed, and pinning each tool to an exact version would deal with the two pipeline tools referenced by a changeable name. The eight loops of files that import each other need breaking.
The product code is 394,602 lines, about €720,000 to rebuild.
A lens is capped at Adequate while one of its dimensions scores below 4 out of 10, however well the rest of the lens does. That way a serious problem in one place always shows in the lens's rating.
How the score is built: what each lens counts forThe 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.
If Production Readiness rose from 35.0 to 62, the lowest score rated Strong, the score would rise from 47.5 to about 56.6.
Code composition: what the lines of code are
Product code 50%Tests 50%
New since the last survey: 258 findings
These 258 critical or serious findings weren't in the previous survey, on 5 November 2026. The first 100 are listed here, and the findings file in the download package lists them all.
God Classes · FunctionTooLong: glide-data-editor.GlideDataEditorInner frontend/src/plugins/impl/data-editor/glide-data-editor.tsx
God Classes · FunctionTooLong: model-discovery.ModelDiscovery frontend/src/components/app-config/model-discovery.tsx
God Classes · FileTooLong: _save/cache_dirs.py marimo/_save/cache_dirs.py
God Classes · FunctionTooLong: pending-ai-cells.PendingAICells frontend/src/components/editor/chrome/wrapper/pending-ai-cells.tsx
God Classes · FileTooLong: wasm/bridge.ts frontend/src/core/wasm/bridge.ts
God Classes · FunctionTooLong: sidebar.Sidebar frontend/src/components/editor/chrome/wrapper/sidebar.tsx
God Classes · FileTooLong: _pyodide/pyodide_session.py marimo/_pyodide/pyodide_session.py
God Classes · FileTooLong: endpoints/ai.py marimo/_server/api/endpoints/ai.py
God Classes · FileTooLong: _pyodide/notebook.py marimo/_pyodide/notebook.py
Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) marimo/_messaging/streams.py
Code Duplication · Edited copy of a member (109 corresponding lines) marimo/_plugins/ui/_impl/input.py
Code Duplication · Edited copy of a member (77 corresponding lines) marimo/_server/api/dependency_tree.py
Code Duplication · Edited copy of a member (66 corresponding lines) marimo/_server/api/endpoints/packages.py
Code Duplication · Edited copy of a member (50 corresponding lines) marimo/_data/_external_storage/huggingface.py
Code Duplication · Edited copy of a member (41 corresponding lines) marimo/_runtime/packages/_micropip_streaming.py
Code Duplication · Edited copy of a member (32 corresponding lines) marimo/_data/series.py
Code Duplication · Edited copy of a member (27 corresponding lines) marimo/_runtime/runner/by_refs.py
Code Duplication · Edited copies of one member (3 members, 54+ corresponding lines) marimo/_runtime/callbacks/datasets.py
Code Duplication · Edited copy of a member (29 corresponding lines) marimo/_runtime/app/script_runner.py
Code Duplication · Edited copy of a member (21 corresponding lines) docs/scripts/html_to_markdown.py
Code Duplication · Edited copy of a member (46 corresponding lines) marimo/_sql/utils.py
Code Duplication · Edited copy of a member (19 corresponding lines) marimo/_runtime/executor/evaluator.py
Code Duplication · Edited copy of a member (24 corresponding lines) marimo/_server/host/record.py
Code Duplication · Edited copy of a member (27 corresponding lines) marimo/_plugins/ui/_impl/table.py
Code Duplication · Edited copy of a member (66 corresponding lines) marimo/_server/templates/api.py
Code Duplication · Edited copy of a member (29 corresponding lines) marimo/_cli/cli.py
Code Duplication · Edited copy of a member (43 corresponding lines) marimo/_sql/engines/adbc.py
Code Duplication · Edited copy of a member (14 corresponding lines) REDACTED
Code Duplication · Edited copy of a member (18 corresponding lines) marimo/_server/host/api.py
Code Duplication · Edited copy of a member (13 corresponding lines) frontend/e2e-tests/py/kitchen_sink.py
Code Duplication · Edited copy of a member (19 corresponding lines) marimo/_snippets/data/matplotlib-0.py
Code Duplication · Edited copy of a member (23 corresponding lines) marimo/_ai/_tools/base.py
Code Duplication · Edited copy of a member (22 corresponding lines) marimo/_environments/backends.py
Code Duplication · Edited copy of a member (19 corresponding lines) marimo/_messaging/streams.py
Code Duplication · Edited copy of a member (23 corresponding lines) marimo/_snippets/data/altair-4.py
Code Duplication · Edited copy of a member (28 corresponding lines) marimo/_server/router.py
Code Duplication · Edited copy of a member (23 corresponding lines) marimo/_ai/llm/_impl.py
Code Duplication · Edited copy of a member (18 corresponding lines) marimo/_runtime/_wasm/_concurrency/_mp_queue.py
Code Duplication · Edited copy of a member (24 corresponding lines) marimo/_runtime/params.py
Code Duplication · Edited copy of a member (13 corresponding lines) marimo/_core/host.py
Code Duplication · Edited copy of a member (22 corresponding lines) marimo/_runtime/_wasm/_patches.py
Code Duplication · Edited copies of one member (3 members, 34+ corresponding lines) marimo/_snippets/data/polars-11.py
Code Duplication · Edited copy of a member (21 corresponding lines) marimo/_data/charts.py
Code Duplication · Edited copy of a member (14 corresponding lines) marimo/_environments/sandbox.py
Code Duplication · Edited copy of a member (21 corresponding lines) marimo/_messaging/notification_utils.py
Code Duplication · Edited copy of a member (15 corresponding lines) marimo/_cli/help_formatter.py
Code Duplication · Edited copy of a member (19 corresponding lines) marimo/_runtime/watch/_directory.py
Code Duplication · Edited copy of a member (12 corresponding lines) marimo/_environments/script_metadata.py
Code Duplication · Edited copy of a member (17 corresponding lines) marimo/_export/_pdf_raster.py
Code Duplication · Edited copy of a member (23 corresponding lines) marimo/_convert/markdown/flavor/base.py
Code Duplication · Edited copy of a member (14 corresponding lines) marimo/_snippets/data/altair-5.py
Code Duplication · Edited copy of a member (15 corresponding lines) marimo/_environments/environment.py
Code Duplication · Edited copy of a member (18 corresponding lines) marimo/_runtime/packages/conda_package_manager.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: 421 findings
These 421 critical or serious findings were in the previous survey, on 5 November 2026, and are gone from this one. The first 100 are listed here.
€240,000 to €1,200,000, for 3,967 to 12,584 hours of work, about 4.9 person-years for 2 to 10 engineers
Difficulty of the problem
Standard, 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 47. 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.
Size
Large: 394,602 lines of product code
What it is not
Not 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 8.7 points · Low effort · Secret Scanning
2
Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.
Raises the score by about 5.5 points · Medium effort · Dependency Hygiene
3
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
Raises the score by about 3.5 points · Medium effort · Keyboard semantics
Diagnosis: what the measurements show together
Each conclusion below combines several dimensions into one point that no single dimension shows, and lists the measurements it rests on.
Where the investment is most exposed · Value at risk
This code would cost about €720,000 to build again, about 4.9 person-years of work. Its weakest lens is Production Readiness, at 35.0 (Weak). Production Readiness is about whether the product is ready to run in production and to change without breaking. Because the weakest lens counts most in the score, work on Production Readiness also moves the score most.
Based on: the rebuild estimate · the Production Readiness grade · how much each lens counts
What to do: Start with the Production Readiness actions in Top priorities.
If you do one thing first · First action
Resolve the 1 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 8.7 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 7.3 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 2% to 5% on every change. The history of the code shows how much it changes: about 386,076 lines over the last 90 days, which is about 1,565,753 lines a year. At that pace, the extra work comes to an estimated 78.3 to 521.9 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 — module dependency graph
Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways, which only happens where the projects form a dependency cycle. A graph without cycles has none.
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.
1476 modules, with 1727 dependencies between them. 7 loops run through 23 of the modules, marked above the diagonal.
The table shows the 40 modules with the most connections; 1436 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.
frontend.src.plugins.impl.DictPlugin uses frontend.src.plugins.impl.anywidget.AnyWidgetPlugin, so a change to frontend.src.plugins.impl.anywidget.AnyWidgetPlugin can break frontend.src.plugins.impl.DictPlugin, while a change to frontend.src.plugins.impl.DictPlugin can't break frontend.src.plugins.impl.anywidget.AnyWidgetPlugin.
Position
Below the diagonal: frontend.src.plugins.impl.DictPlugin uses a module listed above it, which is the healthy direction.
frontend.src.plugins.impl.DictPlugin uses frontend.src.plugins.types, so a change to frontend.src.plugins.types can break frontend.src.plugins.impl.DictPlugin, while a change to frontend.src.plugins.impl.DictPlugin can't break frontend.src.plugins.types.
Position
Below the diagonal: frontend.src.plugins.impl.DictPlugin uses a module listed above it, which is the healthy direction.
frontend.src.plugins.impl.data-editor.types uses packages.llm-info.src, so a change to packages.llm-info.src can break frontend.src.plugins.impl.data-editor.types, while a change to frontend.src.plugins.impl.data-editor.types can't break packages.llm-info.src.
Position
Below the diagonal: frontend.src.plugins.impl.data-editor.types uses a module listed above it, which is the healthy direction.
marimo._config.manager uses marimo._config.config_schema, so a change to marimo._config.config_schema can break marimo._config.manager, while a change to marimo._config.manager can't break marimo._config.config_schema.
Position
Below the diagonal: marimo._config.manager uses a module listed above it, which is the healthy direction.
21→31 marimo._lint.rules.base uses marimo._lint.contextpart of a loop✕
Connections
1 pair of types, where a type in marimo._lint.rules.base uses a type in marimo._lint.context.
marimo._lint.rules.base uses marimo._lint.context, so a change to marimo._lint.context can break marimo._lint.rules.base, while a change to marimo._lint.rules.base can't break marimo._lint.context.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
marimo._plugins.ui._core.ui_element uses marimo._output.hypertext, so a change to marimo._output.hypertext can break marimo._plugins.ui._core.ui_element, while a change to marimo._plugins.ui._core.ui_element can't break marimo._output.hypertext.
Position
Below the diagonal: marimo._plugins.ui._core.ui_element uses a module listed above it, which is the healthy direction.
marimo._runtime.runtime uses marimo._config.config_schema, so a change to marimo._config.config_schema can break marimo._runtime.runtime, while a change to marimo._runtime.runtime can't break marimo._config.config_schema.
Position
Below the diagonal: marimo._runtime.runtime uses a module listed above it, which is the healthy direction.
marimo._runtime.runtime uses marimo._core.protocol, so a change to marimo._core.protocol can break marimo._runtime.runtime, while a change to marimo._runtime.runtime can't break marimo._core.protocol.
Position
Below the diagonal: marimo._runtime.runtime uses a module listed above it, which is the healthy direction.
marimo._runtime.runtime uses marimo._runtime.commands, so a change to marimo._runtime.commands can break marimo._runtime.runtime, while a change to marimo._runtime.runtime can't break marimo._runtime.commands.
Position
Below the diagonal: marimo._runtime.runtime uses a module listed above it, which is the healthy direction.
24→33 marimo._save.cache uses marimo._runtime.context.typespart of a loop✕
Connections
1 pair of types, where a type in marimo._save.cache uses a type in marimo._runtime.context.types.
marimo._save.cache uses marimo._runtime.context.types, so a change to marimo._runtime.context.types can break marimo._save.cache, while a change to marimo._save.cache can't break marimo._runtime.context.types.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
marimo._server.api.endpoints uses marimo._config.config_schema, so a change to marimo._config.config_schema can break marimo._server.api.endpoints, while a change to marimo._server.api.endpoints can't break marimo._config.config_schema.
Position
Below the diagonal: marimo._server.api.endpoints uses a module listed above it, which is the healthy direction.
marimo._session.notebook.file_manager uses marimo._schemas.serialization, so a change to marimo._schemas.serialization can break marimo._session.notebook.file_manager, while a change to marimo._session.notebook.file_manager can't break marimo._schemas.serialization.
Position
Below the diagonal: marimo._session.notebook.file_manager uses a module listed above it, which is the healthy direction.
frontend.src.components.data-table uses frontend.src.components.data-table.cell-selection.types, so a change to frontend.src.components.data-table.cell-selection.types can break frontend.src.components.data-table, while a change to frontend.src.components.data-table can't break frontend.src.components.data-table.cell-selection.types.
Position
Below the diagonal: frontend.src.components.data-table uses a module listed above it, which is the healthy direction.
frontend.src.components.data-table uses frontend.src.components.ui.kbd, so a change to frontend.src.components.ui.kbd can break frontend.src.components.data-table, while a change to frontend.src.components.data-table can't break frontend.src.components.ui.kbd.
Position
Below the diagonal: frontend.src.components.data-table uses a module listed above it, which is the healthy direction.
frontend.src.components.data-table uses frontend.src.plugins.impl.DictPlugin, so a change to frontend.src.plugins.impl.DictPlugin can break frontend.src.components.data-table, while a change to frontend.src.components.data-table can't break frontend.src.plugins.impl.DictPlugin.
Position
Below the diagonal: frontend.src.components.data-table uses a module listed above it, which is the healthy direction.
frontend.src.components.ui uses frontend.src.plugins.impl.DictPlugin, so a change to frontend.src.plugins.impl.DictPlugin can break frontend.src.components.ui, while a change to frontend.src.components.ui can't break frontend.src.plugins.impl.DictPlugin.
Position
Below the diagonal: frontend.src.components.ui uses a module listed above it, which is the healthy direction.
frontend.src.hooks uses frontend.src.components.ui.kbd, so a change to frontend.src.components.ui.kbd can break frontend.src.hooks, while a change to frontend.src.hooks can't break frontend.src.components.ui.kbd.
Position
Below the diagonal: frontend.src.hooks uses a module listed above it, which is the healthy direction.
frontend.src.hooks uses frontend.src.plugins.impl.DictPlugin, so a change to frontend.src.plugins.impl.DictPlugin can break frontend.src.hooks, while a change to frontend.src.hooks can't break frontend.src.plugins.impl.DictPlugin.
Position
Below the diagonal: frontend.src.hooks uses a module listed above it, which is the healthy direction.
frontend.src.plugins.impl uses frontend.src.components.ui.kbd, so a change to frontend.src.components.ui.kbd can break frontend.src.plugins.impl, while a change to frontend.src.plugins.impl can't break frontend.src.components.ui.kbd.
Position
Below the diagonal: frontend.src.plugins.impl uses a module listed above it, which is the healthy direction.
frontend.src.plugins.impl uses frontend.src.plugins.impl.anywidget.AnyWidgetPlugin, so a change to frontend.src.plugins.impl.anywidget.AnyWidgetPlugin can break frontend.src.plugins.impl, while a change to frontend.src.plugins.impl can't break frontend.src.plugins.impl.anywidget.AnyWidgetPlugin.
Position
Below the diagonal: frontend.src.plugins.impl uses a module listed above it, which is the healthy direction.
frontend.src.plugins.impl uses frontend.src.plugins.types, so a change to frontend.src.plugins.types can break frontend.src.plugins.impl, while a change to frontend.src.plugins.impl can't break frontend.src.plugins.types.
Position
Below the diagonal: frontend.src.plugins.impl uses a module listed above it, which is the healthy direction.
frontend.src.plugins.impl uses frontend.src.plugins.impl.DictPlugin, so a change to frontend.src.plugins.impl.DictPlugin can break frontend.src.plugins.impl, while a change to frontend.src.plugins.impl can't break frontend.src.plugins.impl.DictPlugin.
Position
Below the diagonal: frontend.src.plugins.impl uses a module listed above it, which is the healthy direction.
marimo._lint.context uses marimo._runtime.dataflow.graph, so a change to marimo._runtime.dataflow.graph can break marimo._lint.context, while a change to marimo._lint.context can't break marimo._runtime.dataflow.graph.
Position
Below the diagonal: marimo._lint.context uses a module listed above it, which is the healthy direction.
marimo._lint.context uses marimo._lint.rules.base, so a change to marimo._lint.rules.base can break marimo._lint.context, while a change to marimo._lint.context can't break marimo._lint.rules.base.
Position
Below the diagonal: marimo._lint.context uses a module listed above it, which is the healthy direction.
marimo._runtime uses marimo._config.config_schema, so a change to marimo._config.config_schema can break marimo._runtime, while a change to marimo._runtime can't break marimo._config.config_schema.
Position
Below the diagonal: marimo._runtime uses a module listed above it, which is the healthy direction.
marimo._runtime uses marimo._runtime.commands, so a change to marimo._runtime.commands can break marimo._runtime, while a change to marimo._runtime can't break marimo._runtime.commands.
Position
Below the diagonal: marimo._runtime uses a module listed above it, which is the healthy direction.
marimo._runtime uses marimo._runtime.dataflow.graph, so a change to marimo._runtime.dataflow.graph can break marimo._runtime, while a change to marimo._runtime can't break marimo._runtime.dataflow.graph.
Position
Below the diagonal: marimo._runtime uses a module listed above it, which is the healthy direction.
marimo._runtime uses marimo._runtime.runtime, so a change to marimo._runtime.runtime can break marimo._runtime, while a change to marimo._runtime can't break marimo._runtime.runtime.
Position
Below the diagonal: marimo._runtime uses a module listed above it, which is the healthy direction.
marimo._runtime.context.types uses marimo._config.config_schema, so a change to marimo._config.config_schema can break marimo._runtime.context.types, while a change to marimo._runtime.context.types can't break marimo._config.config_schema.
Position
Below the diagonal: marimo._runtime.context.types uses a module listed above it, which is the healthy direction.
marimo._runtime.context.types uses marimo._runtime.dataflow.graph, so a change to marimo._runtime.dataflow.graph can break marimo._runtime.context.types, while a change to marimo._runtime.context.types can't break marimo._runtime.dataflow.graph.
Position
Below the diagonal: marimo._runtime.context.types uses a module listed above it, which is the healthy direction.
marimo._runtime.context.types uses marimo._save.cache, so a change to marimo._save.cache can break marimo._runtime.context.types, while a change to marimo._runtime.context.types can't break marimo._save.cache.
Position
Below the diagonal: marimo._runtime.context.types uses a module listed above it, which is the healthy direction.
marimo._session.types uses marimo._session.model, so a change to marimo._session.model can break marimo._session.types, while a change to marimo._session.types can't break marimo._session.model.
Position
Below the diagonal: marimo._session.types uses a module listed above it, which is the healthy direction.
marimo._session.types uses marimo._config.manager, so a change to marimo._config.manager can break marimo._session.types, while a change to marimo._session.types can't break marimo._config.manager.
Position
Below the diagonal: marimo._session.types uses a module listed above it, which is the healthy direction.
marimo._session.types uses marimo._session.notebook.file_manager, so a change to marimo._session.notebook.file_manager can break marimo._session.types, while a change to marimo._session.types can't break marimo._session.notebook.file_manager.
Position
Below the diagonal: marimo._session.types uses a module listed above it, which is the healthy direction.
marimo._save uses marimo._runtime.dataflow.graph, so a change to marimo._runtime.dataflow.graph can break marimo._save, while a change to marimo._save can't break marimo._runtime.dataflow.graph.
Position
Below the diagonal: marimo._save uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in marimo._save uses a type in marimo._save.cache.
The types involved
marimo._save.hash → marimo._save.cache.Cache
Direction
marimo._save uses marimo._save.cache, so a change to marimo._save.cache can break marimo._save, while a change to marimo._save can't break marimo._save.cache.
Position
Below the diagonal: marimo._save uses a module listed above it, which is the healthy direction.
marimo._save uses marimo._runtime.context.types, so a change to marimo._runtime.context.types can break marimo._save, while a change to marimo._save can't break marimo._runtime.context.types.
Position
Below the diagonal: marimo._save uses a module listed above it, which is the healthy direction.
marimo._server.session_manager uses marimo._session.model, so a change to marimo._session.model can break marimo._server.session_manager, while a change to marimo._server.session_manager can't break marimo._session.model.
Position
Below the diagonal: marimo._server.session_manager uses a module listed above it, which is the healthy direction.
marimo._server.session_manager uses marimo._config.manager, so a change to marimo._config.manager can break marimo._server.session_manager, while a change to marimo._server.session_manager can't break marimo._config.manager.
Position
Below the diagonal: marimo._server.session_manager uses a module listed above it, which is the healthy direction.
marimo._server.session_manager uses marimo._session.notebook.file_manager, so a change to marimo._session.notebook.file_manager can break marimo._server.session_manager, while a change to marimo._server.session_manager can't break marimo._session.notebook.file_manager.
Position
Below the diagonal: marimo._server.session_manager uses a module listed above it, which is the healthy direction.
marimo._server.session_manager uses marimo._session.types, so a change to marimo._session.types can break marimo._server.session_manager, while a change to marimo._server.session_manager can't break marimo._session.types.
Position
Below the diagonal: marimo._server.session_manager uses a module listed above it, which is the healthy direction.
marimo._ai._tools.base uses marimo._messaging.notification, so a change to marimo._messaging.notification can break marimo._ai._tools.base, while a change to marimo._ai._tools.base can't break marimo._messaging.notification.
Position
Below the diagonal: marimo._ai._tools.base uses a module listed above it, which is the healthy direction.
marimo._ai._tools.base uses marimo._session.types, so a change to marimo._session.types can break marimo._ai._tools.base, while a change to marimo._ai._tools.base can't break marimo._session.types.
Position
Below the diagonal: marimo._ai._tools.base uses a module listed above it, which is the healthy direction.
marimo._ai._tools.base uses marimo._server.session_manager, so a change to marimo._server.session_manager can break marimo._ai._tools.base, while a change to marimo._ai._tools.base can't break marimo._server.session_manager.
Position
Below the diagonal: marimo._ai._tools.base uses a module listed above it, which is the healthy direction.
marimo._server uses marimo._config.config_schema, so a change to marimo._config.config_schema can break marimo._server, while a change to marimo._server can't break marimo._config.config_schema.
Position
Below the diagonal: marimo._server uses a module listed above it, which is the healthy direction.
marimo._server uses marimo._messaging.notification, so a change to marimo._messaging.notification can break marimo._server, while a change to marimo._server can't break marimo._messaging.notification.
Position
Below the diagonal: marimo._server uses a module listed above it, which is the healthy direction.
marimo._server uses marimo._runtime.commands, so a change to marimo._runtime.commands can break marimo._server, while a change to marimo._server can't break marimo._runtime.commands.
Position
Below the diagonal: marimo._server uses a module listed above it, which is the healthy direction.
marimo._server uses marimo._session.model, so a change to marimo._session.model can break marimo._server, while a change to marimo._server can't break marimo._session.model.
Position
Below the diagonal: marimo._server uses a module listed above it, which is the healthy direction.
marimo._server uses marimo._session.types, so a change to marimo._session.types can break marimo._server, while a change to marimo._server can't break marimo._session.types.
Position
Below the diagonal: marimo._server uses a module listed above it, which is the healthy direction.
marimo._server uses marimo._server.session_manager, so a change to marimo._server.session_manager can break marimo._server, while a change to marimo._server can't break marimo._server.session_manager.
Position
Below the diagonal: marimo._server uses a module listed above it, which is the healthy direction.
marimo._server.host.bridge uses marimo._core.protocol, so a change to marimo._core.protocol can break marimo._server.host.bridge, while a change to marimo._server.host.bridge can't break marimo._core.protocol.
Position
Below the diagonal: marimo._server.host.bridge uses a module listed above it, which is the healthy direction.
marimo._server.host.bridge uses marimo._session.notebook.file_manager, so a change to marimo._session.notebook.file_manager can break marimo._server.host.bridge, while a change to marimo._server.host.bridge can't break marimo._session.notebook.file_manager.
Position
Below the diagonal: marimo._server.host.bridge uses a module listed above it, which is the healthy direction.
marimo._server.host.bridge uses marimo._session.types, so a change to marimo._session.types can break marimo._server.host.bridge, while a change to marimo._server.host.bridge can't break marimo._session.types.
Position
Below the diagonal: marimo._server.host.bridge uses a module listed above it, which is the healthy direction.
marimo._server.host.bridge uses marimo._server.session_manager, so a change to marimo._server.session_manager can break marimo._server.host.bridge, while a change to marimo._server.host.bridge can't break marimo._server.session_manager.
Position
Below the diagonal: marimo._server.host.bridge uses a module listed above it, which is the healthy direction.
marimo._server.host uses marimo._core.protocol, so a change to marimo._core.protocol can break marimo._server.host, while a change to marimo._server.host can't break marimo._core.protocol.
Position
Below the diagonal: marimo._server.host uses a module listed above it, which is the healthy direction.
marimo._server.host uses marimo._runtime.commands, so a change to marimo._runtime.commands can break marimo._server.host, while a change to marimo._server.host can't break marimo._runtime.commands.
Position
Below the diagonal: marimo._server.host uses a module listed above it, which is the healthy direction.
marimo._server.host uses marimo._session.notebook.file_manager, so a change to marimo._session.notebook.file_manager can break marimo._server.host, while a change to marimo._server.host can't break marimo._session.notebook.file_manager.
Position
Below the diagonal: marimo._server.host uses a module listed above it, which is the healthy direction.
marimo._server.host uses marimo._session.types, so a change to marimo._session.types can break marimo._server.host, while a change to marimo._server.host can't break marimo._session.types.
Position
Below the diagonal: marimo._server.host uses a module listed above it, which is the healthy direction.
marimo._server.host uses marimo._server.host.bridge, so a change to marimo._server.host.bridge can break marimo._server.host, while a change to marimo._server.host can't break marimo._server.host.bridge.
Position
Below the diagonal: marimo._server.host uses a module listed above it, which is the healthy direction.
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 category
Findings
Severity
A05:2025 — Injection
73
High / Critical
A03:2025 — Software Supply Chain Failures
44
High / Critical
A02:2025 — Security Misconfiguration
2
Medium
A07:2025 — Authentication Failures
1
High / Critical
Roadmap
Top priorities: Resolve the 1 Leaked secret finding(s) in Secret Scanning — start with REDACTED; Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies; Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Resolve the 1 Leaked secret finding(s) in Secret Scanning — start with REDACTED.
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.
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.
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 — 91
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 — 1981
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 — 363
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 12
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 82 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 — 82 dimensions across the health lenses
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
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, 2416 of 2435 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.)
Is there a tool behind the number? Every score below names the method that produced it: Roslyn, git or a scanner, not a narrative.
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.
Method
Backs
Version
Evaluator
Roslyn static analysis
Complexity, cohesion, coupling, dead code, API surface, layering
What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.
D8 Code Coverage — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT MEASURED: this repository's production source spans .mts, .ts, .tsx, .py, and our analyzer cannot run the .py test suite(s) — so no coverage was collected for the repository as a whole. The JavaScript/TypeScript half did build and run, and its own line coverage came back at 66.6% — but that is a figure for one half of the product, and we do not publish a partial one as if it were complete. This is OUR limitation, not a defect in the repo — coverage is excluded from the score rather than counted as a near-zero.
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 7,157 test(s) behind this row are the ones the JavaScript/TypeScript census could read, and this repository also carries at least 789 test source file(s) (.py) that it cannot: it reads JavaScript/TypeScript test declarations off disk, so a JUnit/pytest-style suite is invisible to it. Skipped tests, zero-assertion tests and the other quality signals on this row are UNMEASURED in that suite — their absence from the counts above is a gap in this analyzer's language coverage, not a finding that those tests are sound.
D11 Test Reliability — 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. Test reliability NOT SCORED: this repository's production source includes .py, and the python executor ran against the .py half and did not finish re-running within its tier budget — so reliability was not measured for the repository as a whole. The JavaScript/TypeScript (vitest via `pnpm install --frozen-lockfile --ignore-scripts` in the repository root (2356 tests); vitest via `pnpm install --frozen-lockfile --ignore-scripts` in frontend/ (7803 tests); vitest via `pnpm install --frozen-lockfile --ignore-scripts` in packages/client/ (204 tests); vitest via `pnpm install --frozen-lockfile --ignore-scripts` in packages/host-protocol/ (129 tests); vitest via `pnpm install --frozen-lockfile --ignore-scripts` in packages/llm-info/ (84 tests); vitest via `pnpm install --frozen-lockfile --ignore-scripts` in packages/lsp/ (32 tests); vitest via `pnpm install --frozen-lockfile --ignore-scripts` in packages/smart-cells/ (82 tests)): measured (1 flaky) suite(s) did re-run, and came back with 1 flaky across 1 measured tier(s) — but that is a figure for one half of the product, and we do not publish a partial one as if it were complete. This is OUR limitation, not a defect in the repo — test reliability is excluded from the score rather than counted. The half was driven by a runner we ship, so this is not a missing-runner gap.
D14 License Compliance — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares package.json, but the licence verdict published here was taken over its Python distribution dependencies. Nothing was read about its npm dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
D21 Naming Consistency — 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. 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 — 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. 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 — 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. 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.
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.
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. `frontend/.storybook/main.ts`, `frontend/playwright.config.ts`, `frontend/scripts/check-ai-sdk-compatibility.ts`, `frontend/src/components/app-config/get-dirty-values.ts`, `frontend/src/components/chat/notebook-access-selector.stories.tsx`, … (+50 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.
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 marimo/_entrypoints/registry.py, whose lifetimes are not modelled yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
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 — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
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. 'duckdb' is imported (marimo/_tutorials/sql.py:50), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
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. 'duckdb' is imported (marimo/_tutorials/sql.py:50), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
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. 'duckdb' is imported (marimo/_tutorials/sql.py:50), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
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 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 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 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
R10 Code Duplication — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 235 further occurrence(s) are not listed individually; the score already reflects all 275.
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. 179 further occurrence(s) are not listed individually; the score already reflects all 219.
R3 Large Files — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 36 further occurrence(s) are not listed individually; the score already reflects all 76.
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. 15 further occurrence(s) are not listed individually; the score already reflects all 55.
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.
X18 Disposal-pattern correctness — 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.
X26 Unsynchronised callback handoff — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
X27 Collection changed while being enumerated — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This check's reader does not cover every language in this repository. The score describes the part it read, which is most of the product; the rest is a gap in this analyzer's language reach.
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. 59 further occurrence(s) are not listed individually; the score already reflects all 99.
Repo exclusion declarations: 3 pattern(s) declared (.gitattributes linguist-generated/vendored, .editorconfig generated_code) excluded 0 source file(s) from code-quality scoring. Declarations are the repo's own visible statement that a tree is machine-written or vendored — auditable in any diff, honored by GitHub the same way.
Limitations & what we did not check
We assess the repository exactly as committed, and only the repository. By design we do not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.
Per-dimension blind spots
For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.
D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
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.
D21 Naming Consistency: Naming consistency compares each name with the convention its structural peers follow in this repository: it cannot tell whether a consistently used name is a good one, and languages other than C# and TypeScript are not measured.
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.
D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a REDACTED (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
AC1 Text alternatives: Alt-text is detected structurally — the scan sees that an alternative EXISTS, not whether it meaningfully describes the image, and decorative-vs-missing is judged by attribute shape; runtime-injected images and a non-role=img decorative svg are out of scope. This is accessibility readiness, never a WCAG conformance claim.
AC2 Forms & labels: Label association is read from static markup — a label wired up at runtime (JS-set aria-labelledby, framework-injected ids) reads as missing, a present label says nothing about whether its text is correct. A known UI-library field component (e.g. a JSX <TextField>) is now checked conservatively — flagged only when it carries NO label/aria-label/aria-labelledby/id/name — but wrapper/context-labelled libraries (Chakra/Radix FormControl+FormLabel) aren't statically visible (possible false positive) and non-JSX lowercased components are still skipped. A click handler on a plain element is now asked for a name too (it is a control the author declared), but the subtree test that answers it is deliberately generous: any DYNAMIC text expression in the subtree counts as a name, so an icon chosen by a ternary ({cond ? <IconA/> : <IconB/>}) reads as named, and a glyph component from a library the icon-import list does not know still names its parent. A clean result is "no unlabelled control found", not a labelling proof.
AC3 Page structure: Page structure is read from the static markup tree — landmarks, headings and lang injected at runtime aren't seen, heading ORDER is checked structurally (not against the rendered visual hierarchy), and lang/title/main fire only on full documents, never partials, and the data-table check sees header-cell presence (a <th> exists), not whether each header correctly associates with its cells. Static readiness, not conformance.
AC4 Keyboard semantics: Keyboard semantics are inferred from markup attributes — interactivity wired purely in script, focus managed at runtime, and component-level handlers are invisible. A clean result means "no static keyboard-trap shape", not a keyboard-operability proof.
AC5 ARIA correctness: ARIA correctness is checked against the static role/attribute shape — roles/attributes set dynamically aren't seen, a valid role says nothing about whether it matches the element's real behaviour, and required-state checks are suppressed when a JSX spread could supply them. The two-branch toggle check (a control whose state is conveyed only by which of two mutually exclusive branches renders) reads CONDITIONALS THAT ARE ATTRIBUTES — Vue v-if/v-else/v-show and Alpine x-if/x-show — so the same toggle written as a Svelte {#if} block or a JSX ternary is control flow the markup model never projects as a branch and is not seen at all.
AC6 Visual & motion safety: Contrast and motion safety are PARTIAL by construction — literal colours (hex/rgb/hsl/named) in inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS top-level declarations are read (same-rule/same-element colour+background pairs only); computed/runtime/theme colour, external-CDN stylesheets, CSS-in-JS dynamic (${…}) and nested-selector colours, cross-element pairs and image contrast stay out of reach, so a clean result is bounded by what the static CSS itself shows.
AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
M4 Documentation accuracy: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.
P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.
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.
301 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was export-actions.ExportActions at 123. A further 11 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 bootstrap.handleNotification at 47 — they are counted neither in the figure above nor in this dimension's score. 11 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: frontend/src/core/islands/bootstrap.ts (bootstrap.handleNotification at 47), frontend/src/components/datasources/utils.ts (utils.getFormatter at 35), frontend/src/core/codemirror/format.ts (format.getSqlFormatterDialect at 35), frontend/src/core/codemirror/language/languages/sql/sql.ts (sql.connectionNameToParserDialect at 35), frontend/src/core/codemirror/language/languages/sql/utils.ts (utils.guessDialect at 34), and 6 more not listed here. 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.
+ 296 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 8 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with export-actions.ExportActions (cyclomatic 123), agent-panel.AgentPanel (cyclomatic 75), NarwhalsTransformHandler._evaluate_condition (cyclomatic 66). — 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 8 together lifts Cyclomatic Complexity from 5.8 to about 6.5/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
+ 481 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 1 body over 120 down to 120 or less in Cognitive Complexity — start with analyzer.findReactiveVariables::collectDeclarations (cognitive 130). — Refactoring it lifts Cognitive Complexity from 4.5 to about 4.7/10.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes8.0 / 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.
Resolve the 109 FunctionTooLong finding(s) in God Classes — start with ai-config.tsx (3), renderers.tsx (3), notebook-cell.tsx (2). — One of this dimension's main actionable groups (109 warning-level).
Resolve the 76 FileTooLong finding(s) in God Classes — start with commands.py (2), notebook.py (2), plotly.py. — One of this dimension's main actionable groups (76 warning-level).
Resolve the 9 TooManyMethods finding(s) in God Classes — start with bridge.ts, runtime.py, _unsafe_call_analysis.py. — One of this dimension's main actionable groups (9 warning-level).
Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
132 duplicated block group(s) detected. 2.1 % of the production lines (8,480 of 394,602) are in a reported copy. A further 118 rows report members as variants of one another; the share counts each copied line once, however many rows cite it. 68 of the 250 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. Measured on part of this repository only: .tsx, .ts (43% of production source) was not exposed to THIS dimension's token comparison and is not in this count; duplication there is measured by R10 Code Duplication, the frontend lens's card running the same clone algorithm over the JS/TS token stream.
Edited copy of a member (19 corresponding lines) · ×6marimo/_runtime/executor/evaluator.py:39
Edited copy of a member (18 corresponding lines) · ×6marimo/_server/host/api.py:498
+ 130 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 8 Duplicated block (10 lines × 2) finding(s) in Code Duplication — start with help_formatter.py, streams.py, print_code.py. — One of this dimension's main actionable groups (8 warning-level).
Resolve the 7 Edited copy of a member (14 corresponding lines) finding(s) in Code Duplication — start with REDACTED, sandbox.py, altair-5.py. — One of this dimension's main actionable groups (7 warning-level).
Resolve the 7 Duplicated block (13 lines × 2) finding(s) in Code Duplication — start with plotly.py (2), commands.py, mdx.py. — One of this dimension's main actionable groups (7 warning-level).
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D5 · Coupling6.8 / 10Adequate✓ 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.
10 production modules (npm+Python), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; 4 module(s) off the main sequence.
Off the main sequence: @marimo-team/llm-info · ×4
What to do
Resolve the 4 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (4 warning-level).
Detailed fixes: d5_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
Resolve the 2 Low cohesion finding(s) in Cohesion (LCOM4) — start with ui_element.py, pyodide_session.py. — One of this dimension's main actionable groups (2 warning-level).
Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D10 · Test Quality10.0 / 10Stronggated by 16 serious findings✓ Tool-verified
What it measures: Whether the tests truly assert behaviour rather than just running the code.
Method: Per-test assertions, skips, and mock references analyzed via Roslyn; structured skip-reason tags (BUG:/ENV:) separate documented deferrals from debt. Deterministic.
20 skipped (12 with a documented reason), 7 zero-assertion, 1 synchronised by a fixed sleep, no mocking-framework packages referenced (hand-written doubles or no mocking) across 7157 tests. Measured on the JavaScript/TypeScript suite only — at least 789 test source file(s) (.py) went unread, so its test quality is unmeasured and is not in these counts.
Skipped test: date · ×8frontend/e2e-tests/components.spec.ts:92
No assertions: has a method for each request below a notebook · ×7packages/client/src/__tests__/notebook-client.test.ts:386
Fixed-sleep synchronisation: waits for an in-flight `initialize` to settlefrontend/src/plugins/impl/anywidget/__tests__/host.test.ts:124
Mock-dominated test: tells subscribers why it stopped, unless they left or closed it · ×67packages/client/src/__tests__/notebook-events.test.ts:413
Skipped (documented): returns true for contentEditable · ×12frontend/src/utils/__tests__/events.test.ts:182
What to do
Resolve the 8 Skipped test finding(s) in Test Quality — start with components.spec.ts (3), kitchen-sink-wasm.spec.ts (2), mode.spec.ts (2). — One of this dimension's main actionable groups (8 warning-level).
Resolve the 7 No assertions finding(s) in Test Quality — start with notebook-client.test.ts (2), notebook-events.test.ts, operations.test.ts. — One of this dimension's main actionable groups (7 warning-level).
Resolve the 1 Fixed-sleep synchronisation finding(s) in Test Quality — start with host.test.ts. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d10_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
1 outdated, 0 yanked pinned Python distributions. 4 of 23 shipped distributions were graded against pypi.org (0 not published there, 19 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.
Outdated: python-jsonpath
Detailed fixes: d12_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
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.
0 of 36 shipped Python distribution(s) use a banned license. Licences were resolved from PyPI over the distributions a consumer installs — this repository's 23 declared runtime requirement(s) closed transitively over each distribution's published `requires_dist` (13 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. 2 of them publish no licence on PyPI this pass can read; that is missing data, not a violation, and none of them is charged. This repository publishes itself under Apache-2.0, which is its own choice and is not judged here. ★ COVERAGE OF THIS VERDICT: it grades this repository's Python distribution dependencies and nothing else. The repository also declares package.json, and the licences of those dependencies were NOT read by this pass — a gap in this engine's coverage, not a statement about them. So this result says the graded closure carries no banned licence; it does NOT say this repository's licensing is clear.
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.
Top hotspots: frontend/src/core/session/useNotebookSession.tsx (26×55=1430); marimo/_runtime/runtime.py (35×24=840); frontend/src/components/data-table/export-actions.tsx (6×123=738) Repeated repair below the complexity floor: marimo/_server/ai/providers.py (7 of 12 changes were fixes); marimo/_server/lsp.py (5 of 7 changes were fixes); marimo/_runtime/app/script_runner.py (5 of 6 changes were fixes)
Resolve the 100 Hotspot finding(s) in Churn × Complexity Hotspots — start with commands.py (2), useNotebookSession.tsx, runtime.py. — One of this dimension's main actionable groups (100 warning-level).
Resolve the 13 Repeated repair finding(s) in Churn × Complexity Hotspots — start with providers.py, lsp.py, script_runner.py. — One of this dimension's main actionable groups (13 warning-level).
Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D16 · Bus Factor9.1 / 10Exemplary✓ 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.
116 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is marimo/_plugins/ui/_impl/tables/geometry_export.py. Counted over 1280 of the 2630 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 · ×5
Further sole-owners (lower concentration)
✓ On the Gold path — maintain.
Detailed fixes: d16_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
217 deducted task-comment markers across 394602 LoC (0.1/KLoC) → score 9.9. 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.
Resolve the 191 TodoComment finding(s) in Explicit Debt — start with commands.py (13), runtime.py (9), clickhouse.py (7). — One of this dimension's main actionable groups (191 warning-level).
Resolve the 23 HackComment finding(s) in Explicit Debt — start with paste.test.ts (3), vim.ts (2), blocks.tsx (2). — One of this dimension's main actionable groups (23 warning-level).
Resolve the 2 FixmeComment finding(s) in Explicit Debt — start with test_kernel_communication.py, vim.ts. — One of this dimension's main actionable groups (2 warning-level).
Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
1 of 2 documentation facets pass in full; short on: F2 example. 228 document(s) read across 11 unit(s).
Documentation: no build, run or usage examplepackages/smart-cells/README.md:1
What to do
Resolve the 1 Documentation finding(s) in Documentation Quality — start with README.md. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d19_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
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.
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.
What it measures: Whether names — types, methods, variables — are clear and consistent.
Method: Seven vocabulary-free rules (N1-N7) mine each naming convention from the repository and flag a name that breaks a convention its structural peers in the same unit follow; production C# and TypeScript, each its own population. Deterministic, no model, no sample. Advisory.
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.
doc comments repeat the namesfrontend/src/components/data-table/utils.ts:123
What to do
Resolve the 103 redundant comment finding(s) in Comment Value — start with chat-history.test.ts (4), test_pyodide_acceptance.mjs (4), mount.test.ts (3). — One of this dimension's main actionable groups (103 recommendation-level).
Detailed fixes: d24_recommendation.md · top locations in Appendix A, every location in findings.md.
2 of 11 build units (Python, npm) flagged as possibly oversized/incoherent.
Projects may be oversized for their cohesion · ×2package.json:1
What to do
Resolve the 2 Projects may be oversized for their cohesion finding(s) in Project Cohesion — start with package.json (2). — One of this dimension's main actionable groups (2 recommendation-level).
Detailed fixes: d26_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
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).
73 finding(s): 0 critical, 23 high, 35 medium, 15 low. semgrep hit a parse error in 74 file(s) — `docs/overrides/main.html` (line 1, line 4, lines 4–5, …), `frontend/.storybook/main.ts` (line 33), `frontend/e2e-tests/visual-regression.spec.ts` (line 46), `frontend/playwright.config.ts` (line 65), `frontend/scripts/check-ai-sdk-compatibility.ts` (line 29), … (+69 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 9 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
+ 16 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 9 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (4), REDACTED (4), REDACTED. — One of this dimension's main actionable groups (9 issue-level).
Resolve the 6 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2), REDACTED, REDACTED. — One of this dimension's main actionable groups (6 issue-level).
Resolve the 3 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (3). — One of this dimension's main actionable groups (3 issue-level).
Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir and Erlang via Hex, Go modules, Java and Kotlin via Maven/Gradle, JavaScript/npm, .NET/NuGet, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift.
Method: Dependency-CVE scan across every ecosystem the repository declares, scored ONCE. Three sources are unioned and deduplicated by advisory identity (rule id + alias closure, CVE<->GHSA) scoped to package+version, keeping the worst severity: `osv-scanner --recursive` over osv.dev for Dart pub, Elixir/Hex (and Erlang, whose `rebar.lock` syft first converts to a CycloneDX SBOM the scanner reads, with rows attributed back to the lock), Go, Java and Kotlin via Maven/Gradle (and Scala, whose sbt build's pinned direct declarations are written into a CycloneDX SBOM the scanner reads, with rows attributed back to the build file), npm, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift; `trivy fs --scanners vuln` for npm lockfiles; and `dotnet list package --vulnerable --include-transitive` for NuGet (with per-advisory collapse of the project x target-framework fan-out), plus a DECLARED-dependency arm that resolves a published gem's gemspec against rubygems.org where no Gemfile.lock is committed. `SeverityScore(c,h,m,l, normalizer 8.0)`. NotApplicable only when NO ecosystem is readable; if any applicable ecosystem could not be scanned the findings are REPORTED and the score is withheld. Supersedes the npm and OSV arms, retired 2026-09-05. Advisory since rubric-2026.11.2 (CAI decision 0006): every row is a match against a vulnerability database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.
Resolve the 21 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (21). — One of this dimension's main actionable groups (21 issue-level).
Resolve the 16 Medium CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (16). — One of this dimension's main actionable groups (16 warning-level).
Resolve the 2 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (2). — One of this dimension's main actionable groups (2 issue-level).
Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.
Resolve the 1 Medium IaC finding(s) in IaC & Container Security — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
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.
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.
19 of 1280 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is marimo/_ai/_tools/tools/cells.py. Counted over 1280 of the 2630 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
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.
Resolve the 2 Boundary-crossing change coupling finding(s) in Change Coupling — start with cell-array.tsx, DataTablePlugin.tsx. — One of this dimension's main actionable groups (2 issue-level).
Resolve the 19 Change coupling finding(s) in Change Coupling — start with kernel_context.py, MarimoErrorOutput.tsx, edit-app.tsx. — One of this dimension's main actionable groups (19 warning-level).
Resolve the 1 Change coupling clique finding(s) in Change Coupling — start with ai-provider-icon.tsx. — 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.
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.
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
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.
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.
What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. Reported apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.
Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. Advisory since rubric-2026.11.2 (CAI decision 0006): the malicious-package feed is a database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.
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.
0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 2 platform declaration(s) and 23 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.
Do you agree with this assessment?
Frontend & cross-cutting dimensions
R = React/JS · M = Maturity · P = Readiness.
AC1 · Text alternatives4.8 / 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.
An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative. (×2) — frontend/islands/__demo__/output.html:98, frontend/src/core/codemirror/markdown/completions.ts:105
Video with no captions <track> offers no captions. This player's source is set at runtime, so there is no caption file to author here: give the player a way to carry captions — accept a track/captions URL alongside the media and render a <track kind="captions"> when one is supplied — and capture that asset wherever the media enters the product (upload, import or generation). (×2) — frontend/src/components/editor/file-tree/renderers.tsx:151, frontend/src/components/editor/output/VideoOutput.tsx:13
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. — frontend/src/plugins/impl/matplotlib/matplotlib-renderer.ts:300
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.
Do you agree with this assessment?
AC2 · Forms & labels5.5 / 10Adequate✓ Tool-verified
Other · Accessibility — Whether form controls have a programmatic label (an associated label, aria-label or aria-labelledby), buttons have text, links have an accessible name, a click handler on a plain element names the control it declares, fieldsets have a non-empty legend, known UI-library field components carry a label prop, and a placeholder isn't used as the only label. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: inputs/selects/textareas checked for an associated label[for]/wrapping label/aria-label/aria-labelledby (per document), buttons for accessible text, fieldsets for a legend; placeholder-only labelling flagged. Deterministic, hard fact per control.
Coverage: Population: form controls, buttons, links, fieldsets and known UI-library field components in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and spread/dynamic-attribute elements are skipped, so a control whose label arrives through a spread or a runtime expression is deliberately not judged. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id alone, wherever it is set, names nothing until a label points at it). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed. (×5) — frontend/src/components/chat/acp/agent-panel.tsx:445, frontend/src/components/chat/acp/model-selector.tsx:33, frontend/src/components/data-table/charts/components/chart-items.tsx:139, …
This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label. — frontend/src/components/data-table/SearchBar.tsx:50
An element made editable (contenteditable, or role="textbox"/"searchbox" with a tab stop or key handling) is a text-entry control, and it has no aria-label, no aria-labelledby and no title, so assistive tech announces an unnamed edit field. Point aria-labelledby at its visible caption, or add an aria-label. — frontend/src/components/editor/actions/name-cell-input.tsx:87
A fieldset groups related controls but has no <legend> to name the group. Add a <legend> as its first child — or, if the group already has a visible caption beside it (or the fieldset is there only to disable its subtree and carries no group box), point aria-labelledby at that caption's id instead, which names the group without rendering a second one. — frontend/src/components/editor/chrome/panels/packages-panel.tsx:162
This select is named only by the placeholder of its value part. Nothing is typed into a select, so the placeholder does not vanish on input: it is shown as the trigger's text until a value is chosen, and then the chosen value replaces it — so at no point does the control state what the choice is for, and the trigger's role (combobox) takes its name from the author, not from that text. Name it: an aria-label on the trigger, or an id on the trigger with a <label htmlFor> pointing at it. (×6) — frontend/src/components/editor/chrome/panels/write-secret-modal.tsx:174, frontend/src/components/editor/connections/components.tsx:90, frontend/src/components/editor/renderers/layout-select.tsx:37, …
A link with no text, aria-label or labelled child (e.g. an icon-only link) has no accessible name, so assistive tech can't say where it goes. Add visible text or an aria-label. (×2) — frontend/src/components/editor/notebook-cell.tsx:811, frontend/src/components/editor/notebook-cell.tsx:823
This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed. (×4) — frontend/src/components/forms/switchable-multi-select.tsx:54, frontend/src/components/forms/switchable-multi-select.tsx:105, frontend/src/components/ui/number-field.tsx:53, …
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.
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.
The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en"). (×2) — frontend/islands/__demo__/index.html:3, frontend/islands/__demo__/output.html:2
No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>. (×2) — frontend/islands/__demo__/index.html:3, frontend/islands/__demo__/output.html:2
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). — frontend/src/components/editor/package-alert.tsx:174
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.
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".
The repo's own CSS styles .cursor-pointer with `cursor: pointer`, so this <span> is a control — but it has no role, no tabIndex={0} and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabIndex={0} + a key handler. (×6) — frontend/src/components/ai/ai-model-dropdown.tsx:208, frontend/src/components/chat/acp/blocks.tsx:490, frontend/src/components/editor/links/cell-link-list.tsx:53, …
The repo's own CSS styles .cursor-pointer with `cursor: pointer`, so this <div> is a control — but it has no role, no tabIndex={0} and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabIndex={0} + a key handler. (×3) — frontend/src/components/ai/ai-model-dropdown.tsx:290, frontend/src/components/app-config/ai-config.tsx:1500, frontend/src/components/data-table/url-detector.tsx:32
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. (×2) — frontend/src/components/chat/chat-components.tsx:58, frontend/src/components/tracing/tracing.tsx:391
This <div role="alertdialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close. — frontend/src/components/chat/tool-call/tool-approval-card.tsx:27
A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler. (×9) — frontend/src/components/data-table/columns.tsx:636, frontend/src/components/data-table/columns.tsx:641, frontend/src/components/data-table/columns.tsx:662, …
This <div> binds double-click and nothing else. No click, no key handler, and no tabIndex={0}, so it cannot even take focus. Nothing synthesises a double-click from the keyboard: Enter and Space fire a single click, and only on a native <button> or <a href>. So this behaviour has no keyboard path at all. Expose the same action on a real control, or add role + tabIndex={0} + a key handler alongside the double-click. (×3) — frontend/src/components/editor/cell/code/cell-editor.tsx:552, frontend/src/components/editor/file-tree/file-search-results.tsx:122, frontend/src/components/editor/notebook-cell.tsx:574
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. — frontend/src/core/documentation/DocHoverTarget.tsx:16
What to do
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
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.
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.
This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade. (×3) — frontend/src/components/app-config/mcp-config.tsx:81, frontend/src/components/datasources/components.tsx:58, frontend/src/components/datasources/components.tsx:77
<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). — frontend/src/plugins/impl/MatrixPlugin.tsx:472
`.js-plotly-plot .plotly input:focus` 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. — frontend/src/plugins/impl/plotly/plotly.css:16
`.marimo-cell:focus-visible` 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. — frontend/src/css/app/Cell.css:27
`.cm-focused.cm-focused` 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. — frontend/src/css/app/codemirror.css:19
`.mo-slides-notes-resize` 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. — frontend/src/components/slides/slides.css:42
`.resize-handle` 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. — frontend/src/components/editor/chrome/wrapper/app-chrome.css:4
`.vega-embed .vega-actions` moves (`animation-name: scale-in`) 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. — frontend/src/plugins/impl/vega/vega.css:94
`.markdown details summary::before` moves (`transition: transform 0.2s`) 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. — frontend/src/css/md.css:360
`progress::-webkit-progress-value` moves (`transition: width 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. — frontend/src/css/progress.css:79
`progress::-moz-progress-bar` moves (`transition: width 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. — frontend/src/css/progress.css:85
`.running-app-icon` moves (`animation: running-app-animation 2000ms`) 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. — frontend/src/css/app/Header.css:21
`.pa-chevron` 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. — docs/stylesheets/extra.css:169
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.
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.
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.
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.
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.
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.
`EditRequests` declares 64 required operations: `sendRename`, `saveLayout`, `sendCopy`, `sendRunScratchpad`, `sendShutdown`, `sendFormat`, `sendCodeCompletionRequest`, `saveUserConfig`, `saveAppConfig`, `sendRestart`, `sendInstallMissingPackages`, `readCode`, `readSnippets`, `previewDatasetColumn`, `previewSQLTable`, `previewSQLTableList`, `previewSQLSchemaList`, `previewDataSourceConnection`, `discoverDataSources`, `validateSQL`, `openFile`, `getUsageStats`, `getEnvironmentInfo`, `sendPdb`, `sendSetBreakpoints`, `getFileRoots`, `sendListFiles`, `sendSearchFiles`, `sendCreateFileOrFolder`, `sendDeleteFileOrFolder`, `sendCopyFileOrFolder`, `sendRenameFileOrFolder`, `sendUpdateFile`, `sendFileDetails`, `openTutorial`, `getRecentFiles`, `getWorkspaceFiles`, `getRunningNotebooks`, `shutdownSession`, `getExportAvailability`, and 24 more. Counted over its REQUIRED operations — a method signature or a function-typed property with no `?`, once per signature; optional members and data properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — frontend/src/core/network/types.ts:157
`RawBridge` declares 25 required operations: `put_control_request`, `code_complete`, `read_code`, `read_snippets`, `get_environment_info`, `format`, `copy`, `save_app_config`, `save_user_config`, `rename_file`, `list_files`, `file_roots`, `search_files`, `file_details`, `create_file_or_directory`, `delete_file_or_directory`, `copy_file_or_directory`, `move_file_or_directory`, `update_file`, `load_packages`, `read_file`, `set_interrupt_buffer`, `export_html`, `export_markdown`, `export_script`. Counted over its REQUIRED operations — a method signature or a function-typed property with no `?`, once per signature; optional members and data properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — frontend/src/core/wasm/worker/types.ts:73
`TableManager` declares 22 abstract methods: `apply_formatting`, `supports_filters`, `sort_values`, `to_csv_str`, `to_json_str`, `to_parquet`, `select_rows`, `select_columns`, `select_cells`, `drop_columns`, `get_row_headers`, `get_field_type`, `take`, `search`, `get_stats`, `get_bin_values`, `get_num_rows`, `get_num_columns`, `get_column_names`, `get_unique_column_values`, `get_sample_values`, `calculate_top_k_rows`. Counted over its `@abstractmethod`s (and abstract properties), once per name; concrete methods are helpers an implementer inherits, not a burden, and `_`-prefixed members are not counted. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — marimo/_plugins/ui/_impl/tables/table_manager.py:70
`Session` declares 18 protocol members: `stable_id`, `notebook_sandbox`, `document`, `kernel_state`, `kernel_pid`, `kernel_exit_info`, `try_interrupt`, `rename_path`, `put_control_request`, `reply_input`, `disconnect_consumer`, `disconnect_main_consumer`, `connect_consumer`, `connection_state`, `notify`, `instantiate`, `scoped`, `close`. Counted over its public methods and properties, once per name — a `typing.Protocol` is satisfied structurally, so every one of them is an operation each implementer must provide and each consumer depends on; `_`-prefixed members, static methods and data attributes are not counted, and an `@overload` family is one operation. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — marimo/_session/types.py:132
What to do
Split fat interfaces into focused role-interfaces so clients depend only on what they use.
Other · Security — Whether access is authorized by default — a framework authorization attribute/decorator or policy, or imperative guard methods (throw-on-violation) called from handlers.
Method: Roslyn scan: [Authorize] usage and authorization policies, plus imperative throw-on-violation guard methods detected via syntax. Deterministic.
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.
What to do
Add a build/run (quick start) section to the root README — the first thing a newcomer needs.
Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
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.
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.
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.
docs/guides/deploying/deploying_kubernetes.md names Python 3.9 or later, but REDACTED:5 requires `requires-python = ">=3.11"` (the lowest of 2 declarations): the package does not install on Python 3.9. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — docs/guides/deploying/deploying_kubernetes.md:16
What to do
Reconcile the README with reality: docs/guides/deploying/deploying_kubernetes.md names Python 3.9 or later, but REDACTED:5 requires `requires-python = ">=3.11"` (the lowest of 2 declarations): the package does not install on Python 3.9.
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.
Do you agree with this assessment?
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.
Only 5/6 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `docs`.
`frontend/src/utils/tracer.ts` reports through `console.*` at line 93 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — frontend/src/utils/tracer.ts:93
`frontend/src/core/islands/bridge.ts` reports through `console.*` at line 58 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — frontend/src/core/islands/bridge.ts:58
`frontend/src/core/cells/logs.ts` reports through `console.*` at line 159 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — frontend/src/core/cells/logs.ts:159
`frontend/e2e-tests/global-teardown.ts` reports through `console.*` at line 86 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — frontend/e2e-tests/global-teardown.ts:86
`frontend/e2e-tests/global-teardown.ts` reports through `console.*` at line 91 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — frontend/e2e-tests/global-teardown.ts:91
`frontend/e2e-tests/global-teardown.ts` reports through `console.*` at line 96 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — frontend/e2e-tests/global-teardown.ts:96
`frontend/e2e-tests/global-teardown.ts` reports through `console.*` at line 98 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — frontend/e2e-tests/global-teardown.ts:98
`packages/llm-info/src/simple_logger.ts` reports through `console.*` at line 28 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/llm-info/src/simple_logger.ts:28
`packages/llm-info/src/simple_logger.ts` reports through `console.*` at line 31 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/llm-info/src/simple_logger.ts:31
`packages/llm-info/src/simple_logger.ts` reports through `console.*` at line 34 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/llm-info/src/simple_logger.ts:34
`packages/llm-info/src/simple_logger.ts` reports through `console.*` at line 37 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — packages/llm-info/src/simple_logger.ts:37
What to do
Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
Route service-code `console.*` output through the module's structured logger (with named fields), so delivery outcomes and failures reach the log pipeline with a level.
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 32 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. — .github/workflows/cla.yml:5
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.
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.
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.
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.
`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. (×10) — marimo/_cli/convert/utils.py:17, marimo/_cli/convert/utils.py:22, marimo/_cli/files/file_path.py:63, …
`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. — REDACTED:433
`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. (×7) — REDACTED:688, REDACTED:39, REDACTED:606, …
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.
Readiness · Performance — Whether the code protects its performance with benchmarks — a benchmark suite, allocation/memory measurement, and (ideally) a CI gate. Presence is credited as a bonus, never a deduction.
Method: Repo + source scan: BenchmarkDotNet referenced (csproj/source), [Benchmark]/[MemoryDiagnoser] attribute counts, and a benchmark step in CI; off .NET, the same ladder over Go testing.B, Rust criterion/#[bench]/divan, JMH/kotlinx-benchmark, pytest-benchmark/asv/pyperf, tinybench/mitata/vitest bench/benchmark.js and Swift package-benchmark — scored as a bonus ladder (absence is neutral, never a deduction). Deterministic, presence detection.
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.
Do you agree with this assessment?
R1 · Type Safety10.0 / 10Exemplary✓ Tool-verified
React / JS · Code Health — How much of the frontend is typed TypeScript vs untyped JavaScript.
Method: Frontend file inventory: the share of typed TypeScript vs untyped JavaScript across the source tree. Deterministic, exhaustive over frontend files.
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.
18 duplicated blocks under frontend/src/components/ have copies in at least two of the sibling directories app-config, chat, data-table, datasources, dependency-graph, editor (+7 more sibling(s) not listed) — 5 of them are reported below, and 13 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 18 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 18 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 18 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — frontend/src/components/data-table/filter-pill-editor.tsx:282
17 duplicated blocks under frontend/src/ have copies in at least two of the sibling directories components, core, plugins, utils — 8 of them are reported below, and 9 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 17 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 17 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 17 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — frontend/src/components/editor/file-tree/upload.tsx:58
10 duplicated blocks under frontend/src/core/ have copies in at least two of the sibling directories ai, codemirror, datasets, islands, saving, session (+2 more sibling(s) not listed) — 7 of them are reported below, and 3 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 10 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 10 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 10 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — frontend/src/core/ai/context/providers/cell-output.ts:130
frontend/src/components/ui/context-menu.tsx:29 · frontend/src/components/ui/dropdown-menu.tsx:25 — the two spans are one implementation copied and then locally edited — 887 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — frontend/src/components/ui/context-menu.tsx:29
frontend/src/components/editor/notebook-cell.tsx:411 · frontend/src/components/editor/notebook-cell.tsx:1064 — the two spans are one implementation copied and then locally edited — 606 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. — frontend/src/components/editor/notebook-cell.tsx:411
frontend/src/core/network/requests-network.ts:159 · frontend/src/core/network/requests-network.ts:263 — the two spans are one implementation copied and then locally edited — 341 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. — frontend/src/core/network/requests-network.ts:159
frontend/src/components/editor/connections/form-renderers.tsx:83 · frontend/src/components/editor/connections/form-renderers.tsx:147 — the two spans are one implementation copied and then locally edited — 262 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. — frontend/src/components/editor/connections/form-renderers.tsx:83
frontend/src/plugins/impl/data-editor/components.tsx:26 · frontend/src/plugins/impl/data-editor/components.tsx:88 — the two spans are one implementation copied and then locally edited — 240 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. — frontend/src/plugins/impl/data-editor/components.tsx:26
frontend/src/components/editor/cell/CellStatus.tsx:60 · frontend/src/components/editor/cell/CellStatus.tsx:137 — the two spans are one implementation copied and then locally edited — 175 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. — frontend/src/components/editor/cell/CellStatus.tsx:60
frontend/src/core/codemirror/go-to-definition/commands.ts:280 · frontend/src/core/codemirror/reactive-references/analyzer.ts:209 — the two spans are one implementation copied and then locally edited — 219 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — frontend/src/core/codemirror/go-to-definition/commands.ts:280
frontend/src/components/editor/actions/useConfigActions.tsx:39 · frontend/src/components/editor/actions/useConfigActions.tsx:86 — the two spans are one implementation copied and then locally edited — 158 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. — frontend/src/components/editor/actions/useConfigActions.tsx:39
frontend/src/components/ui/input.tsx:49 · frontend/src/components/ui/textarea.tsx:24 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — frontend/src/components/ui/input.tsx:49
frontend/src/plugins/impl/DatePickerPlugin.tsx:10 · frontend/src/plugins/impl/DateTimePickerPlugin.tsx:10 — the two spans are one implementation copied and then locally edited — 234 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — frontend/src/plugins/impl/DatePickerPlugin.tsx:10
frontend/src/components/editor/KernelStartupErrorModal.tsx:31 · frontend/src/components/editor/errors/traceback-modal.tsx:37 — the two spans are one implementation copied and then locally edited — 154 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — frontend/src/components/editor/KernelStartupErrorModal.tsx:31
frontend/src/components/data-table/range-focus/atoms.ts:103 · frontend/src/components/data-table/range-focus/atoms.ts:249 — the two spans are one implementation copied and then locally edited — 129 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. — frontend/src/components/data-table/range-focus/atoms.ts:103
frontend/src/components/editor/actions/export-dialog/format-options.tsx:392 · frontend/src/components/editor/actions/export-dialog/format-options.tsx:444 — 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. — frontend/src/components/editor/actions/export-dialog/format-options.tsx:392
frontend/src/components/ui/date-picker.tsx:83 · frontend/src/components/ui/date-picker.tsx:152 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — frontend/src/components/ui/date-picker.tsx:83
frontend/src/core/codemirror/cells/debugger-decorations.ts:41 · frontend/src/core/codemirror/cells/line-timing-decorations.ts:105 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — frontend/src/core/codemirror/cells/debugger-decorations.ts:41
frontend/src/plugins/impl/RangeSliderPlugin.tsx:35 · frontend/src/plugins/impl/SliderPlugin.tsx:41 — the two spans are one implementation copied and then locally edited — 208 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — frontend/src/plugins/impl/RangeSliderPlugin.tsx:35
frontend/src/components/editor/chrome/wrapper/app-chrome.tsx:140 · frontend/src/components/editor/chrome/wrapper/sidebar.tsx:54 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — frontend/src/components/editor/chrome/wrapper/app-chrome.tsx:140
frontend/src/components/ui/alert-dialog.tsx:64 · frontend/src/components/ui/dialog.tsx:89 · frontend/src/components/ui/sheet.tsx:78 — the 3 copies are spread across 3 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — frontend/src/components/ui/alert-dialog.tsx:64
frontend/src/components/editor/chrome/wrapper/footer-items/machine-stats.tsx:62 · frontend/src/components/editor/chrome/wrapper/footer-items/machine-stats.tsx:146 — the two spans are one implementation copied and then locally edited — 172 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. — frontend/src/components/editor/chrome/wrapper/footer-items/machine-stats.tsx:62
frontend/src/components/app-config/user-config-form.tsx:209 · frontend/src/components/app-config/user-config-form.tsx:340 — the two spans are one implementation copied and then locally edited — 148 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. — frontend/src/components/app-config/user-config-form.tsx:209
frontend/src/components/ui/calendar.tsx:156 · frontend/src/components/ui/calendar.tsx:192 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — frontend/src/components/ui/calendar.tsx:156
frontend/src/core/codemirror/lsp/notebook-lsp.ts:518 · frontend/src/core/codemirror/lsp/notebook-lsp.ts:823 — the two spans are one implementation copied and then locally edited — 183 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. — frontend/src/core/codemirror/lsp/notebook-lsp.ts:518
frontend/src/core/packages/toast-components.tsx:82 · frontend/src/core/packages/toast-components.tsx:110 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — frontend/src/core/packages/toast-components.tsx:82
frontend/lint/marimo-plugin.js:20 · frontend/lint/marimo-plugin.js:57 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — frontend/lint/marimo-plugin.js:20
frontend/src/components/app-config/user-config-form.tsx:637 · frontend/src/components/app-config/user-config-form.tsx:677 · frontend/src/components/app-config/user-config-form.tsx:717 · frontend/src/components/app-config/user-config-form.tsx:756 — 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. — frontend/src/components/app-config/user-config-form.tsx:637
frontend/src/core/codemirror/markdown/commands.ts:273 · frontend/src/core/codemirror/markdown/commands.ts:396 — 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. — frontend/src/core/codemirror/markdown/commands.ts:273
frontend/src/components/app-config/data-form.tsx:119 · frontend/src/components/app-config/data-form.tsx:154 · frontend/src/components/app-config/user-config-form.tsx:375 — the 3 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — frontend/src/components/app-config/data-form.tsx:119
frontend/src/components/editor/file-tree/upload.tsx:58 · frontend/src/plugins/impl/FileUploadPlugin.tsx:127 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — frontend/src/components/editor/file-tree/upload.tsx:58
frontend/src/components/ui/fullscreen.tsx:118 · frontend/src/components/ui/fullscreen.tsx:171 — 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. — frontend/src/components/ui/fullscreen.tsx:118
frontend/src/components/ui/input.tsx:172 · frontend/src/components/ui/textarea.tsx:62 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — frontend/src/components/ui/input.tsx:172
frontend/src/core/codemirror/markdown/completions.ts:6 · frontend/src/core/codemirror/markdown/completions.ts:53 — 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. — frontend/src/core/codemirror/markdown/completions.ts:6
frontend/src/components/editor/chrome/panels/dependency-graph-panel.tsx:27 · frontend/src/components/editor/chrome/wrapper/app-chrome.tsx:351 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — frontend/src/components/editor/chrome/panels/dependency-graph-panel.tsx:27
frontend/src/components/ui/range-slider.tsx:171 · frontend/src/components/ui/range-slider.tsx:195 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — frontend/src/components/ui/range-slider.tsx:171
frontend/src/plugins/impl/DataTablePlugin.tsx:322 · frontend/src/plugins/impl/data-frames/DataFramePlugin.tsx:135 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — frontend/src/plugins/impl/DataTablePlugin.tsx:322
frontend/src/core/codemirror/language/embedded/latex.ts:131 · frontend/src/core/codemirror/language/embedded/latex.ts:155 — 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. — frontend/src/core/codemirror/language/embedded/latex.ts:131
frontend/src/components/editor/file-tree/file-operations.tsx:218 · frontend/src/components/editor/file-tree/file-operations.tsx:240 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — frontend/src/components/editor/file-tree/file-operations.tsx:218
frontend/src/components/editor/output/MarimoErrorOutput.tsx:47 · frontend/src/components/editor/output/MarimoTracebackOutput.tsx:122 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — frontend/src/components/editor/output/MarimoErrorOutput.tsx:47
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.
React / JS · Architecture — Conformance to the detected frontend architecture layout (feature-sliced / layered src) plus cross-package deep-import rules (D-386).
Method: Conformance to the detected frontend layout (feature-sliced / layered src) plus cross-package deep-import rules, over the module graph. Deterministic.
frontend/src/components/data-table/charts/components/chart-items.tsx:17 imports frontend/src/components/data-table/charts/chart-spec/spec.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on. — frontend/src/components/data-table/charts/components/chart-items.tsx:17
frontend/src/components/data-table/charts/components/chart-items.tsx:18 imports frontend/src/components/data-table/charts/chart-spec/types.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on. — frontend/src/components/data-table/charts/components/chart-items.tsx:18
frontend/src/components/data-table/charts/components/form-fields.tsx:39 imports frontend/src/components/data-table/charts/chart-spec/types.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on. — frontend/src/components/data-table/charts/components/form-fields.tsx:39
frontend/src/components/data-table/charts/forms/common-chart.tsx:8 imports frontend/src/components/data-table/charts/chart-spec/spec.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on. — frontend/src/components/data-table/charts/forms/common-chart.tsx:8
frontend/src/components/data-table/charts/forms/heatmap.tsx:4 imports frontend/src/components/data-table/charts/chart-spec/spec.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on. — frontend/src/components/data-table/charts/forms/heatmap.tsx:4
frontend/src/components/data-table/charts/forms/pie.tsx:4 imports frontend/src/components/data-table/charts/chart-spec/spec.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on. — frontend/src/components/data-table/charts/forms/pie.tsx:4
frontend/src/components/data-table/charts/forms/pie.tsx:5 imports frontend/src/components/data-table/charts/chart-spec/types.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on. — frontend/src/components/data-table/charts/forms/pie.tsx:5
frontend/src/plugins/impl/DataEditorPlugin.tsx:3 imports @glideapps/glide-data-grid/dist/index.css?inline, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — frontend/src/plugins/impl/DataEditorPlugin.tsx:3
frontend/src/plugins/impl/DataEditorPlugin.tsx:4 imports @glideapps/glide-data-grid-cells/dist/index.css?inline, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — frontend/src/plugins/impl/DataEditorPlugin.tsx:4
frontend/src/plugins/impl/data-explorer/ConnectedDataExplorerComponent.tsx:3 imports compassql/build/src, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — frontend/src/plugins/impl/data-explorer/ConnectedDataExplorerComponent.tsx:3
frontend/src/plugins/impl/data-explorer/components/icons.tsx:2 imports compassql/build/src/schema, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — frontend/src/plugins/impl/data-explorer/components/icons.tsx:2
frontend/src/plugins/impl/data-explorer/components/query-form.tsx:4 imports compassql/build/src/query/expandedtype, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — frontend/src/plugins/impl/data-explorer/components/query-form.tsx:4
frontend/src/plugins/impl/data-explorer/components/query-form.tsx:5 imports compassql/build/src/schema, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — frontend/src/plugins/impl/data-explorer/components/query-form.tsx:5
frontend/src/plugins/impl/data-explorer/components/query-form.tsx:6 imports compassql/build/src/wildcard, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — frontend/src/plugins/impl/data-explorer/components/query-form.tsx:6
frontend/src/plugins/impl/data-explorer/encoding.ts:4 imports compassql/build/src/wildcard, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — frontend/src/plugins/impl/data-explorer/encoding.ts:4
frontend/src/plugins/impl/data-explorer/marks.ts:3 imports compassql/build/src/wildcard, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — frontend/src/plugins/impl/data-explorer/marks.ts:3
frontend/src/plugins/impl/data-explorer/queries/field-suggestion.ts:4 imports compassql/build/src/wildcard, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — frontend/src/plugins/impl/data-explorer/queries/field-suggestion.ts:4
frontend/src/plugins/impl/data-explorer/queries/histograms.ts:3 imports compassql/build/src/wildcard, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — frontend/src/plugins/impl/data-explorer/queries/histograms.ts:3
frontend/src/plugins/impl/data-explorer/queries/queries.ts:3 imports compassql/build/src, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — frontend/src/plugins/impl/data-explorer/queries/queries.ts:3
frontend/src/plugins/impl/data-explorer/queries/queries.ts:9 imports compassql/build/src/query/encoding, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — frontend/src/plugins/impl/data-explorer/queries/queries.ts:9
frontend/src/plugins/impl/data-explorer/queries/queries.ts:11 imports compassql/build/src/result, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — frontend/src/plugins/impl/data-explorer/queries/queries.ts:11
frontend/src/plugins/impl/data-explorer/queries/utils.ts:2 imports compassql/build/src/query/encoding, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — frontend/src/plugins/impl/data-explorer/queries/utils.ts:2
frontend/src/plugins/impl/data-explorer/queries/utils.ts:7 imports compassql/build/src/wildcard, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — frontend/src/plugins/impl/data-explorer/queries/utils.ts:7
frontend/src/plugins/impl/data-explorer/state/reducer.ts:4 imports compassql/build/src/wildcard, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — frontend/src/plugins/impl/data-explorer/state/reducer.ts:4
frontend/src/plugins/impl/plotly/Plot.tsx:9 imports plotly.js/dist/plotly, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — frontend/src/plugins/impl/plotly/Plot.tsx:9
packages/client/src/__tests__/operations.test.ts:6 reaches past another workspace package's public entry into its internals with a relative path (../operations.ts) — the test is coupled to a file layout that package makes no promise about, so a refactor behind its entry point breaks the suite. Import the package by name instead. — packages/client/src/__tests__/operations.test.ts:6
packages/client/src/request.ts:4 reaches into another package with a relative path (./operations.ts) — import the package by name instead. — packages/client/src/request.ts:4
What to do
Fix the listed violations: import through the target package's declared public entry rather than a deep path into its internals or a relative path into its directory (20 rows); move the shared test helper into a source directory production code may depend on (7 rows).
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.
collectDeclarations has cyclomatic complexity 87 and cognitive complexity 171; 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. — frontend/src/core/codemirror/reactive-references/analyzer.ts:67
(anonymous) has cyclomatic complexity 63 and cognitive complexity 55; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — frontend/src/components/data-table/export-actions.tsx:756
handleNotification has cyclomatic complexity 54 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 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. — frontend/src/core/session/useNotebookSession.tsx:127
EditableCellComponent has cyclomatic complexity 42 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 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. — frontend/src/components/editor/notebook-cell.tsx:399
collectMatchingDeclarations has cyclomatic complexity 41 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. — frontend/src/core/codemirror/go-to-definition/commands.ts:210
formatValue has cyclomatic complexity 41 and cognitive complexity 26; 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. — frontend/src/components/data-table/filters/format.ts:19
filterToFilterCondition has cyclomatic complexity 36 and cognitive complexity 13; 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. — frontend/src/components/data-table/filters/serialize.ts:18
ConnectionNotice has cyclomatic complexity 35 and cognitive complexity 28; 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. — frontend/src/components/editor/alerts/connection-notice.tsx:20
renderZodSchema has cyclomatic complexity 33 and cognitive complexity 43; 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. — frontend/src/components/forms/form.tsx:91
renderMessages has cyclomatic complexity 32 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. — frontend/src/components/editor/output/MarimoErrorOutput.tsx:232
parseSQLStatement has cyclomatic complexity 31 and cognitive complexity 58; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/smart-cells/src/parsers/sql-parser.ts:173
apply has cyclomatic complexity 30 and cognitive complexity 53; 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. — frontend/src/core/notebook/document/__tests__/test-host.ts:71
applyFormat has cyclomatic complexity 30 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 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. — frontend/src/components/data-table/column-formatting/feature.ts:146
(anonymous) has cyclomatic complexity 30 and cognitive complexity 9; 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. — frontend/src/components/editor/Output.tsx:78
renderCellValue has cyclomatic complexity 29 and cognitive complexity 37; 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. — frontend/src/components/data-table/columns.tsx:612
getTooltips has cyclomatic complexity 28 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. — frontend/src/components/data-table/charts/chart-spec/tooltips.ts:31
Chatbot has cyclomatic complexity 28 and cognitive complexity 21; 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. — frontend/src/plugins/impl/chat/chat-ui.tsx:141
(anonymous) has cyclomatic complexity 27 and cognitive complexity 43; 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. — frontend/src/plugins/impl/data-editor/glide-utils.ts:137
RevealSlidesComponent has cyclomatic complexity 27 and cognitive complexity 26; 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. — frontend/src/components/slides/reveal-component.tsx:472
FileViewer has cyclomatic complexity 27 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. — frontend/src/components/editor/file-tree/file-viewer.tsx:42
Node has cyclomatic complexity 27 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 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. — frontend/src/components/editor/file-tree/file-explorer.tsx:690
generateAltairChart has cyclomatic complexity 26 and cognitive complexity 43; 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. — frontend/src/components/data-table/charts/chart-spec/altair-generator.ts:16
startApps has cyclomatic complexity 26 and cognitive complexity 41; 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. — frontend/src/core/islands/bridge.ts:195
handleTreeKeyDown has cyclomatic complexity 26 and cognitive complexity 31; 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. — frontend/src/components/editor/file-tree/file-explorer.tsx:247
CellStatusComponent has cyclomatic complexity 26 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. — frontend/src/components/editor/cell/CellStatus.tsx:36
(anonymous) has cyclomatic complexity 25 and cognitive complexity 38; 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. — frontend/src/plugins/impl/matplotlib/matplotlib-renderer.ts:723
(anonymous) has cyclomatic complexity 25 and cognitive complexity 35; 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. — frontend/src/core/network/connection-notice.ts:22
getStringContent has cyclomatic complexity 25 and cognitive complexity 35; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/smart-cells/src/utils/python-ast.ts:113
(anonymous) 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. — frontend/src/components/data-table/data-table.tsx:137
parsePayloadBackedApps has cyclomatic complexity 24 and cognitive complexity 44; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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. — frontend/src/core/islands/parse.ts:161
(anonymous) has cyclomatic complexity 24 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 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. — frontend/src/plugins/impl/SliderPlugin.tsx:156
applyEditorEdits has cyclomatic complexity 23 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. — frontend/src/plugins/impl/data-editor/editor-state.ts:19
FeedbackModal has cyclomatic complexity 23 and cognitive complexity 21; 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. — frontend/src/components/editor/chrome/components/feedback-button.tsx:109
operationsModule has cyclomatic complexity 22 and cognitive complexity 45; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/client/scripts/generate-protocol.ts:67
(anonymous) has cyclomatic complexity 22 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. — frontend/src/core/cells/runs.ts:46
getPrefixLength has cyclomatic complexity 22 and cognitive complexity 21; 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. — packages/smart-cells/src/utils/python-ast.ts:173
AiCompletionEditor has cyclomatic complexity 22 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 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. — frontend/src/components/editor/ai/ai-completion-editor.tsx:85
mergeModels has cyclomatic complexity 21 and cognitive complexity 37; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/llm-info/src/sources/merge.ts:277
(anonymous) has cyclomatic complexity 21 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 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. — frontend/src/stories/runtime-story.tsx:226
PackageAlert has cyclomatic complexity 21 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 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. — frontend/src/components/editor/package-alert.tsx:106
Do you agree with this assessment?
R3 · Large Files7.6 / 10Strong✓ 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.
frontend/src/components/app-config/ai-config.tsx has 1940 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — frontend/src/components/app-config/ai-config.tsx:1
frontend/src/components/app-config/user-config-form.tsx has 1335 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — frontend/src/components/app-config/user-config-form.tsx:1
frontend/src/components/editor/notebook-cell.tsx has 1242 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — frontend/src/components/editor/notebook-cell.tsx:1
frontend/src/plugins/impl/DataTablePlugin.tsx has 1196 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — frontend/src/plugins/impl/DataTablePlugin.tsx:1
frontend/src/components/chat/acp/agent-panel.tsx has 1187 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — frontend/src/components/chat/acp/agent-panel.tsx:1
frontend/src/components/data-table/export-actions.tsx has 1147 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — frontend/src/components/data-table/export-actions.tsx:1
frontend/src/components/editor/file-tree/file-explorer.tsx has 1055 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — frontend/src/components/editor/file-tree/file-explorer.tsx:1
frontend/src/components/storage/storage-inspector.tsx has 1046 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — frontend/src/components/storage/storage-inspector.tsx:1
frontend/src/components/datasources/datasources.tsx has 1017 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — frontend/src/components/datasources/datasources.tsx:1
frontend/src/components/chat/chat-panel.tsx has 981 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — frontend/src/components/chat/chat-panel.tsx:1
scripts/generate-design-md.ts has 947 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — scripts/generate-design-md.ts:1
frontend/src/components/editor/connections/database/as-code.ts has 931 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — frontend/src/components/editor/connections/database/as-code.ts:1
frontend/src/components/slides/reveal-component.tsx has 931 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — frontend/src/components/slides/reveal-component.tsx:1
frontend/src/core/codemirror/lsp/notebook-lsp.ts has 921 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — frontend/src/core/codemirror/lsp/notebook-lsp.ts:1
frontend/src/plugins/impl/chat/chat-ui.tsx has 879 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — frontend/src/plugins/impl/chat/chat-ui.tsx:1
frontend/src/components/data-table/charts/components/form-fields.tsx has 832 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — frontend/src/components/data-table/charts/components/form-fields.tsx:1
frontend/src/components/forms/form.tsx has 823 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — frontend/src/components/forms/form.tsx:1
frontend/src/components/data-table/column-summary/chart-spec-model.tsx has 801 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — frontend/src/components/data-table/column-summary/chart-spec-model.tsx:1
frontend/src/plugins/impl/matplotlib/matplotlib-renderer.ts has 778 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — frontend/src/plugins/impl/matplotlib/matplotlib-renderer.ts:1
frontend/src/components/data-table/columns.tsx has 767 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — frontend/src/components/data-table/columns.tsx:1
frontend/src/components/slides/minimap.tsx has 763 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — frontend/src/components/slides/minimap.tsx:1
frontend/src/components/editor/navigation/navigation.ts has 756 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — frontend/src/components/editor/navigation/navigation.ts:1
frontend/src/components/editor/output/MarimoErrorOutput.tsx has 745 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — frontend/src/components/editor/output/MarimoErrorOutput.tsx:1
frontend/src/core/wasm/bridge.ts has 744 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — frontend/src/core/wasm/bridge.ts:1
frontend/src/components/editor/package-alert.tsx has 734 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — frontend/src/components/editor/package-alert.tsx:1
frontend/src/components/chat/acp/blocks.tsx has 722 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — frontend/src/components/chat/acp/blocks.tsx:1
frontend/src/components/editor/actions/useNotebookActions.tsx has 719 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — frontend/src/components/editor/actions/useNotebookActions.tsx:1
frontend/src/core/codemirror/language/languages/sql/sql.ts has 686 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — frontend/src/core/codemirror/language/languages/sql/sql.ts:1
frontend/src/components/data-table/filter-pill-editor.tsx has 671 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — frontend/src/components/data-table/filter-pill-editor.tsx:1
frontend/src/components/pages/home-page.tsx has 660 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — frontend/src/components/pages/home-page.tsx:1
frontend/src/core/cells/actions.ts has 658 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — frontend/src/core/cells/actions.ts:1
frontend/src/components/editor/renderers/grid-layout/grid-layout.tsx has 654 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — frontend/src/components/editor/renderers/grid-layout/grid-layout.tsx:1
frontend/src/components/editor/chrome/panels/packages-panel.tsx has 634 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — frontend/src/components/editor/chrome/panels/packages-panel.tsx:1
frontend/src/core/cells/cells.ts has 618 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — frontend/src/core/cells/cells.ts:1
frontend/src/components/editor/chrome/wrapper/app-chrome.tsx has 598 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — frontend/src/components/editor/chrome/wrapper/app-chrome.tsx:1
frontend/src/plugins/core/registerReactComponent.tsx has 596 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — frontend/src/plugins/core/registerReactComponent.tsx:1
frontend/src/core/hotkeys/hotkeys.ts has 591 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — frontend/src/core/hotkeys/hotkeys.ts:1
frontend/src/plugins/impl/FileBrowserPlugin.tsx has 591 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — frontend/src/plugins/impl/FileBrowserPlugin.tsx:1
frontend/src/core/codemirror/language/languages/sql/renderers.tsx has 586 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — frontend/src/core/codemirror/language/languages/sql/renderers.tsx:1
frontend/src/components/data-table/charts/charts.tsx has 569 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — frontend/src/components/data-table/charts/charts.tsx:1
What to do
Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
Do you agree with this assessment?
R4 · Test Coverage9.8 / 10Exemplary✓ 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. (×22) — frontend/lint/marimo-plugin.js:1, frontend/scripts/check-ai-sdk-compatibility.ts:1, frontend/src/hooks/debug.ts:1, …
What to do
Add tests that import the unreached modules (directly or through their public entry).
Do you agree with this assessment?
R6 · Tooling10.0 / 10Exemplary✓ Tool-verified
React / JS · Readiness — Whether the project wires up test, lint and typecheck — detected from each package.json script's COMMAND (eslint / tsc / vitest / jest / playwright), not just its name, and corroborated against CI-workflow invocations so a tool run only in CI still counts.
Method: package.json scanned for test/lint/typecheck script wiring. Deterministic presence check.
Do you agree with this assessment?
R7 · Dead Code9.7 / 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.
3 file(s) (~2455 LoC) were excluded from dead-code analysis — declare main/module/exports or a conventional entry (src/index.*, an REDACTED script) so reachability can see this package.
1 file(s) (~30 LoC) were excluded from dead-code analysis — declare main/module/exports or a conventional entry (src/index.*, an REDACTED script) so reachability can see this package. — packages/ts-config
Unreachable from the 1874 application, 22 tooling and 736 test entry point(s) detected in this repo. Gate removals on `pnpm run typecheck` — an undetected custom entry would make these reachable.
no import path from any entry point (1874 application, 22 tooling, 736 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make (×2) — frontend/lint/marimo-plugin.js, packages/smart-cells/src/parsers/index.ts
Nothing ultimately consumes this binding: its only referrer is the re-export in packages/smart-cells/src/utils/index.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in packages/smart-cells/src/utils/index.ts in the same commit, or the barrel will import a name that no longer exists. (×3) — packages/smart-cells/src/utils/quote-parser.ts:30, packages/smart-cells/src/utils/quote-parser.ts:37, packages/smart-cells/src/utils/string-escaper.ts:12
This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it. (×3) — frontend/src/components/data-table/column-header.tsx:30, frontend/src/components/data-table/filter-by-values-picker.tsx:32, frontend/src/components/data-table/filter-pill-editor.tsx:367
What to do
Delete the dead files and unused exports — every line is maintenance cost and rebuild-estimate inflation with zero runtime value.
React / JS · Readiness — npm dependency truthfulness (D-386): unused dependencies, imports not declared anywhere, and type-/test-only packages shipped as production deps.
Method: npm dependency truthfulness: unused dependencies, imports declared nowhere, and type-/test-only packages shipped as production deps — from the manifest + import graph. Deterministic.
Imported but not declared in any reachable package.json — installs work only by hoisting accident. — tests/_pyodide/test_pyodide_acceptance.mjs:92
Declared in the root package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it. — package.json:14
Declared in frontend/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it. (×6) — frontend/package.json:53, frontend/package.json:104, frontend/package.json:111, …
Declared in packages/client/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it. — packages/client/package.json:33
Every import is type-only — move it to devDependencies. (×4) — frontend/src/plugins/impl/anywidget/__tests__/widget-binding.test.ts:4, frontend/src/components/chat/acp/agent-panel.tsx:46, frontend/src/components/editor/file-tree/dnd-wrapper.tsx:3, …
Only test files import it (first: frontend/src/plugins/impl/vega/__tests__/make-selectable.test.ts:4) — move it to devDependencies. — frontend/package.json:156
What to do
Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.
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.
frontend/src/components/ai/ai-model-dropdown.tsx → frontend/src/components/app-config/state.ts → frontend/src/components/app-config/user-config-form.tsx → frontend/src/components/app-config/ai-config.tsx → frontend/src/components/ai/ai-model-dropdown.tsx (one verified cycle inside a mutually-dependent group of 5 files) — frontend/src/components/ai/ai-model-dropdown.tsx:22
Other · Security — Only what this repository's own non-C# files could be read for was assessed — markup this repository SHIPS is scored for third-party script integrity whether or not the repository serves it itself, since a page handed to a consumer runs in that consumer’s origin — and because this repository commits the configuration that serves its own HTTP surface, that configuration could be read in full for the security response headers it sets. Nothing else in this dimension was assessed: the transport, cookie, input-validation and crypto controls are read from a source model that was not loaded for this repository’s language, so their absence here is not a finding about this repository.
Method: Roslyn plus filesystem scan: HSTS/security headers, secure cookies, input validation, middleware order, weak crypto (MD5/SHA1/DES); HTTPS-metadata context-aware. On a repository with no .NET source it reads JavaScript/TypeScript, Dart, Ruby, Scala, Rust or Elixir source itself (test, vendored, generated and minified paths not) for the arms that hold whether or not the code serves HTTP: a weak hash or cipher, key material fixed in the source, a TLS client that accepts any certificate, and (JavaScript/TypeScript, Ruby, Scala, Rust and Elixir) an obsolete TLS version; the server controls are not assessed there, and a Dart, Ruby, Scala, Rust or Elixir repository that serves no HTTP of its own is N/A on them. Deterministic.
`https://cdn.jsdelivr.net/npm/@marimo-team/islands@0.13.14/dist/main.js` is executed by this page with no Subresource Integrity. Whoever can answer that request — the CDN, anyone who compromises it, anyone on the network path — runs arbitrary script in this page's origin, with its session. 3 such include(s) across the repository's markup. — frontend/islands/__demo__/index.html:11
None of the 11 security response headers the OWASP Secure Headers Project recommends (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options, …) is configured — defense in depth, even when a reverse proxy could set them. This is reported because `vercel.json` configures this repository's static hosting, including its response headers, so the configuration that would carry these headers is in this repository and was read in full. (−2.0 on this card.) — docs/vercel.json:1
What to do
Pin third-party scripts and verify them: name an exact version in the URL and add an `integrity="sha384-…"` hash alongside `crossorigin="anonymous"` (both are required — an integrity hash on a cross-origin script without `crossorigin` is not evaluated, it blocks the script). Where the vendor ships a continuously-updated loader and publishes no stable hash (tag managers, analytics, chat widgets), Subresource Integrity is not available: constrain it instead with a `Content-Security-Policy` that names the exact origins allowed to execute, and drop the script from the pages that do not need it. Where the page is shipped inside a package that others host, prefer vendoring the asset and serving it from the app’s own origin, so no consumer inherits a third-party dependency they did not choose.
Set security response headers on the surface this repository serves: an `add_header` directive per header in the nginx/Caddy/Apache config, a `_headers` / `vercel.json` / `netlify.toml` entry for a static host, or `helmet()` in the HTTP server. `Content-Security-Policy` is the one that pays for itself first — it is what contains an injected script once one reaches the page — followed by `X-Content-Type-Options: nosniff` and a frame policy (`X-Frame-Options: DENY`, or CSP `frame-ancestors`). Where the app is served from a build container, the header configuration belongs in the image beside the built assets, so it ships with them rather than depending on where it lands.
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. (×2) — marimo/_server/host/backend.py:140, marimo/_server/host/handover.py:78
What to do
Task from `asyncio.get_running_loop().create_task` is not kept
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.
Do you agree with this assessment?
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.
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.
Do you agree with this assessment?
X17 · Uncapped recursion over a caller-supplied document1.5 / 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.
`sorted_keys` is public and takes `value: Any` from its caller, and it calls itself at line 56 (`sorted_keys`) with a piece of `value` (and at line 58) — and nowhere in `sorted_keys` 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 `sorted_keys` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — REDACTED:56
`forGenerators` is exported, takes a document from its caller (line 135) and hands it to `adjust`, which calls itself at line 62 (`adjust`) with a piece of `value` — and nowhere in `adjust` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `adjust` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — packages/host-protocol/src/internal/openapi.ts:62
`deep_to_camel_case` is public and takes `snake_dict: Any` from its caller, and it calls itself at line 42 (`deep_to_camel_case`) with a piece of `snake_dict` (and at line 49, line 52) — and nowhere in `deep_to_camel_case` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `deep_to_camel_case` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — marimo/_utils/case.py:42
`convert` is public and takes `py_type: Any` from its caller, and it calls itself at line 62 (`self.convert`) with a piece of `py_type` (and at line 81, line 91, line 104, line 119, line 128, line 147, line 153, line 166) — and nowhere in `convert` 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 `convert` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — marimo/_utils/dataclass_to_openapi.py:62
`flatten` is public, takes a document from its caller (line 215) and hands it to `_flatten`, which calls itself at line 179 (`_flatten`) with a piece of `value` — and nowhere in `_flatten` 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 `_flatten` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — marimo/_utils/flatten.py:179
`contains_instance` is public, takes a document from its caller (line 283) and hands it to `_contains_instance`, which calls itself at line 297 (`_contains_instance`) with a piece of `value` (and at line 299) — and nowhere in `_contains_instance` 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 `_contains_instance` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — marimo/_utils/flatten.py:297
`restore` is public, takes a document from its caller (line 189) and hands it to `_restore_from_stub_if_needed`, which calls itself at line 315 (`self._restore_from_stub_if_needed`) with a piece of `value` (and at line 322, line 331, line 342, line 364) — and nowhere in `_restore_from_stub_if_needed` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_restore_from_stub_if_needed` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — marimo/_save/cache.py:315
`primitive_to_bytes` is public and takes `value: Any` from its caller, and it calls itself at line 157 (`primitive_to_bytes`) with a piece of `value` — and nowhere in `primitive_to_bytes` 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 `primitive_to_bytes` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — marimo/_save/encode.py:157
`common_container_to_bytes` is public, takes a document from its caller (line 189) and hands it to `recurse_container`, which calls itself at line 197 (`recurse_container`) with a piece of `value` (and at line 200, line 203, line 206) — and nowhere in `recurse_container` 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 `recurse_container` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — marimo/_save/encode.py:197
`is_primitive` is public and takes `value: Any` from its caller, and it calls itself at line 48 (`is_primitive`) with a piece of `value` — and nowhere in `is_primitive` 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 `is_primitive` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — marimo/_runtime/primitives.py:48
`register_scope` is public, takes a document from its caller (line 103) and hands it to `_find_bindings_in_namespace`, which calls itself at line 85 (`self._find_bindings_in_namespace`) with a piece of `glbls` — and nowhere in `_find_bindings_in_namespace` 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_bindings_in_namespace` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — marimo/_plugins/ui/_core/registry.py:85
`tabs` is public and takes `tabs: Mapping[str, object]` from its caller, and it calls itself at line 44 (`tabs`) with a piece of `tabs` — and nowhere in `tabs` 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 `tabs` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — marimo/_plugins/stateless/tabs.py:44
`enc_hook` is public and takes `obj: Any` from its caller, and it calls itself at line 230 (`enc_hook`) with a piece of `obj` (and at line 233, line 245) — and nowhere in `enc_hook` 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 `enc_hook` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — marimo/_messaging/msgspec_encoder.py:230
`config_paths` is public and takes `config: dict[str, Any]` from its caller, and it calls itself at line 57 (`config_paths`) with a piece of `config` — and nowhere in `config_paths` 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 `config_paths` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — marimo/_config/resolver.py:57
`from_dict` is public, takes a document from its caller (line 152) and hands it to `_retain_unknown_fields`, which calls itself at line 66 (`_retain_unknown_fields`) with a piece of `source` (and at line 72, line 75) — and nowhere in `_retain_unknown_fields` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_retain_unknown_fields` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — marimo/_config/schema_utils.py:66
`drop_none_values` is public and takes `values: dict[str, Any]` from its caller, and it calls itself at line 23 (`drop_none_values`) with a piece of `values` (and at line 27) — and nowhere in `drop_none_values` 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 `drop_none_values` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — marimo/_config/utils.py:23
`getContainerWidth` is exported and takes `spec: unknown` from its caller, and it calls itself at line 23 (`getContainerWidth`) with a piece of `spec` — and nowhere in `getContainerWidth` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `getContainerWidth` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — frontend/src/plugins/impl/vega/utils.ts:23
`extractBuffers` is exported and takes `value: unknown` from its caller, and it calls itself at line 24 (`extractBuffers`) with a piece of `value` (and at line 29, line 46) — and nowhere in `extractBuffers` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `extractBuffers` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — frontend/src/plugins/impl/panel/utils.ts:24
`paginateJson` is exported, takes a document from its caller (line 16) and hands it to `visit`, which calls itself at line 44 (`visit`) with a piece of `node` — and nowhere in `visit` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `visit` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — frontend/src/components/editor/output/json-output/pagination.ts:44
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.
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.
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 5/12 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.
`fetchModelsDev` 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 })`. — packages/llm-info/src/sources/models-dev.ts:108
`copyImageToClipboard` 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 })`. — frontend/src/utils/copy.ts:64
`http` 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 })`. — frontend/src/core/static/files.ts:77
`load` 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 })`. — frontend/src/core/static/files.ts:96
`fetchHealth` 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 })`. — frontend/src/core/runtime/runtime.ts:221
`requestEditCompletion` 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 })`. — frontend/src/core/codemirror/ai/request.ts:12
`getMarkdownContent` 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 })`. — docs/_static/js/page_actions.js:38
What to do
Thread an AbortSignal through async functions that make requests, so the work stops when its caller gives up.
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.
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 473 is called with an argument built by `"…".join(cmd)` (line 473), 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. — REDACTED:473
`debug` at line 179 is called with an argument built by `"…".join(cmd)` (line 179), 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. — REDACTED:179
`debug` at line 147 is called with an argument built by `"…".join(map(repr, notebook.violations))` (line 149), 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. — marimo/_ast/load.py:147
`trace` at line 25 is called with an argument built by `join(", ")` (line 25), whose cost grows with the collection it walks. JavaScript 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 trace is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch. — frontend/src/utils/maps.ts:25
`debug` at line 198 is called with an argument built by `apps.map((a) => `${ a.id } (${ a.cells.length } cells)`)` (line 200), whose cost grows with the collection it walks. JavaScript 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 `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch. — frontend/src/core/islands/bridge.ts:198
What to do
Each finding names the diagnostic call and the expression inside its argument whose cost scales with a collection. Confirm from the two that the argument is built before the call — that is JavaScript's evaluation order, not a guess — then put the construction behind the level check the logger offers (`if (logger.isLevelEnabled('debug'))` for pino and winston, `isDebugEnabled()` for log4js, the repository's own debug flag where it has one), or hand the logger the object and a format string (`logger.debug({ payload }, 'raw request')`) so the serialising happens only when the line is written. Moving the call is not the fix: it is the join/projection/stringify in the argument that is paid, wherever the call sits. 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.
Do you agree with this assessment?
X24 · Document value interpolated into markup unescaped6.0 / 10Adequate✓ Tool-verified
Other · Security — Whether text read out of the document being converted is escaped before it is written into generated markup — a value the document's author chose, interpolated into an attribute the surrounding literal delimits, can close that attribute and open another.
Method: Roslyn semantic model over the whole compilation: a string-typed `Value`/`InnerText`/`InnerXml`/`Text` member declared inside `DocumentFormat.OpenXml` or `System.Xml` is a taint SOURCE, propagated through assignments, returns, arguments, tuple elements and string composition to its transitive closure, then read at interpolated-string holes that sit in a markup position the surrounding literal itself delimits. Escaper/encoder calls and enclosing validator conditions cut the flow. Flow- and container-insensitive by construction. A second arm needs no provenance at all and reports a type that CONTRADICTS ITSELF — the same expression escaped at one delimited markup hole and interpolated raw at another hole in the same markup position of the same type, which the type's own escaping proves is a defect without knowing where the value came from. On a repository with no .NET source it reads JavaScript/TypeScript off the token stream with the same rule: a DOM read of raw document text (`getAttribute`, `textContent`, `innerText`, `nodeValue`) is the source, propagated through local bindings and string composition, and judged at template-literal and concatenation holes in the same two delimited markup positions; escapers and validating conditions cut it, and documentation-site, test, vendored and minified scripts are not read. Deterministic, provable per finding. Advisory.
`html` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — frontend/src/components/data-table/utils.ts:271
`item.html` is text this program did not author, and it is written into the text of an element through `dangerouslySetInnerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — frontend/src/components/editor/chrome/panels/outline/floating-outline.tsx:153
`LENS_ICONS[spec.kind]` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — frontend/src/core/codemirror/code-lens/extension.ts:159
`innerHtml` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — frontend/src/core/codemirror/completion/Autocompleter.ts:30
`DefaultSqlTooltipRenders.keyword({keyword:label,info:keywordInfo,})` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — frontend/src/core/codemirror/language/languages/sql/completion-sources.tsx:73
`cell.displayOutput?cell.outputHtml:""` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — frontend/src/core/islands/parse.ts:320
`element.outerHTML` is text this program did not author, and it is written into the text of an element through `dangerouslySetInnerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — frontend/src/plugins/core/RenderHTML.tsx:95
`svg` is text this program did not author, and it is written into the text of an element through `dangerouslySetInnerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — REDACTED:103
`htmlString` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — frontend/src/utils/dom.ts:19
What to do
Each finding names the expression, the attribute it lands in and the line. Confirm the value's origin from the read this analyzer traced, then escape it at the sink or validate it against the shape the attribute accepts before interpolating.
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.
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.
Do you agree with this assessment?
X27 · Collection changed while being enumerated10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a `for` loop leaves the `dict`, `set` or `deque` it is walking alone — CPython's iterators over those check that the collection has not changed size since the loop began, so a body that removes from (or empties) the very collection the loop is walking makes the next step raise `RuntimeError: dictionary changed size during iteration` and the remaining items are never seen.
Method: Roslyn syntax + semantics: `foreach` statements whose body calls a structural mutator (`Add`/`Remove`/`Clear`/`Insert`/…) on the very expression the loop is enumerating. Two arms. ARM A — the source is a concrete fragile BCL collection, or a live `Keys`/`Values` view over one, and the mutator resolves to that same collection's own member; concurrent and immutable collections and arrays are outside the population by construction, since their enumerators survive a structural change. ARM B — the source is an argument-less accessor CALL on a receiver whose body is in source: the accessor must return a stored field VERBATIM and a sibling member must structurally change that same field, both read off the implementations rather than from the members' names. A mutation the loop provably exits immediately after (`break`/`return`/`throw`/`goto`), or one written inside a nested loop or a lambda, is counted and never reported. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
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.
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. (×16) — packages/client/src/transport/sse.ts:23, marimo/_utils/format_signature.py:40, marimo/_utils/tmpdir.py:34, …
`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. (×24) — marimo/_templates.py:265, marimo/_tracer.py:159, marimo/_utils/diagnostics.py:75, …
What to do
Swallowed exception (empty catch)
Do you agree with this assessment?
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.
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 171 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. — marimo/_loggers.py:171
`debug` at line 114 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. — marimo/_server/asgi.py:114
`debug` at line 135 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. — marimo/_server/asgi.py:135
`debug` at line 246 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. — marimo/_server/asgi.py:246
`debug` at line 263 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. — marimo/_server/asgi.py:263
`debug` at line 269 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. — marimo/_server/asgi.py:269
`debug` at line 276 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. — marimo/_server/asgi.py:276
`debug` at line 301 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. — marimo/_server/asgi.py:301
`debug` at line 324 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. — marimo/_server/asgi.py:324
`debug` at line 339 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. — marimo/_server/asgi.py:339
`debug` at line 343 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. — marimo/_server/asgi.py:343
Other · Code Health — Whether strict null checking is enabled and not undermined by heavy `!` assertion — TypeScript's `strictNullChecks` (which `strict` turns on) is what makes `string` exclude `null` and `undefined`, and the postfix `!` is the operator that silences it.
Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.
~0.1 `!` null assertions per 1k TypeScript source lines — 13 assertion(s) across the 179837 source line(s) of the 1204 TypeScript file(s) read, which is the only code the operator asserts anything in (a `!` in a `.js` file is not this operator and was not counted, and one in a file whose null checking is off silences nothing). Densest: frontend/src/core/wasm/worker/bootstrap.ts (4), frontend/src/utils/Deferred.ts (2), frontend/src/core/codemirror/facet.ts (1). Each one tells the compiler to trust the author about null, suppressing the very diagnostic `strictNullChecks` exists to produce. Many are correct: each is a claim the checker could not verify, and it is wrong only where the value can in fact be missing, so review the densest places first.
What to do
The findings name the configuration each number was taken from and, for the assertions, the files that hold them. Turn null checking on where it is off — `"strict": true` in the base tsconfig that the others extend switches `strictNullChecks` on with the rest of the family — and then resolve the assertions rather than adding to them. A `!` on a value the checker could show to be null is a promise the author cannot check from where they are standing, and each one is a `TypeError: Cannot read properties of null` waiting for the path that makes it true; where the value genuinely cannot be null, say something the checker can see instead (narrow it with a test, make the property required, drop the `?`).
Do you agree with this assessment?
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).
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.
Unscored — 4 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.
P12 CI test-gate honesty — 6 observation(s) recorded · Reported, not scored — this card publishes what the CI gate does with the test inventory rather than grading it. The findings above are its output.
X10 Duplicated predicate — 40 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X6 Hand-rolled structured-format parsing — 3 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X7 Silent fallback defaults — 33 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: this repository stores data through 'duckdb' (marimo/_tutorials/sql.py:50) but declares no persisted model this check reads (Django, SQLAlchemy, SQLModel, Peewee, Tortoise and MongoEngine model fields, Alembic and Django migration columns, CREATE TABLE and ALTER TABLE … ADD columns in SQL files). Personal data may be written through raw SQL or a hosted backend, so whether its changes need an audit trail could not be established, and the trail's absence is not scored.
C4 Data Retention — Not assessed: this repository stores data through 'duckdb' (marimo/_tutorials/sql.py:50) but declares no persisted model this check reads (Django, SQLAlchemy, SQLModel, Peewee, Tortoise and mongoengine model fields, Alembic and Django migration columns, SQL schemas). Personal data may be written through raw SQL or a hosted backend, so whether a retention limit applies here could not be established, and its absence is not scored.
C5 Data-Subject Rights — Not assessed: this repository stores data through 'duckdb' (marimo/_tutorials/sql.py:50) but declares no persisted model this check reads (Django, SQLAlchemy, SQLModel, Peewee, Tortoise and mongoengine model fields, Alembic and Django migration columns, CREATE TABLE and ALTER TABLE … ADD columns in SQL files). Personal data may be written through raw SQL or a hosted backend, so whether data-subject rights apply here could not be established, and their absence is not scored.
P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 39 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
AX9 CQS / query purity — no CQRS query handlers detected — query purity is not applicable to this codebase
AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
AXR1 Runtime accessibility — docker build failed (exit 1) — 29 | chown -R appuser:appuser /app "${VIRTUAL_ENV}" 30 | 31 | >>> COPY --chown=appuser:appuser marimo/_tutorials tutorials 32 | RUN rm -rf tutorials/__init__.py 33 | -------------------- ERROR: failed to solve: failed to compute cache key: failed to calculate checksum of ref d7f046de-1367-4188-8f4c-bc82eb9045d8::u1eznw5bs964qiyt3ttbus6ss: "/marimo/_tutorials": not found; likely cause (the repository): a file the REDACTED copies (`marimo/_tutorials`) is not in the repository's build context (it may be produced by a build step outside the REDACTED, or excluded by .dockerignore); runtime evidence skipped The cause is in the repository, not in our sandbox: a file the REDACTED copies (`marimo/_tutorials`) is not in the repository's build context (it may be produced by a build step outside the REDACTED, or excluded by .dockerignore). 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.
D11 Test Reliability — Test reliability not scored — polyglot repository, one half's runner produced no measurement
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.
D22 Internal API Consistency — N/A — too few peer members to establish a convention across 4 exposed TypeScript types.
D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ sibling projects each declaring an entity of their own or taking another project's integration events. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
D25 ADR Conformance — no ADRs to check
D27 Navigability — symbol resolution incomplete — navigability not assessed
D32 Data Compliance (PII/GDPR) — 55 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.
D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
D8 Code Coverage — Coverage not measured — polyglot repository, one half has no runner
DM1 Domain Modelling — applicable but not scored (2 of 3 signals for this style — below the bar we score at): 295 value object(s); 1 domain event(s); its domain events are published by services or handlers — no domain entity raises one
ED1 Event-Driven — not scored — this repository shows none of the 3 signals this lens looks for
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
P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
P9 Domain vs controller coverage — coverage data present for 1171 file(s), but no domain-layer files were identified: no covered file's path contains any of the markers this check keys on (/domain/, /aggregates/, /valueobjects/, /domainmodel/, .domain/, /entities/), which are matched case-insensitively anywhere in the path. With no domain partition there is nothing to compare the web/controller layer against — if this repository keeps its business rules under a folder named none of those, that naming is what the check cannot see, not the domain logic.
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.
R5 Dependency Freshness — uses a pnpm lockfile — dependency freshness not measured here; JS/npm CVEs are scored in D30 (Dependency Vulnerabilities), which answers every ecosystem
SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X15 Unvalidated length from an untrusted reader — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X16 Unfloored truncation loop — X16 reached only 43% of this repository's production lines — python (225,831 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 — X18 reached only 43% of this repository's production lines — python (225,831 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
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 43% of this repository's production lines — python (225,831 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.
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.
AC4 · Keyboard semantics· Clickable element isn't keyboard-operable · ×9
Clickable element isn't keyboard-operable frontend/src/components/ai/ai-model-dropdown.tsx:208— The repo's own CSS styles .cursor-pointer with `cursor: pointer`, so this <span> is a control — but it has no role, no tabIndex={0} and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabIndex={0} + a key handler.
Clickable element isn't keyboard-operable frontend/src/components/ai/ai-model-dropdown.tsx:290— The repo's own CSS styles .cursor-pointer with `cursor: pointer`, so this <div> is a control — but it has no role, no tabIndex={0} and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabIndex={0} + a key handler.
Clickable element isn't keyboard-operable frontend/src/components/app-config/ai-config.tsx:1500— The repo's own CSS styles .cursor-pointer with `cursor: pointer`, so this <div> is a control — but it has no role, no tabIndex={0} and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabIndex={0} + a key handler.
Clickable element isn't keyboard-operable frontend/src/components/chat/acp/blocks.tsx:490— The repo's own CSS styles .cursor-pointer with `cursor: pointer`, so this <span> is a control — but it has no role, no tabIndex={0} and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabIndex={0} + a key handler.
Clickable element isn't keyboard-operable frontend/src/components/data-table/url-detector.tsx:32— The repo's own CSS styles .cursor-pointer with `cursor: pointer`, so this <div> is a control — but it has no role, no tabIndex={0} and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabIndex={0} + a key handler.
Clickable element isn't keyboard-operable frontend/src/components/editor/links/cell-link-list.tsx:53— The repo's own CSS styles .cursor-pointer with `cursor: pointer`, so this <span> is a control — but it has no role, no tabIndex={0} and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabIndex={0} + a key handler.
Clickable element isn't keyboard-operable frontend/src/plugins/impl/FileUploadPlugin.tsx:205— The repo's own CSS styles .cursor-pointer with `cursor: pointer`, so this <span> is a control — but it has no role, no tabIndex={0} and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabIndex={0} + a key handler.
Clickable element isn't keyboard-operable frontend/src/plugins/impl/FileUploadPlugin.tsx:277— The repo's own CSS styles .cursor-pointer with `cursor: pointer`, so this <span> is a control — but it has no role, no tabIndex={0} and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabIndex={0} + a key handler.
Clickable element isn't keyboard-operable frontend/src/plugins/impl/data-frames/panel.tsx:404— The repo's own CSS styles .cursor-pointer with `cursor: pointer`, so this <span> is a control — but it has no role, no tabIndex={0} and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabIndex={0} + a key handler.
AC4 · Keyboard semantics· Click handler on a non-interactive <div> · ×9
Click handler on a non-interactive <div> frontend/src/components/data-table/columns.tsx:636— 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> frontend/src/components/data-table/columns.tsx:641— 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> frontend/src/components/data-table/columns.tsx:662— 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> frontend/src/components/data-table/columns.tsx:684— 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> frontend/src/components/data-table/columns.tsx:734— 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> frontend/src/components/data-table/columns.tsx:771— 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> frontend/src/components/data-table/columns.tsx:793— 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> frontend/src/components/data-table/columns.tsx:816— 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> frontend/src/components/pages/home-page.tsx:468— 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· Double-click handler on a non-interactive <div> · ×3
Double-click handler on a non-interactive <div> frontend/src/components/editor/cell/code/cell-editor.tsx:552— This <div> binds double-click and nothing else. No click, no key handler, and no tabIndex={0}, so it cannot even take focus. Nothing synthesises a double-click from the keyboard: Enter and Space fire a single click, and only on a native <button> or <a href>. So this behaviour has no keyboard path at all. Expose the same action on a real control, or add role + tabIndex={0} + a key handler alongside the double-click.
Double-click handler on a non-interactive <div> frontend/src/components/editor/file-tree/file-search-results.tsx:122— This <div> binds double-click and nothing else. No click, no key handler, and no tabIndex={0}, so it cannot even take focus. Nothing synthesises a double-click from the keyboard: Enter and Space fire a single click, and only on a native <button> or <a href>. So this behaviour has no keyboard path at all. Expose the same action on a real control, or add role + tabIndex={0} + a key handler alongside the double-click.
Double-click handler on a non-interactive <div> frontend/src/components/editor/notebook-cell.tsx:574— This <div> binds double-click and nothing else. No click, no key handler, and no tabIndex={0}, so it cannot even take focus. Nothing synthesises a double-click from the keyboard: Enter and Space fire a single click, and only on a native <button> or <a href>. So this behaviour has no keyboard path at all. Expose the same action on a real control, or add role + tabIndex={0} + a key handler alongside the double-click.
AC1 · Text alternatives· <img> without a text alternative · ×2
<img> without a text alternative frontend/islands/__demo__/output.html:98— An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
<img> without a text alternative frontend/src/core/codemirror/markdown/completions.ts:105— An image with no alt (and no aria-label/aria-labelledby) is unreadable to assistive tech. Add alt — alt="" if it's purely decorative.
AC2 · Forms & labels· Link with no accessible name · ×2
Link with no accessible name frontend/src/components/editor/notebook-cell.tsx:811— A link with no text, aria-label or labelled child (e.g. an icon-only link) has no accessible name, so assistive tech can't say where it goes. Add visible text or an aria-label.
Link with no accessible name frontend/src/components/editor/notebook-cell.tsx:823— A link with no text, aria-label or labelled child (e.g. an icon-only link) has no accessible name, so assistive tech can't say where it goes. Add visible text or an aria-label.
<html> without a lang frontend/islands/__demo__/index.html:3— The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
<html> without a lang frontend/islands/__demo__/output.html:2— The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
AC4 · Keyboard semantics· Hover-only interaction on <div> · ×2
Hover-only interaction on <div> frontend/src/components/chat/chat-components.tsx:58— 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.
Hover-only interaction on <div> frontend/src/components/tracing/tracing.tsx:391— 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.
Boundary-crossing change coupling: cell-array.tsx ↔ cell.stories.tsx frontend/src/components/editor/renderers/cell-array.tsx:1— `frontend/src/components/editor/renderers/cell-array.tsx` (context components) and `frontend/src/stories/cell.stories.tsx` (context stories) sit in DIFFERENT parts of the tree yet change together 50% of the time (18 of the 36 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 18 shared commits counted here, the most recent 3 are `cea1fef0` fix: setup cell can be focused / enter command mode (#6645); `863fec4e` Refactor `CellArray`/`Cell` to use atom-based state management (#5897) (at that commit the file was still `frontend/src/components/editor/renderers/CellArray.tsx`); `c29afca6` fix: remove autoscroll (#5344) (at that commit the file was still `frontend/src/components/editor/renderers/CellArray.tsx`) — run `git show` on any of them.
Boundary-crossing change coupling: DataTablePlugin.tsx ↔ dataframe.stories.tsx frontend/src/plugins/impl/DataTablePlugin.tsx:1— `frontend/src/plugins/impl/DataTablePlugin.tsx` (context plugins) and `frontend/src/stories/dataframe.stories.tsx` (context stories) sit in DIFFERENT parts of the tree yet change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — 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 5 shared commits counted here, the most recent 3 are `143b4cf7` feat: add GeoJSON export for tables and dataframes (#11116); `54a3b92b` feat: export geometry columns as GeoParquet (#11063); `b65bfb48` perf(table): lazy download-size RPC + first-page extrapolation (#9691) — run `git show` on any of them.
AC2 · Forms & labels· <input> without a programmatic label · ×1
<input> without a programmatic label frontend/src/components/data-table/SearchBar.tsx:50— This control has only a placeholder — a placeholder is not a label (it vanishes on input and many AT ignore it). Add a <label htmlFor>, a wrapping <label>, or aria-label.
AC2 · Forms & labels· Editable <span> without an accessible name · ×1
Editable <span> without an accessible name frontend/src/components/editor/actions/name-cell-input.tsx:87— An element made editable (contenteditable, or role="textbox"/"searchbox" with a tab stop or key handling) is a text-entry control, and it has no aria-label, no aria-labelledby and no title, so assistive tech announces an unnamed edit field. Point aria-labelledby at its visible caption, or add an aria-label.
AC4 · Keyboard semantics· Hover-only interaction on <span> · ×1
Hover-only interaction on <span> frontend/src/core/documentation/DocHoverTarget.tsx:16— 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.
Unlisted import 'pyodide' tests/_pyodide/test_pyodide_acceptance.mjs:92— Imported but not declared in any reachable package.json — installs work only by hoisting accident.
TodoComment tests/_sql/test_sql.py:373— # TODO — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment marimo/_sql/engines/clickhouse.py:616— # TODO — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment tests/_session/state/test_serialize_session.py:492— # TODO(akshayka): Reconcile this test with — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment tests/_server/api/endpoints/test_home.py:92— # TODO: Debug on Windows — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment tests/_save/test_cache.py:294— # TODO: fix with_setup to properly manage both traces. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment tests/_save/test_external_decorators.py:107— # TODO: Negate and fix. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment tests/_save/test_external_decorators.py:177— # TODO: Negate and fix. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment tests/_runtime/test_complete.py:560— # TODO case could be added to `cases_objects_supporting_key_completions()` — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment tests/_runtime/test_complete.py:609— # TODO add test cases for all other completion modalities — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment tests/_runtime/test_complete.py:610— # TODO improve coupling between variable name, source code, and assertions — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment tests/_runtime/test_complete.py:722— # TODO if `expects_completions=False`, something else than `_maybe_get_key_options()` — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment tests/_runtime/script_data/fn_exception.py:30— # TODO: Consider removing from signature? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment tests/_runtime/reload/test_module_watcher.py:140— # TODO: Invesitigate flaky on minimal CI — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment tests/_runtime/packages/test_package_utils.py:18— # TODO(akshayka): virtualenv not activating on windows CI — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment tests/_plugins/ui/_impl/tables/test_narwhals.py:560— # TODO: Unsupported by narwhals — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment tests/_plugins/ui/_impl/tables/test_pandas_table.py:1010— # TODO: fix xdist upstream — workermanage.py:462 should not tear down — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment tests/_plugins/ui/_impl/tables/test_polars_table.py:474— # TODO: narwhals doesn't support median — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment tests/_plugins/ui/_impl/dataframes/test_print_code.py:446— # TODO: test ibis python print — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment tests/_plugins/ui/_impl/dataframes/test_print_code.py:874— # TODO: unimplemented — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment tests/_plugins/ui/_impl/chat/test_chat.py:930— # TODO(dmadisetti): Resolve weave / windows issue. Raised upstream — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment tests/_plugins/stateless/test_image.py:161— # TODO(akshayka): Debug on Windows — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment tests/_output/formatters/test_ai_formatters.py:137— # TODO: Test streaming completion — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment tests/_output/formatters/test_altair.py:143— # TODO: Add tests for vegafusion — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment tests/_convert/markdown/test_markdown_conversion.py:503— # TODO: Ideally extract notebook title. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment tests/_cli/test_cli.py:2098— # TODO: fix this, it does not get overridden in tests (maybe it is using a different marimo version that the one in CI) — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FunctionTooLong: user-config-form.UserConfigForm frontend/src/components/app-config/user-config-form.tsx:103— FunctionTooLong — UserConfigForm runs 1126 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1026 over it, 11.26× 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: ai-config.AiCodeCompletionConfig frontend/src/components/app-config/ai-config.tsx:535— FunctionTooLong — AiCodeCompletionConfig runs 786 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 686 over it, 7.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.
FunctionTooLong: export-actions.ExportActions frontend/src/components/data-table/export-actions.tsx:355— FunctionTooLong — ExportActions runs 570 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 470 over it, 5.70× 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: MarimoErrorOutput.MarimoErrorOutput frontend/src/components/editor/output/MarimoErrorOutput.tsx:107— FunctionTooLong — MarimoErrorOutput runs 524 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 424 over it, 5.24× 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: chat-panel.ChatPanelBody frontend/src/components/chat/chat-panel.tsx:426— FunctionTooLong — ChatPanelBody runs 453 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 353 over it, 4.53× 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: agent-panel.AgentPanel frontend/src/components/chat/acp/agent-panel.tsx:662— FunctionTooLong — AgentPanel runs 431 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 331 over it, 4.31× 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: useNotebookActions.useNotebookActions frontend/src/components/editor/actions/useNotebookActions.tsx:113— FunctionTooLong — useNotebookActions runs 429 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 329 over it, 4.29× 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: app-chrome.AppChrome frontend/src/components/editor/chrome/wrapper/app-chrome.tsx:96— FunctionTooLong — AppChrome runs 405 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 305 over it, 4.05× 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: requests-network.createNetworkRequests frontend/src/core/network/requests-network.ts:32— FunctionTooLong — createNetworkRequests runs 401 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 301 over it, 4.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.
FunctionTooLong: chat-ui.Chatbot frontend/src/plugins/impl/chat/chat-ui.tsx:141— FunctionTooLong — Chatbot runs 396 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 296 over it, 3.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.
FunctionTooLong: notebook-cell.EditableCellComponent frontend/src/components/editor/notebook-cell.tsx:399— FunctionTooLong — EditableCellComponent runs 371 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 271 over it, 3.71× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: ai-config.AiProvidersConfig frontend/src/components/app-config/ai-config.tsx:899— FunctionTooLong — AiProvidersConfig runs 361 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 261 over it, 3.61× 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: FileBrowserPlugin.FileBrowser frontend/src/plugins/impl/FileBrowserPlugin.tsx:191— FunctionTooLong — FileBrowser runs 343 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 243 over it, 3.43× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: glide-data-editor.GlideDataEditorInner frontend/src/plugins/impl/data-editor/glide-data-editor.tsx:101— FunctionTooLong — GlideDataEditorInner runs 336 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 236 over it, 3.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.
FunctionTooLong: useNotebookSession.useNotebookSession frontend/src/core/session/useNotebookSession.tsx:87— FunctionTooLong — useNotebookSession runs 330 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 230 over it, 3.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.
FunctionTooLong: form.renderZodSchema frontend/src/components/forms/form.tsx:91— FunctionTooLong — renderZodSchema runs 320 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 220 over it, 3.20× 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: analyzer.findReactiveVariables frontend/src/core/codemirror/reactive-references/analyzer.ts:20— FunctionTooLong — findReactiveVariables runs 309 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 209 over it, 3.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.
FunctionTooLong: MatrixPlugin.MatrixComponent frontend/src/plugins/impl/MatrixPlugin.tsx:97— FunctionTooLong — MatrixComponent runs 305 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 205 over it, 3.05× 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: cell-editor.CellEditorInternal frontend/src/components/editor/cell/code/cell-editor.tsx:100— FunctionTooLong — CellEditorInternal runs 297 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 197 over it, 2.97× 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: ai-completion-editor.AiCompletionEditor frontend/src/components/editor/ai/ai-completion-editor.tsx:85— FunctionTooLong — AiCompletionEditor runs 271 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 171 over it, 2.71× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: data-table.DataTableInternal frontend/src/components/data-table/data-table.tsx:137— FunctionTooLong — DataTableInternal runs 257 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 157 over it, 2.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: useCellActionButton.useCellActionButtons frontend/src/components/editor/actions/useCellActionButton.tsx:91— FunctionTooLong — useCellActionButtons runs 257 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 157 over it, 2.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: file-explorer.Node frontend/src/components/editor/file-tree/file-explorer.tsx:690— FunctionTooLong — Node runs 253 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 153 over it, 2.53× 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: prompt.getAgentPrompt frontend/src/components/chat/acp/prompt.ts:3— FunctionTooLong — getAgentPrompt runs 248 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 148 over it, 2.48× 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: runtime-story.RuntimeStory frontend/src/stories/runtime-story.tsx:225— FunctionTooLong — RuntimeStory runs 232 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 132 over it, 2.32× 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.
Hotspot: frontend/src/core/session/useNotebookSession.tsx frontend/src/core/session/useNotebookSession.tsx:127— frontend/src/core/session/useNotebookSession.tsx changed 26 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 55 in useNotebookSession.useNotebookSession.handleNotification at line 127. 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 17:48:14 -05:00' --until='2026-11-16 17:48:14 -05:00' --full-history --no-merges -- frontend/src/core/session/useNotebookSession.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: marimo/_runtime/runtime.py marimo/_runtime/runtime.py:1279— marimo/_runtime/runtime.py changed 35 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 24 in Kernel.mutate_graph at line 1279. 8 of those changes were fix/bug commits, and the other 27 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-18..2026-11-16, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-18 17:48:14 -05:00' --until='2026-11-16 17:48:14 -05:00' --full-history --no-merges -- marimo/_runtime/runtime.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: frontend/src/components/data-table/export-actions.tsx frontend/src/components/data-table/export-actions.tsx:355— frontend/src/components/data-table/export-actions.tsx changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 123 in export-actions.ExportActions at line 355. 2 of those changes were fix/bug commits, and the other 4 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 17:48:14 -05:00' --until='2026-11-16 17:48:14 -05:00' --full-history --no-merges -- frontend/src/components/data-table/export-actions.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: frontend/src/components/editor/notebook-cell.tsx frontend/src/components/editor/notebook-cell.tsx:399— frontend/src/components/editor/notebook-cell.tsx changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 56 in notebook-cell.EditableCellComponent at line 399. 1 of those changes was a fix/bug commit, and the other 11 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 17:48:14 -05:00' --until='2026-11-16 17:48:14 -05:00' --full-history --no-merges -- frontend/src/components/editor/notebook-cell.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: frontend/src/components/chat/chat-panel.tsx frontend/src/components/chat/chat-panel.tsx:426— frontend/src/components/chat/chat-panel.tsx changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 61 in chat-panel.ChatPanelBody at line 426. 4 of those changes were fix/bug commits, and the other 7 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 17:48:14 -05:00' --until='2026-11-16 17:48:14 -05:00' --full-history --no-merges -- frontend/src/components/chat/chat-panel.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: frontend/src/core/notebook/replica/replica.ts frontend/src/core/notebook/replica/replica.ts:151— frontend/src/core/notebook/replica/replica.ts changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 28 in replica.createNotebookReplica at line 151. 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 17:48:14 -05:00' --until='2026-11-16 17:48:14 -05:00' --full-history --no-merges -- frontend/src/core/notebook/replica/replica.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: marimo/_server/host/backend.py marimo/_server/host/backend.py:522— marimo/_server/host/backend.py changed 24 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in SessionBackend._handle_notification at line 522. 1 of those changes was a fix/bug commit, and the other 23 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 17:48:14 -05:00' --until='2026-11-16 17:48:14 -05:00' --full-history --no-merges -- marimo/_server/host/backend.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: marimo/_server/host/translate.py marimo/_server/host/translate.py:93— marimo/_server/host/translate.py changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 29 in RunTranslator.feed at line 93. 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 17:48:14 -05:00' --until='2026-11-16 17:48:14 -05:00' --full-history --no-merges -- marimo/_server/host/translate.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: frontend/src/components/app-config/user-config-form.tsx frontend/src/components/app-config/user-config-form.tsx:103— frontend/src/components/app-config/user-config-form.tsx changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 58 in user-config-form.UserConfigForm at line 103. 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 17:48:14 -05:00' --until='2026-11-16 17:48:14 -05:00' --full-history --no-merges -- frontend/src/components/app-config/user-config-form.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: marimo/_session/state/session_view.py marimo/_session/state/session_view.py:304— marimo/_session/state/session_view.py changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 50 in SessionView.add_notification at line 304. 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 17:48:14 -05:00' --until='2026-11-16 17:48:14 -05:00' --full-history --no-merges -- marimo/_session/state/session_view.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:301— REDACTED changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 28 in IPCKernelManagerImpl.start_kernel at line 301. 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 17:48:14 -05:00' --until='2026-11-16 17:48:14 -05: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: marimo/_code_mode/_context.py marimo/_code_mode/_context.py:1727— marimo/_code_mode/_context.py changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 30 in AsyncCodeModeContext._apply_ops at line 1727. 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 17:48:14 -05:00' --until='2026-11-16 17:48:14 -05:00' --full-history --no-merges -- marimo/_code_mode/_context.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: marimo/_core/executions.py marimo/_core/executions.py:306— marimo/_core/executions.py changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 29 in Executions.observe at line 306. 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 17:48:14 -05:00' --until='2026-11-16 17:48:14 -05:00' --full-history --no-merges -- marimo/_core/executions.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: frontend/src/components/chat/acp/agent-panel.tsx frontend/src/components/chat/acp/agent-panel.tsx:662— frontend/src/components/chat/acp/agent-panel.tsx changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 75 in agent-panel.AgentPanel at line 662. 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 17:48:14 -05:00' --until='2026-11-16 17:48:14 -05:00' --full-history --no-merges -- frontend/src/components/chat/acp/agent-panel.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: marimo/_plugins/ui/_impl/table.py marimo/_plugins/ui/_impl/table.py:664— marimo/_plugins/ui/_impl/table.py changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 45 in table.__init__ at line 664. 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 17:48:14 -05:00' --until='2026-11-16 17:48:14 -05:00' --full-history --no-merges -- marimo/_plugins/ui/_impl/table.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: marimo/_cli/pair/commands.py marimo/_cli/pair/commands.py:215— marimo/_cli/pair/commands.py changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 32 in commands.execute at line 215. 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 17:48:14 -05:00' --until='2026-11-16 17:48:14 -05:00' --full-history --no-merges -- marimo/_cli/pair/commands.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: frontend/src/plugins/impl/data-editor/glide-data-editor.tsx frontend/src/plugins/impl/data-editor/glide-data-editor.tsx:101— frontend/src/plugins/impl/data-editor/glide-data-editor.tsx changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 56 in glide-data-editor.GlideDataEditorInner at line 101. 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 17:48:14 -05:00' --until='2026-11-16 17:48:14 -05:00' --full-history --no-merges -- frontend/src/plugins/impl/data-editor/glide-data-editor.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: frontend/src/components/editor/file-tree/file-explorer.tsx frontend/src/components/editor/file-tree/file-explorer.tsx:111— frontend/src/components/editor/file-tree/file-explorer.tsx changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 55 in file-explorer.FileExplorer at line 111. 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 17:48:14 -05:00' --until='2026-11-16 17:48:14 -05:00' --full-history --no-merges -- frontend/src/components/editor/file-tree/file-explorer.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: frontend/src/components/editor/cell/code/cell-editor.tsx frontend/src/components/editor/cell/code/cell-editor.tsx:100— frontend/src/components/editor/cell/code/cell-editor.tsx changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in cell-editor.CellEditorInternal at line 100. 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 17:48:14 -05:00' --until='2026-11-16 17:48:14 -05:00' --full-history --no-merges -- frontend/src/components/editor/cell/code/cell-editor.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: REDACTED REDACTED:1160— REDACTED changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 29 in LazyLoader.restore_cache at line 1160. 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 17:48:14 -05:00' --until='2026-11-16 17:48:14 -05: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: frontend/src/plugins/impl/chat/chat-ui.tsx frontend/src/plugins/impl/chat/chat-ui.tsx:141— frontend/src/plugins/impl/chat/chat-ui.tsx changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 52 in chat-ui.Chatbot at line 141. 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 17:48:14 -05:00' --until='2026-11-16 17:48:14 -05:00' --full-history --no-merges -- frontend/src/plugins/impl/chat/chat-ui.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: marimo/_server/api/endpoints/ai.py marimo/_server/api/endpoints/ai.py:131— marimo/_server/api/endpoints/ai.py changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 28 in ai.list_provider_models at line 131. 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 17:48:14 -05:00' --until='2026-11-16 17:48:14 -05:00' --full-history --no-merges -- marimo/_server/api/endpoints/ai.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: marimo/_runtime/runner/cell_runner.py marimo/_runtime/runner/cell_runner.py:396— marimo/_runtime/runner/cell_runner.py changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in Runner._run_result_from_exception at line 396. 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 17:48:14 -05:00' --until='2026-11-16 17:48:14 -05:00' --full-history --no-merges -- marimo/_runtime/runner/cell_runner.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: frontend/src/components/slides/reveal-component.tsx frontend/src/components/slides/reveal-component.tsx:472— frontend/src/components/slides/reveal-component.tsx changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 48 in reveal-component.RevealSlidesComponent at line 472. 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 17:48:14 -05:00' --until='2026-11-16 17:48:14 -05:00' --full-history --no-merges -- frontend/src/components/slides/reveal-component.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: marimo/_templates.py marimo/_templates.py:303— marimo/_templates.py changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in _templates.notebook_page_template at line 303. 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 17:48:14 -05:00' --until='2026-11-16 17:48:14 -05:00' --full-history --no-merges -- marimo/_templates.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.
FileTooLong: _impl/plotly.py marimo/_plugins/ui/_impl/plotly.py— FileTooLong — 2476 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1976 over it, 4.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: _runtime/runtime.py marimo/_runtime/runtime.py— FileTooLong — 1964 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1464 over it, 3.93× 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: app-config/ai-config.tsx frontend/src/components/app-config/ai-config.tsx— FileTooLong — 1728 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1228 over it, 3.46× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: _impl/table.py marimo/_plugins/ui/_impl/table.py— FileTooLong — 1304 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 804 over it, 2.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: app-config/user-config-form.tsx frontend/src/components/app-config/user-config-form.tsx— FileTooLong — 1206 significant lines (blank, comment-only and punctuation-only lines excluded), about 93% of them inside a single declaration: UserConfigForm (103-1361). The bar is 500 significant lines; this is 706 over it, 2.41× 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: REDACTED REDACTED— FileTooLong — 1148 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 648 over it, 2.30× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: tables/geometry_export.py marimo/_plugins/ui/_impl/tables/geometry_export.py— FileTooLong — 1005 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 505 over it, 2.01× 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: impl/DataTablePlugin.tsx frontend/src/plugins/impl/DataTablePlugin.tsx— FileTooLong — 1002 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 502 over it, 2.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: editor/notebook-cell.tsx frontend/src/components/editor/notebook-cell.tsx— FileTooLong — 1001 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 501 over it, 2.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: _code_mode/_context.py marimo/_code_mode/_context.py— FileTooLong — 965 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 465 over it, 1.93× 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: acp/agent-panel.tsx frontend/src/components/chat/acp/agent-panel.tsx— FileTooLong — 962 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 462 over it, 1.92× 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: data-table/export-actions.tsx frontend/src/components/data-table/export-actions.tsx— FileTooLong — 951 significant lines (blank, comment-only and punctuation-only lines excluded), about 60% of them inside a single declaration: ExportActions (355-1054). The bar is 500 significant lines; this is 451 over it, 1.90× 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: ai/providers.py marimo/_server/ai/providers.py— FileTooLong — 899 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 399 over it, 1.80× 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: file-tree/file-explorer.tsx frontend/src/components/editor/file-tree/file-explorer.tsx— FileTooLong — 892 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 392 over it, 1.78× 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: _save/save.py marimo/_save/save.py— FileTooLong — 869 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 369 over it, 1.74× 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: ipynb/to_ir.py marimo/_convert/ipynb/to_ir.py— FileTooLong — 860 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 360 over it, 1.72× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: storage/storage-inspector.tsx frontend/src/components/storage/storage-inspector.tsx— FileTooLong — 850 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 350 over it, 1.70× 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: _impl/input.py marimo/_plugins/ui/_impl/input.py— FileTooLong — 839 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 339 over it, 1.68× 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: _cli/cli.py marimo/_cli/cli.py— FileTooLong — 833 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 333 over it, 1.67× 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: _impl/data_editor.py marimo/_plugins/ui/_impl/data_editor.py— FileTooLong — 823 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 323 over it, 1.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: chat/chat-panel.tsx frontend/src/components/chat/chat-panel.tsx— FileTooLong — 816 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 316 over it, 1.63× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: _ast/parse.py marimo/_ast/parse.py— FileTooLong — 811 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 311 over it, 1.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: datasources/datasources.tsx frontend/src/components/datasources/datasources.tsx— FileTooLong — 811 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 311 over it, 1.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: _config/config_schema.py marimo/_config/config_schema.py— FileTooLong — 782 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 282 over it, 1.56× 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: _ast/visitor.py marimo/_ast/visitor.py— FileTooLong — 770 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 270 over it, 1.54× 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.
Boundary violation [package:test-suite-dependency] frontend/src/components/data-table/charts/components/chart-items.tsx:17— frontend/src/components/data-table/charts/components/chart-items.tsx:17 imports frontend/src/components/data-table/charts/chart-spec/spec.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on.
Boundary violation [package:test-suite-dependency] frontend/src/components/data-table/charts/components/chart-items.tsx:18— frontend/src/components/data-table/charts/components/chart-items.tsx:18 imports frontend/src/components/data-table/charts/chart-spec/types.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on.
Boundary violation [package:test-suite-dependency] frontend/src/components/data-table/charts/components/form-fields.tsx:39— frontend/src/components/data-table/charts/components/form-fields.tsx:39 imports frontend/src/components/data-table/charts/chart-spec/types.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on.
Boundary violation [package:test-suite-dependency] frontend/src/components/data-table/charts/forms/common-chart.tsx:8— frontend/src/components/data-table/charts/forms/common-chart.tsx:8 imports frontend/src/components/data-table/charts/chart-spec/spec.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on.
Boundary violation [package:test-suite-dependency] frontend/src/components/data-table/charts/forms/heatmap.tsx:4— frontend/src/components/data-table/charts/forms/heatmap.tsx:4 imports frontend/src/components/data-table/charts/chart-spec/spec.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on.
Boundary violation [package:test-suite-dependency] frontend/src/components/data-table/charts/forms/pie.tsx:4— frontend/src/components/data-table/charts/forms/pie.tsx:4 imports frontend/src/components/data-table/charts/chart-spec/spec.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on.
Boundary violation [package:test-suite-dependency] frontend/src/components/data-table/charts/forms/pie.tsx:5— frontend/src/components/data-table/charts/forms/pie.tsx:5 imports frontend/src/components/data-table/charts/chart-spec/types.ts, a module inside the test suite — test helpers carry no compatibility contract and are maintained for the suite, not as an API, so production code that depends on one is coupled to a module nobody keeps stable. Move the shared helper into a source directory both layers may depend on.
Boundary violation [package:third-party-deep-import] frontend/src/plugins/impl/DataEditorPlugin.tsx:3— frontend/src/plugins/impl/DataEditorPlugin.tsx:3 imports @glideapps/glide-data-grid/dist/index.css?inline, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
Boundary violation [package:third-party-deep-import] frontend/src/plugins/impl/DataEditorPlugin.tsx:4— frontend/src/plugins/impl/DataEditorPlugin.tsx:4 imports @glideapps/glide-data-grid-cells/dist/index.css?inline, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
Boundary violation [package:third-party-deep-import] frontend/src/plugins/impl/data-explorer/ConnectedDataExplorerComponent.tsx:3— frontend/src/plugins/impl/data-explorer/ConnectedDataExplorerComponent.tsx:3 imports compassql/build/src, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
Boundary violation [package:third-party-deep-import] frontend/src/plugins/impl/data-explorer/components/icons.tsx:2— frontend/src/plugins/impl/data-explorer/components/icons.tsx:2 imports compassql/build/src/schema, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
Boundary violation [package:third-party-deep-import] frontend/src/plugins/impl/data-explorer/components/query-form.tsx:4— frontend/src/plugins/impl/data-explorer/components/query-form.tsx:4 imports compassql/build/src/query/expandedtype, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
Boundary violation [package:third-party-deep-import] frontend/src/plugins/impl/data-explorer/components/query-form.tsx:5— frontend/src/plugins/impl/data-explorer/components/query-form.tsx:5 imports compassql/build/src/schema, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
Boundary violation [package:third-party-deep-import] frontend/src/plugins/impl/data-explorer/components/query-form.tsx:6— frontend/src/plugins/impl/data-explorer/components/query-form.tsx:6 imports compassql/build/src/wildcard, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
Boundary violation [package:third-party-deep-import] frontend/src/plugins/impl/data-explorer/encoding.ts:4— frontend/src/plugins/impl/data-explorer/encoding.ts:4 imports compassql/build/src/wildcard, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
Boundary violation [package:third-party-deep-import] frontend/src/plugins/impl/data-explorer/marks.ts:3— frontend/src/plugins/impl/data-explorer/marks.ts:3 imports compassql/build/src/wildcard, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
Boundary violation [package:third-party-deep-import] frontend/src/plugins/impl/data-explorer/queries/field-suggestion.ts:4— frontend/src/plugins/impl/data-explorer/queries/field-suggestion.ts:4 imports compassql/build/src/wildcard, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
Boundary violation [package:third-party-deep-import] frontend/src/plugins/impl/data-explorer/queries/histograms.ts:3— frontend/src/plugins/impl/data-explorer/queries/histograms.ts:3 imports compassql/build/src/wildcard, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
Boundary violation [package:third-party-deep-import] frontend/src/plugins/impl/data-explorer/queries/queries.ts:3— frontend/src/plugins/impl/data-explorer/queries/queries.ts:3 imports compassql/build/src, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
Boundary violation [package:third-party-deep-import] frontend/src/plugins/impl/data-explorer/queries/queries.ts:9— frontend/src/plugins/impl/data-explorer/queries/queries.ts:9 imports compassql/build/src/query/encoding, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
Boundary violation [package:third-party-deep-import] frontend/src/plugins/impl/data-explorer/queries/queries.ts:11— frontend/src/plugins/impl/data-explorer/queries/queries.ts:11 imports compassql/build/src/result, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
Boundary violation [package:third-party-deep-import] frontend/src/plugins/impl/data-explorer/queries/utils.ts:2— frontend/src/plugins/impl/data-explorer/queries/utils.ts:2 imports compassql/build/src/query/encoding, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
Boundary violation [package:third-party-deep-import] frontend/src/plugins/impl/data-explorer/queries/utils.ts:7— frontend/src/plugins/impl/data-explorer/queries/utils.ts:7 imports compassql/build/src/wildcard, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
Boundary violation [package:third-party-deep-import] frontend/src/plugins/impl/data-explorer/state/reducer.ts:4— frontend/src/plugins/impl/data-explorer/state/reducer.ts:4 imports compassql/build/src/wildcard, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
Boundary violation [package:third-party-deep-import] frontend/src/plugins/impl/plotly/Plot.tsx:9— frontend/src/plugins/impl/plotly/Plot.tsx:9 imports plotly.js/dist/plotly, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
Swallowed exception (caught, then discarded) marimo/_templates.py:265— `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) marimo/_tracer.py:159— `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) marimo/_utils/diagnostics.py:75— `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) marimo/_utils/formatter.py:207— `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) marimo/_utils/methods.py:34— `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) marimo/_utils/narwhals_utils.py:190— `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) marimo/_utils/versions.py:24— `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) marimo/_sql/engines/clickhouse.py:602— `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) marimo/_sql/engines/dbapi.py:137— `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) marimo/_sql/engines/dbapi.py:166— `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) marimo/_server/lsp.py:214— `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) marimo/_server/lsp.py:267— `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) marimo/_server/lsp.py:278— `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) marimo/_server/api/middleware.py:769— `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) marimo/_server/api/endpoints/terminal.py:92— `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) marimo/_save/stubs/stubs.py:25— `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) marimo/_runtime/complete.py:317— `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) marimo/_runtime/primitives.py:114— `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) marimo/_runtime/runner/hooks_post_execution.py:210— `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) marimo/_runtime/packages/_micropip_streaming.py:173— `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) marimo/_runtime/callbacks/cache.py:34— `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) marimo/_runtime/callbacks/packages.py:74— `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:591— `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:117— `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.
HackComment marimo/_session/state/serialize.py:345— # HACK: We need to detect tracebacks in stderr by checking for HTML — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
HackComment marimo/_session/managers/kernel.py:277— # Hack: Wait for kernel to exit and write out profile; — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
HackComment marimo/_runtime/runner/cell_runner.py:1000— # Hack: frontend sets status to queued on run, so we also have to — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
HackComment marimo/_plugins/ui/_impl/dataframes/transforms/types.py:103— # Hack to convert to tuple for frozen dataclass — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
HackComment marimo/_output/hypertext.py:359— # HACK: we must set MARIMO_NO_JS since the rendering may happen in another — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
HackComment marimo/_export/file.py:712— # Hack: yield to give the session view a chance to process the incoming — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
HackComment REDACTED:192— # hack. At some point rewriting / overriding the markdown parser would be a — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
HackComment frontend/src/plugins/impl/FileBrowserPlugin.tsx:212— // HACK: use the random-id of the host element to force a re-render — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
HackComment frontend/src/plugins/impl/data-editor/glide-data-editor.tsx:259— // Hack to emit copy event as these events aren't triggered automatically in shadow DOM — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
HackComment frontend/src/plugins/impl/chat/chat-ui.tsx:305— // HACK: strip the error message to clean up the response — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
HackComment frontend/src/core/codemirror/misc/__tests__/paste.test.ts:373— // HACK: manually add the paste event listener — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
HackComment frontend/src/core/codemirror/misc/__tests__/paste.test.ts:400— // HACK: manually add the paste event listener — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
HackComment frontend/src/core/codemirror/misc/__tests__/paste.test.ts:441— // HACK: manually add the paste event listener — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
HackComment REDACTED:144— // HACK: Ignore iceberg connections — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
HackComment frontend/src/core/codemirror/keymaps/vim.ts:403— // HACK: setSelections will steal focus from the current editor — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
HackComment frontend/src/core/codemirror/keymaps/vim.ts:439— // HACK: restore selection — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
HackComment frontend/src/core/codemirror/find-replace/state.ts:130— // HACK: If open, close it and re-open it to gain focus — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
HackComment frontend/src/components/editor/navigation/multi-cell-action-toolbar.tsx:424— // HACK: evt.target is the root <html> element — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
HackComment frontend/src/components/editor/chrome/wrapper/app-chrome.tsx:201— // HACK: Unfortunately, we have to do this twice to make sure the — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
HackComment frontend/src/components/editor/chrome/panels/outline/useActiveOutline.tsx:10— // HACK: this is a bit leaky — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
HackComment frontend/src/components/editor/cell/CreateCellButton.tsx:124— // Hack to prevent the first item from being clicked when the dropdown is — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
HackComment frontend/src/components/chat/acp/blocks.tsx:670— // Hack: sometimes title comes back: "undefined", so lets undo that — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
HackComment frontend/src/components/chat/acp/blocks.tsx:721— // HACK: if the raw input is `abs_path`, `old_string`, `new_string` then handle it as if it is a diff — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
R4 · Test Coverage· No test reaches this file · ×22
No test reaches this file frontend/lint/marimo-plugin.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 frontend/scripts/check-ai-sdk-compatibility.ts: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 frontend/src/hooks/debug.ts: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 packages/openapi/convert_types.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 frontend/src/components/data-table/SearchBar.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file frontend/src/components/editor/alerts/stdin-blocking-alert.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file frontend/src/components/dependency-graph/utils/changes.ts: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 frontend/src/components/editor/alerts/floating-alert.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file frontend/vite.shared.mts: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 frontend/src/components/editor/chrome/panels/variable-panel.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file frontend/src/core/islands/stubs/slide-cell-view.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/lsp/move.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 frontend/src/main.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file frontend/src/core/config/if-capability.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/host-protocol/scripts/openapi.ts: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 frontend/scripts/sync-katex-css.ts: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 frontend/vite.editing-profile.mts: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 frontend/src/core/debugger/state.ts: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 frontend/src/utils/dereference.ts: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 frontend/src/core/runtime/utils.ts: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 frontend/src/components/editor/chrome/panels/datasources-panel.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file frontend/src/utils/staticImplements.ts: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.
Change coupling: kernel_context.py ↔ script_context.py marimo/_runtime/context/kernel_context.py:1— `marimo/_runtime/context/kernel_context.py` and `marimo/_runtime/context/script_context.py` change together 79% of the time (15 of the 19 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 15 shared commits counted here, the most recent 3 are `cb68a52f` feat(cache): default persistent caching to the lazy loader (#11403); `55e2a22f` feat(cache): sanitize signing config from untrusted layers (#10525); `3dbe26fe` refactor(cache): introduce SigningPolicy and rename mode to verificat… — run `git show` on any of them.
Change coupling: MarimoErrorOutput.tsx ↔ errors.py frontend/src/components/editor/output/MarimoErrorOutput.tsx:1— `frontend/src/components/editor/output/MarimoErrorOutput.tsx` and `marimo/_messaging/errors.py` change together 69% of the time (9 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit — they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary — an event or message name, a route, a serialised shape — that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other's build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `15ed710d` feat: support lazy imports in setup cells (#11431); `e2e1556e` feat: Wrap and pass SQL Errors (#6498); `143620ff` mep/8: Setup cell protections (#4382) — run `git show` on any of them.
Change coupling: edit-app.tsx ↔ run-app.tsx frontend/src/core/edit-app.tsx:1— `frontend/src/core/edit-app.tsx` and `frontend/src/core/run-app.tsx` change together 67% of the time (8 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 8 shared commits counted here, the most recent 3 are `e7049767` Initialize cells from the host document (#11532); `9bc92717` Consume host events through `NotebookClient` (#11305); `72bda05d` feat(frontend): introduce progressive loading for wasm (#10044) — run `git show` on any of them.
Change coupling: dataflow.py ↔ markdown.py marimo/_tutorials/dataflow.py:1— `marimo/_tutorials/dataflow.py` and `marimo/_tutorials/markdown.py` 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) 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 7 shared commits counted here, the most recent 3 are `f9f475db` Bump matplotlib pin in tutorials to avoid Path.__deepcopy__ recursion…; `373fe21b` feat: marimo new prompt.txt (#4426); `6b0c5fd9` fix: add tutorial dependencies (#4368) — run `git show` on any of them.
Change coupling: plugins.ts ↔ REDACTED frontend/src/plugins/plugins.ts:1— `frontend/src/plugins/plugins.ts` and `marimo/_plugins/ui/__init__.py` change together 62% of the time (13 of the 21 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit — they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary — an event or message name, a route, a serialised shape — that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other's build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge. You can check this without leaving the row: of the 13 shared commits counted here, the most recent 3 are `6e6d801e` feat: mo.ui.matrix() (#8354); `a0ba6041` Add Panel support (#2719); `c461eb59` experimental: mo.ui.data_editor (#2567) — run `git show` on any of them.
Change coupling: cell-editor.tsx ↔ utils.ts frontend/src/components/editor/cell/code/cell-editor.tsx:1— `frontend/src/components/editor/cell/code/cell-editor.tsx` and `frontend/src/core/codemirror/language/utils.ts` 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 `35f44056` fix: [rtc] edge cases for auto-run and focus (#4861); `3f2d4523` Revert "improve: Move highlighted code to newly created cells (#2484)"; `25afc557` improve: Move highlighted code to newly created cells (#2484) — run `git show` on any of them.
Change coupling: user-config-form.tsx ↔ feature-flag.tsx frontend/src/components/app-config/user-config-form.tsx:1— `frontend/src/components/app-config/user-config-form.tsx` and `frontend/src/core/config/feature-flag.tsx` change together 59% of the time (27 of the 46 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 27 shared commits counted here, the most recent 3 are `f8be7db3` feat: experimental line_timing — green active-line highlight + per-li…; `cc265db2` remove feat flag for storage inspector (#8987); `14e78025` fix: dont rasterize images in the /pdf endpoint (#8558) — run `git show` on any of them.
Change coupling: default_table.py ↔ ibis_table.py marimo/_plugins/ui/_impl/tables/default_table.py:1— `marimo/_plugins/ui/_impl/tables/default_table.py` and `marimo/_plugins/ui/_impl/tables/ibis_table.py` change together 57% of the time (8 of the 14 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 `37976952` improvement: use backend binning for numeric columns (#5669); `46e8140d` chore: refactor col summaries (#5014); `9c072b7d` feat: add col filtering (#4531) — run `git show` on any of them.
Change coupling: data-table.tsx ↔ row-viewer.tsx frontend/src/components/data-table/data-table.tsx:1— `frontend/src/components/data-table/data-table.tsx` and `frontend/src/components/data-table/row-viewer-panel/row-viewer.tsx` 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) 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 `6ca62c81` adjust styles for table (#8963); `9d64f844` feat: unify row viewer and column explorer (#8905); `7942ddae` improvement: selectable row viewer (#5147) — run `git show` on any of them.
Change coupling: AnyWidgetPlugin.tsx ↔ model.ts frontend/src/plugins/impl/anywidget/AnyWidgetPlugin.tsx:1— `frontend/src/plugins/impl/anywidget/AnyWidgetPlugin.tsx` and `frontend/src/plugins/impl/anywidget/model.ts` 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) 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 `f7b1571e` fix: anywidget refresh value (#9454); `6c080985` Separate anywidget Model from widget binding lifecycle (#8156); `e9741235` Unify handling of widget state/buffers/bufferPaths (#7441) — run `git show` on any of them.
Change coupling: pair-with-agent-modal.tsx ↔ commands.py frontend/src/components/editor/actions/pair-with-agent-modal.tsx:1— `frontend/src/components/editor/actions/pair-with-agent-modal.tsx` and `marimo/_cli/pair/commands.py` 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) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit — they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary — an event or message name, a route, a serialised shape — that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other's build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `a5d03aa6` feat(pair): target notebooks by stable session ID (#11013); `4c64fc40` feat(pair): add opt-in CLI prompts for agent pairing (#10889); `3e44bbca` fix(pair): use --file path instead of --session for pair prompt (#10367) — run `git show` on any of them.
Change coupling: commands.py ↔ commands.py marimo/_cli/convert/commands.py:1— `marimo/_cli/convert/commands.py` and `marimo/_cli/export/commands.py` change together 54% of the time (7 of the 13 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 7 shared commits counted here, the most recent 3 are `95a290be` Ask for confirmation if file name already exist instead of overriding…; `fa5ed75b` chore: use Path over open (#4005); `d7c0e43d` cli: better support for bash completion (#3230) — run `git show` on any of them.
Change coupling: lsp.py ↔ index.ts marimo/_server/lsp.py:1— `marimo/_server/lsp.py` and `packages/lsp/index.ts` change together 54% of the time (7 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit — they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary — an event or message name, a route, a serialised shape — that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other's build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `48eb3f83` fix: secure language server websocket listeners (#10979); `21cfe3ea` fix: LSP servers not stopping gracefully on shutdown (#9084); `353bef38` fix: kill LSP child processes on shutdown to prevent memory leak (#8927) — run `git show` on any of them.
Change coupling: cell-array.tsx ↔ types.ts frontend/src/components/editor/renderers/cell-array.tsx:1— `frontend/src/components/editor/renderers/cell-array.tsx` and `frontend/src/core/cells/types.ts` change together 53% of the time (10 of the 19 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 10 shared commits counted here, the most recent 3 are `b0eee6eb` improvement: start markdown cells with hidden code (#5627) (at that commit the file was still `frontend/src/components/editor/renderers/CellArray.tsx`); `c04aaefc` mep/8: frontend function hints (#4025) (at that commit the file was still `frontend/src/components/editor/renderers/CellArray.tsx`); `de49311d` improvement: show last run in cell indicator (#2954) (at that commit the file was still `frontend/src/components/editor/renderers/CellArray.tsx`) — run `git show` on any of them.
Change coupling: bootstrap.ts ↔ worker.ts frontend/src/core/wasm/worker/bootstrap.ts:1— `frontend/src/core/wasm/worker/bootstrap.ts` and `frontend/src/core/wasm/worker/worker.ts` change together 52% of the time (16 of the 31 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 16 shared commits counted here, the most recent 3 are `54bb253c` Prepare WASM sessions before starting execution (#11520); `30ad03b0` Follow the WASM notebook through its host stream (#11517); `356a2664` Serve notebook edits in the WASM worker (#11488) — run `git show` on any of them.
Change coupling: DataTablePlugin.tsx ↔ ibis_table.py frontend/src/plugins/impl/DataTablePlugin.tsx:1— `frontend/src/plugins/impl/DataTablePlugin.tsx` and `marimo/_plugins/ui/_impl/tables/ibis_table.py` change together 50% of the time (7 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit — they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary — an event or message name, a route, a serialised shape — that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other's build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `7eaa8928` improvement: experimental backend aggregations in table charts (#5704); `37976952` improvement: use backend binning for numeric columns (#5669); `46e8140d` chore: refactor col summaries (#5014) — run `git show` on any of them.
Change coupling: REDACTED ↔ builder.py marimo/__init__.py:1— `marimo/__init__.py` and `marimo/_output/builder.py` change together 50% of the time (7 of the 14 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 7 shared commits counted here, the most recent 3 are `17631414` Add `mo.inspect` for rich object introspection (#5936); `7cf556ee` feat: mo.icon (#619); `6c62bbca` feat: mo.video (#234) — run `git show` on any of them.
Change coupling: export-actions.tsx ↔ dataframe.py frontend/src/components/data-table/export-actions.tsx:1— `frontend/src/components/data-table/export-actions.tsx` and `marimo/_plugins/ui/_impl/dataframes/dataframe.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) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit — they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary — an event or message name, a route, a serialised shape — that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other's build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `143b4cf7` feat: add GeoJSON export for tables and dataframes (#11116); `54a3b92b` feat: export geometry columns as GeoParquet (#11063); `bfa96392` feat: add shared table export dialog (#11029) — run `git show` on any of them.
Change coupling: array.py ↔ batch.py marimo/_plugins/ui/_impl/array.py:1— `marimo/_plugins/ui/_impl/array.py` and `marimo/_plugins/ui/_impl/batch.py` change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `bc203a43` fix(form): unify Ctrl+Enter, Shift+Enter and Submit button behavior (…; `2934e398` fix: higher-order components should call `on_update_completion()` (#3…; `d7a062ab` feat: add reactive execution on `ui.array` and `ui.dictionary`'s cont… — run `git show` on any of them.
X17 · Uncapped recursion over a caller-supplied document· Recursive walk over a caller-supplied document has no depth cap · ×19
Recursive walk over a caller-supplied document has no depth cap REDACTED:56— `sorted_keys` is public and takes `value: Any` from its caller, and it calls itself at line 56 (`sorted_keys`) with a piece of `value` (and at line 58) — and nowhere in `sorted_keys` 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 `sorted_keys` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap packages/host-protocol/src/internal/openapi.ts:62— `forGenerators` is exported, takes a document from its caller (line 135) and hands it to `adjust`, which calls itself at line 62 (`adjust`) with a piece of `value` — and nowhere in `adjust` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `adjust` 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 marimo/_utils/case.py:42— `deep_to_camel_case` is public and takes `snake_dict: Any` from its caller, and it calls itself at line 42 (`deep_to_camel_case`) with a piece of `snake_dict` (and at line 49, line 52) — and nowhere in `deep_to_camel_case` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `deep_to_camel_case` 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 marimo/_utils/dataclass_to_openapi.py:62— `convert` is public and takes `py_type: Any` from its caller, and it calls itself at line 62 (`self.convert`) with a piece of `py_type` (and at line 81, line 91, line 104, line 119, line 128, line 147, line 153, line 166) — and nowhere in `convert` 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 `convert` 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 marimo/_utils/flatten.py:179— `flatten` is public, takes a document from its caller (line 215) and hands it to `_flatten`, which calls itself at line 179 (`_flatten`) with a piece of `value` — and nowhere in `_flatten` 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 `_flatten` 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 marimo/_utils/flatten.py:297— `contains_instance` is public, takes a document from its caller (line 283) and hands it to `_contains_instance`, which calls itself at line 297 (`_contains_instance`) with a piece of `value` (and at line 299) — and nowhere in `_contains_instance` 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 `_contains_instance` 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 marimo/_save/cache.py:315— `restore` is public, takes a document from its caller (line 189) and hands it to `_restore_from_stub_if_needed`, which calls itself at line 315 (`self._restore_from_stub_if_needed`) with a piece of `value` (and at line 322, line 331, line 342, line 364) — and nowhere in `_restore_from_stub_if_needed` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_restore_from_stub_if_needed` 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 marimo/_save/encode.py:157— `primitive_to_bytes` is public and takes `value: Any` from its caller, and it calls itself at line 157 (`primitive_to_bytes`) with a piece of `value` — and nowhere in `primitive_to_bytes` 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 `primitive_to_bytes` 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 marimo/_save/encode.py:197— `common_container_to_bytes` is public, takes a document from its caller (line 189) and hands it to `recurse_container`, which calls itself at line 197 (`recurse_container`) with a piece of `value` (and at line 200, line 203, line 206) — and nowhere in `recurse_container` 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 `recurse_container` 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 marimo/_runtime/primitives.py:48— `is_primitive` is public and takes `value: Any` from its caller, and it calls itself at line 48 (`is_primitive`) with a piece of `value` — and nowhere in `is_primitive` 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 `is_primitive` 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 marimo/_plugins/ui/_core/registry.py:85— `register_scope` is public, takes a document from its caller (line 103) and hands it to `_find_bindings_in_namespace`, which calls itself at line 85 (`self._find_bindings_in_namespace`) with a piece of `glbls` — and nowhere in `_find_bindings_in_namespace` 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_bindings_in_namespace` 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 marimo/_plugins/stateless/tabs.py:44— `tabs` is public and takes `tabs: Mapping[str, object]` from its caller, and it calls itself at line 44 (`tabs`) with a piece of `tabs` — and nowhere in `tabs` 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 `tabs` 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 marimo/_messaging/msgspec_encoder.py:230— `enc_hook` is public and takes `obj: Any` from its caller, and it calls itself at line 230 (`enc_hook`) with a piece of `obj` (and at line 233, line 245) — and nowhere in `enc_hook` 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 `enc_hook` 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 marimo/_config/resolver.py:57— `config_paths` is public and takes `config: dict[str, Any]` from its caller, and it calls itself at line 57 (`config_paths`) with a piece of `config` — and nowhere in `config_paths` 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 `config_paths` 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 marimo/_config/schema_utils.py:66— `from_dict` is public, takes a document from its caller (line 152) and hands it to `_retain_unknown_fields`, which calls itself at line 66 (`_retain_unknown_fields`) with a piece of `source` (and at line 72, line 75) — and nowhere in `_retain_unknown_fields` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_retain_unknown_fields` 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 marimo/_config/utils.py:23— `drop_none_values` is public and takes `values: dict[str, Any]` from its caller, and it calls itself at line 23 (`drop_none_values`) with a piece of `values` (and at line 27) — and nowhere in `drop_none_values` 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 `drop_none_values` 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 frontend/src/plugins/impl/vega/utils.ts:23— `getContainerWidth` is exported and takes `spec: unknown` from its caller, and it calls itself at line 23 (`getContainerWidth`) with a piece of `spec` — and nowhere in `getContainerWidth` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `getContainerWidth` 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 frontend/src/plugins/impl/panel/utils.ts:24— `extractBuffers` is exported and takes `value: unknown` from its caller, and it calls itself at line 24 (`extractBuffers`) with a piece of `value` (and at line 29, line 46) — and nowhere in `extractBuffers` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `extractBuffers` 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 frontend/src/components/editor/output/json-output/pagination.ts:44— `paginateJson` is exported, takes a document from its caller (line 16) and hands it to `visit`, which calls itself at line 44 (`visit`) with a piece of `node` — and nowhere in `visit` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `visit` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Outbound HTTP without resilience marimo/_cli/convert/utils.py:17— `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 marimo/_cli/convert/utils.py:22— `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 marimo/_cli/files/file_path.py:63— `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 marimo/_cli/files/file_path.py:116— `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 marimo/_cli/files/file_path.py:160— `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 marimo/_cli/files/file_path.py:225— `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 marimo/_cli/files/file_path.py:237— `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 marimo/_cli/files/file_path.py:248— `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 marimo/_export/exporter.py:945— `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:433— `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:688— `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:39— `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:606— `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:38— `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:62— `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:89— `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:105— `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 marimo/_server/api/endpoints/assets.py:314— `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.
D30 · Dependency Vulnerabilities· Medium CVE · ×16
Swallowed exception (empty catch) packages/client/src/transport/sse.ts:23— 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) marimo/_utils/format_signature.py:40— 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) marimo/_utils/tmpdir.py:34— 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) marimo/_sql/engines/clickhouse.py:556— 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:532— 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:250— 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:333— 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:366— 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) marimo/_server/print.py:21— 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) marimo/_server/api/utils.py:170— 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) marimo/_server/api/endpoints/terminal.py:435— 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) marimo/_save/encode.py:253— 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:1791— 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) marimo/_runtime/runner/cell_runner.py:529— 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) marimo/_runtime/packages/package_manager.py:215— 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) marimo/_runtime/_wasm/_concurrency/_futures.py:623— 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.
Repeated repair: marimo/_server/ai/providers.py marimo/_server/ai/providers.py:597— marimo/_server/ai/providers.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 15 (its worst body is OpenAIClientMixin.get_openai_client at line 597), 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: preserve chat prompt caching across notebook edits (#11790)”; “fix: preserve AI provider routing with newer SDKs (#11466)”; “fix: preserve generic OpenAI provider for shared endpoints (#11499)”; “fix: allow AI code generation with deepseek-flash (#11461)”. 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 17:48:14 -05:00' --until='2026-11-16 17:48:14 -05:00' --full-history --no-merges -- marimo/_server/ai/providers.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: marimo/_server/lsp.py marimo/_server/lsp.py:91— marimo/_server/lsp.py changed 7 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is BaseLspServer._start_internal 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: use the detected package manager in install hints (#11846)”; “fix: launch helper python -m subprocesses with -P (#11860)”; “fix: probe LSP ports on loopback to avoid Windows firewall prompts (#11579)”; “fix: detect ty language server on PATH (#11321)”. 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 17:48:14 -05:00' --until='2026-11-16 17:48:14 -05:00' --full-history --no-merges -- marimo/_server/lsp.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: marimo/_runtime/app/script_runner.py marimo/_runtime/app/script_runner.py:256— marimo/_runtime/app/script_runner.py changed 6 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 13 (its worst body is AppScriptRunner.run at line 256), 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: stop script mode from importing matplotlib on startup (#11590)”; “fix(cache): finish manifest lifecycle cleanup (#11497)”; “fix: populate the cell cache when a notebook runs as a script (#11369)”; “fix: stop applying the notebook theme to plotting libraries (#11147)”. 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 17:48:14 -05:00' --until='2026-11-16 17:48:14 -05:00' --full-history --no-merges -- marimo/_runtime/app/script_runner.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: marimo/_server/api/middleware.py marimo/_server/api/middleware.py:558— marimo/_server/api/middleware.py 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 15 (its worst body is ProxyMiddleware.__call__ at line 558), 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: apply origin settings to WebSocket connections (#11621)”; “fix: trace the full HTTP response lifecycle (#11050)”; “fix: secure language server websocket listeners (#10979)”; “fix: keep marimo running when tracing dependencies are missing (#10758)”. 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 17:48:14 -05:00' --until='2026-11-16 17:48:14 -05:00' --full-history --no-merges -- marimo/_server/api/middleware.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: marimo/_sql/utils.py marimo/_sql/utils.py:245— marimo/_sql/utils.py changed 5 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is utils.convert_to_output at line 245), 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: use the detected package manager in install hints (#11846)”; “fix: adapt DuckDB relation and result handling for 2.0 (#11525)”; “fix: report SQL errors during automatic dataframe conversion (#11247)”; “fix: normalize Unicode DuckDB SQL error locations (#11151)”. 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 17:48:14 -05:00' --until='2026-11-16 17:48:14 -05:00' --full-history --no-merges -- marimo/_sql/utils.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: marimo/_sql/engines/duckdb.py marimo/_sql/engines/duckdb.py:430— marimo/_sql/engines/duckdb.py changed 5 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is DuckDBEngine._load_table_details at line 430), 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: adapt DuckDB relation and result handling for 2.0 (#11525)”; “fix: restore DuckDB 2.0 default database and schema discovery (#11515)”; “fix(sql): preserve nested schema paths in datasource browsing (#11458)”; “fix(sql): honor DuckDB discovery settings (#11007)”. 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 17:48:14 -05:00' --until='2026-11-16 17:48:14 -05:00' --full-history --no-merges -- marimo/_sql/engines/duckdb.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: marimo/_sql/parse.py marimo/_sql/parse.py:97— marimo/_sql/parse.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 14 (its worst body is parse._parse_sql_duckdb at line 97), 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: adapt DuckDB relation and result handling for 2.0 (#11525)”; “fix: align diagnostics after multiline SQL placeholders (#11224)”; “fix: align SQL interpolation error offsets (#11159)”; “fix: normalize Unicode DuckDB SQL error locations (#11151)”. 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 17:48:14 -05:00' --until='2026-11-16 17:48:14 -05:00' --full-history --no-merges -- marimo/_sql/parse.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: marimo/_plugins/ui/_impl/dates.py marimo/_plugins/ui/_impl/dates.py:238— marimo/_plugins/ui/_impl/dates.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 14 (its worst body is datetime.__init__ at line 238), 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(ui): handle empty series initializers (#11319)”; “fix: normalize datetime inputs in date widgets (#11289)”; “fix(dates): date_range default respects a single supplied bound (#10649)”. 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 17:48:14 -05:00' --until='2026-11-16 17:48:14 -05:00' --full-history --no-merges -- marimo/_plugins/ui/_impl/dates.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: marimo/_export/_pdf_raster.py marimo/_export/_pdf_raster.py:204— marimo/_export/_pdf_raster.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 8 (its worst body is _pdf_raster._collect_raster_targets at line 204), 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: preserve native math in WebPDF HTML outputs (#11831)”; “fix: run Playwright exports on a Proactor loop on Windows (#11491)”; “Fix PDF export for bare Altair charts (#11557)”. 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 17:48:14 -05:00' --until='2026-11-16 17:48:14 -05:00' --full-history --no-merges -- marimo/_export/_pdf_raster.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: frontend/playwright.config.ts frontend/playwright.config.ts:79— frontend/playwright.config.ts 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 4 (its worst body is getAppUrl at line 79), 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: improve slider width and decimal precision (#11797)”; “fix: preserve slide layouts across display resolutions (#11502)”; “test: add visual regression harness (#10670)”. 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 17:48:14 -05:00' --until='2026-11-16 17:48:14 -05:00' --full-history --no-merges -- frontend/playwright.config.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: marimo/_plugins/stateless/audio.py marimo/_plugins/stateless/audio.py:61— marimo/_plugins/stateless/audio.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 12 (its worst body is audio.get_resolved_src at line 61), 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(audio): resolve Safari audio controls blur in scroll containers (… (#11216)”; “fix(media): support pathlib.Path in mo.video and mo.audio (#11262)”; “fix(audio): avoid division by zero when normalizing silence (#11101)”. 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 17:48:14 -05:00' --until='2026-11-16 17:48:14 -05:00' --full-history --no-merges -- marimo/_plugins/stateless/audio.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: frontend/src/components/ui/fullscreen.tsx frontend/src/components/ui/fullscreen.tsx:215— frontend/src/components/ui/fullscreen.tsx 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 5 (its worst body is fullscreen.closestThroughShadowDOMs at line 215), 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 full screen open for elements inside plugin shadow roots (#11812)”; “fix: speed up notebook rendering by tracking fullscreen state (#11676)”; “fix: add an exit control to fullscreen cell output (#10769)”. 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 17:48:14 -05:00' --until='2026-11-16 17:48:14 -05:00' --full-history --no-merges -- frontend/src/components/ui/fullscreen.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: frontend/src/hooks/useEventListener.ts frontend/src/hooks/useEventListener.ts:15— frontend/src/hooks/useEventListener.ts 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 4 (its worst body is useEventListener.isRefObject at line 15), 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 debounce callbacks typed without any (#11404)”; “fix: preserve window listeners with current anchors (#11272)”; “fix: add an exit control to fullscreen cell output (#10769)”. 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 17:48:14 -05:00' --until='2026-11-16 17:48:14 -05:00' --full-history --no-merges -- frontend/src/hooks/useEventListener.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
AC2 · Forms & labels· <Select> field component without a label · ×11
<Select> field component without a label frontend/src/components/chat/acp/agent-panel.tsx:445— This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id alone, wherever it is set, names nothing until a label points at it). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<Select> field component without a label frontend/src/components/chat/acp/model-selector.tsx:33— This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id alone, wherever it is set, names nothing until a label points at it). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<Select> field component without a label frontend/src/components/data-table/charts/components/chart-items.tsx:139— This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id alone, wherever it is set, names nothing until a label points at it). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<Select> field component without a label frontend/src/components/editor/chrome/panels/write-secret-modal.tsx:174— This select is named only by the placeholder of its value part. Nothing is typed into a select, so the placeholder does not vanish on input: it is shown as the trigger's text until a value is chosen, and then the chosen value replaces it — so at no point does the control state what the choice is for, and the trigger's role (combobox) takes its name from the author, not from that text. Name it: an aria-label on the trigger, or an id on the trigger with a <label htmlFor> pointing at it.
<Select> field component without a label frontend/src/components/editor/connections/components.tsx:90— This select is named only by the placeholder of its value part. Nothing is typed into a select, so the placeholder does not vanish on input: it is shown as the trigger's text until a value is chosen, and then the chosen value replaces it — so at no point does the control state what the choice is for, and the trigger's role (combobox) takes its name from the author, not from that text. Name it: an aria-label on the trigger, or an id on the trigger with a <label htmlFor> pointing at it.
<Select> field component without a label frontend/src/components/editor/renderers/layout-select.tsx:37— This select is named only by the placeholder of its value part. Nothing is typed into a select, so the placeholder does not vanish on input: it is shown as the trigger's text until a value is chosen, and then the chosen value replaces it — so at no point does the control state what the choice is for, and the trigger's role (combobox) takes its name from the author, not from that text. Name it: an aria-label on the trigger, or an id on the trigger with a <label htmlFor> pointing at it.
<Select> field component without a label REDACTED:164— This select is named only by the placeholder of its value part. Nothing is typed into a select, so the placeholder does not vanish on input: it is shown as the trigger's text until a value is chosen, and then the chosen value replaces it — so at no point does the control state what the choice is for, and the trigger's role (combobox) takes its name from the author, not from that text. Name it: an aria-label on the trigger, or an id on the trigger with a <label htmlFor> pointing at it.
<Select> field component without a label frontend/src/plugins/impl/data-explorer/components/column-summary.tsx:102— This select is named only by the placeholder of its value part. Nothing is typed into a select, so the placeholder does not vanish on input: it is shown as the trigger's text until a value is chosen, and then the chosen value replaces it — so at no point does the control state what the choice is for, and the trigger's role (combobox) takes its name from the author, not from that text. Name it: an aria-label on the trigger, or an id on the trigger with a <label htmlFor> pointing at it.
<Select> field component without a label frontend/src/plugins/impl/data-explorer/components/query-form.tsx:68— This select is named only by the placeholder of its value part. Nothing is typed into a select, so the placeholder does not vanish on input: it is shown as the trigger's text until a value is chosen, and then the chosen value replaces it — so at no point does the control state what the choice is for, and the trigger's role (combobox) takes its name from the author, not from that text. Name it: an aria-label on the trigger, or an id on the trigger with a <label htmlFor> pointing at it.
<Select> field component without a label frontend/src/plugins/impl/data-explorer/components/query-form.tsx:161— This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id alone, wherever it is set, names nothing until a label points at it). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
<Select> field component without a label frontend/src/plugins/impl/data-explorer/components/query-form.tsx:256— This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id alone, wherever it is set, names nothing until a label points at it). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
TooManyMethods: PyodideBridge frontend/src/core/wasm/bridge.ts:63— TooManyMethods — 58 methods. The bar is 30 methods; this is 28 over it, 1.93× the bar. This type is on a published API surface — an apidiff API-compatibility gate in CI (.github/workflows/test_schemas.yaml) declares its compatibility contractual — so moving members onto a smaller type is a breaking change for every consumer, not a local refactor. To reduce it, treat the split as an API migration: move each cohesive group onto its own published type and keep the old members as deprecated forwards for a deprecation period, removing them at the next compatibility break. Where the surface has to stay as it is, that is a decision to record rather than a change to make.
TooManyMethods: Kernel marimo/_runtime/runtime.py:529— TooManyMethods — 57 methods. The bar is 30 methods; this is 27 over it, 1.90× the bar. This type is on a published API surface — an apidiff API-compatibility gate in CI (.github/workflows/test_schemas.yaml) declares its compatibility contractual — so moving members onto a smaller type is a breaking change for every consumer, not a local refactor. To reduce it, treat the split as an API migration: move each cohesive group onto its own published type and keep the old members as deprecated forwards for a deprecation period, removing them at the next compatibility break. Where the surface has to stay as it is, that is a decision to record rather than a change to make.
TooManyMethods: UnsafeCallVisitor marimo/_lint/rules/wasm/_unsafe_call_analysis.py:235— TooManyMethods — 56 methods. The bar is 30 methods; this is 26 over it, 1.87× the bar. This type is on a published API surface — an apidiff API-compatibility gate in CI (.github/workflows/test_schemas.yaml) declares its compatibility contractual — so moving members onto a smaller type is a breaking change for every consumer, not a local refactor. To reduce it, treat the split as an API migration: move each cohesive group onto its own published type and keep the old members as deprecated forwards for a deprecation period, removing them at the next compatibility break. Where the surface has to stay as it is, that is a decision to record rather than a change to make.
TooManyMethods: Notebook marimo/_core/notebook.py:45— TooManyMethods — 38 methods. The bar is 30 methods; this is 8 over it, 1.27× the bar. This type is on a published API surface — an apidiff API-compatibility gate in CI (.github/workflows/test_schemas.yaml) declares its compatibility contractual — so moving members onto a smaller type is a breaking change for every consumer, not a local refactor. To reduce it, treat the split as an API migration: move each cohesive group onto its own published type and keep the old members as deprecated forwards for a deprecation period, removing them at the next compatibility break. Where the surface has to stay as it is, that is a decision to record rather than a change to make.
TooManyMethods: SessionBridge marimo/_server/host/bridge.py:93— TooManyMethods — 37 methods. The bar is 30 methods; this is 7 over it, 1.23× the bar. This type is on a published API surface — an apidiff API-compatibility gate in CI (.github/workflows/test_schemas.yaml) declares its compatibility contractual — so moving members onto a smaller type is a breaking change for every consumer, not a local refactor. To reduce it, treat the split as an API migration: move each cohesive group onto its own published type and keep the old members as deprecated forwards for a deprecation period, removing them at the next compatibility break. Where the surface has to stay as it is, that is a decision to record rather than a change to make.
TooManyMethods: ScopedVisitor marimo/_ast/visitor.py:242— TooManyMethods — 34 methods. The bar is 30 methods; this is 4 over it, 1.13× the bar. This type is on a published API surface — an apidiff API-compatibility gate in CI (.github/workflows/test_schemas.yaml) declares its compatibility contractual — so moving members onto a smaller type is a breaking change for every consumer, not a local refactor. To reduce it, treat the split as an API migration: move each cohesive group onto its own published type and keep the old members as deprecated forwards for a deprecation period, removing them at the next compatibility break. Where the surface has to stay as it is, that is a decision to record rather than a change to make.
TooManyMethods: TableManager marimo/_plugins/ui/_impl/tables/table_manager.py:70— TooManyMethods — 34 methods. The bar is 30 methods; this is 4 over it, 1.13× the bar. This type is on a published API surface — an apidiff API-compatibility gate in CI (.github/workflows/test_schemas.yaml) declares its compatibility contractual — so moving members onto a smaller type is a breaking change for every consumer, not a local refactor. To reduce it, treat the split as an API migration: move each cohesive group onto its own published type and keep the old members as deprecated forwards for a deprecation period, removing them at the next compatibility break. Where the surface has to stay as it is, that is a decision to record rather than a change to make.
TooManyMethods: NarwhalsTableManager marimo/_plugins/ui/_impl/tables/narwhals_table.py:116— TooManyMethods — 33 methods. The bar is 30 methods; this is 3 over it, 1.10× the bar. This type is on a published API surface — an apidiff API-compatibility gate in CI (.github/workflows/test_schemas.yaml) declares its compatibility contractual — so moving members onto a smaller type is a breaking change for every consumer, not a local refactor. To reduce it, treat the split as an API migration: move each cohesive group onto its own published type and keep the old members as deprecated forwards for a deprecation period, removing them at the next compatibility break. Where the surface has to stay as it is, that is a decision to record rather than a change to make.
TooManyMethods: CellManager marimo/_ast/cell_manager.py:60— TooManyMethods — 31 methods. The bar is 30 methods; this is 1 over it, 1.03× the bar. This type is on a published API surface — an apidiff API-compatibility gate in CI (.github/workflows/test_schemas.yaml) declares its compatibility contractual — so moving members onto a smaller type is a breaking change for every consumer, not a local refactor. To reduce it, treat the split as an API migration: move each cohesive group onto its own published type and keep the old members as deprecated forwards for a deprecation period, removing them at the next compatibility break. Where the surface has to stay as it is, that is a decision to record rather than a change to make.
X24 · Document value interpolated into markup unescaped· Untrusted text written into markup unescaped · ×9
Untrusted text written into markup unescaped frontend/src/components/data-table/utils.ts:271— `html` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
Untrusted text written into markup unescaped frontend/src/components/editor/chrome/panels/outline/floating-outline.tsx:153— `item.html` is text this program did not author, and it is written into the text of an element through `dangerouslySetInnerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
Untrusted text written into markup unescaped frontend/src/core/codemirror/code-lens/extension.ts:159— `LENS_ICONS[spec.kind]` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
Untrusted text written into markup unescaped frontend/src/core/codemirror/completion/Autocompleter.ts:30— `innerHtml` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
Untrusted text written into markup unescaped frontend/src/core/codemirror/language/languages/sql/completion-sources.tsx:73— `DefaultSqlTooltipRenders.keyword({keyword:label,info:keywordInfo,})` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
Untrusted text written into markup unescaped frontend/src/core/islands/parse.ts:320— `cell.displayOutput?cell.outputHtml:""` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
Untrusted text written into markup unescaped frontend/src/plugins/core/RenderHTML.tsx:95— `element.outerHTML` is text this program did not author, and it is written into the text of an element through `dangerouslySetInnerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
Untrusted text written into markup unescaped REDACTED:103— `svg` is text this program did not author, and it is written into the text of an element through `dangerouslySetInnerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
Untrusted text written into markup unescaped frontend/src/utils/dom.ts:19— `htmlString` is text this program did not author, and it is written into the text of an element through `innerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
Duplicated block (10 lines × 2) marimo/_cli/help_formatter.py:44— marimo/_cli/help_formatter.py:44-53 | marimo/_cli/help_formatter.py:151-160 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) marimo/_messaging/streams.py:331— marimo/_messaging/streams.py:331-340 | marimo/_pyodide/streams.py:81-90 — `marimo/_messaging/streams.py` and `marimo/_pyodide/streams.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 3 separate duplicated blocks between them, totalling at least 36 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) marimo/_plugins/ui/_impl/dataframes/transforms/print_code.py:37— marimo/_plugins/ui/_impl/dataframes/transforms/print_code.py:37-46 | marimo/_plugins/ui/_impl/dataframes/transforms/print_code.py:580-589 — both copies are in the same file, so extract the 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) marimo/_smoke_tests/matrix.py:47— marimo/_smoke_tests/matrix.py:47-56 | marimo/_tutorials/ui.py:239-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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (10 lines × 2) frontend/e2e-tests/py/kitchen_sink.py:42— frontend/e2e-tests/py/kitchen_sink.py:42-51 | marimo/_tutorials/layout.py:83-92 — 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) marimo/_smoke_tests/theming/bokeh_theme.py:42— marimo/_smoke_tests/theming/bokeh_theme.py:42-51 | marimo/_smoke_tests/theming/bokeh_theme.py:56-65 — both copies are in the same file, so extract the 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) examples/ai/data/data_labeler.py:48— examples/ai/data/data_labeler.py:48-57 | examples/ai/data/model_comparison.py:50-59 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (10 lines × 2) marimo/_smoke_tests/sql/sql_alchemy_engine.py:163— marimo/_smoke_tests/sql/sql_alchemy_engine.py:163-172 | marimo/_smoke_tests/sql/sqlmodel_engine.py:178-187 — before extracting anything, compare `marimo/_smoke_tests/sql/sql_alchemy_engine.py` and `marimo/_smoke_tests/sql/sqlmodel_engine.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The `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.
No assertions: has a method for each request below a notebook packages/client/src/__tests__/notebook-client.test.ts:386— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: types each call from the operations table packages/client/src/__tests__/notebook-client.test.ts:491— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: narrows events to the requested kinds packages/client/src/__tests__/notebook-events.test.ts:224— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: names every operation in the spec packages/client/src/__tests__/operations.test.ts:21— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: separates cell runs from scratch execution packages/client/src/__tests__/protocol.test.ts:275— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: follows %s theme attributes in both directions frontend/src/theme/__tests__/islands-theme.test.tsx:73— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: matches the declared TypeScript signatures frontend/src/core/islands/__tests__/main.test.ts:75— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
D4 · Code Duplication· Edited copy of a member (14 corresponding lines) · ×7
Edited copy of a member (14 corresponding lines) REDACTED:78— REDACTED:78-99 | REDACTED:102-115 — 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) marimo/_environments/sandbox.py:530— marimo/_environments/sandbox.py:530-543 | marimo/_environments/sandbox.py:548-566 — 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) marimo/_snippets/data/altair-5.py:23— marimo/_snippets/data/altair-5.py:23-36 | marimo/_snippets/data/altair-6.py:23-42 — 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) marimo/_runtime/packages/sandbox_package_manager.py:79— marimo/_runtime/packages/sandbox_package_manager.py:79-99 | marimo/_runtime/packages/sandbox_package_manager.py:102-115 — 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) marimo/_environments/backends.py:495— marimo/_environments/backends.py:495-509 | marimo/_environments/backends.py:574-587 — 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) examples/cloud/gcp/google_cloud_bigquery.py:60— examples/cloud/gcp/google_cloud_bigquery.py:60-73 | examples/cloud/gcp/google_cloud_storage.py:53-67 — 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) examples/ai/chat/gemini.py:54— examples/ai/chat/gemini.py:54-67 | examples/ai/chat/groq_example.py:70-83 — 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.
Duplicated block (13 lines × 2) marimo/_cli/export/commands.py:1228— marimo/_cli/export/commands.py:1228-1240 | marimo/_cli/export/commands.py:1262-1274 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `marimo/_cli/export/commands.py:1228` 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) marimo/_convert/markdown/flavor/mdx.py:139— marimo/_convert/markdown/flavor/mdx.py:139-151 | marimo/_convert/markdown/flavor/mystmd.py:230-242 — 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) marimo/_data/series.py:121— marimo/_data/series.py:121-133 | marimo/_data/series.py:157-169 — both copies are in the same file, so extract the 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) marimo/_plugins/ui/_impl/plotly.py:1750— marimo/_plugins/ui/_impl/plotly.py:1750-1762 | marimo/_plugins/ui/_impl/plotly.py:1860-1872 — both copies are in the same file, so extract the 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, `marimo/_plugins/ui/_impl/plotly.py:1765` calls `asarray` and `marimo/_plugins/ui/_impl/plotly.py:1876` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (13 lines × 2) marimo/_plugins/ui/_impl/plotly.py:2072— marimo/_plugins/ui/_impl/plotly.py:2072-2084 | marimo/_plugins/ui/_impl/plotly.py:3389-3402 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) scripts/analyze_traces.py:229— scripts/analyze_traces.py:229-241 | scripts/analyze_traces.py:243-255 — both copies are in the same file, so extract the 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 `scripts/analyze_traces.py:229` 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) examples/ai/tools/chat_with_tools.py:69— examples/ai/tools/chat_with_tools.py:69-81 | examples/ai/tools/dataset_analysis.py:58-70 — 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.
X2 · Cancellation propagation· Async function without AbortSignal · ×7
Async function without AbortSignal: fetchModelsDev packages/llm-info/src/sources/models-dev.ts:108— `fetchModelsDev` 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: copyImageToClipboard frontend/src/utils/copy.ts:64— `copyImageToClipboard` 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: http frontend/src/core/static/files.ts:77— `http` 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: load frontend/src/core/static/files.ts:96— `load` 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: fetchHealth frontend/src/core/runtime/runtime.ts:221— `fetchHealth` 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: requestEditCompletion frontend/src/core/codemirror/ai/request.ts:12— `requestEditCompletion` 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: getMarkdownContent docs/_static/js/page_actions.js:38— `getMarkdownContent` 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 })`.
AC6 · Visual & motion safety· Animation without a prefers-reduced-motion guard · ×6
Animation without a prefers-reduced-motion guard frontend/src/plugins/impl/vega/vega.css:94— `.vega-embed .vega-actions` moves (`animation-name: scale-in`) 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 frontend/src/css/md.css:360— `.markdown details summary::before` moves (`transition: transform 0.2s`) 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 frontend/src/css/progress.css:79— `progress::-webkit-progress-value` moves (`transition: width 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 frontend/src/css/progress.css:85— `progress::-moz-progress-bar` moves (`transition: width 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 frontend/src/css/app/Header.css:21— `.running-app-icon` moves (`animation: running-app-animation 2000ms`) 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 docs/stylesheets/extra.css:169— `.pa-chevron` 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.
D4 · Code Duplication· Edited copy of a member (19 corresponding lines) · ×6
Edited copy of a member (19 corresponding lines) marimo/_runtime/executor/evaluator.py:39— marimo/_runtime/executor/evaluator.py:39-64 | marimo/_runtime/executor/evaluator.py:69-87 — 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) marimo/_snippets/data/matplotlib-0.py:31— marimo/_snippets/data/matplotlib-0.py:31-54 | marimo/_snippets/data/matplotlib-8.py:31-49 — 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) marimo/_messaging/streams.py:330— marimo/_messaging/streams.py:330-351 | marimo/_pyodide/streams.py:80-98 — 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) marimo/_runtime/watch/_directory.py:51— marimo/_runtime/watch/_directory.py:51-69 | marimo/_runtime/watch/_file.py:28-49 — 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) marimo/_runtime/runtime.py:211— marimo/_runtime/runtime.py:211-229 | marimo/_runtime/runtime.py:234-263 — 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) examples/ai/data/data_labeler.py:135— examples/ai/data/data_labeler.py:135-157 | examples/ai/data/model_comparison.py:172-190 — 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 (18 corresponding lines) · ×6
Edited copy of a member (18 corresponding lines) marimo/_server/host/api.py:498— marimo/_server/host/api.py:498-515 | marimo/_server/host/api.py:520-541 — 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) marimo/_runtime/_wasm/_concurrency/_mp_queue.py:60— marimo/_runtime/_wasm/_concurrency/_mp_queue.py:60-77 | marimo/_runtime/_wasm/_concurrency/_mp_queue.py:80-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.
Edited copy of a member (18 corresponding lines) marimo/_runtime/packages/conda_package_manager.py:47— marimo/_runtime/packages/conda_package_manager.py:47-67 | marimo/_runtime/packages/pypi_package_manager.py:117-134 — 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) marimo/_save/signing.py:196— marimo/_save/signing.py:196-215 | marimo/_save/signing.py:219-236 — 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) marimo/_plugins/stateless/status/_progress.py:437— marimo/_plugins/stateless/status/_progress.py:437-454 | marimo/_plugins/stateless/status/_progress.py:457-474 — 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) examples/misc/mortgage_calculator.py:111— examples/misc/mortgage_calculator.py:111-152 | examples/misc/mortgage_calculator.py:236-253 — 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.
AC6 · Visual & motion safety· Focus outline removed in CSS without a · ×5
Focus outline removed in CSS without a :focus replacement frontend/src/plugins/impl/plotly/plotly.css:16— `.js-plotly-plot .plotly input:focus` 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.
Focus outline removed in CSS without a :focus replacement frontend/src/css/app/Cell.css:27— `.marimo-cell:focus-visible` 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.
Focus outline removed in CSS without a :focus replacement frontend/src/css/app/codemirror.css:19— `.cm-focused.cm-focused` 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.
Focus outline removed in CSS without a :focus replacement frontend/src/components/slides/slides.css:42— `.mo-slides-notes-resize` 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.
Focus outline removed in CSS without a :focus replacement frontend/src/components/editor/chrome/wrapper/app-chrome.css:4— `.resize-handle` 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.
D4 · Code Duplication· Edited copy of a member (23 corresponding lines) · ×5
Edited copy of a member (23 corresponding lines) marimo/_ai/_tools/base.py:105— marimo/_ai/_tools/base.py:105-134 | marimo/_server/api/endpoints/home.py:190-212 — 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) marimo/_snippets/data/altair-4.py:23— marimo/_snippets/data/altair-4.py:23-45 | marimo/_snippets/data/altair-7.py:23-50 — 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) marimo/_ai/llm/_impl.py:277— marimo/_ai/llm/_impl.py:277-299 | marimo/_ai/llm/_impl.py:388-410 — 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) marimo/_convert/markdown/flavor/base.py:89— marimo/_convert/markdown/flavor/base.py:89-119 | marimo/_convert/markdown/flavor/mdx.py:58-80 — 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) marimo/_runtime/capture.py:23— marimo/_runtime/capture.py:23-49 | marimo/_runtime/capture.py:54-76 — 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.
Duplicated block (15 lines × 2) marimo/_environments/backends.py:335— marimo/_environments/backends.py:335-349 | marimo/_environments/backends.py:365-379 — both copies are in the same file, so extract the 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) marimo/_plugins/ui/_impl/dataframes/transforms/print_code.py:124— marimo/_plugins/ui/_impl/dataframes/transforms/print_code.py:124-138 | marimo/_plugins/ui/_impl/dataframes/transforms/print_code.py:418-432 — both copies are in the same file, so extract the 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 `marimo/_plugins/ui/_impl/dataframes/transforms/print_code.py:124` 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) marimo/_runtime/runtime.py:1134— marimo/_runtime/runtime.py:1134-1148 | marimo/_runtime/runtime.py:1150-1165 — both copies are in the same file, so extract the 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 `marimo/_runtime/runtime.py:1134` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (15 lines × 2) marimo/_sql/engines/duckdb.py:152— marimo/_sql/engines/duckdb.py:152-166 | marimo/_sql/engines/duckdb.py:169-183 — both copies are in the same file, so extract the 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) marimo/_utils/health.py:163— marimo/_utils/health.py:163-180 | marimo/_utils/health.py:184-198 — both copies are in the same file, so extract the 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) marimo/_convert/markdown/flavor/pymdown.py:30— marimo/_convert/markdown/flavor/pymdown.py:30-41 | marimo/_convert/markdown/flavor/qmd.py:30-41 — 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 (12 lines × 2) marimo/_plugins/ui/_impl/dataframes/transforms/print_code.py:45— marimo/_plugins/ui/_impl/dataframes/transforms/print_code.py:45-56 | marimo/_plugins/ui/_impl/dataframes/transforms/print_code.py:315-326 — both copies are in the same file, so extract the 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) marimo/_plugins/ui/_impl/matrix.py:475— marimo/_plugins/ui/_impl/matrix.py:475-486 | marimo/_plugins/ui/_impl/matrix.py:494-505 — both copies are in the same file, so extract the 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) examples/misc/create_your_own_shape.py:163— examples/misc/create_your_own_shape.py:163-174 | marimo/_smoke_tests/dates.py:23-34 — 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) examples/sql/misc/electric_vehicles.py:69— examples/sql/misc/electric_vehicles.py:69-80 | examples/sql/misc/electric_vehicles.py:85-96 — both copies are in the same file, so extract the 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.
ClassTooLong: MarimoErrorOutput frontend/src/components/editor/output/MarimoErrorOutput.tsx:1— ClassTooLong — 524 significant lines (blank, comment-only and punctuation-only lines excluded), 3 methods. The bar is 400 significant lines; this is 124 over it, 1.31× 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: NotebookLanguageServerClient frontend/src/core/codemirror/lsp/notebook-lsp.ts:185— ClassTooLong — 476 significant lines (blank, comment-only and punctuation-only lines excluded), 27 methods. The bar is 400 significant lines; this is 76 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: PyodideBridge frontend/src/core/wasm/bridge.ts:63— ClassTooLong — 474 significant lines (blank, comment-only and punctuation-only lines excluded), 58 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: useNotebookActions frontend/src/components/editor/actions/useNotebookActions.tsx:1— ClassTooLong — 429 significant lines (blank, comment-only and punctuation-only lines excluded), 2 methods. The bar is 400 significant lines; this is 29 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.
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×4
Members sharing a duplicated core (4 members, 50+ identical tokens) examples/ui/layout.py:89— examples/ui/layout.py:89-97 | marimo/_smoke_tests/grid.py:62-70 | marimo/_smoke_tests/layout.py:62-70 | marimo/_tutorials/layout.py:127-135 — 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) marimo/_messaging/streams.py:408— marimo/_messaging/streams.py:408-432 | marimo/_messaging/streams.py:467-506 | marimo/_pyodide/streams.py:130-154 | marimo/_pyodide/streams.py:183-219 — 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) marimo/_plugins/ui/_impl/plotly.py:621— marimo/_plugins/ui/_impl/plotly.py:621-635 | marimo/_plugins/ui/_impl/plotly.py:1720-1734 | marimo/_plugins/ui/_impl/plotly.py:2153-2166 | marimo/_plugins/ui/_impl/plotly.py:3473-3490 — 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) marimo/_plugins/ui/_impl/plotly.py:2583— marimo/_plugins/ui/_impl/plotly.py:2583-2688 | marimo/_plugins/ui/_impl/plotly.py:2977-3091 | marimo/_plugins/ui/_impl/plotly.py:3097-3184 | marimo/_plugins/ui/_impl/plotly.py:3242-3330 — 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 (21 corresponding lines) · ×4
Edited copy of a member (21 corresponding lines) docs/scripts/html_to_markdown.py:53— docs/scripts/html_to_markdown.py:53-73 | docs/scripts/html_to_markdown.py:111-143 — 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) marimo/_data/charts.py:477— marimo/_data/charts.py:477-497 | marimo/_data/charts.py:500-575 — 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) marimo/_messaging/notification_utils.py:121— marimo/_messaging/notification_utils.py:121-141 | marimo/_messaging/notification_utils.py:175-195 — 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) marimo/_plugins/ui/_impl/matrix.py:60— marimo/_plugins/ui/_impl/matrix.py:60-82 | marimo/_plugins/ui/_impl/matrix.py:89-109 — 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 (17 corresponding lines) · ×4
Edited copy of a member (17 corresponding lines) marimo/_export/_pdf_raster.py:154— marimo/_export/_pdf_raster.py:154-175 | marimo/_export/_pdf_raster.py:185-201 — 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) REDACTED:63— REDACTED:63-81 | REDACTED:86-102 — 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) marimo/_smoke_tests/altair_examples/altair_brush.py:54— marimo/_smoke_tests/altair_examples/altair_brush.py:54-70 | marimo/_smoke_tests/altair_examples/altair_brush.py:82-101 — 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) marimo/_smoke_tests/altair_examples/altair_charts.py:189— marimo/_smoke_tests/altair_examples/altair_charts.py:189-205 | marimo/_smoke_tests/altair_examples/altair_charts.py:219-239 — 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 (6 corresponding lines) · ×4
Edited copy of a member (6 corresponding lines) marimo/_plugins/ui/_core/registry.py:106— marimo/_plugins/ui/_core/registry.py:106-111 | marimo/_runtime/state.py:68-75 — 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) marimo/_output/formatters/flax_formatters.py:60— marimo/_output/formatters/flax_formatters.py:60-65 | marimo/_output/formatters/pytorch_formatters.py:139-144 — 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) marimo/_smoke_tests/issues/1161.py:30— marimo/_smoke_tests/issues/1161.py:30-37 | marimo/_smoke_tests/issues/846.py:62-67 — 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) examples/ai/misc/micrograd_mlp.py:111— examples/ai/misc/micrograd_mlp.py:111-116 | examples/misc/pixi_r.py:64-72 — 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.
D4 · Code Duplication· Edited copy of a member (4 corresponding lines) · ×4
Edited copy of a member (4 corresponding lines) marimo/_server/api/dependency_tree.py:8— marimo/_server/api/dependency_tree.py:8-11 | marimo/_utils/uv_tree.py:26-30 — 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) marimo/_convert/markdown/flavor/mdx.py:155— marimo/_convert/markdown/flavor/mdx.py:155-158 | marimo/_convert/markdown/flavor/mystmd.py:246-249 — 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) frontend/e2e-tests/py/components.py:197— frontend/e2e-tests/py/components.py:197-200 | marimo/_tutorials/ui.py:506-510 — 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) examples/ai/misc/build_a_superhero.py:24— examples/ai/misc/build_a_superhero.py:24-28 | examples/ai/misc/pdf_question_answer.py:47-50 — 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.
Duplicated block (23 lines × 2) marimo/_convert/markdown/flavor/base.py:97— marimo/_convert/markdown/flavor/base.py:97-119 | marimo/_convert/markdown/flavor/mdx.py:58-80 — 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 (23 lines × 2) marimo/_plugins/ui/_impl/dataframes/transforms/print_code.py:58— marimo/_plugins/ui/_impl/dataframes/transforms/print_code.py:58-80 | marimo/_plugins/ui/_impl/dataframes/transforms/print_code.py:330-352 — both copies are in the same file, so extract the 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 `marimo/_plugins/ui/_impl/dataframes/transforms/print_code.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 (23 lines × 2) marimo/_plugins/ui/_impl/input.py:255— marimo/_plugins/ui/_impl/input.py:255-277 | marimo/_plugins/ui/_impl/input.py:471-493 — both copies are in the same file, so extract the 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 (23 lines × 2) marimo/_runtime/app/script_runner.py:109— marimo/_runtime/app/script_runner.py:109-131 | marimo/_runtime/app/script_runner.py:143-165 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (17 lines × 2) marimo/_ai/_tools/tools/datasource.py:109— marimo/_ai/_tools/tools/datasource.py:109-125 | marimo/_ai/_tools/tools/datasource.py:131-147 — both copies are in the same file, so extract the 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) marimo/_plugins/ui/_impl/plotly.py:671— marimo/_plugins/ui/_impl/plotly.py:671-687 | marimo/_plugins/ui/_impl/plotly.py:940-956 — both copies are in the same file, so extract the 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) marimo/_plugins/ui/_impl/plotly.py:3506— marimo/_plugins/ui/_impl/plotly.py:3506-3522 | marimo/_plugins/ui/_impl/plotly.py:3582-3598 — both copies are in the same file, so extract the 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) marimo/_tutorials/external_dependencies.py:92— marimo/_tutorials/external_dependencies.py:92-108 | marimo/_tutorials/plots.py:243-267 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (16 lines × 2) marimo/_ast/visitor.py:694— marimo/_ast/visitor.py:694-709 | marimo/_ast/visitor.py:712-727 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. Note first that the copies are not typed on the same thing: the declarations holding them bind `node` to `ast.AsyncFunctionDef` in one and `ast.FunctionDef` 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 (16 lines × 2) marimo/_convert/markdown/flavor/pymdown.py:64— marimo/_convert/markdown/flavor/pymdown.py:64-79 | marimo/_convert/markdown/flavor/qmd.py:64-79 — 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 (16 lines × 2) marimo/_server/api/dependency_tree.py:77— marimo/_server/api/dependency_tree.py:77-92 | marimo/_utils/uv_tree.py:131-146 — before extracting anything, compare `marimo/_server/api/dependency_tree.py` and `marimo/_utils/uv_tree.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 70 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.
Duplicated block (16 lines × 2) marimo/_smoke_tests/process_isolation/app1.py:17— marimo/_smoke_tests/process_isolation/app1.py:17-32 | marimo/_smoke_tests/process_isolation/app2.py:17-32 — before extracting anything, compare `marimo/_smoke_tests/process_isolation/app1.py` and `marimo/_smoke_tests/process_isolation/app2.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 104 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.
Duplicated block (14 lines × 2) marimo/_plugins/ui/_impl/plotly.py:954— marimo/_plugins/ui/_impl/plotly.py:954-967 | marimo/_plugins/ui/_impl/plotly.py:971-984 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (14 lines × 2) marimo/_plugins/ui/_impl/plotly.py:2547— marimo/_plugins/ui/_impl/plotly.py:2547-2560 | marimo/_plugins/ui/_impl/plotly.py:2902-2915 — both copies are in the same file, so extract the 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 `marimo/_plugins/ui/_impl/plotly.py:2547` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (14 lines × 2) marimo/_server/api/dependency_tree.py:16— marimo/_server/api/dependency_tree.py:16-29 | marimo/_utils/uv_tree.py:70-83 — before extracting anything, compare `marimo/_server/api/dependency_tree.py` and `marimo/_utils/uv_tree.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 70 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 `marimo/_server/api/dependency_tree.py:16` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `marimo/_utils/uv_tree.py:84` calls `skip_line` and `marimo/_server/api/dependency_tree.py:30` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (14 lines × 2) examples/ai/chat/dagger_code_interpreter.py:201— examples/ai/chat/dagger_code_interpreter.py:201-214 | examples/ai/tools/code_interpreter.py:168-181 — 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 `examples/ai/chat/dagger_code_interpreter.py:201` 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) marimo/_save/save.py:537— marimo/_save/save.py:537-547 | marimo/_save/save.py:666-676 — both copies are in the same file, so extract the 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) marimo/_server/api/endpoints/packages.py:75— marimo/_server/api/endpoints/packages.py:75-85 | marimo/_server/api/endpoints/packages.py:153-163 — both copies are in the same file, so extract the 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 `marimo/_server/api/endpoints/packages.py:75` 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 (11 lines × 2) marimo/_utils/docs.py:225— marimo/_utils/docs.py:225-235 | marimo/_utils/docs.py:236-246 — both copies are in the same file, so extract the 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) marimo/_smoke_tests/cache_lazy_benchmark.py:32— marimo/_smoke_tests/cache_lazy_benchmark.py:32-42 | marimo/_smoke_tests/cache_lazy_benchmark.py:47-57 — both copies are in the same file, so extract the 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.
Off the main sequence: @marimo-team/llm-info — @marimo-team/llm-info: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
Off the main sequence: @marimo-team/marimo-api — @marimo-team/marimo-api: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
Off the main sequence: @marimo-team/smart-cells — @marimo-team/smart-cells: abstractness 0.10, instability 0.00, distance 0.90 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
Off the main sequence: @marimo-team/client — @marimo-team/client: abstractness 0.26, instability 0.00, distance 0.74 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
P12 · CI test-gate honesty· Workspace package's tests never run by CI · ×4
Workspace package's tests never run by CI frontend/package.json:170— `frontend` is a workspace package with 6806 test(s) in 637 file(s) (e.g. `frontend/e2e-tests/accessibility.spec.ts`, `frontend/e2e-tests/badButton.spec.ts`), but no CI command runs them — no step names the package and no workspace-wide command reaches it, so its tests gate nothing. Run its tests in CI, or delete them.
Workspace package's tests never run by CI packages/client/package.json:22— `packages/client` is a workspace package with 114 test(s) in 12 file(s) (e.g. `packages/client/src/__tests__/catalog-events.test.ts`, `packages/client/src/__tests__/catalog-reducer.test.ts`), but no CI command runs them — no step names the package and no workspace-wide command reaches it, so its tests gate nothing. Run its tests in CI, or delete them.
Workspace package's tests never run by CI packages/lsp/package.json:11— `packages/lsp` is a workspace package with 16 test(s) in 2 file(s) (e.g. `packages/lsp/index.test.ts`, `packages/lsp/websocket-server.test.ts`), but no CI command runs them — no step names the package and no workspace-wide command reaches it, so its tests gate nothing. Run its tests in CI, or delete them.
Workspace package's tests never run by CI packages/smart-cells/package.json:14— `packages/smart-cells` is a workspace package with 82 test(s) in 5 file(s) (e.g. `packages/smart-cells/src/__tests__/index.test.ts`, `packages/smart-cells/src/__tests__/markdown-parser.test.ts`), but no CI command runs them — no step names the package and no workspace-wide command reaches it, so its tests gate nothing. Run its tests in CI, or delete them.
Duplicated block (25 lines × 2 locations) frontend/src/components/editor/file-tree/upload.tsx:58— frontend/src/components/editor/file-tree/upload.tsx:58 · frontend/src/plugins/impl/FileUploadPlugin.tsx:127 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
Duplicated block (25 lines × 2 locations) frontend/src/components/ui/fullscreen.tsx:118— frontend/src/components/ui/fullscreen.tsx:118 · frontend/src/components/ui/fullscreen.tsx:171 — 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 (25 lines × 2 locations) frontend/src/components/ui/input.tsx:172— frontend/src/components/ui/input.tsx:172 · frontend/src/components/ui/textarea.tsx:62 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
Duplicated block (25 lines × 2 locations) frontend/src/core/codemirror/markdown/completions.ts:6— frontend/src/core/codemirror/markdown/completions.ts:6 · frontend/src/core/codemirror/markdown/completions.ts:53 — 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.
D4 · Code Duplication· Edited copy of a member (24 corresponding lines) · ×3
Edited copy of a member (24 corresponding lines) marimo/_server/host/record.py:160— marimo/_server/host/record.py:160-185 | marimo/_server/server_registry.py:93-116 — 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) marimo/_runtime/params.py:127— marimo/_runtime/params.py:127-150 | marimo/_runtime/params.py:153-179 — 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) REDACTED:872— REDACTED:872-895 | REDACTED:899-922 — 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 (13 corresponding lines) · ×3
Edited copy of a member (13 corresponding lines) frontend/e2e-tests/py/kitchen_sink.py:36— frontend/e2e-tests/py/kitchen_sink.py:36-52 | marimo/_tutorials/layout.py:83-95 — 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) marimo/_core/host.py:142— marimo/_core/host.py:142-155 | marimo/_core/host.py:160-172 — 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) marimo/_runtime/context/kernel_context.py:134— marimo/_runtime/context/kernel_context.py:134-146 | marimo/_runtime/context/script_context.py:118-132 — 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 (11 corresponding lines) · ×3
Edited copy of a member (11 corresponding lines) marimo/_plugins/ui/_impl/array.py:116— marimo/_plugins/ui/_impl/array.py:116-126 | marimo/_plugins/ui/_impl/batch.py:132-145 — 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) marimo/_output/formatters/flax_formatters.py:255— marimo/_output/formatters/flax_formatters.py:255-265 | marimo/_output/formatters/pytorch_formatters.py:249-259 — 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) examples/ui/matrix.py:17— examples/ui/matrix.py:17-27 | marimo/_smoke_tests/matrix.py:101-111 — 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· Edited copy of a member (8 corresponding lines) · ×3
Edited copy of a member (8 corresponding lines) marimo/_lint/rules/wasm/_unsafe_call_analysis.py:799— marimo/_lint/rules/wasm/_unsafe_call_analysis.py:799-806 | marimo/_lint/rules/wasm/_unsafe_call_analysis.py:809-820 — 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) marimo/_core/run_log.py:144— marimo/_core/run_log.py:144-154 | marimo/_core/run_log.py:157-164 — 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) marimo/_plugins/ui/_impl/dataframes/dataframe.py:260— marimo/_plugins/ui/_impl/dataframes/dataframe.py:260-267 | marimo/_plugins/ui/_impl/table.py:1956-1964 — 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.
D4 · Code Duplication· Edited copy of a member (9 corresponding lines) · ×3
Edited copy of a member (9 corresponding lines) marimo/_runtime/_wasm/_concurrency/_threading.py:144— marimo/_runtime/_wasm/_concurrency/_threading.py:144-152 | marimo/_runtime/_wasm/_concurrency/_threading.py:155-167 — 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) marimo/_smoke_tests/matrix.py:338— marimo/_smoke_tests/matrix.py:338-346 | marimo/_smoke_tests/vector.py:130-138 — 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) examples/outputs/progress_bar.py:24— examples/outputs/progress_bar.py:24-33 | marimo/_smoke_tests/status/status.py:58-66 — 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.
D4 · Code Duplication· Edited copy of a member (3 corresponding lines) · ×3
Edited copy of a member (3 corresponding lines) examples/ui/array_element.py:16— examples/ui/array_element.py:16-18 | marimo/_tutorials/ui.py:281-285 — 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) examples/misc/iss.py:137— examples/misc/iss.py:137-139 | examples/ai/chat/mlx_chat.py:136-142 — 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) marimo/_smoke_tests/_matplotlib/with_slider.py:16— marimo/_smoke_tests/_matplotlib/with_slider.py:16-18 | marimo/_smoke_tests/issues/4544_flex.py:99-101 — 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.
Duplicated block (18 lines × 2) marimo/_data/series.py:135— marimo/_data/series.py:135-152 | marimo/_data/series.py:175-192 — both copies are in the same file, so extract the 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, `marimo/_data/series.py:171` calls `strftime`, `isinstance`, `datetime` and `marimo/_data/series.py:134` 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) marimo/_plugins/ui/_impl/plotly.py:1445— marimo/_plugins/ui/_impl/plotly.py:1445-1462 | marimo/_plugins/ui/_impl/plotly.py:1507-1524 — both copies are in the same file, so extract the 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 (18 lines × 2) examples/sql/connect_to_postgres.py:33— examples/sql/connect_to_postgres.py:33-50 | examples/sql/connect_to_sqlite.py:36-53 — 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–13 lines × 2) docs/scripts/html_to_markdown.py:61— docs/scripts/html_to_markdown.py:61-73 | docs/scripts/html_to_markdown.py:132-143 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12–13 lines × 2) marimo/_plugins/ui/_impl/plotly.py:648— marimo/_plugins/ui/_impl/plotly.py:648-659 | marimo/_plugins/ui/_impl/plotly.py:1296-1308 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12–13 lines × 2) examples/cloud/gcp/google_cloud_bigquery.py:60— examples/cloud/gcp/google_cloud_bigquery.py:60-71 | examples/cloud/gcp/google_cloud_storage.py:53-65 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (8 lines × 2) marimo/_code_mode/_context.py:480— marimo/_code_mode/_context.py:480-487 | marimo/_messaging/notebook/document.py:60-67 — 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) marimo/_plugins/ui/_impl/dataframes/transforms/print_code.py:219— marimo/_plugins/ui/_impl/dataframes/transforms/print_code.py:219-226 | marimo/_plugins/ui/_impl/dataframes/transforms/print_code.py:710-717 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `marimo/_plugins/ui/_impl/dataframes/transforms/print_code.py:219` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 2) marimo/_plugins/ui/_impl/dates.py:112— marimo/_plugins/ui/_impl/dates.py:112-119 | marimo/_plugins/ui/_impl/dates.py:432-439 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) marimo/_plugins/ui/_impl/from_anywidget.py:290— marimo/_plugins/ui/_impl/from_anywidget.py:290-295 | marimo/_plugins/ui/_impl/from_panel.py:383-388 — 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) marimo/_plugins/ui/_impl/from_anywidget.py:300— marimo/_plugins/ui/_impl/from_anywidget.py:300-305 | marimo/_plugins/ui/_impl/from_panel.py:393-398 — 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) frontend/e2e-tests/py/components.py:169— frontend/e2e-tests/py/components.py:169-174 | marimo/_tutorials/ui.py:462-467 — before extracting anything, compare `frontend/e2e-tests/py/components.py` and `marimo/_tutorials/ui.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 55 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 `frontend/e2e-tests/py/components.py:169` 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, `marimo/_tutorials/ui.py:469` calls `range_slider` and `frontend/e2e-tests/py/components.py:176` 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 (10 corresponding lines) · ×3
Edited copy of a member (10 corresponding lines) marimo/_smoke_tests/altair_examples/vegafusion_histograms.py:30— marimo/_smoke_tests/altair_examples/vegafusion_histograms.py:30-39 | marimo/_smoke_tests/primitives/_decimal.py:16-25 — 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) examples/ai/tools/chat_with_tools.py:55— examples/ai/tools/chat_with_tools.py:55-64 | examples/ai/tools/code_interpreter.py:44-54 — 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) marimo/_smoke_tests/matrix.py:159— marimo/_smoke_tests/matrix.py:159-168 | marimo/_smoke_tests/vector.py:102-111 — 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 (5 corresponding lines) · ×3
Edited copy of a member (5 corresponding lines) marimo/_smoke_tests/issues/4970-unique-transform.py:35— marimo/_smoke_tests/issues/4970-unique-transform.py:35-39 | marimo/_smoke_tests/issues/7345-dataframe-pivot-transform.py:21-25 — 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) examples/misc/pixi_ffmpeg.py:31— examples/misc/pixi_ffmpeg.py:31-35 | examples/misc/seam_carving.py:67-78 — 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) examples/ui/button.py:16— examples/ui/button.py:16-20 | marimo/_smoke_tests/issues/1271.py:24-28 — 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.
Duplicated block (24 lines × 2 locations) frontend/src/components/editor/chrome/panels/dependency-graph-panel.tsx:27— frontend/src/components/editor/chrome/panels/dependency-graph-panel.tsx:27 · frontend/src/components/editor/chrome/wrapper/app-chrome.tsx:351 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
Duplicated block (24 lines × 2 locations) frontend/src/components/ui/range-slider.tsx:171— frontend/src/components/ui/range-slider.tsx:171 · frontend/src/components/ui/range-slider.tsx:195 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (24 lines × 2 locations) frontend/src/plugins/impl/DataTablePlugin.tsx:322— frontend/src/plugins/impl/DataTablePlugin.tsx:322 · frontend/src/plugins/impl/data-frames/DataFramePlugin.tsx:135 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
AC1 · Text alternatives· <video> without a captions track · ×2
<video> without a captions track frontend/src/components/editor/file-tree/renderers.tsx:151— Video with no captions <track> offers no captions. This player's source is set at runtime, so there is no caption file to author here: give the player a way to carry captions — accept a track/captions URL alongside the media and render a <track kind="captions"> when one is supplied — and capture that asset wherever the media enters the product (upload, import or generation).
<video> without a captions track frontend/src/components/editor/output/VideoOutput.tsx:13— Video with no captions <track> offers no captions. This player's source is set at runtime, so there is no caption file to author here: give the player a way to carry captions — accept a track/captions URL alongside the media and render a <track kind="captions"> when one is supplied — and capture that asset wherever the media enters the product (upload, import or generation).
AC3 · Page structure· Page without a main landmark · ×2
Page without a main landmark frontend/islands/__demo__/index.html:3— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
Page without a main landmark frontend/islands/__demo__/output.html:2— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
Low contrast Tailwind colour pair (4.4:1) frontend/src/components/app-config/mcp-config.tsx:81— 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.4:1) frontend/src/components/datasources/components.tsx:58— 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.
FixmeComment tests/_ipc/test_kernel_communication.py:171— # FIXME: stdin/stdout are flushed every 10ms, so wait 100ms — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment frontend/src/core/codemirror/keymaps/vim.ts:100— // FIXME: The vim extension swallows `Ctrl+Escape` events, preventing them — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
MethodTooLong: EditNotebookTool.handler frontend/src/core/ai/tools/edit-notebook-tool.ts:86— MethodTooLong — handler runs 111 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 11 over it, 1.11× 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: DefaultWasmController.prepareSession frontend/src/core/wasm/worker/bootstrap.ts:139— MethodTooLong — prepareSession 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.
D4 · Code Duplication· Edited copy of a member (66 corresponding lines) · ×2
Edited copy of a member (66 corresponding lines) marimo/_server/api/endpoints/packages.py:59— marimo/_server/api/endpoints/packages.py:59-130 | marimo/_server/api/endpoints/packages.py:136-201 — These two members are one piece of code written twice and then edited apart: 66 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 (66 corresponding lines) marimo/_server/templates/api.py:85— marimo/_server/templates/api.py:85-154 | marimo/_server/templates/api.py:170-235 — These two members are one piece of code written twice and then edited apart: 66 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 (32 corresponding lines) · ×2
Edited copy of a member (32 corresponding lines) marimo/_data/series.py:121— marimo/_data/series.py:121-152 | marimo/_data/series.py:157-192 — 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) scripts/generate.py:66— scripts/generate.py:66-97 | scripts/generate_schemas.py:120-165 — 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 (27 corresponding lines) · ×2
Edited copy of a member (27 corresponding lines) marimo/_runtime/runner/by_refs.py:118— marimo/_runtime/runner/by_refs.py:118-144 | marimo/_runtime/runner/by_refs.py:152-193 — 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) marimo/_plugins/ui/_impl/table.py:1732— marimo/_plugins/ui/_impl/table.py:1732-1759 | marimo/_plugins/ui/_impl/table.py:1767-1793 — 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 (29 corresponding lines) · ×2
Edited copy of a member (29 corresponding lines) marimo/_runtime/app/script_runner.py:109— marimo/_runtime/app/script_runner.py:109-137 | marimo/_runtime/app/script_runner.py:143-171 — These two members are one piece of code written twice and then edited apart: 29 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 (29 corresponding lines) marimo/_cli/cli.py:738— marimo/_cli/cli.py:738-770 | marimo/_cli/cli.py:1333-1361 — These two members are one piece of code written twice and then edited apart: 29 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 (22 corresponding lines) · ×2
Edited copy of a member (22 corresponding lines) marimo/_environments/backends.py:322— marimo/_environments/backends.py:322-349 | marimo/_environments/backends.py:358-379 — 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) marimo/_runtime/_wasm/_patches.py:88— marimo/_runtime/_wasm/_patches.py:88-112 | marimo/_runtime/_wasm/_patches.py:124-145 — 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 (28 corresponding lines) · ×2
Edited copy of a member (28 corresponding lines) marimo/_server/router.py:44— marimo/_server/router.py:44-71 | marimo/_server/router.py:79-106 — These two members are one piece of code written twice and then edited apart: 28 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 (28 corresponding lines) marimo/_smoke_tests/formatters/pytorch_formatters.py:41— marimo/_smoke_tests/formatters/pytorch_formatters.py:41-69 | marimo/_smoke_tests/formatters/pytorch_formatters.py:213-240 — These two members are one piece of code written twice and then edited apart: 28 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) · ×2
Edited copy of a member (15 corresponding lines) marimo/_cli/help_formatter.py:151— marimo/_cli/help_formatter.py:151-165 | marimo/_cli/help_formatter.py:170-187 — 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) marimo/_environments/environment.py:327— marimo/_environments/environment.py:327-344 | marimo/_environments/pixi.py:546-560 — 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) · ×2
Edited copy of a member (12 corresponding lines) marimo/_environments/script_metadata.py:286— marimo/_environments/script_metadata.py:286-303 | marimo/_environments/script_metadata.py:312-323 — 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) marimo/_convert/markdown/flavor/mdx.py:104— marimo/_convert/markdown/flavor/mdx.py:104-115 | marimo/_convert/markdown/flavor/mystmd.py:175-195 — 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· Edited copy of a member (31 corresponding lines) · ×2
Edited copy of a member (31 corresponding lines) marimo/_data/charts.py:120— marimo/_data/charts.py:120-151 | marimo/_data/charts.py:729-759 — 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) examples/ai/chat/dagger_code_interpreter.py:62— examples/ai/chat/dagger_code_interpreter.py:62-92 | examples/ai/tools/code_interpreter.py:68-98 — 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 (25 corresponding lines) · ×2
Edited copy of a member (25 corresponding lines) marimo/_runtime/capture.py:96— marimo/_runtime/capture.py:96-122 | marimo/_runtime/capture.py:127-151 — 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) examples/ai/misc/build_a_superhero.py:48— examples/ai/misc/build_a_superhero.py:48-72 | examples/ai/misc/build_a_superhero.py:90-115 — 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 copy of a member (7 corresponding lines) · ×2
Edited copy of a member (7 corresponding lines) marimo/_runtime/callbacks/cache.py:77— marimo/_runtime/callbacks/cache.py:77-83 | marimo/_runtime/runner/hooks_on_finish.py:96-107 — 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) marimo/_smoke_tests/altair_examples/vegafusion_nb.py:50— marimo/_smoke_tests/altair_examples/vegafusion_nb.py:50-58 | marimo/_smoke_tests/altair_examples/vegafusion_histograms.py:70-76 — 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.
Duplicated block (24 lines × 2) marimo/_plugins/ui/_impl/dates.py:142— marimo/_plugins/ui/_impl/dates.py:142-165 | marimo/_plugins/ui/_impl/dates.py:477-500 — both copies are in the same file, so extract the 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 (24 lines × 2) marimo/_smoke_tests/tables/ibis_interactive.py:64— marimo/_smoke_tests/tables/ibis_interactive.py:64-87 | marimo/_smoke_tests/tables/lazy.py:165-188 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (21 lines × 2) marimo/_runtime/packages/_micropip_streaming.py:44— marimo/_runtime/packages/_micropip_streaming.py:44-64 | marimo/_runtime/packages/utils.py:280-300 — 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 `marimo/_runtime/packages/_micropip_streaming.py:44` 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 (21 lines × 2) marimo/_snippets/data/pandas-12.py:10— marimo/_snippets/data/pandas-12.py:10-40 | marimo/_snippets/data/pandas-13.py:10-30 — before extracting anything, compare `marimo/_snippets/data/pandas-12.py` and `marimo/_snippets/data/pandas-13.py` as WHOLE FILES: 90% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. 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 (19 lines × 2) frontend/e2e-tests/py/components.py:127— frontend/e2e-tests/py/components.py:127-145 | marimo/_tutorials/ui.py:428-446 — before extracting anything, compare `frontend/e2e-tests/py/components.py` and `marimo/_tutorials/ui.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 55 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 `frontend/e2e-tests/py/components.py:127` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19 lines × 2) marimo/_plugins/ui/_impl/plotly.py:2459— marimo/_plugins/ui/_impl/plotly.py:2459-2477 | marimo/_plugins/ui/_impl/plotly.py:2814-2832 — both copies are in the same file, so extract the 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 `marimo/_plugins/ui/_impl/plotly.py:2459` 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 (11 lines × 4) marimo/_messaging/streams.py:409— marimo/_messaging/streams.py:409-419 | marimo/_messaging/streams.py:469-480 | marimo/_pyodide/streams.py:131-141 | marimo/_pyodide/streams.py:186-196 — `marimo/_messaging/streams.py` and `marimo/_pyodide/streams.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 3 separate duplicated blocks between them, totalling at least 36 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `marimo/_pyodide/streams.py:198` calls `str`, `uuid4` and `marimo/_pyodide/streams.py:143` 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 (11 lines × 4) marimo/_plugins/ui/_impl/plotly.py:645— marimo/_plugins/ui/_impl/plotly.py:645-655 | marimo/_plugins/ui/_impl/plotly.py:1744-1754 | marimo/_plugins/ui/_impl/plotly.py:2176-2186 | marimo/_plugins/ui/_impl/plotly.py:3500-3510 — 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. 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) marimo/_ast/transformers.py:171— marimo/_ast/transformers.py:171-179 | marimo/_ast/transformers.py:182-190 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. Note first that the copies are not typed on the same thing: the declarations holding them bind `node` to `ast.Import` in one and `ast.ImportFrom` 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 (9 lines × 2) marimo/_code_mode/_better_inspect.py:275— marimo/_code_mode/_better_inspect.py:275-283 | marimo/_code_mode/_better_inspect.py:383-391 — both copies are in the same file, so extract the 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) docs/scripts/generate_llms_txt.py:57— docs/scripts/generate_llms_txt.py:57-63 | docs/scripts/generate_llms_txt.py:78-84 — both copies are in the same file, so extract the 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) marimo/_smoke_tests/ai/model_check.py:135— marimo/_smoke_tests/ai/model_check.py:135-141 | marimo/_smoke_tests/ai/model_check.py:153-159 — both copies are in the same file, so extract the 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· Edited copies of one member (3 members, 13+ corresponding lines) · ×2
Edited copies of one member (3 members, 13+ corresponding lines) examples/ui/layout.py:30— examples/ui/layout.py:30-50 | marimo/_smoke_tests/grid.py:11-23 | marimo/_smoke_tests/layout.py:11-23 — 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.
Edited copies of one member (3 members, 13+ corresponding lines) marimo/_smoke_tests/altair_examples/binning.py:64— marimo/_smoke_tests/altair_examples/binning.py:64-76 | marimo/_smoke_tests/altair_examples/binning.py:134-148 | marimo/_smoke_tests/altair_examples/binning.py:311-326 — 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.
Duplicated block (29 lines × 2) marimo/_smoke_tests/theming/custom_css.py:17— marimo/_smoke_tests/theming/custom_css.py:17-51 | marimo/_smoke_tests/theming/custom_head.py:17-45 — before extracting anything, compare `marimo/_smoke_tests/theming/custom_css.py` and `marimo/_smoke_tests/theming/custom_head.py` as WHOLE FILES: 90% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. 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 `marimo/_smoke_tests/theming/custom_css.py:17` 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, `marimo/_smoke_tests/theming/custom_css.py:51` calls `number` and `marimo/_smoke_tests/theming/custom_head.py:48` 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 (29 lines × 2) marimo/_smoke_tests/sql/sql_alchemy_engine.py:38— marimo/_smoke_tests/sql/sql_alchemy_engine.py:38-66 | marimo/_smoke_tests/sql/sqlmodel_engine.py:53-81 — before extracting anything, compare `marimo/_smoke_tests/sql/sql_alchemy_engine.py` and `marimo/_smoke_tests/sql/sqlmodel_engine.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The `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) marimo/_smoke_tests/pandas_smoke_tests/pandas_nan.py:53— marimo/_smoke_tests/pandas_smoke_tests/pandas_nan.py:53-57 | marimo/_smoke_tests/tables/column-header-chart.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. 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) marimo/_smoke_tests/sql/sql_alchemy_engine.py:134— marimo/_smoke_tests/sql/sql_alchemy_engine.py:134-138 | marimo/_smoke_tests/sql/sqlmodel_engine.py:149-153 — before extracting anything, compare `marimo/_smoke_tests/sql/sql_alchemy_engine.py` and `marimo/_smoke_tests/sql/sqlmodel_engine.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The `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.
Low cohesion: UIElement (LCOM4 5) marimo/_plugins/ui/_core/ui_element.py:85— UIElement'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: PyodideBridge (LCOM4 5) marimo/_pyodide/pyodide_session.py:287— PyodideBridge'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.
R10 · Code Duplication· Duplicated block with local edits (51 matched lines × 2 locations) · ×2
Duplicated block with local edits (51 matched lines × 2 locations) frontend/src/components/editor/connections/form-renderers.tsx:83— frontend/src/components/editor/connections/form-renderers.tsx:83 · frontend/src/components/editor/connections/form-renderers.tsx:147 — the two spans are one implementation copied and then locally edited — 262 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.
Duplicated block with local edits (51 matched lines × 2 locations) frontend/src/plugins/impl/data-editor/components.tsx:26— frontend/src/plugins/impl/data-editor/components.tsx:26 · frontend/src/plugins/impl/data-editor/components.tsx:88 — the two spans are one implementation copied and then locally edited — 240 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.
Duplicated block (35 lines × 2 locations) frontend/src/components/editor/actions/export-dialog/format-options.tsx:392— frontend/src/components/editor/actions/export-dialog/format-options.tsx:392 · frontend/src/components/editor/actions/export-dialog/format-options.tsx:444 — 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 (35 lines × 2 locations) frontend/src/components/ui/date-picker.tsx:83— frontend/src/components/ui/date-picker.tsx:83 · frontend/src/components/ui/date-picker.tsx:152 — both copies are in the same file, so extract the 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 (26 lines × 2 locations) frontend/lint/marimo-plugin.js:20— frontend/lint/marimo-plugin.js:20 · frontend/lint/marimo-plugin.js:57 — both copies are in the same file, so extract the 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 (26 lines × 2 locations) frontend/src/core/codemirror/markdown/commands.ts:273— frontend/src/core/codemirror/markdown/commands.ts:273 · frontend/src/core/codemirror/markdown/commands.ts:396 — 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 (21 lines × 2 locations) frontend/src/components/editor/file-tree/file-operations.tsx:218— frontend/src/components/editor/file-tree/file-operations.tsx:218 · frontend/src/components/editor/file-tree/file-operations.tsx:240 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
Duplicated block (21 lines × 2 locations) frontend/src/components/editor/output/MarimoErrorOutput.tsx:47— frontend/src/components/editor/output/MarimoErrorOutput.tsx:47 · frontend/src/components/editor/output/MarimoTracebackOutput.tsx:122 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
X1 · Async correctness· Task from `asyncio.get_running_loop().create_task` is not kept · ×2
Task from `asyncio.get_running_loop().create_task` is not kept marimo/_server/host/backend.py:140— The task this creates is not kept anywhere. The event loop holds only a weak reference to its tasks, so a task nobody references can be garbage-collected before it finishes (Python's documentation for `asyncio.create_task`: save a reference to the result); and nothing ever awaits it, so an exception it raises is never handled — it surfaces, if at all, as "Task exception was never retrieved" in a log. Keep the task: `await` it, gather it, start it in an `asyncio.TaskGroup` (`async with asyncio.TaskGroup() as tg: tg.create_task(…)`), or, for genuine fire-and-forget, add it to a set and `task.add_done_callback(tasks.discard)` with a callback that also reads its exception.
Task from `asyncio.get_running_loop().create_task` is not kept marimo/_server/host/handover.py:78— The task this creates is not kept anywhere. The event loop holds only a weak reference to its tasks, so a task nobody references can be garbage-collected before it finishes (Python's documentation for `asyncio.create_task`: save a reference to the result); and nothing ever awaits it, so an exception it raises is never handled — it surfaces, if at all, as "Task exception was never retrieved" in a log. Keep the task: `await` it, gather it, start it in an `asyncio.TaskGroup` (`async with asyncio.TaskGroup() as tg: tg.create_task(…)`), or, for genuine fire-and-forget, add it to a set and `task.add_done_callback(tasks.discard)` with a callback that also reads its exception.
AC1 · Text alternatives· <canvas> without a text alternative · ×1
<canvas> without a text alternative frontend/src/plugins/impl/matplotlib/matplotlib-renderer.ts:300— 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.
AC2 · Forms & labels· <fieldset> without a <legend> · ×1
<fieldset> without a <legend> frontend/src/components/editor/chrome/panels/packages-panel.tsx:162— A fieldset groups related controls but has no <legend> to name the group. Add a <legend> as its first child — or, if the group already has a visible caption beside it (or the fieldset is there only to disable its subtree and carries no group box), point aria-labelledby at that caption's id instead, which names the group without rendering a second one.
AC2 · Forms & labels· <Combobox> field component without a label · ×1
<Combobox> field component without a label frontend/src/components/forms/switchable-multi-select.tsx:54— This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
AC2 · Forms & labels· <Textarea> field component without a label · ×1
<Textarea> field component without a label frontend/src/components/forms/switchable-multi-select.tsx:105— This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
AC2 · Forms & labels· <RACInput> field component without a label · ×1
<RACInput> field component without a label frontend/src/components/ui/number-field.tsx:53— This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
AC2 · Forms & labels· <SearchInput> field component without a label · ×1
<SearchInput> field component without a label frontend/src/components/variables/variables-table.tsx:294— This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
AC3 · Page structure· Data table has no header cells · ×1
Data table has no header cells frontend/src/components/editor/package-alert.tsx:174— 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 frontend/src/components/chat/tool-call/tool-approval-card.tsx:27— This <div role="alertdialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
Low contrast Tailwind colour pair (3.5:1) frontend/src/components/datasources/components.tsx:77— 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.
Focus outline removed inline frontend/src/plugins/impl/MatrixPlugin.tsx:472— <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).
export-actions.ExportActions (cyclomatic 123) frontend/src/components/data-table/export-actions.tsx:355— export-actions.ExportActions has cyclomatic complexity 123 (threshold 15). Most of this is not in the body itself: 15 of the 123 points are its own statements and the rest belongs to 18 function items inside it that branch (a function literal at line 756, a function literal at line 647, resolveDownloadUrl, …). 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.
agent-panel.AgentPanel (cyclomatic 75) frontend/src/components/chat/acp/agent-panel.tsx:662— agent-panel.AgentPanel has cyclomatic complexity 75 (threshold 15). Most of this is not in the body itself: 7 of the 75 points are its own statements and the rest belongs to 19 function items inside it that branch (renderBody, a function literal at line 929, a function literal at line 884, …). 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.
NarwhalsTransformHandler._evaluate_condition (cyclomatic 66) marimo/_plugins/ui/_impl/dataframes/transforms/handlers.py:161— NarwhalsTransformHandler._evaluate_condition has cyclomatic complexity 66 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
analyzer.findReactiveVariables::collectDeclarations (cyclomatic 66) frontend/src/core/codemirror/reactive-references/analyzer.ts:67— analyzer.findReactiveVariables::collectDeclarations has cyclomatic complexity 66 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
msgspec_encoder.enc_hook (cyclomatic 64) marimo/_messaging/msgspec_encoder.py:27— msgspec_encoder.enc_hook has cyclomatic complexity 64 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
MatrixPlugin.MatrixComponent (cyclomatic 64) frontend/src/plugins/impl/MatrixPlugin.tsx:97— MatrixPlugin.MatrixComponent has cyclomatic complexity 64 (threshold 15). Most of this is not in the body itself: 7 of the 64 points are its own statements and the rest belongs to 13 function items inside it that branch (a function literal at line 332, a function literal at line 433, a function literal at line 220, …). 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.
app-chrome.AppChrome (cyclomatic 62) frontend/src/components/editor/chrome/wrapper/app-chrome.tsx:96— app-chrome.AppChrome has cyclomatic complexity 62 (threshold 15). Of this number, 18 points are the body's own statements and 44 belong to 16 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.
chat-panel.ChatPanelBody (cyclomatic 61) frontend/src/components/chat/chat-panel.tsx:426— chat-panel.ChatPanelBody has cyclomatic complexity 61 (threshold 15). Of this number, 16 points are the body's own statements and 45 belong to 23 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
FileBrowserPlugin.FileBrowser (cyclomatic 59) frontend/src/plugins/impl/FileBrowserPlugin.tsx:191— FileBrowserPlugin.FileBrowser has cyclomatic complexity 59 (threshold 15). Of this number, 19 points are the body's own statements and 40 belong to 12 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
_BoundaryDetector.feed (cyclomatic 58) marimo/_ast/scanner.py:83— _BoundaryDetector.feed has cyclomatic complexity 58 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
user-config-form.UserConfigForm (cyclomatic 58) frontend/src/components/app-config/user-config-form.tsx:103— user-config-form.UserConfigForm has cyclomatic complexity 58 (threshold 15). Most of this is not in the body itself: 4 of the 58 points are its own statements and the rest belongs to 30 function items inside it that branch (renderBody, setAiModels, a function literal at line 639, …). 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.
notebook-cell.EditableCellComponent (cyclomatic 56) frontend/src/components/editor/notebook-cell.tsx:399— notebook-cell.EditableCellComponent has cyclomatic complexity 56 (threshold 15). Of this number, 43 points are the body's own statements and 13 belong to 7 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
glide-data-editor.GlideDataEditorInner (cyclomatic 56) frontend/src/plugins/impl/data-editor/glide-data-editor.tsx:101— glide-data-editor.GlideDataEditorInner has cyclomatic complexity 56 (threshold 15). Most of this is not in the body itself: 3 of the 56 points are its own statements and the rest belongs to 12 function items inside it that branch (a function literal at line 300, a function literal at line 216, a function literal at line 262, …). 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.
useNotebookSession.useNotebookSession.handleNotification (cyclomatic 55) frontend/src/core/session/useNotebookSession.tsx:127— useNotebookSession.useNotebookSession.handleNotification has cyclomatic complexity 55 (threshold 15). Of this number, 52 points are the body's own statements and 3 belong to one function literal inside it that branches. 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.
chat-ui.Chatbot (cyclomatic 52) frontend/src/plugins/impl/chat/chat-ui.tsx:141— chat-ui.Chatbot has cyclomatic complexity 52 (threshold 15). Of this number, 28 points are the body's own statements and 24 belong to 12 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
SessionView.add_notification (cyclomatic 50) marimo/_session/state/session_view.py:304— SessionView.add_notification 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.
DataTablePlugin.DataTableComponent (cyclomatic 50) frontend/src/plugins/impl/DataTablePlugin.tsx:862— DataTablePlugin.DataTableComponent has cyclomatic complexity 50 (threshold 15). Of this number, 20 points are the body's own statements and 30 belong to 11 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
reveal-component.RevealSlidesComponent (cyclomatic 48) frontend/src/components/slides/reveal-component.tsx:472— reveal-component.RevealSlidesComponent has cyclomatic complexity 48 (threshold 15). Of this number, 22 points are the body's own statements and 26 belong to 12 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
PythonTypeToOpenAPI.convert (cyclomatic 47) marimo/_utils/dataclass_to_openapi.py:40— PythonTypeToOpenAPI.convert has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
plotly._append_violin_points_to_selection (cyclomatic 46) marimo/_plugins/ui/_impl/plotly.py:2378— plotly._append_violin_points_to_selection 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.
sql_visitor.find_sql_defs (cyclomatic 45) marimo/_ast/sql_visitor.py:167— sql_visitor.find_sql_defs 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.
plotly._append_box_points_to_selection (cyclomatic 45) marimo/_plugins/ui/_impl/plotly.py:2729— plotly._append_box_points_to_selection 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.
table.__init__ (cyclomatic 45) marimo/_plugins/ui/_impl/table.py:664— table.__init__ 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.
_DataclassParser._build_value (cyclomatic 45) marimo/_utils/parse_dataclass.py:42— _DataclassParser._build_value 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.
filter-pill-editor.buildFilterValue (cyclomatic 45) frontend/src/components/data-table/filter-pill-editor.tsx:590— filter-pill-editor.buildFilterValue 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.
navigation.useCellNavigationProps (cyclomatic 45) frontend/src/components/editor/navigation/navigation.ts:192— navigation.useCellNavigationProps has cyclomatic complexity 45 (threshold 15). Most of this is not in the body itself: 1 of the 45 points is its own statement and the rest belongs to 22 function items inside it that branch (a function literal at line 248, a function literal at line 576, a function literal at line 281, …). 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.
form.renderZodSchema (cyclomatic 43) frontend/src/components/forms/form.tsx:91— form.renderZodSchema has cyclomatic complexity 43 (threshold 15). Of this number, 32 points are the body's own statements and 11 belong to 6 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
format.formatValue (cyclomatic 41) frontend/src/components/data-table/filters/format.ts:19— format.formatValue has cyclomatic complexity 41 (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.
DataTablePlugin.LoadingDataTableComponent (cyclomatic 41) frontend/src/plugins/impl/DataTablePlugin.tsx:516— DataTablePlugin.LoadingDataTableComponent has cyclomatic complexity 41 (threshold 15). Of this number, 16 points are the body's own statements and 25 belong to 10 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
print_code.python_print_polars (cyclomatic 39) marimo/_plugins/ui/_impl/dataframes/transforms/print_code.py:304— print_code.python_print_polars 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.
print_code.python_print_pandas (cyclomatic 38) marimo/_plugins/ui/_impl/dataframes/transforms/print_code.py:34— print_code.python_print_pandas 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.
ai-completion-editor.AiCompletionEditor (cyclomatic 38) frontend/src/components/editor/ai/ai-completion-editor.tsx:85— ai-completion-editor.AiCompletionEditor has cyclomatic complexity 38 (threshold 15). Of this number, 19 points are the body's own statements and 19 belong to 9 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
Output.OutputRenderer (cyclomatic 37) frontend/src/components/editor/Output.tsx:78— Output.OutputRenderer has cyclomatic complexity 37 (threshold 15). Of this number, 30 points are the body's own statements and 7 belong to one function literal inside it that branches. 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.
runtime-story.RuntimeStory (cyclomatic 37) frontend/src/stories/runtime-story.tsx:225— runtime-story.RuntimeStory has cyclomatic complexity 37 (threshold 15). Most of this is not in the body itself: 8 of the 37 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 226, 291, 381, …). 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.
serialize.filterToFilterCondition (cyclomatic 36) frontend/src/components/data-table/filters/serialize.ts:18— serialize.filterToFilterCondition has cyclomatic complexity 36 (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.
connection-notice.ConnectionNotice (cyclomatic 35) frontend/src/components/editor/alerts/connection-notice.tsx:20— connection-notice.ConnectionNotice has cyclomatic complexity 35 (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.
commands.collectMatchingDeclarations (cyclomatic 35) frontend/src/core/codemirror/go-to-definition/commands.ts:210— commands.collectMatchingDeclarations has cyclomatic complexity 35 (threshold 15). Of this number, 34 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
file-viewer.FileViewer (cyclomatic 35) frontend/src/components/editor/file-tree/file-viewer.tsx:42— file-viewer.FileViewer has cyclomatic complexity 35 (threshold 15). Of this number, 25 points are the body's own statements and 10 belong to 5 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
forwarder.run_forwarder (cyclomatic 34) marimo/_cli/pair/forwarder.py:188— forwarder.run_forwarder 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.
plotly._extract_scatter_points_fallback (cyclomatic 33) marimo/_plugins/ui/_impl/plotly.py:1021— plotly._extract_scatter_points_fallback 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.
plotly._extract_scatter_points_from_lasso (cyclomatic 33) marimo/_plugins/ui/_impl/plotly.py:1183— plotly._extract_scatter_points_from_lasso 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.
BlockHasher.serialize_and_dequeue_content_refs (cyclomatic 33) marimo/_save/hash.py:731— BlockHasher.serialize_and_dequeue_content_refs 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.
file-explorer.Node (cyclomatic 33) frontend/src/components/editor/file-tree/file-explorer.tsx:690— file-explorer.Node has cyclomatic complexity 33 (threshold 15). Of this number, 27 points are the body's own statements and 6 belong to 5 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
SliderPlugin.SliderComponent (cyclomatic 33) frontend/src/plugins/impl/SliderPlugin.tsx:141— SliderPlugin.SliderComponent has cyclomatic complexity 33 (threshold 15). Of this number, 23 points are the body's own statements and 10 belong to 3 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
commands.execute (cyclomatic 32) marimo/_cli/pair/commands.py:215— commands.execute 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.
MarimoErrorOutput.MarimoErrorOutput::renderMessages (cyclomatic 32) frontend/src/components/editor/output/MarimoErrorOutput.tsx:232— MarimoErrorOutput.MarimoErrorOutput::renderMessages has cyclomatic complexity 32 (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.
filter-by-values-picker.FilterByValuesList (cyclomatic 32) frontend/src/components/data-table/filter-by-values-picker.tsx:99— filter-by-values-picker.FilterByValuesList has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 13 of the 32 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 160, handleToggleAll, a function literal at line 114, …). 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.
ScopedVisitor.generic_visit (cyclomatic 31) marimo/_ast/visitor.py:485— ScopedVisitor.generic_visit has cyclomatic complexity 31 (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.
file_browser.__init__ (cyclomatic 31) marimo/_plugins/ui/_impl/file_browser.py:305— file_browser.__init__ 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.
AsyncCodeModeContext._apply_ops (cyclomatic 30) marimo/_code_mode/_context.py:1727— AsyncCodeModeContext._apply_ops 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.
altair_chart._filter_dataframe (cyclomatic 30) REDACTED:224— altair_chart._filter_dataframe 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.
cell_matching._approximate_assignment (cyclomatic 30) marimo/_utils/cell_matching.py:89— cell_matching._approximate_assignment 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.
docs.google_docstring_to_markdown (cyclomatic 30) marimo/_utils/docs.py:31— docs.google_docstring_to_markdown 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.
keyboard-shortcuts.KeyboardShortcuts (cyclomatic 30) frontend/src/components/editor/controls/keyboard-shortcuts.tsx:33— keyboard-shortcuts.KeyboardShortcuts has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 2 of the 30 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 136, renderItem, renderCommandGroup, …). 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.
feature.applyFormat (cyclomatic 30) frontend/src/components/data-table/column-formatting/feature.ts:146— feature.applyFormat has cyclomatic complexity 30 (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.
row-viewer.RowViewerPanel (cyclomatic 30) frontend/src/components/data-table/row-viewer-panel/row-viewer.tsx:60— row-viewer.RowViewerPanel has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 7 of the 30 points are its own statements and the rest belongs to 6 function items inside it that branch (renderTable, handleKeyDown, setRow, …). 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.
storage-inspector.StorageNamespaceSection (cyclomatic 30) frontend/src/components/storage/storage-inspector.tsx:603— storage-inspector.StorageNamespaceSection has cyclomatic complexity 30 (threshold 15). Of this number, 16 points are the body's own statements and 14 belong to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
sql-parser.parseSQLStatement (cyclomatic 30) packages/smart-cells/src/parsers/sql-parser.ts:173— sql-parser.parseSQLStatement 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.
commands.html_wasm (cyclomatic 29) marimo/_cli/export/commands.py:1043— commands.html_wasm 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.
AsyncCodeModeContext._print_summary (cyclomatic 29) marimo/_code_mode/_context.py:862— AsyncCodeModeContext._print_summary 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.
Executions.observe (cyclomatic 29) marimo/_core/executions.py:306— Executions.observe 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.
LazyLoader.restore_cache (cyclomatic 29) REDACTED:1160— LazyLoader.restore_cache 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.
RunTranslator.feed (cyclomatic 29) marimo/_server/host/translate.py:93— RunTranslator.feed 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.
start.start (cyclomatic 29) REDACTED:188— start.start 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.
feedback-button.FeedbackModal (cyclomatic 29) frontend/src/components/editor/chrome/components/feedback-button.tsx:109— feedback-button.FeedbackModal has cyclomatic complexity 29 (threshold 15). Of this number, 23 points are the body's own statements and 6 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.
columns.renderCellValue (cyclomatic 29) frontend/src/components/data-table/columns.tsx:612— columns.renderCellValue 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.
PanelPlugin.PanelSlot (cyclomatic 29) frontend/src/plugins/impl/panel/PanelPlugin.tsx:140— PanelPlugin.PanelSlot has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 1 of the 29 points is its own statement and the rest belongs to 8 function literals inside it that branch (lines 218, 152, 273, …). 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.
scanner.scan_notebook (cyclomatic 28) marimo/_ast/scanner.py:227— scanner.scan_notebook 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.
sandbox.run_in_sandbox (cyclomatic 28) marimo/_cli/sandbox.py:424— sandbox.run_in_sandbox 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.
plotly._extract_box_points_fallback (cyclomatic 28) marimo/_plugins/ui/_impl/plotly.py:3094— plotly._extract_box_points_fallback 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.
plotly._extract_violin_points_fallback (cyclomatic 28) marimo/_plugins/ui/_impl/plotly.py:3239— plotly._extract_violin_points_fallback 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.
geometry_export._describe_export_source (cyclomatic 28) marimo/_plugins/ui/_impl/tables/geometry_export.py:221— geometry_export._describe_export_source 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.
geometry_export.serialize_geojson (cyclomatic 28) marimo/_plugins/ui/_impl/tables/geometry_export.py:677— geometry_export.serialize_geojson 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.
ai.list_provider_models (cyclomatic 28) marimo/_server/api/endpoints/ai.py:131— ai.list_provider_models 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.
IPCKernelManagerImpl.start_kernel (cyclomatic 28) REDACTED:301— IPCKernelManagerImpl.start_kernel 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.
replica.createNotebookReplica (cyclomatic 28) frontend/src/core/notebook/replica/replica.ts:151— replica.createNotebookReplica has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 1 of the 28 points is its own statement and the rest belongs to 12 function items inside it that branch (connect::reconnect, a function literal at line 215, a function literal at line 292, …). 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.
package-alert.PackageAlert (cyclomatic 28) frontend/src/components/editor/package-alert.tsx:106— package-alert.PackageAlert has cyclomatic complexity 28 (threshold 15). Of this number, 19 points are the body's own statements and 9 belong to 4 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
glide-utils.pasteCells (cyclomatic 28) frontend/src/plugins/impl/data-editor/glide-utils.ts:120— glide-utils.pasteCells has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 2 of the 28 points are its own statements and the rest belongs to one function literal inside it that branches (line 137). 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.
document._validate (cyclomatic 27) marimo/_messaging/notebook/document.py:342— document._validate 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.
plotly._extract_scatter_points_numpy (cyclomatic 27) marimo/_plugins/ui/_impl/plotly.py:892— plotly._extract_scatter_points_numpy 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.
Runner._run_result_from_exception (cyclomatic 27) marimo/_runtime/runner/cell_runner.py:396— Runner._run_result_from_exception 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.
combobox.Combobox (cyclomatic 27) frontend/src/components/ui/combobox.tsx:79— combobox.Combobox has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 7 of the 27 points are its own statements and the rest belongs to 6 function items inside it that branch (renderValueLabel, a function literal at line 129, a function literal at line 192, …). 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.
data-table.DataTableInternal (cyclomatic 27) frontend/src/components/data-table/data-table.tsx:137— data-table.DataTableInternal has cyclomatic complexity 27 (threshold 15). Of this number, 21 points are the body's own statements and 6 belong to 5 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
startup-output.StartupOutput (cyclomatic 27) frontend/src/components/editor/alerts/startup-output.tsx:17— startup-output.StartupOutput has cyclomatic complexity 27 (threshold 15). Of this number, 14 points are the body's own statements and 13 belong to 6 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
cell-editor.CellEditorInternal (cyclomatic 27) frontend/src/components/editor/cell/code/cell-editor.tsx:100— cell-editor.CellEditorInternal has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 9 of the 27 points are its own statements and the rest belongs to 11 function literals inside it that branch (lines 139, 154, 177, …). 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.
find-replace.FindReplace (cyclomatic 27) frontend/src/components/find-replace/find-replace.tsx:41— find-replace.FindReplace has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 11 of the 27 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 143, a function literal at line 51, a function literal at line 66, …). 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.
reorderable-list.ReorderableList (cyclomatic 27) frontend/src/components/ui/reorderable-list.tsx:139— reorderable-list.ReorderableList has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 7 of the 27 points are its own statements and the rest belongs to 6 function items inside it that branch (handleCrossListDrop, a function literal at line 200, handleToggleItem, …). 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.
hooks._extract_description (cyclomatic 26) docs/hooks.py:35— hooks._extract_description 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.
print_code.python_print_ibis (cyclomatic 26) marimo/_plugins/ui/_impl/dataframes/transforms/print_code.py:577— print_code.python_print_ibis 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.
utils._split_around_extras (cyclomatic 26) marimo/_runtime/packages/utils.py:200— utils._split_around_extras 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.
ModuleReloader._check (cyclomatic 26) marimo/_runtime/reload/autoreload.py:349— ModuleReloader._check 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.
sql.sql (cyclomatic 26) marimo/_sql/sql.py:140— sql.sql 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.
datasources.DatasetTableItem (cyclomatic 26) frontend/src/components/datasources/datasources.tsx:817— datasources.DatasetTableItem has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 5 of the 26 points are its own statements and the rest belongs to 5 function items inside it that branch (handleAddTable::getCode, a function literal at line 829, renderColumns, …). 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.
useCellActionButton.useCellActionButtons (cyclomatic 26) frontend/src/components/editor/actions/useCellActionButton.tsx:91— useCellActionButton.useCellActionButtons has cyclomatic complexity 26 (threshold 15). Of this number, 16 points are the body's own statements and 10 belong to 7 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
file-explorer.FileExplorer::handleTreeKeyDown (cyclomatic 26) frontend/src/components/editor/file-tree/file-explorer.tsx:247— file-explorer.FileExplorer::handleTreeKeyDown 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.
lsp-status.LspStatus (cyclomatic 26) frontend/src/components/editor/chrome/wrapper/footer-items/lsp-status.tsx:25— lsp-status.LspStatus has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 5 of the 26 points are its own statements and the rest belongs to 6 function items inside it that branch (getServerStatusDisplay, getStatusIcon, handleRestart, …). 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.
IslandsPyodideBridge.startApps (cyclomatic 26) frontend/src/core/islands/bridge.ts:195— IslandsPyodideBridge.startApps 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.
table._get_column_summaries (cyclomatic 25) marimo/_plugins/ui/_impl/table.py:1227— table._get_column_summaries 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.
CellStatus.CellStatusComponent (cyclomatic 25) frontend/src/components/editor/cell/CellStatus.tsx:36— CellStatus.CellStatusComponent 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.
make-selectable.makeSelectable (cyclomatic 25) frontend/src/plugins/impl/vega/make-selectable.ts:282— make-selectable.makeSelectable has cyclomatic complexity 25 (threshold 15). Of this number, 17 points are the body's own statements and 8 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.
python-ast.getStringContent (cyclomatic 25) packages/smart-cells/src/utils/python-ast.ts:113— python-ast.getStringContent 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.
ScopedVisitor.visit_Call (cyclomatic 24) marimo/_ast/visitor.py:729— ScopedVisitor.visit_Call 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.
Kernel.mutate_graph (cyclomatic 24) marimo/_runtime/runtime.py:1279— Kernel.mutate_graph 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.
net._bind_sockets (cyclomatic 24) marimo/_utils/net.py:38— net._bind_sockets 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.
columns.generateColumns.columns (cyclomatic 24) frontend/src/components/data-table/columns.tsx:200— columns.generateColumns.columns has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 5 of the 24 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 209, 282, 283). 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.
cell-context-menu.CellActionsContextMenu (cyclomatic 24) frontend/src/components/editor/cell/cell-context-menu.tsx:51— cell-context-menu.CellActionsContextMenu has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 1 of the 24 points is its own statement and the rest belongs to 12 function literals inside it that branch (lines 239, 113, 83, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
terminal.TerminalComponent (cyclomatic 24) frontend/src/components/terminal/terminal.tsx:139— terminal.TerminalComponent has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 4 of the 24 points are its own statements and the rest belongs to 10 function literals inside it that branch (lines 323, 213, 225, …). 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.
parse.parsePayloadBackedApps (cyclomatic 24) frontend/src/core/islands/parse.ts:161— parse.parsePayloadBackedApps has cyclomatic complexity 24 (threshold 15). Of this number, 23 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
connection-notice.connectionNoticeAtom (cyclomatic 24) frontend/src/core/network/connection-notice.ts:22— connection-notice.connectionNoticeAtom 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.
DisplayMathPreprocessor._convert_rst_math_blocks (cyclomatic 23) marimo/_output/md_extensions/display_math.py:282— DisplayMathPreprocessor._convert_rst_math_blocks 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.
matrix._validate_and_build_args (cyclomatic 23) marimo/_plugins/ui/_impl/matrix.py:206— matrix._validate_and_build_args 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.
plotly._extract_violin_points_numpy (cyclomatic 23) marimo/_plugins/ui/_impl/plotly.py:2580— plotly._extract_violin_points_numpy 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.
geometry_export._arrow_geometry_declaration (cyclomatic 23) marimo/_plugins/ui/_impl/tables/geometry_export.py:387— geometry_export._arrow_geometry_declaration has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
_futures.wasm_as_completed (cyclomatic 23) marimo/_runtime/_wasm/_concurrency/_futures.py:312— _futures.wasm_as_completed 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.
PackagesCallbacks.install_missing_packages (cyclomatic 23) marimo/_runtime/callbacks/packages.py:244— PackagesCallbacks.install_missing_packages 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.
BlockHasher.extract_ref_state_and_normalize_scope (cyclomatic 23) marimo/_save/hash.py:635— BlockHasher.extract_ref_state_and_normalize_scope 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.
DynamicDirectoryMiddleware.__call__ (cyclomatic 23) marimo/_server/asgi.py:194— DynamicDirectoryMiddleware.__call__ has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ScratchCellListener.on_notification_sent (cyclomatic 23) marimo/_server/scratchpad.py:114— ScratchCellListener.on_notification_sent 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.
model-discovery.ModelDiscovery (cyclomatic 23) frontend/src/components/app-config/model-discovery.tsx:30— model-discovery.ModelDiscovery has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 9 of the 23 points are its own statements and the rest belongs to 3 function items inside it that branch (load, a function literal at line 151, a function literal at line 176). 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.
filter-pill-editor.ValueSlot (cyclomatic 23) frontend/src/components/data-table/filter-pill-editor.tsx:378— filter-pill-editor.ValueSlot 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.
logs.getCellLogsForMessage (cyclomatic 23) frontend/src/core/cells/logs.ts:35— logs.getCellLogsForMessage has cyclomatic complexity 23 (threshold 15). Of this number, 20 points are the body's own statements and 3 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.
filename-input.FilenameInput (cyclomatic 23) frontend/src/components/editor/header/filename-input.tsx:40— filename-input.FilenameInput has cyclomatic complexity 23 (threshold 15). Of this number, 15 points are the body's own statements and 8 belong to 6 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
grid-layout.GridLayoutRenderer (cyclomatic 23) frontend/src/components/editor/renderers/grid-layout/grid-layout.tsx:56— grid-layout.GridLayoutRenderer has cyclomatic complexity 23 (threshold 15). Of this number, 15 points are the body's own statements and 8 belong to 7 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
storage-file-viewer.StorageFileViewer (cyclomatic 23) frontend/src/components/storage/storage-file-viewer.tsx:46— storage-file-viewer.StorageFileViewer has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 10 of the 23 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 66, renderMetadata, a function literal at line 95, …). 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.
storage-inspector.StorageInspector (cyclomatic 23) frontend/src/components/storage/storage-inspector.tsx:835— storage-inspector.StorageInspector has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 5 of the 23 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 920, 868, 1051, …). 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.
registerReactComponent.registerReactComponent (cyclomatic 23) frontend/src/plugins/core/registerReactComponent.tsx:331— registerReactComponent.registerReactComponent has cyclomatic complexity 23 (threshold 15). Of this number, 18 points are the body's own statements and 5 belong to 3 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
editor-state.applyEditorEdits (cyclomatic 23) frontend/src/plugins/impl/data-editor/editor-state.ts:19— editor-state.applyEditorEdits 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.
MatplotlibRenderer.#handlePointerMove (cyclomatic 23) frontend/src/plugins/impl/matplotlib/matplotlib-renderer.ts:723— MatplotlibRenderer.#handlePointerMove 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.
compiler.compile_cell (cyclomatic 22) marimo/_ast/compiler.py:226— compiler.compile_cell 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.
SQLRef.matches_hierarchical_ref (cyclomatic 22) marimo/_ast/sql_visitor.py:389— SQLRef.matches_hierarchical_ref 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.
from_ir._convert_output_to_ipynb (cyclomatic 22) marimo/_convert/ipynb/from_ir.py:317— from_ir._convert_output_to_ipynb 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.
from_ir._notebook_to_markdown_export_document (cyclomatic 22) marimo/_convert/markdown/from_ir.py:42— from_ir._notebook_to_markdown_export_document 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.
get_datasets._db_type_to_data_type (cyclomatic 22) marimo/_data/get_datasets.py:538— get_datasets._db_type_to_data_type 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.
cache_dirs.delete_blob_dirs (cyclomatic 22) marimo/_save/cache_dirs.py:430— cache_dirs.delete_blob_dirs 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.
SessionManager.create_session (cyclomatic 22) marimo/_server/session_manager.py:218— SessionManager.create_session 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.
column-header.DataTableColumnHeader (cyclomatic 22) frontend/src/components/data-table/column-header.tsx:47— column-header.DataTableColumnHeader has cyclomatic complexity 22 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
charts.TablePanel (cyclomatic 22) frontend/src/components/data-table/charts/charts.tsx:94— charts.TablePanel has cyclomatic complexity 22 (threshold 15). Of this number, 12 points are the body's own statements and 10 belong to 6 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
paste.extractMarimoApp (cyclomatic 22) frontend/src/core/codemirror/misc/paste.ts:65— paste.extractMarimoApp has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 3 of the 22 points are its own statements and the rest belongs to 3 function items inside it that branch (a function literal at line 113, bodyText, pushCell). 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.
python-ast.getPrefixLength (cyclomatic 22) packages/smart-cells/src/utils/python-ast.ts:173— python-ast.getPrefixLength 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.
_convert.convert_to_anthropic_messages (cyclomatic 21) marimo/_ai/_convert.py:195— _convert.convert_to_anthropic_messages has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
to_ir.transform_exclamation_mark (cyclomatic 21) marimo/_convert/ipynb/to_ir.py:821— to_ir.transform_exclamation_mark 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.
_EditableTable._apply_column_edit (cyclomatic 21) marimo/_plugins/ui/_impl/data_editor.py:399— _EditableTable._apply_column_edit 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.
plotly._append_scatter_points_to_selection (cyclomatic 21) marimo/_plugins/ui/_impl/plotly.py:725— plotly._append_scatter_points_to_selection 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.
plotly._append_waterfall_bars_to_selection (cyclomatic 21) marimo/_plugins/ui/_impl/plotly.py:2069— plotly._append_waterfall_bars_to_selection has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (plotly._append_funnel_points_to_selection) 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.
plotly._append_map_scatter_points_to_selection (cyclomatic 21) marimo/_plugins/ui/_impl/plotly.py:2309— plotly._append_map_scatter_points_to_selection 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.
plotly._append_funnel_points_to_selection (cyclomatic 21) marimo/_plugins/ui/_impl/plotly.py:3386— plotly._append_funnel_points_to_selection has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (plotly._append_waterfall_bars_to_selection) 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.
NarwhalsTableManager._get_stats_internal (cyclomatic 21) marimo/_plugins/ui/_impl/tables/narwhals_table.py:547— NarwhalsTableManager._get_stats_internal 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.
Cache._convert_to_stub_if_needed (cyclomatic 21) marimo/_save/cache.py:427— Cache._convert_to_stub_if_needed 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.
cache_dirs._delete_block_entries (cyclomatic 21) marimo/_save/cache_dirs.py:713— cache_dirs._delete_block_entries 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.
prune.plan_prune (cyclomatic 21) marimo/_save/prune.py:81— prune.plan_prune 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.
_templates.notebook_page_template (cyclomatic 21) marimo/_templates.py:303— _templates.notebook_page_template 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.
ai-config.AddModelForm (cyclomatic 21) frontend/src/components/app-config/ai-config.tsx:1675— ai-config.AddModelForm has cyclomatic complexity 21 (threshold 15). Of this number, 19 points are the body's own statements and 2 belong to 2 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
renderers.DataTableBody (cyclomatic 21) frontend/src/components/data-table/renderers.tsx:90— renderers.DataTableBody has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 3 of the 21 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 139, renderRow, renderRows, …). 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.
use-file-search.useFileSearch (cyclomatic 21) frontend/src/components/editor/file-tree/use-file-search.ts:26— use-file-search.useFileSearch has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 4 of the 21 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 59, 50, 109, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
runtime-panel.RuntimeDetails (cyclomatic 21) frontend/src/components/editor/chrome/panels/runtime-panel.tsx:116— runtime-panel.RuntimeDetails has cyclomatic complexity 21 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
storage-inspector.StorageEntryRow (cyclomatic 21) frontend/src/components/storage/storage-inspector.tsx:407— storage-inspector.StorageEntryRow has cyclomatic complexity 21 (threshold 15). 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.
select-list.SelectList (cyclomatic 21) frontend/src/components/ui/select-core/select-list.tsx:66— select-list.SelectList has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 4 of the 21 points are its own statements and the rest belongs to 8 function items inside it that branch (handleComboChange, pinnedSeparator, renderTriggerValue, …). 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.
MplInteractivePlugin.MplInteractiveSlot (cyclomatic 21) frontend/src/plugins/impl/mpl-interactive/MplInteractivePlugin.tsx:172— MplInteractivePlugin.MplInteractiveSlot has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 1 of the 21 points is its own statement and the rest belongs to 8 function literals inside it that branch (lines 232, 202, 293, …). 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.
OpenCodeHarness.detect (cyclomatic 20) marimo/_cli/pair/harnesses/opencode.py:129— OpenCodeHarness.detect 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.
target.resolve_target (cyclomatic 20) marimo/_cli/pair/target.py:29— target.resolve_target 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.
_better_inspect._build_help (cyclomatic 20) marimo/_code_mode/_better_inspect.py:332— _better_inspect._build_help 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.
EnvVarReader.read (cyclomatic 20) marimo/_config/manager.py:460— EnvVarReader.read 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.
plotly._extract_box_points_numpy (cyclomatic 20) marimo/_plugins/ui/_impl/plotly.py:2974— plotly._extract_box_points_numpy 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.
hooks_post_execution._broadcast_outputs (cyclomatic 20) marimo/_runtime/runner/hooks_post_execution.py:311— hooks_post_execution._broadcast_outputs 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.
Kernel._delete_variables (cyclomatic 20) marimo/_runtime/runtime.py:1104— Kernel._delete_variables 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.
Kernel.set_ui_element_value (cyclomatic 20) marimo/_runtime/runtime.py:2392— Kernel.set_ui_element_value 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.
cache_dirs.orphan_blob_dirs (cyclomatic 20) marimo/_save/cache_dirs.py:367— cache_dirs.orphan_blob_dirs 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.
bindings.existing_sql_bindings (cyclomatic 20) marimo/_sql/bindings.py:53— bindings.existing_sql_bindings 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.
pair-with-agent-modal.PairWithAgentModal (cyclomatic 20) frontend/src/components/editor/actions/pair-with-agent-modal.tsx:50— pair-with-agent-modal.PairWithAgentModal has cyclomatic complexity 20 (threshold 15). Of this number, 12 points are the body's own statements and 8 belong to 4 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
useNotebookActions.useNotebookActions (cyclomatic 20) frontend/src/components/editor/actions/useNotebookActions.tsx:113— useNotebookActions.useNotebookActions has cyclomatic complexity 20 (threshold 15). Of this number, 10 points are the body's own statements and 10 belong to 8 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
normalize-markdown-math.convertRstMathBlocks (cyclomatic 20) frontend/src/core/codemirror/lsp/normalize-markdown-math.ts:275— normalize-markdown-math.convertRstMathBlocks has cyclomatic complexity 20 (threshold 15). Of this number, 19 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
packages-panel.DependencyTreeNode (cyclomatic 20) frontend/src/components/editor/chrome/panels/packages-panel.tsx:521— packages-panel.DependencyTreeNode has cyclomatic complexity 20 (threshold 15). Of this number, 12 points are the body's own statements and 8 belong to 3 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
actions.deleteCellsAtom (cyclomatic 20) frontend/src/core/cells/actions.ts:443— actions.deleteCellsAtom has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 7 of the 20 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 498, 454, 467, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
ConsoleOutput.ConsoleOutputInternal (cyclomatic 20) frontend/src/components/editor/output/console/ConsoleOutput.tsx:92— ConsoleOutput.ConsoleOutputInternal has cyclomatic complexity 20 (threshold 15). Of this number, 13 points are the body's own statements and 7 belong to 3 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
copilot-config.CopilotConfig (cyclomatic 20) frontend/src/core/codemirror/copilot/copilot-config.tsx:15— copilot-config.CopilotConfig has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 1 of the 20 points is its own statement and the rest belongs to 4 function items inside it that branch (renderBody, trySignIn, tryFinishSignIn, …). 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.
openapi.adjustNode (cyclomatic 20) packages/host-protocol/src/internal/openapi.ts:67— openapi.adjustNode has cyclomatic complexity 20 (threshold 15). Of this number, 19 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.
codegen.to_functiondef (cyclomatic 19) marimo/_ast/codegen.py:340— codegen.to_functiondef 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.
parse.extract_offsets_post_colon (cyclomatic 19) marimo/_ast/parse.py:823— parse.extract_offsets_post_colon 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.
scanner._find_body_start (cyclomatic 19) marimo/_ast/scanner.py:424— scanner._find_body_start 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.
media.io_to_data_url (cyclomatic 19) marimo/_plugins/core/media.py:49— media.io_to_data_url 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.
image._normalize_image (cyclomatic 19) marimo/_plugins/stateless/image.py:24— image._normalize_image 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.
altair_chart.__init__ (cyclomatic 19) REDACTED:535— altair_chart.__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.
range_slider.__init__ (cyclomatic 19) marimo/_plugins/ui/_impl/input.py:449— range_slider.__init__ 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.
geometry_export._prepare_geographic_export (cyclomatic 19) marimo/_plugins/ui/_impl/tables/geometry_export.py:575— geometry_export._prepare_geographic_export 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.
module_watcher.watch_modules (cyclomatic 19) marimo/_runtime/reload/module_watcher.py:167— module_watcher.watch_modules 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.
Runner._dispatch_runnable (cyclomatic 19) marimo/_runtime/runner/cell_runner.py:947— Runner._dispatch_runnable 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.
translate._describe (cyclomatic 19) marimo/_server/host/translate.py:550— translate._describe 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.
ai-model-dropdown.AIModelDropdown (cyclomatic 19) frontend/src/components/ai/ai-model-dropdown.tsx:52— ai-model-dropdown.AIModelDropdown has cyclomatic complexity 19 (threshold 15). Of this number, 16 points are the body's own statements and 3 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.
column-summary.TableColumnSummary::renderStats (cyclomatic 19) frontend/src/components/data-table/column-summary/column-summary.tsx:75— column-summary.TableColumnSummary::renderStats 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.
filter-pill-editor.toDraftValue (cyclomatic 19) frontend/src/components/data-table/filter-pill-editor.tsx:508— filter-pill-editor.toDraftValue has cyclomatic complexity 19 (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.
charts.ChartPanel (cyclomatic 19) frontend/src/components/data-table/charts/charts.tsx:327— charts.ChartPanel has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 6 of the 19 points are its own statements and the rest belongs to 3 function items inside it that branch (a function literal at line 355, a function literal at line 399, renderChartDisplay). 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.
backend-status.BackendConnectionStatus (cyclomatic 19) frontend/src/components/editor/chrome/wrapper/footer-items/backend-status.tsx:35— backend-status.BackendConnectionStatus has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 3 of the 19 points are its own statements and the rest belongs to 3 function items inside it that branch (a function literal at line 40, getStatusIcon, getStatusInfo). 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.
SortableCellsProvider.SortableCellsProviderInternal (cyclomatic 19) frontend/src/components/sort/SortableCellsProvider.tsx:43— SortableCellsProvider.SortableCellsProviderInternal has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 2 of the 19 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 155, 92, 192, …). 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.
freshness.freshnessOf (cyclomatic 19) frontend/src/core/executions/freshness.ts:75— freshness.freshnessOf 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 4 function items inside it that branch (inputsChanged, a function literal at line 93, sourceChanged, …). 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.
analyzer.findDeclarationSites (cyclomatic 19) frontend/src/core/codemirror/code-lens/analyzer.ts:23— analyzer.findDeclarationSites has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 4 of the 19 points are its own statements and the rest belongs to 3 function items inside it that branch (collectTargetNames, collectAssignmentTargets, visit). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
extension.copilotBundle (cyclomatic 19) frontend/src/core/codemirror/copilot/extension.ts:45— extension.copilotBundle has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 4 of the 19 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 56, 102, 157). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
data-source-connections.allTablesAtom (cyclomatic 19) frontend/src/core/datasets/data-source-connections.ts:406— data-source-connections.allTablesAtom has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 7 of the 19 points are its own statements and the rest belongs to one function item inside it that branches (walkSchema). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
registerReactComponent.PluginSlotInternal (cyclomatic 19) frontend/src/plugins/core/registerReactComponent.tsx:103— registerReactComponent.PluginSlotInternal has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 2 of the 19 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 204, 193, 146, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
matplotlib-renderer.getResizeHandle (cyclomatic 19) frontend/src/plugins/impl/matplotlib/matplotlib-renderer.ts:95— matplotlib-renderer.getResizeHandle 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.
merge.mergeModels (cyclomatic 19) packages/llm-info/src/sources/merge.ts:277— merge.mergeModels 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.
sync-models.refreshMetadata (cyclomatic 19) packages/llm-info/src/sync-models.ts:250— sync-models.refreshMetadata 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.
GetCellDependencyGraph.handle (cyclomatic 18) marimo/_ai/_tools/tools/dependency_graph.py:97— GetCellDependencyGraph.handle 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.
codegen.format_markdown (cyclomatic 18) marimo/_ast/codegen.py:208— codegen.format_markdown 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.
ScopedVisitor.visit_Name (cyclomatic 18) marimo/_ast/visitor.py:1024— ScopedVisitor.visit_Name 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.
to_ir._strip_paragraph_tags (cyclomatic 18) marimo/_convert/ipynb/to_ir.py:55— to_ir._strip_paragraph_tags 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.
preview_column._sanitize_data (cyclomatic 18) marimo/_data/preview_column.py:343— preview_column._sanitize_data 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.
NotebookDocument._apply_change (cyclomatic 18) marimo/_messaging/notebook/document.py:177— NotebookDocument._apply_change 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.
reconcile.reconcile_transaction (cyclomatic 18) marimo/_messaging/notebook/reconcile.py:28— reconcile.reconcile_transaction 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.
inspect.__init__ (cyclomatic 18) marimo/_plugins/stateless/inspect.py:38— inspect.__init__ 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.
plotly._extract_waterfall_bars_fallback (cyclomatic 18) marimo/_plugins/ui/_impl/plotly.py:2244— plotly._extract_waterfall_bars_fallback 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.
plotly._build_global_category_order (cyclomatic 18) marimo/_plugins/ui/_impl/plotly.py:2918— plotly._build_global_category_order 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.
plotly._extract_funnel_stages_numpy (cyclomatic 18) marimo/_plugins/ui/_impl/plotly.py:3493— plotly._extract_funnel_stages_numpy 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.
prompts.get_refactor_or_insert_notebook_cell_system_prompt (cyclomatic 18) marimo/_server/ai/prompts.py:106— prompts.get_refactor_or_insert_notebook_cell_system_prompt 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.
health.usage (cyclomatic 18) marimo/_server/api/endpoints/health.py:212— health.usage 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.
errors.handle_error (cyclomatic 18) marimo/_server/errors.py:44— errors.handle_error 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.
SessionBackend._handle_notification (cyclomatic 18) marimo/_server/host/backend.py:522— SessionBackend._handle_notification 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.
IPCKernelManagerImpl.close_kernel (cyclomatic 18) REDACTED:699— IPCKernelManagerImpl.close_kernel 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.
serialize.deserialize_session (cyclomatic 18) marimo/_session/state/serialize.py:253— serialize.deserialize_session 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.
AdbcConnectionCatalog.get_databases (cyclomatic 18) marimo/_sql/engines/adbc.py:200— AdbcConnectionCatalog.get_databases 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.
uv_tree._parse_tree (cyclomatic 18) marimo/_utils/uv_tree.py:63— uv_tree._parse_tree 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.
shortcuts.areKeysPressed (cyclomatic 18) frontend/src/core/hotkeys/shortcuts.ts:47— shortcuts.areKeysPressed 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.
chat-display.renderUIMessage::renderPart (cyclomatic 18) frontend/src/components/chat/chat-display.tsx:81— chat-display.renderUIMessage::renderPart 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.
JsonOutput.JsonTree (cyclomatic 18) frontend/src/components/editor/output/JsonOutput.tsx:65— JsonOutput.JsonTree has cyclomatic complexity 18 (threshold 15). Of this number, 9 points are the body's own statements and 9 belong to 4 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
column-visibility-dropdown.ColumnVisibilityDropdown (cyclomatic 18) frontend/src/components/data-table/column-visibility-dropdown.tsx:50— column-visibility-dropdown.ColumnVisibilityDropdown has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 7 of the 18 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 204, a function literal at line 184, applyHidden, …). 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.
secret-combobox.SecretCombobox (cyclomatic 18) REDACTED:79— secret-combobox.SecretCombobox has cyclomatic complexity 18 (threshold 15). Of this number, 15 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
runtime-settings.RuntimeSettings (cyclomatic 18) frontend/src/components/editor/chrome/wrapper/footer-items/runtime-settings.tsx:29— runtime-settings.RuntimeSettings has cyclomatic complexity 18 (threshold 15). Of this number, 17 points are the body's own statements and 1 belongs to one function item 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.
minimap.SlidesMinimap (cyclomatic 18) frontend/src/components/slides/minimap.tsx:221— minimap.SlidesMinimap has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 4 of the 18 points are its own statements and the rest belongs to 7 function items inside it that branch (handleDragEnd, a function literal at line 363, a function literal at line 249, …). 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.
EditNotebookTool.handler (cyclomatic 18) frontend/src/core/ai/tools/edit-notebook-tool.ts:86— EditNotebookTool.handler 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.
vim.applyVimCommands (cyclomatic 18) frontend/src/core/codemirror/keymaps/vim.ts:217— vim.applyVimCommands has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 6 of the 18 points are its own statements and the rest belongs to 4 function items inside it that branch (map, noremap, unmap, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
useNotebookSession.useNotebookSession (cyclomatic 18) frontend/src/core/session/useNotebookSession.tsx:87— useNotebookSession.useNotebookSession has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to 6 function literals inside it that branch (lines 474, 452, 392, …). 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.
loader.vegaLoadData (cyclomatic 18) frontend/src/plugins/impl/vega/loader.ts:153— loader.vegaLoadData has cyclomatic complexity 18 (threshold 15). Of this number, 16 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
edit-distance.editDistanceGeneral (cyclomatic 18) frontend/src/utils/edit-distance.ts:22— edit-distance.editDistanceGeneral 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.
discovery.discoverHosts (cyclomatic 18) packages/client/src/node/discovery.ts:32— discovery.discoverHosts 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.
Cell.__call__ (cyclomatic 17) marimo/_ast/cell.py:697— Cell.__call__ 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.
cli.run (cyclomatic 17) marimo/_cli/cli.py:1072— cli.run 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.
commands.pdf (cyclomatic 17) marimo/_cli/export/commands.py:734— commands.pdf 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.
_context._plan_to_document_ops (cyclomatic 17) marimo/_code_mode/_context.py:1976— _context._plan_to_document_ops 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.
ReusableDefinitionOrderRule._stable_provider_order (cyclomatic 17) marimo/_lint/rules/runtime/reusable_definition_order.py:189— ReusableDefinitionOrderRule._stable_provider_order 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.
variables.get_variable_preview (cyclomatic 17) marimo/_messaging/variables.py:14— variables.get_variable_preview 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.
_EditableTable._apply_positional_edit (cyclomatic 17) marimo/_plugins/ui/_impl/data_editor.py:329— _EditableTable._apply_positional_edit 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.
data_editor._convert_like (cyclomatic 17) marimo/_plugins/ui/_impl/data_editor.py:1009— data_editor._convert_like 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.
file_browser._list_directory (cyclomatic 17) marimo/_plugins/ui/_impl/file_browser.py:542— file_browser._list_directory 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.
slider.__init__ (cyclomatic 17) marimo/_plugins/ui/_impl/input.py:231— slider.__init__ 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.
plotly._extract_heatmap_cells_fallback (cyclomatic 17) marimo/_plugins/ui/_impl/plotly.py:1288— plotly._extract_heatmap_cells_fallback 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.
PackagesCallbacks.missing_packages_hook (cyclomatic 17) marimo/_runtime/callbacks/packages.py:148— PackagesCallbacks.missing_packages_hook 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.
_micropip_streaming.stream_transaction_install (cyclomatic 17) marimo/_runtime/packages/_micropip_streaming.py:69— _micropip_streaming.stream_transaction_install 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.
primitives.is_data_primitive (cyclomatic 17) marimo/_runtime/primitives.py:60— primitives.is_data_primitive 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.
Cache._restore_from_stub_if_needed (cyclomatic 17) marimo/_save/cache.py:292— Cache._restore_from_stub_if_needed 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.
encode.primitive_to_bytes (cyclomatic 17) marimo/_save/encode.py:138— encode.primitive_to_bytes 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.
_cache_call._set_context (cyclomatic 17) marimo/_save/save.py:174— _cache_call._set_context has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
dependency_tree.parse_uv_tree (cyclomatic 17) marimo/_server/api/dependency_tree.py:14— dependency_tree.parse_uv_tree 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.
record.discover_hosts (cyclomatic 17) marimo/_server/host/record.py:30— record.discover_hosts 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.
scratchpad.extract_result (cyclomatic 17) marimo/_server/scratchpad.py:359— scratchpad.extract_result 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.
cell_matching._match_cell_ids_by_similarity (cyclomatic 17) marimo/_utils/cell_matching.py:237— cell_matching._match_cell_ids_by_similarity 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.
page_actions.createDropdown (cyclomatic 17) docs/_static/js/page_actions.js:185— page_actions.createDropdown has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 1 of the 17 points is its own statement and the rest belongs to 6 function items inside it that branch (a function literal at line 302, a function literal at line 327, a function literal at line 251, …). 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.
ai-config.CustomProvidersConfig (cyclomatic 17) frontend/src/components/app-config/ai-config.tsx:606— ai-config.CustomProvidersConfig has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 6 of the 17 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 644, 651, 745, …). 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.
MarimoTracebackOutput.MarimoTracebackOutput (cyclomatic 17) frontend/src/components/editor/output/MarimoTracebackOutput.tsx:64— MarimoTracebackOutput.MarimoTracebackOutput 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.
TableBottomBar.TableBottomBar (cyclomatic 17) frontend/src/components/data-table/TableBottomBar.tsx:32— TableBottomBar.TableBottomBar has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 3 of the 17 points are its own statements and the rest belongs to 4 function items inside it that branch (renderTotal, handleSelectAllRows, a function literal at line 72, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
use-cell-range-selection.useCellRangeSelection.handleCellsKeyDown (cyclomatic 17) frontend/src/components/data-table/range-focus/use-cell-range-selection.ts:57— use-cell-range-selection.useCellRangeSelection.handleCellsKeyDown has cyclomatic complexity 17 (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.
state.getExportFormatStatus (cyclomatic 17) frontend/src/components/editor/actions/export-dialog/state.ts:256— state.getExportFormatStatus 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.
renderers.renderTableInfo (cyclomatic 17) frontend/src/core/codemirror/language/languages/sql/renderers.tsx:131— renderers.renderTableInfo 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.
NotebookLanguageServerClient.textDocumentRename (cyclomatic 17) frontend/src/core/codemirror/lsp/notebook-lsp.ts:661— NotebookLanguageServerClient.textDocumentRename has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
sync.createDocumentSync.drain (cyclomatic 17) frontend/src/core/notebook/document/sync.ts:244— sync.createDocumentSync.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.
useTheme.getHostTheme (cyclomatic 17) frontend/src/theme/useTheme.ts:24— useTheme.getHostTheme 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.
swiper-component.SlidesComponent (cyclomatic 17) frontend/src/components/slides/swiper-component.tsx:30— swiper-component.SlidesComponent has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 7 of the 17 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 43, 105, 112, …). 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.
calendar.CalendarCell (cyclomatic 17) frontend/src/components/ui/calendar.tsx:107— calendar.CalendarCell has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 1 of the 17 points is its own statement and the rest belongs to one function literal inside it that branches (line 111). 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.
hooks.useEnrichCellOutputs.<returned closure> (cyclomatic 17) frontend/src/core/export/hooks.ts:127— hooks.useEnrichCellOutputs.<returned closure> 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.
glide-utils.isValidCellValue (cyclomatic 17) frontend/src/plugins/impl/data-editor/glide-utils.ts:66— glide-utils.isValidCellValue has cyclomatic complexity 17 (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.
DataFramePlugin.DataFrameComponent (cyclomatic 17) frontend/src/plugins/impl/data-frames/DataFramePlugin.tsx:193— DataFramePlugin.DataFrameComponent has cyclomatic complexity 17 (threshold 15). Of this number, 13 points are the body's own statements and 4 belong to 3 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
urls.appendQueryParams (cyclomatic 17) frontend/src/utils/urls.ts:63— urls.appendQueryParams 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.
generate-protocol.operationsModule (cyclomatic 17) packages/client/scripts/generate-protocol.ts:67— generate-protocol.operationsModule 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.
cli.edit (cyclomatic 16) marimo/_cli/cli.py:462— cli.edit 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.
client.list_sessions (cyclomatic 16) marimo/_cli/pair/client.py:482— client.list_sessions 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.
parse_args.parse_args (cyclomatic 16) marimo/_cli/parse_args.py:13— parse_args.parse_args 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.
Document.apply (cyclomatic 16) marimo/_core/document.py:274— Document.apply 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.
plotly._extract_heatmap_cells_numpy (cyclomatic 16) marimo/_plugins/ui/_impl/plotly.py:638— plotly._extract_heatmap_cells_numpy 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.
DefaultTableManager.select_cells (cyclomatic 16) marimo/_plugins/ui/_impl/tables/default_table.py:184— DefaultTableManager.select_cells 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.
complete.complete (cyclomatic 16) marimo/_runtime/complete.py:662— complete.complete 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.
edges.resolve_cell_references (cyclomatic 16) marimo/_runtime/dataflow/edges.py:139— edges.resolve_cell_references 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.
Kernel._maybe_register_cell (cyclomatic 16) marimo/_runtime/runtime.py:1009— Kernel._maybe_register_cell 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.
Kernel.prepare_execution_requests (cyclomatic 16) marimo/_runtime/runtime.py:2034— Kernel.prepare_execution_requests 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.
lazy.to_item (cyclomatic 16) REDACTED:290— lazy.to_item 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.
_cache_context.trace (cyclomatic 16) marimo/_save/save.py:727— _cache_context.trace 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.
serialize.serialize_session_view (cyclomatic 16) marimo/_session/state/serialize.py:136— serialize.serialize_session_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.
inline_script_metadata._pyproject_toml_to_requirements_txt (cyclomatic 16) marimo/_utils/inline_script_metadata.py:130— inline_script_metadata._pyproject_toml_to_requirements_txt has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
blocks.ToolBodyBlock (cyclomatic 16) frontend/src/components/chat/acp/blocks.tsx:706— blocks.ToolBodyBlock 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.
pending-ai-cells.PendingAICells (cyclomatic 16) frontend/src/components/editor/chrome/wrapper/pending-ai-cells.tsx:24— pending-ai-cells.PendingAICells has cyclomatic complexity 16 (threshold 15). Of this number, 10 points are the body's own statements and 6 belong to 3 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
column-preview.DatasetColumnPreview (cyclomatic 16) frontend/src/components/datasources/column-preview.tsx:40— column-preview.DatasetColumnPreview has cyclomatic complexity 16 (threshold 15). Of this number, 13 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
TerminalBuffer.handleEscape (cyclomatic 16) REDACTED:98— TerminalBuffer.handleEscape 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, 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.
minimap.SlideThumbnailCard (cyclomatic 16) frontend/src/components/slides/minimap.tsx:616— minimap.SlideThumbnailCard 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.
analyzer.analyzeCacheSite (cyclomatic 16) frontend/src/core/codemirror/code-lens/analyzer.ts:178— analyzer.analyzeCacheSite 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.
error-entries.describeError (cyclomatic 16) frontend/src/core/errors/error-entries.ts:111— error-entries.describeError 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.
useConnectionNotice.useConnectionNotice (cyclomatic 16) frontend/src/core/network/useConnectionNotice.ts:14— useConnectionNotice.useConnectionNotice has cyclomatic complexity 16 (threshold 15). Of this number, 14 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
useResizeHandle.useResizeHandle (cyclomatic 16) frontend/src/hooks/useResizeHandle.ts:12— useResizeHandle.useResizeHandle has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 40, 22, 87, …). 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.
ProgressPlugin.ProgressComponent (cyclomatic 16) frontend/src/plugins/layout/ProgressPlugin.tsx:60— ProgressPlugin.ProgressComponent has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 4 of the 16 points are its own statements and the rest belongs to 2 function items inside it that branch (renderMeta, renderProgress). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
StatPlugin.StatComponent (cyclomatic 16) frontend/src/plugins/layout/StatPlugin.tsx:45— StatPlugin.StatComponent has cyclomatic complexity 16 (threshold 15). Of this number, 9 points are the body's own statements and 7 belong to 2 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
traceback.getTracebackInfo (cyclomatic 16) frontend/src/utils/traceback.ts:64— traceback.getTracebackInfo 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.
request.request (cyclomatic 16) packages/client/src/request.ts:271— request.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.
ServerSentEventStream.constructor (cyclomatic 16) packages/client/src/transport/sse.ts:12— ServerSentEventStream.constructor has cyclomatic complexity 16 (threshold 15). Of this number, 12 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.
sse.sse.<returned closure> (cyclomatic 16) packages/client/src/transport/sse.ts:104— sse.sse.<returned closure> 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.
models-dev.parseModelsDev (cyclomatic 16) packages/llm-info/src/sources/models-dev.ts:42— models-dev.parseModelsDev 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.
D10 · Test Quality· Fixed-sleep synchronisation · ×1
Fixed-sleep synchronisation: waits for an in-flight `initialize` to settle frontend/src/plugins/impl/anywidget/__tests__/host.test.ts:124— This test starts work it did not wait for (`widgetPromise`, still running when the sleep starts) and then orders itself against it with `new Promise((r) => setTimeout(r, 5))` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
XxxComment marimo/_runtime/runtime.py:950— # first line has the form File XXX, line XXX — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `# REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
analyzer.findReactiveVariables::collectDeclarations (cognitive 130) frontend/src/core/codemirror/reactive-references/analyzer.ts:67— analyzer.findReactiveVariables::collectDeclarations has cognitive complexity 130 (threshold 15). Drivers by points: if/else 32 (88 pts), loops 14 (34 pts), boolean chains 7, match/switch 1 (nesting depth added 76). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
sql_visitor.find_sql_defs (cognitive 118) marimo/_ast/sql_visitor.py:167— sql_visitor.find_sql_defs has cognitive complexity 118 (threshold 15). Drivers by points: if/else 28 (101 pts), boolean chains 11, loops 2 (6 pts) (nesting depth added 77). 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.
export-actions.ExportActions (cognitive 108) frontend/src/components/data-table/export-actions.tsx:355— export-actions.ExportActions has cognitive complexity 108 (threshold 15). Drivers by points: boolean chains 44, ternaries 30 (34 pts), if/else 23 (25 pts), error handling 3, match/switch 2 (nesting depth added 6). Most of this is not in the body itself: 15 of the 108 points are its own statements and the rest belongs to 18 function items inside it that branch (a function literal at line 756, resolveDownloadUrl, a function literal at line 647, …). 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.
msgspec_encoder.enc_hook (cognitive 105) marimo/_messaging/msgspec_encoder.py:27— msgspec_encoder.enc_hook has cognitive complexity 105 (threshold 15). Drivers by points: if/else 55 (91 pts), error handling 5 (10 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 42). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
plotly._append_violin_points_to_selection (cognitive 104) marimo/_plugins/ui/_impl/plotly.py:2378— plotly._append_violin_points_to_selection has cognitive complexity 104 (threshold 15). Drivers by points: if/else 32 (83 pts), loops 5 (12 pts), boolean chains 9 (nesting depth added 58). 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.
plotly._append_box_points_to_selection (cognitive 101) marimo/_plugins/ui/_impl/plotly.py:2729— plotly._append_box_points_to_selection has cognitive complexity 101 (threshold 15). Drivers by points: if/else 31 (80 pts), loops 5 (12 pts), boolean chains 9 (nesting depth added 56). 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.
forwarder.run_forwarder (cognitive 92) marimo/_cli/pair/forwarder.py:188— forwarder.run_forwarder has cognitive complexity 92 (threshold 15). Drivers by points: if/else 21 (77 pts), loops 3 (5 pts), ternaries 1 (4 pts), boolean chains 3, error handling 1 (3 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.
to_ir.transform_exclamation_mark (cognitive 80) marimo/_convert/ipynb/to_ir.py:821— to_ir.transform_exclamation_mark has cognitive complexity 80 (threshold 15). Drivers by points: if/else 16 (56 pts), loops 5 (20 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 56). 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.
NarwhalsTransformHandler._evaluate_condition (cognitive 77) marimo/_plugins/ui/_impl/dataframes/transforms/handlers.py:161— NarwhalsTransformHandler._evaluate_condition has cognitive complexity 77 (threshold 15). Drivers by points: ternaries 21 (46 pts), if/else 12 (20 pts), boolean chains 8, error handling 1 (2 pts), match/switch 1 (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
plotly._extract_violin_points_fallback (cognitive 77) marimo/_plugins/ui/_impl/plotly.py:3239— plotly._extract_violin_points_fallback has cognitive complexity 77 (threshold 15). Drivers by points: if/else 18 (51 pts), error handling 3 (13 pts), loops 3 (6 pts), boolean chains 4, ternaries 1 (3 pts) (nesting depth added 48). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ScopedVisitor.visit_Call (cognitive 70) marimo/_ast/visitor.py:729— ScopedVisitor.visit_Call has cognitive complexity 70 (threshold 15). Drivers by points: loops 7 (27 pts), if/else 7 (22 pts), error handling 5 (18 pts), boolean chains 3 (nesting depth added 48). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
app-chrome.AppChrome (cognitive 70) frontend/src/components/editor/chrome/wrapper/app-chrome.tsx:96— app-chrome.AppChrome has cognitive complexity 70 (threshold 15). Drivers by points: if/else 24 (31 pts), boolean chains 27, ternaries 9 (12 pts) (nesting depth added 10). Of this number, 19 points are the body's own statements and 51 belong to 16 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.
_BoundaryDetector.feed (cognitive 68) marimo/_ast/scanner.py:83— _BoundaryDetector.feed has cognitive complexity 68 (threshold 15). Drivers by points: if/else 31 (49 pts), boolean chains 19 (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.
SessionView.add_notification (cognitive 68) marimo/_session/state/session_view.py:304— SessionView.add_notification has cognitive complexity 68 (threshold 15). Drivers by points: if/else 20 (47 pts), loops 7 (14 pts), boolean chains 5, ternaries 1 (2 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.
plotly._extract_scatter_points_from_lasso (cognitive 67) marimo/_plugins/ui/_impl/plotly.py:1183— plotly._extract_scatter_points_from_lasso has cognitive complexity 67 (threshold 15). Drivers by points: if/else 15 (42 pts), boolean chains 8, error handling 2 (8 pts), loops 3 (5 pts), ternaries 4 (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.
table.__init__ (cognitive 67) marimo/_plugins/ui/_impl/table.py:664— table.__init__ has cognitive complexity 67 (threshold 15). Drivers by points: if/else 28 (41 pts), boolean chains 12, loops 2 (6 pts), ternaries 4 (6 pts), error handling 1 (2 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
plotly._extract_scatter_points_fallback (cognitive 66) marimo/_plugins/ui/_impl/plotly.py:1021— plotly._extract_scatter_points_fallback has cognitive complexity 66 (threshold 15). Drivers by points: if/else 12 (33 pts), boolean chains 11, error handling 2 (9 pts), ternaries 6 (8 pts), loops 3 (5 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.
plotly._extract_box_points_fallback (cognitive 65) marimo/_plugins/ui/_impl/plotly.py:3094— plotly._extract_box_points_fallback has cognitive complexity 65 (threshold 15). Drivers by points: if/else 18 (49 pts), boolean chains 6, ternaries 1 (4 pts), error handling 1 (3 pts), loops 2 (3 pts) (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
altair_chart._filter_dataframe (cognitive 64) REDACTED:224— altair_chart._filter_dataframe has cognitive complexity 64 (threshold 15). Drivers by points: if/else 17 (41 pts), error handling 3 (9 pts), boolean chains 6, ternaries 1 (5 pts), loops 2 (3 pts) (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
plotly._extract_violin_points_numpy (cognitive 63) marimo/_plugins/ui/_impl/plotly.py:2580— plotly._extract_violin_points_numpy has cognitive complexity 63 (threshold 15). Drivers by points: if/else 16 (33 pts), ternaries 3 (12 pts), error handling 2 (8 pts), loops 3 (7 pts), boolean chains 3 (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.
chat-panel.ChatPanelBody (cognitive 63) frontend/src/components/chat/chat-panel.tsx:426— chat-panel.ChatPanelBody has cognitive complexity 63 (threshold 15). Drivers by points: if/else 28 (29 pts), ternaries 15 (18 pts), boolean chains 16 (nesting depth added 4). Most of this is not in the body itself: 10 of the 63 points are its own statements and the rest belongs to 23 function literals inside it that branch (lines 909, 530, 796, …). 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.
navigation.useCellNavigationProps (cognitive 63) frontend/src/components/editor/navigation/navigation.ts:192— navigation.useCellNavigationProps has cognitive complexity 63 (threshold 15). Drivers by points: if/else 34 (49 pts), boolean chains 6, ternaries 2 (5 pts), loops 3 (nesting depth added 18). None of this is in the body itself: all 63 points belong to 22 function items inside it that branch (a function literal at line 248, a function literal at line 281, a function literal at line 300, …). 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.
filter-pill-editor.buildFilterValue (cognitive 62) frontend/src/components/data-table/filter-pill-editor.tsx:590— filter-pill-editor.buildFilterValue has cognitive complexity 62 (threshold 15). Drivers by points: if/else 22 (44 pts), boolean chains 13, ternaries 2 (5 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.
FileBrowserPlugin.FileBrowser (cognitive 60) frontend/src/plugins/impl/FileBrowserPlugin.tsx:191— FileBrowserPlugin.FileBrowser has cognitive complexity 60 (threshold 15). Drivers by points: ternaries 15 (20 pts), boolean chains 19, if/else 15 (19 pts), loops 1, match/switch 1 (nesting depth added 9). Of this number, 16 points are the body's own statements and 44 belong to 12 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.
module_watcher.watch_modules (cognitive 59) marimo/_runtime/reload/module_watcher.py:167— module_watcher.watch_modules has cognitive complexity 59 (threshold 15). Drivers by points: if/else 8 (34 pts), loops 8 (23 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.
cell_matching._approximate_assignment (cognitive 59) marimo/_utils/cell_matching.py:89— cell_matching._approximate_assignment has cognitive complexity 59 (threshold 15). Drivers by points: if/else 9 (27 pts), loops 14 (27 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.
document._validate (cognitive 58) marimo/_messaging/notebook/document.py:342— document._validate has cognitive complexity 58 (threshold 15). Drivers by points: if/else 17 (48 pts), ternaries 2 (6 pts), boolean chains 3, loops 1 (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.
form.renderZodSchema (cognitive 58) frontend/src/components/forms/form.tsx:91— form.renderZodSchema has cognitive complexity 58 (threshold 15). Drivers by points: if/else 24 (32 pts), ternaries 9 (19 pts), boolean chains 6, loops 1 (nesting depth added 18). Of this number, 40 points are the body's own statements and 18 belong to 6 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DataTablePlugin.DataTableComponent (cognitive 58) frontend/src/plugins/impl/DataTablePlugin.tsx:862— DataTablePlugin.DataTableComponent has cognitive complexity 58 (threshold 15). Drivers by points: if/else 14 (25 pts), boolean chains 23, loops 2 (6 pts), ternaries 4 (nesting depth added 15). Most of this is not in the body itself: 13 of the 58 points are its own statements and the rest belongs to 11 function literals inside it that branch (lines 981, 1068, 944, …). 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.
MatrixPlugin.MatrixComponent (cognitive 58) frontend/src/plugins/impl/MatrixPlugin.tsx:97— MatrixPlugin.MatrixComponent has cognitive complexity 58 (threshold 15). Drivers by points: if/else 24 (27 pts), boolean chains 21, ternaries 8 (9 pts), match/switch 1 (nesting depth added 4). Most of this is not in the body itself: 6 of the 58 points are its own statements and the rest belongs to 13 function items inside it that branch (a function literal at line 433, a function literal at line 332, a function literal at line 220, …). 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.
runtime-story.RuntimeStory (cognitive 58) frontend/src/stories/runtime-story.tsx:225— runtime-story.RuntimeStory has cognitive complexity 58 (threshold 15). Drivers by points: ternaries 26 (48 pts), boolean chains 6, if/else 4 (nesting depth added 22). Most of this is not in the body itself: 10 of the 58 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 226, 291, 381, …). 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.
scanner.scan_notebook (cognitive 56) marimo/_ast/scanner.py:227— scanner.scan_notebook has cognitive complexity 56 (threshold 15). Drivers by points: if/else 16 (34 pts), loops 9 (18 pts), boolean chains 4 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
user-config-form.UserConfigForm (cognitive 56) frontend/src/components/app-config/user-config-form.tsx:103— user-config-form.UserConfigForm has cognitive complexity 56 (threshold 15). Drivers by points: boolean chains 33, if/else 10 (15 pts), ternaries 4 (7 pts), match/switch 1 (nesting depth added 8). Most of this is not in the body itself: 3 of the 56 points are its own statements and the rest belongs to 30 function items inside it that branch (setAiModels, renderBody, onSubmitNotDebounced, …). 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.
sql-parser.parseSQLStatement (cognitive 56) packages/smart-cells/src/parsers/sql-parser.ts:173— sql-parser.parseSQLStatement has cognitive complexity 56 (threshold 15). Drivers by points: if/else 19 (35 pts), loops 4 (11 pts), match/switch 1 (6 pts), boolean chains 3, error handling 1 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
glide-data-editor.GlideDataEditorInner (cognitive 55) frontend/src/plugins/impl/data-editor/glide-data-editor.tsx:101— glide-data-editor.GlideDataEditorInner has cognitive complexity 55 (threshold 15). Drivers by points: if/else 20 (23 pts), ternaries 9 (16 pts), boolean chains 14, loops 1, match/switch 1 (nesting depth added 10). Most of this is not in the body itself: 2 of the 55 points are its own statements and the rest belongs to 12 function items inside it that branch (a function literal at line 126, a function literal at line 156, a function literal at line 216, …). 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.
ScopedVisitor.generic_visit (cognitive 54) marimo/_ast/visitor.py:485— ScopedVisitor.generic_visit has cognitive complexity 54 (threshold 15). Drivers by points: loops 13 (30 pts), if/else 11 (21 pts), boolean chains 3 (nesting depth added 27). 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.
table._get_column_summaries (cognitive 54) marimo/_plugins/ui/_impl/table.py:1227— table._get_column_summaries has cognitive complexity 54 (threshold 15). Drivers by points: if/else 12 (29 pts), error handling 4 (14 pts), boolean chains 6, ternaries 1 (4 pts), loops 1 (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
hooks._extract_description (cognitive 53) docs/hooks.py:35— hooks._extract_description has cognitive complexity 53 (threshold 15). Drivers by points: if/else 21 (49 pts), boolean chains 3, loops 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.
DisplayMathPreprocessor._convert_rst_math_blocks (cognitive 52) marimo/_output/md_extensions/display_math.py:282— DisplayMathPreprocessor._convert_rst_math_blocks has cognitive complexity 52 (threshold 15). Drivers by points: if/else 15 (36 pts), loops 5 (12 pts), boolean chains 4 (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.
PythonTypeToOpenAPI.convert (cognitive 52) marimo/_utils/dataclass_to_openapi.py:40— PythonTypeToOpenAPI.convert has cognitive complexity 52 (threshold 15). Drivers by points: if/else 22 (39 pts), ternaries 2 (7 pts), boolean chains 4, loops 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.
geometry_export._describe_export_source (cognitive 50) marimo/_plugins/ui/_impl/tables/geometry_export.py:221— geometry_export._describe_export_source has cognitive complexity 50 (threshold 15). Drivers by points: if/else 14 (25 pts), ternaries 7 (15 pts), boolean chains 5, loops 3 (5 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.
plotly._extract_box_points_numpy (cognitive 49) marimo/_plugins/ui/_impl/plotly.py:2974— plotly._extract_box_points_numpy has cognitive complexity 49 (threshold 15). Drivers by points: if/else 15 (28 pts), ternaries 4 (15 pts), boolean chains 3, loops 2 (3 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.
_DataclassParser._build_value (cognitive 49) marimo/_utils/parse_dataclass.py:42— _DataclassParser._build_value has cognitive complexity 49 (threshold 15). Drivers by points: if/else 21 (26 pts), boolean chains 14, error handling 3 (7 pts), loops 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, 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.
AsyncCodeModeContext._print_summary (cognitive 48) marimo/_code_mode/_context.py:862— AsyncCodeModeContext._print_summary has cognitive complexity 48 (threshold 15). Drivers by points: if/else 16 (30 pts), ternaries 3 (10 pts), loops 4 (5 pts), boolean chains 3 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AdbcConnectionCatalog.get_databases (cognitive 48) marimo/_sql/engines/adbc.py:200— AdbcConnectionCatalog.get_databases has cognitive complexity 48 (threshold 15). Drivers by points: if/else 10 (30 pts), loops 3 (9 pts), ternaries 2 (6 pts), boolean chains 3 (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.
plotly._extract_scatter_points_numpy (cognitive 47) marimo/_plugins/ui/_impl/plotly.py:892— plotly._extract_scatter_points_numpy has cognitive complexity 47 (threshold 15). Drivers by points: if/else 10 (19 pts), ternaries 10 (18 pts), boolean chains 7, 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.
plotly._append_waterfall_bars_to_selection (cognitive 47) marimo/_plugins/ui/_impl/plotly.py:2069— plotly._append_waterfall_bars_to_selection has cognitive complexity 47 (threshold 15). Drivers by points: if/else 15 (38 pts), loops 3 (6 pts), boolean chains 3 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (plotly._append_funnel_points_to_selection) 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.
plotly._append_funnel_points_to_selection (cognitive 47) marimo/_plugins/ui/_impl/plotly.py:3386— plotly._append_funnel_points_to_selection has cognitive complexity 47 (threshold 15). Drivers by points: if/else 15 (38 pts), loops 3 (6 pts), boolean chains 3 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (plotly._append_waterfall_bars_to_selection) 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.
cache_dirs.delete_blob_dirs (cognitive 47) marimo/_save/cache_dirs.py:430— cache_dirs.delete_blob_dirs has cognitive complexity 47 (threshold 15). Drivers by points: if/else 13 (35 pts), error handling 2 (5 pts), boolean chains 4, 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.
chat-ui.Chatbot (cognitive 47) frontend/src/plugins/impl/chat/chat-ui.tsx:141— chat-ui.Chatbot has cognitive complexity 47 (threshold 15). Drivers by points: if/else 15 (19 pts), boolean chains 17, ternaries 9, error handling 2 (nesting depth added 4). Of this number, 20 points are the body's own statements and 27 belong to 12 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.
Runner._run_result_from_exception (cognitive 46) marimo/_runtime/runner/cell_runner.py:396— Runner._run_result_from_exception has cognitive complexity 46 (threshold 15). Drivers by points: if/else 14 (32 pts), boolean chains 6, error handling 1 (3 pts), ternaries 1 (3 pts), loops 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.
commands.collectMatchingDeclarations (cognitive 46) frontend/src/core/codemirror/go-to-definition/commands.ts:210— commands.collectMatchingDeclarations has cognitive complexity 46 (threshold 15). Drivers by points: if/else 13 (32 pts), loops 5 (10 pts), boolean chains 2, match/switch 1, ternaries 1 (nesting depth added 24). Of this number, 44 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
print_code.python_print_pandas (cognitive 45) marimo/_plugins/ui/_impl/dataframes/transforms/print_code.py:34— print_code.python_print_pandas has cognitive complexity 45 (threshold 15). Drivers by points: if/else 18 (33 pts), ternaries 3 (6 pts), loops 2 (5 pts), boolean chains 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.
normalize-markdown-math.convertRstMathBlocks (cognitive 45) frontend/src/core/codemirror/lsp/normalize-markdown-math.ts:275— normalize-markdown-math.convertRstMathBlocks has cognitive complexity 45 (threshold 15). Drivers by points: if/else 13 (32 pts), loops 4 (10 pts), boolean chains 3 (nesting depth added 25). Of this number, 43 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Executions.observe (cognitive 44) marimo/_core/executions.py:306— Executions.observe has cognitive complexity 44 (threshold 15). Drivers by points: if/else 13 (34 pts), boolean chains 6, loops 1 (3 pts), match/switch 1 (nesting depth added 23). 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.
ModuleReloader._check (cognitive 44) marimo/_runtime/reload/autoreload.py:349— ModuleReloader._check has cognitive complexity 44 (threshold 15). Drivers by points: if/else 17 (33 pts), boolean chains 7, error handling 1 (2 pts), 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.
reveal-component.RevealSlidesComponent (cognitive 44) frontend/src/components/slides/reveal-component.tsx:472— reveal-component.RevealSlidesComponent has cognitive complexity 44 (threshold 15). Drivers by points: if/else 21 (22 pts), boolean chains 15, ternaries 6 (7 pts) (nesting depth added 2). Of this number, 16 points are the body's own statements and 28 belong to 12 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
parse.parsePayloadBackedApps (cognitive 44) frontend/src/core/islands/parse.ts:161— parse.parsePayloadBackedApps has cognitive complexity 44 (threshold 15). Drivers by points: if/else 11 (27 pts), loops 6 (10 pts), boolean chains 4, ternaries 1 (3 pts) (nesting depth added 22). Of this number, 43 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_better_inspect._build_help (cognitive 43) marimo/_code_mode/_better_inspect.py:332— _better_inspect._build_help has cognitive complexity 43 (threshold 15). Drivers by points: if/else 12 (24 pts), ternaries 2 (8 pts), error handling 1 (4 pts), loops 3 (4 pts), boolean chains 3 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
config.parse_config (cognitive 43) marimo/_config/config.py:18— config.parse_config has cognitive complexity 43 (threshold 15). Drivers by points: if/else 9 (26 pts), loops 3 (8 pts), error handling 2 (7 pts), boolean chains 2 (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.
print_code.python_print_polars (cognitive 43) marimo/_plugins/ui/_impl/dataframes/transforms/print_code.py:304— print_code.python_print_polars has cognitive complexity 43 (threshold 15). Drivers by points: if/else 12 (22 pts), ternaries 5 (10 pts), loops 3 (7 pts), boolean chains 2, error handling 1 (2 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
file_browser.__init__ (cognitive 43) marimo/_plugins/ui/_impl/file_browser.py:305— file_browser.__init__ has cognitive complexity 43 (threshold 15). Drivers by points: if/else 20 (27 pts), ternaries 4 (6 pts), boolean chains 5, loops 3 (5 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
edges.resolve_cell_references (cognitive 43) marimo/_runtime/dataflow/edges.py:139— edges.resolve_cell_references has cognitive complexity 43 (threshold 15). Drivers by points: if/else 9 (30 pts), loops 3 (6 pts), ternaries 1 (5 pts), boolean chains 2 (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.
Kernel.set_ui_element_value (cognitive 43) marimo/_runtime/runtime.py:2392— Kernel.set_ui_element_value has cognitive complexity 43 (threshold 15). Drivers by points: if/else 6 (15 pts), error handling 6 (13 pts), loops 6 (13 pts), boolean chains 2 (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.
serialize.deserialize_session (cognitive 43) marimo/_session/state/serialize.py:253— serialize.deserialize_session has cognitive complexity 43 (threshold 15). Drivers by points: if/else 11 (25 pts), ternaries 3 (11 pts), loops 3 (5 pts), boolean chains 2 (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.
net._bind_sockets (cognitive 43) marimo/_utils/net.py:38— net._bind_sockets has cognitive complexity 43 (threshold 15). Drivers by points: if/else 15 (30 pts), error handling 3 (7 pts), boolean chains 5, 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.
sync-models.refreshMetadata (cognitive 43) packages/llm-info/src/sync-models.ts:250— sync-models.refreshMetadata has cognitive complexity 43 (threshold 15). Drivers by points: if/else 10 (31 pts), loops 3 (6 pts), boolean chains 3, ternaries 2 (3 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.
scanner._find_body_start (cognitive 42) marimo/_ast/scanner.py:424— scanner._find_body_start has cognitive complexity 42 (threshold 15). Drivers by points: if/else 10 (29 pts), loops 4 (9 pts), boolean chains 4 (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.
from_ir._notebook_to_markdown_export_document (cognitive 42) marimo/_convert/markdown/from_ir.py:42— from_ir._notebook_to_markdown_export_document has cognitive complexity 42 (threshold 15). Drivers by points: if/else 14 (32 pts), boolean chains 5, error handling 2 (4 pts), loops 1 (nesting depth added 20). 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.
_EditableTable._apply_column_edit (cognitive 42) marimo/_plugins/ui/_impl/data_editor.py:399— _EditableTable._apply_column_edit has cognitive complexity 42 (threshold 15). Drivers by points: if/else 16 (23 pts), ternaries 4 (10 pts), loops 3 (8 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.
_futures.wasm_as_completed (cognitive 42) marimo/_runtime/_wasm/_concurrency/_futures.py:312— _futures.wasm_as_completed has cognitive complexity 42 (threshold 15). Drivers by points: if/else 14 (28 pts), loops 5 (11 pts), boolean chains 2, ternaries 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BlockHasher.serialize_and_dequeue_content_refs (cognitive 42) marimo/_save/hash.py:731— BlockHasher.serialize_and_dequeue_content_refs has cognitive complexity 42 (threshold 15). Drivers by points: if/else 10 (24 pts), boolean chains 8, ternaries 3 (7 pts), loops 2 (3 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RunTranslator.feed (cognitive 42) marimo/_server/host/translate.py:93— RunTranslator.feed has cognitive complexity 42 (threshold 15). Drivers by points: if/else 17 (28 pts), boolean chains 8, ternaries 2 (6 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.
_convert.convert_to_anthropic_messages (cognitive 41) marimo/_ai/_convert.py:195— _convert.convert_to_anthropic_messages has cognitive complexity 41 (threshold 15). Drivers by points: if/else 11 (33 pts), boolean chains 3, loops 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
matrix._validate_and_build_args (cognitive 41) marimo/_plugins/ui/_impl/matrix.py:206— matrix._validate_and_build_args has cognitive complexity 41 (threshold 15). Drivers by points: if/else 12 (27 pts), loops 4 (8 pts), boolean chains 6 (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.
ScratchCellListener.on_notification_sent (cognitive 40) marimo/_server/scratchpad.py:114— ScratchCellListener.on_notification_sent has cognitive complexity 40 (threshold 15). Drivers by points: if/else 16 (30 pts), boolean chains 5, loops 1 (3 pts), 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.
connection-notice.connectionNoticeAtom (cognitive 40) frontend/src/core/network/connection-notice.ts:22— connection-notice.connectionNoticeAtom has cognitive complexity 40 (threshold 15). Drivers by points: ternaries 15 (34 pts), boolean chains 3, if/else 3 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
glide-utils.pasteCells (cognitive 40) frontend/src/plugins/impl/data-editor/glide-utils.ts:120— glide-utils.pasteCells has cognitive complexity 40 (threshold 15). Drivers by points: if/else 10 (26 pts), error handling 1 (4 pts), boolean chains 3, loops 2 (3 pts), match/switch 1 (3 pts), ternaries 1 (nesting depth added 22). Most of this is not in the body itself: 1 of the 40 points is its own statement and the rest belongs to one function literal inside it that branches (line 137). 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.
generate-protocol.operationsModule (cognitive 40) packages/client/scripts/generate-protocol.ts:67— generate-protocol.operationsModule has cognitive complexity 40 (threshold 15). Drivers by points: if/else 12 (27 pts), loops 4 (9 pts), ternaries 1 (3 pts), boolean chains 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.
commands.html_wasm (cognitive 39) marimo/_cli/export/commands.py:1043— commands.html_wasm has cognitive complexity 39 (threshold 15). Drivers by points: if/else 18 (23 pts), boolean chains 7, ternaries 3 (7 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.
AsyncCodeModeContext._apply_ops (cognitive 39) marimo/_code_mode/_context.py:1727— AsyncCodeModeContext._apply_ops has cognitive complexity 39 (threshold 15). Drivers by points: if/else 16 (26 pts), boolean chains 7, loops 6 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
image._normalize_image (cognitive 39) marimo/_plugins/stateless/image.py:24— image._normalize_image has cognitive complexity 39 (threshold 15). Drivers by points: if/else 13 (29 pts), ternaries 2 (6 pts), boolean chains 4 (nesting depth added 20). 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.
plotly._append_map_scatter_points_to_selection (cognitive 39) marimo/_plugins/ui/_impl/plotly.py:2309— plotly._append_map_scatter_points_to_selection has cognitive complexity 39 (threshold 15). Drivers by points: if/else 11 (23 pts), ternaries 2 (8 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
utils._split_around_extras (cognitive 39) marimo/_runtime/packages/utils.py:200— utils._split_around_extras has cognitive complexity 39 (threshold 15). Drivers by points: if/else 9 (21 pts), boolean chains 11, loops 2 (4 pts), ternaries 1 (3 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Kernel._delete_variables (cognitive 39) marimo/_runtime/runtime.py:1104— Kernel._delete_variables has cognitive complexity 39 (threshold 15). Drivers by points: if/else 8 (20 pts), error handling 3 (11 pts), boolean chains 5, ternaries 1 (2 pts), loops 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BlockHasher.extract_ref_state_and_normalize_scope (cognitive 39) marimo/_save/hash.py:635— BlockHasher.extract_ref_state_and_normalize_scope has cognitive complexity 39 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 4 (10 pts), boolean chains 7 (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.
docs.google_docstring_to_markdown (cognitive 39) marimo/_utils/docs.py:31— docs.google_docstring_to_markdown has cognitive complexity 39 (threshold 15). Drivers by points: if/else 18 (29 pts), loops 5 (9 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.
notebook-cell.EditableCellComponent (cognitive 39) frontend/src/components/editor/notebook-cell.tsx:399— notebook-cell.EditableCellComponent has cognitive complexity 39 (threshold 15). Drivers by points: boolean chains 32, if/else 5, ternaries 2. Of this number, 30 points are the body's own statements and 9 belong to 7 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
Runner._dispatch_runnable (cognitive 38) marimo/_runtime/runner/cell_runner.py:947— Runner._dispatch_runnable has cognitive complexity 38 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 6 (12 pts), error handling 1 (3 pts), boolean chains 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.
sql.sql (cognitive 38) marimo/_sql/sql.py:140— sql.sql has cognitive complexity 38 (threshold 15). Drivers by points: if/else 15 (24 pts), ternaries 2 (6 pts), boolean chains 4, error handling 2, loops 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.
keyboard-shortcuts.KeyboardShortcuts (cognitive 38) frontend/src/components/editor/controls/keyboard-shortcuts.tsx:33— keyboard-shortcuts.KeyboardShortcuts has cognitive complexity 38 (threshold 15). Drivers by points: if/else 14 (23 pts), ternaries 6 (10 pts), boolean chains 5 (nesting depth added 13). Most of this is not in the body itself: 1 of the 38 points is its own statement and the rest belongs to 6 function items inside it that branch (a function literal at line 136, renderItem, renderCommandGroup, …). 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.
LazyLoader.restore_cache (cognitive 37) REDACTED:1160— LazyLoader.restore_cache has cognitive complexity 37 (threshold 15). Drivers by points: if/else 16 (27 pts), boolean chains 7, loops 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.
IPCKernelManagerImpl.start_kernel (cognitive 37) REDACTED:301— IPCKernelManagerImpl.start_kernel has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (18 pts), error handling 8 (13 pts), boolean chains 3, ternaries 3 (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.
IPCKernelManagerImpl.close_kernel (cognitive 37) REDACTED:699— IPCKernelManagerImpl.close_kernel has cognitive complexity 37 (threshold 15). Drivers by points: if/else 8 (17 pts), error handling 5 (16 pts), boolean chains 4 (nesting depth added 20). 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.
cell_matching._hungarian_algorithm (cognitive 37) marimo/_utils/cell_matching.py:168— cell_matching._hungarian_algorithm has cognitive complexity 37 (threshold 15). Drivers by points: if/else 8 (25 pts), loops 6 (12 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.
columns.renderCellValue (cognitive 37) frontend/src/components/data-table/columns.tsx:612— columns.renderCellValue has cognitive complexity 37 (threshold 15). Drivers by points: if/else 14 (18 pts), ternaries 5 (10 pts), boolean chains 7, 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.
IslandsPyodideBridge.startApps (cognitive 37) frontend/src/core/islands/bridge.ts:195— IslandsPyodideBridge.startApps has cognitive complexity 37 (threshold 15). Drivers by points: if/else 9 (21 pts), boolean chains 8, ternaries 4 (5 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.
compiler.compile_cell (cognitive 36) marimo/_ast/compiler.py:226— compiler.compile_cell has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (19 pts), loops 3 (9 pts), boolean chains 6, 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.
plotly._extract_heatmap_cells_fallback (cognitive 36) marimo/_plugins/ui/_impl/plotly.py:1288— plotly._extract_heatmap_cells_fallback has cognitive complexity 36 (threshold 15). Drivers by points: if/else 8 (23 pts), boolean chains 7, loops 3 (6 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.
geometry_export.serialize_geojson (cognitive 36) marimo/_plugins/ui/_impl/tables/geometry_export.py:677— geometry_export.serialize_geojson has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (15 pts), ternaries 6 (11 pts), boolean chains 7, error handling 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
editor-state.applyEditorEdits (cognitive 36) frontend/src/plugins/impl/data-editor/editor-state.ts:19— editor-state.applyEditorEdits has cognitive complexity 36 (threshold 15). Drivers by points: if/else 10 (27 pts), loops 2 (4 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DataTablePlugin.LoadingDataTableComponent (cognitive 36) frontend/src/plugins/impl/DataTablePlugin.tsx:516— DataTablePlugin.LoadingDataTableComponent has cognitive complexity 36 (threshold 15). Drivers by points: boolean chains 13, if/else 13, ternaries 7 (10 pts) (nesting depth added 3). Most of this is not in the body itself: 15 of the 36 points are its own statements and the rest belongs to 10 function literals inside it that branch (lines 587, 532, 680, …). 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.
MatplotlibRenderer.#handlePointerMove (cognitive 36) frontend/src/plugins/impl/matplotlib/matplotlib-renderer.ts:723— MatplotlibRenderer.#handlePointerMove has cognitive complexity 36 (threshold 15). Drivers by points: if/else 14 (26 pts), boolean chains 6, 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.
sql_visitor.find_sql_refs (cognitive 35) marimo/_ast/sql_visitor.py:493— sql_visitor.find_sql_refs has cognitive complexity 35 (threshold 15). Drivers by points: if/else 6 (23 pts), loops 3 (8 pts), error handling 2 (3 pts), boolean chains 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
commands.execute (cognitive 35) marimo/_cli/pair/commands.py:215— commands.execute has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 7, ternaries 6 (7 pts), error handling 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.
sandbox.run_in_sandbox (cognitive 35) marimo/_cli/sandbox.py:424— sandbox.run_in_sandbox has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 11, error handling 3 (5 pts), ternaries 3 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
plotly._append_scatter_points_to_selection (cognitive 35) marimo/_plugins/ui/_impl/plotly.py:725— plotly._append_scatter_points_to_selection has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (26 pts), boolean chains 5, loops 2 (4 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
plotly._extract_bars_numpy (cognitive 35) marimo/_plugins/ui/_impl/plotly.py:1737— plotly._extract_bars_numpy has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (19 pts), ternaries 4 (12 pts), loops 2 (3 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.
cache_dirs.orphan_blob_dirs (cognitive 35) marimo/_save/cache_dirs.py:367— cache_dirs.orphan_blob_dirs has cognitive complexity 35 (threshold 15). Drivers by points: if/else 9 (18 pts), ternaries 3 (6 pts), error handling 2 (5 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
serialize.serialize_session_view (cognitive 35) marimo/_session/state/serialize.py:136— serialize.serialize_session_view has cognitive complexity 35 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 4 (10 pts), ternaries 1 (4 pts), boolean chains 2 (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.
uv_tree._parse_tree (cognitive 35) marimo/_utils/uv_tree.py:63— uv_tree._parse_tree has cognitive complexity 35 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 4 (8 pts), boolean chains 5, ternaries 1 (3 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
filter-by-values-picker.FilterByValuesList (cognitive 35) frontend/src/components/data-table/filter-by-values-picker.tsx:99— filter-by-values-picker.FilterByValuesList has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 8, ternaries 6 (7 pts), loops 3 (5 pts), error handling 1 (nesting depth added 5). Most of this is not in the body itself: 12 of the 35 points are its own statements and the rest belongs to 8 function items inside it that branch (handleToggleAll, a function literal at line 160, a function literal at line 114, …). 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.
merge.mergeModels (cognitive 35) packages/llm-info/src/sources/merge.ts:277— merge.mergeModels has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (25 pts), loops 5 (7 pts), boolean chains 2, 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.
python-ast.getStringContent (cognitive 35) packages/smart-cells/src/utils/python-ast.ts:113— python-ast.getStringContent has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (24 pts), boolean chains 11 (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.
plotly._extract_heatmap_cells_numpy (cognitive 34) marimo/_plugins/ui/_impl/plotly.py:638— plotly._extract_heatmap_cells_numpy has cognitive complexity 34 (threshold 15). Drivers by points: if/else 7 (14 pts), ternaries 5 (12 pts), loops 3 (6 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.
plotly._extract_funnel_stages_numpy (cognitive 34) marimo/_plugins/ui/_impl/plotly.py:3493— plotly._extract_funnel_stages_numpy has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 3 (6 pts), boolean chains 5, error handling 1 (2 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.
dependency_tree.parse_uv_tree (cognitive 34) marimo/_server/api/dependency_tree.py:14— dependency_tree.parse_uv_tree has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 4 (8 pts), boolean chains 4, ternaries 1 (3 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ai.list_provider_models (cognitive 34) marimo/_server/api/endpoints/ai.py:131— ai.list_provider_models has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (11 pts), ternaries 6 (11 pts), boolean chains 6, error handling 5, 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.
make-selectable.makeSelectable (cognitive 34) frontend/src/plugins/impl/vega/make-selectable.ts:282— make-selectable.makeSelectable has cognitive complexity 34 (threshold 15). Drivers by points: if/else 15 (23 pts), boolean chains 7, ternaries 2 (4 pts) (nesting depth added 10). Of this number, 19 points are the body's own statements and 15 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.
Kernel.mutate_graph (cognitive 33) marimo/_runtime/runtime.py:1279— Kernel.mutate_graph has cognitive complexity 33 (threshold 15). Drivers by points: if/else 14 (21 pts), loops 7 (8 pts), boolean chains 3, 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.
cell_matching._match_cell_ids_by_similarity (cognitive 33) marimo/_utils/cell_matching.py:237— cell_matching._match_cell_ids_by_similarity has cognitive complexity 33 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 6 (12 pts), boolean chains 2, 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.
NotebookLanguageServerClient.patchProcessNotification::processNotification (cognitive 33) frontend/src/core/codemirror/lsp/notebook-lsp.ts:950— NotebookLanguageServerClient.patchProcessNotification::processNotification has cognitive complexity 33 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 4 (10 pts), ternaries 1 (5 pts), boolean chains 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.
file-viewer.FileViewer (cognitive 33) frontend/src/components/editor/file-tree/file-viewer.tsx:42— file-viewer.FileViewer has cognitive complexity 33 (threshold 15). Drivers by points: boolean chains 12, ternaries 8 (11 pts), if/else 10 (nesting depth added 3). Of this number, 23 points are the body's own statements and 10 belong to 5 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
PanelPlugin.PanelSlot (cognitive 33) frontend/src/plugins/impl/panel/PanelPlugin.tsx:140— PanelPlugin.PanelSlot has cognitive complexity 33 (threshold 15). Drivers by points: if/else 19 (23 pts), boolean chains 9, loops 1 (nesting depth added 4). None of this is in the body itself: all 33 points belong to 8 function literals inside it that branch (lines 218, 281, 152, …). 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.
EnvVarReader.read (cognitive 32) marimo/_config/manager.py:460— EnvVarReader.read has cognitive complexity 32 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 6, error handling 2 (5 pts), loops 3 (5 pts), ternaries 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cache_dirs._delete_block_entries (cognitive 32) marimo/_save/cache_dirs.py:713— cache_dirs._delete_block_entries has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 5, ternaries 2 (5 pts), loops 3 (4 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
start.start (cognitive 32) REDACTED:188— start.start has cognitive complexity 32 (threshold 15). Drivers by points: if/else 15 (16 pts), boolean chains 8, ternaries 5 (6 pts), error handling 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.
MarimoErrorOutput.MarimoErrorOutput::renderMessages (cognitive 32) frontend/src/components/editor/output/MarimoErrorOutput.tsx:232— MarimoErrorOutput.MarimoErrorOutput::renderMessages has cognitive complexity 32 (threshold 15). Drivers by points: boolean chains 17, if/else 13, ternaries 1 (2 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.
combobox.Combobox (cognitive 32) frontend/src/components/ui/combobox.tsx:79— combobox.Combobox has cognitive complexity 32 (threshold 15). Drivers by points: if/else 15 (24 pts), boolean chains 7, ternaries 1 (nesting depth added 9). Most of this is not in the body itself: 5 of the 32 points are its own statements and the rest belongs to 6 function items inside it that branch (renderValueLabel, a function literal at line 129, a function literal at line 192, …). 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.
GetCellDependencyGraph.handle (cognitive 31) marimo/_ai/_tools/tools/dependency_graph.py:97— GetCellDependencyGraph.handle has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 5 (7 pts), ternaries 1 (3 pts), error handling 2, boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SQLRef.matches_hierarchical_ref (cognitive 31) marimo/_ast/sql_visitor.py:389— SQLRef.matches_hierarchical_ref has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (25 pts), boolean chains 6 (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.
parse_args.parse_args (cognitive 31) marimo/_cli/parse_args.py:13— parse_args.parse_args has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (20 pts), error handling 2 (7 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.
reconcile.reconcile_transaction (cognitive 31) marimo/_messaging/notebook/reconcile.py:28— reconcile.reconcile_transaction has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (27 pts), boolean chains 3, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
plotly._extract_waterfall_bars_fallback (cognitive 31) marimo/_plugins/ui/_impl/plotly.py:2244— plotly._extract_waterfall_bars_fallback has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (19 pts), boolean chains 5, ternaries 2 (4 pts), 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.
Kernel._maybe_register_cell (cognitive 31) marimo/_runtime/runtime.py:1009— Kernel._maybe_register_cell has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (21 pts), ternaries 2 (6 pts), boolean chains 4 (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
DynamicDirectoryMiddleware.__call__ (cognitive 31) marimo/_server/asgi.py:194— DynamicDirectoryMiddleware.__call__ has cognitive complexity 31 (threshold 15). Drivers by points: if/else 16 (20 pts), error handling 4 (7 pts), boolean chains 3, ternaries 1 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
row-viewer.RowViewerPanel (cognitive 31) frontend/src/components/data-table/row-viewer-panel/row-viewer.tsx:60— row-viewer.RowViewerPanel has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (16 pts), boolean chains 9, ternaries 3 (4 pts), loops 1, match/switch 1 (nesting depth added 3). Most of this is not in the body itself: 6 of the 31 points are its own statements and the rest belongs to 6 function items inside it that branch (renderTable, setRow, handleKeyDown, …). 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.
ai-completion-editor.AiCompletionEditor (cognitive 31) frontend/src/components/editor/ai/ai-completion-editor.tsx:85— ai-completion-editor.AiCompletionEditor has cognitive complexity 31 (threshold 15). Drivers by points: boolean chains 18, if/else 9 (10 pts), ternaries 3 (nesting depth added 1). Of this number, 16 points are the body's own statements and 15 belong to 9 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
replica.createNotebookReplica (cognitive 31) frontend/src/core/notebook/replica/replica.ts:151— replica.createNotebookReplica has cognitive complexity 31 (threshold 15). Drivers by points: if/else 18 (21 pts), ternaries 5, boolean chains 3, error handling 2 (nesting depth added 3). None of this is in the body itself: all 31 points belong to 12 function items inside it that branch (connect::reconnect, a function literal at line 292, connect::apply, …). 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.
logs.getCellLogsForMessage (cognitive 31) frontend/src/core/cells/logs.ts:35— logs.getCellLogsForMessage has cognitive complexity 31 (threshold 15). Drivers by points: boolean chains 10, if/else 5 (9 pts), ternaries 2 (8 pts), match/switch 1 (3 pts), loops 1 (nesting depth added 12). Of this number, 28 points are the body's own statements and 3 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
file-explorer.FileExplorer::handleTreeKeyDown (cognitive 31) frontend/src/components/editor/file-tree/file-explorer.tsx:247— file-explorer.FileExplorer::handleTreeKeyDown has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (19 pts), boolean chains 11, 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.
SliderPlugin.SliderComponent (cognitive 31) frontend/src/plugins/impl/SliderPlugin.tsx:141— SliderPlugin.SliderComponent has cognitive complexity 31 (threshold 15). Drivers by points: boolean chains 16, ternaries 7 (8 pts), if/else 5 (7 pts) (nesting depth added 3). Of this number, 20 points are the body's own statements and 11 belong to 3 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
plotly._build_global_category_order (cognitive 30) marimo/_plugins/ui/_impl/plotly.py:2918— plotly._build_global_category_order has cognitive complexity 30 (threshold 15). Drivers by points: if/else 6 (12 pts), error handling 2 (6 pts), ternaries 3 (6 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.
PackagesCallbacks.install_missing_packages (cognitive 30) marimo/_runtime/callbacks/packages.py:244— PackagesCallbacks.install_missing_packages has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (15 pts), ternaries 2 (6 pts), loops 5, 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.
prune.plan_prune (cognitive 30) marimo/_save/prune.py:81— prune.plan_prune has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 4, error handling 2 (3 pts), ternaries 2 (3 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.
notebook-context.withNotebookContext (cognitive 30) frontend/src/components/chat/notebook-context.ts:25— notebook-context.withNotebookContext has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 4 (10 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.
cli.edit (cognitive 29) marimo/_cli/cli.py:462— cli.edit has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (19 pts), error handling 2 (7 pts), boolean chains 3 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MarkdownDedentRule.check (cognitive 29) marimo/_lint/rules/formatting/markdown_dedent.py:70— MarkdownDedentRule.check has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (21 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
nav_menu._build_and_validate_menu (cognitive 29) marimo/_plugins/stateless/nav_menu.py:97— nav_menu._build_and_validate_menu has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (18 pts), ternaries 1 (5 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.
plotly._extract_bars_fallback (cognitive 29) marimo/_plugins/ui/_impl/plotly.py:1849— plotly._extract_bars_fallback has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (23 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_cache_context.trace (cognitive 29) marimo/_save/save.py:727— _cache_context.trace has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (25 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.
errors.handle_error (cognitive 29) marimo/_server/errors.py:44— errors.handle_error has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (20 pts), ternaries 2 (6 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CompositeLspServer.restart (cognitive 29) marimo/_server/lsp.py:966— CompositeLspServer.restart has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (24 pts), loops 2 (3 pts), error handling 1 (2 pts) (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.
data-table.DataTableInternal (cognitive 29) frontend/src/components/data-table/data-table.tsx:137— data-table.DataTableInternal has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 11 (12 pts), boolean chains 10, if/else 6 (7 pts) (nesting depth added 2). Of this number, 21 points are the body's own statements and 8 belong to 5 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
commands.insertImage (cognitive 29) frontend/src/core/codemirror/markdown/commands.ts:304— commands.insertImage has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (20 pts), ternaries 2 (6 pts), error handling 2, boolean chains 1 (nesting depth added 14). Of this number, 28 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
compose-slides.buildSlideIndices (cognitive 29) frontend/src/components/slides/compose-slides.ts:151— compose-slides.buildSlideIndices has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (20 pts), loops 5 (9 pts) (nesting depth added 14). Most of this is not in the body itself: 1 of the 29 points is its own statement and the rest belongs to one function literal inside it that branches (line 168). 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.
registerReactComponent.registerReactComponent (cognitive 29) frontend/src/plugins/core/registerReactComponent.tsx:331— registerReactComponent.registerReactComponent has cognitive complexity 29 (threshold 15). Drivers by points: if/else 15 (21 pts), error handling 2 (4 pts), boolean chains 2, loops 2 (nesting depth added 8). Of this number, 22 points are the body's own statements and 7 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_nbformat_png_fallbacks.inject_png_fallbacks_into_notebook (cognitive 28) marimo/_export/_nbformat_png_fallbacks.py:27— _nbformat_png_fallbacks.inject_png_fallbacks_into_notebook has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (23 pts), loops 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.
console_output_worker.buffered_writer (cognitive 28) marimo/_messaging/console_output_worker.py:127— console_output_worker.buffered_writer has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (19 pts), loops 3 (6 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.
inspect.__init__ (cognitive 28) marimo/_plugins/stateless/inspect.py:38— inspect.__init__ has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (13 pts), ternaries 4 (10 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
print_code.python_print_ibis (cognitive 28) marimo/_plugins/ui/_impl/dataframes/transforms/print_code.py:577— print_code.python_print_ibis has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 3 (7 pts), ternaries 3 (6 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
file_browser._list_directory (cognitive 28) marimo/_plugins/ui/_impl/file_browser.py:542— file_browser._list_directory has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (22 pts), boolean chains 4, 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.
SerializedWasmExecutor.shutdown (cognitive 28) marimo/_runtime/_wasm/_concurrency/_futures.py:605— SerializedWasmExecutor.shutdown has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (13 pts), error handling 2 (8 pts), loops 2 (4 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.
filter-pill-editor.ValueSlot (cognitive 28) frontend/src/components/data-table/filter-pill-editor.tsx:378— filter-pill-editor.ValueSlot has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 6 (12 pts), boolean chains 8, if/else 7 (8 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.
find-replace.FindReplace (cognitive 28) frontend/src/components/find-replace/find-replace.tsx:41— find-replace.FindReplace has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (16 pts), boolean chains 7, ternaries 5 (nesting depth added 2). Most of this is not in the body itself: 8 of the 28 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 143, a function literal at line 51, a function literal at line 66, …). 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.
reorderable-list.ReorderableList (cognitive 28) frontend/src/components/ui/reorderable-list.tsx:139— reorderable-list.ReorderableList has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (15 pts), ternaries 7, boolean chains 5, loops 1 (nesting depth added 4). Most of this is not in the body itself: 6 of the 28 points are its own statements and the rest belongs to 6 function items inside it that branch (handleCrossListDrop, a function literal at line 200, handleToggleItem, …). 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.
paste.extractMarimoApp (cognitive 28) frontend/src/core/codemirror/misc/paste.ts:65— paste.extractMarimoApp has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (21 pts), boolean chains 4, ternaries 2, loops 1 (nesting depth added 7). Most of this is not in the body itself: 2 of the 28 points are its own statements and the rest belongs to 3 function items inside it that branch (a function literal at line 113, bodyText, pushCell). 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.
GetDatabaseTables._get_tables (cognitive 27) marimo/_ai/_tools/tools/datasource.py:77— GetDatabaseTables._get_tables has cognitive complexity 27 (threshold 15). Drivers by points: loops 5 (15 pts), if/else 4 (11 pts), boolean chains 1 (nesting depth added 17). 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.
codegen.to_functiondef (cognitive 27) marimo/_ast/codegen.py:340— codegen.to_functiondef has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (20 pts), ternaries 3 (4 pts), boolean chains 2, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Extractor.to_cell_def (cognitive 27) marimo/_ast/parse.py:251— Extractor.to_cell_def has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (23 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
schema._enrich_branded_types (cognitive 27) marimo/_cli/development/schema.py:42— schema._enrich_branded_types has cognitive complexity 27 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 6 (8 pts), error handling 2 (4 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DisplayMathPreprocessor._split_by_inline_code (cognitive 27) marimo/_output/md_extensions/display_math.py:227— DisplayMathPreprocessor._split_by_inline_code has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (20 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
range_slider.__init__ (cognitive 27) marimo/_plugins/ui/_impl/input.py:449— range_slider.__init__ has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 7, ternaries 3 (6 pts), error handling 2 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PackagesCallbacks.missing_packages_hook (cognitive 27) marimo/_runtime/callbacks/packages.py:148— PackagesCallbacks.missing_packages_hook has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (25 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.
health.usage (cognitive 27) marimo/_server/api/endpoints/health.py:212— health.usage has cognitive complexity 27 (threshold 15). Drivers by points: error handling 4 (10 pts), if/else 7 (10 pts), loops 2 (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.
bindings.existing_sql_bindings (cognitive 27) marimo/_sql/bindings.py:53— bindings.existing_sql_bindings has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 5, ternaries 2 (4 pts), error handling 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DBAPIEngine.get_cursor_metadata (cognitive 27) marimo/_sql/engines/dbapi.py:170— DBAPIEngine.get_cursor_metadata has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 6 (18 pts), if/else 6, loops 1 (2 pts), error handling 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
feedback-button.FeedbackModal (cognitive 27) frontend/src/components/editor/chrome/components/feedback-button.tsx:109— feedback-button.FeedbackModal has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 13, if/else 5 (7 pts), ternaries 5 (7 pts) (nesting depth added 4). Of this number, 21 points are the body's own statements and 6 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
format.formatValue (cognitive 27) frontend/src/components/data-table/filters/format.ts:19— format.formatValue has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 4 (11 pts), match/switch 4 (8 pts), if/else 7, 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.
useCellActionButton.useCellActionButtons (cognitive 27) frontend/src/components/editor/actions/useCellActionButton.tsx:91— useCellActionButton.useCellActionButtons has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 7, ternaries 7 (nesting depth added 3). Most of this is not in the body itself: 13 of the 27 points are its own statements and the rest belongs to 7 function items inside it that branch (toggleHideCode, a function literal at line 224, a function literal at line 172, …). 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.
cell-context-menu.CellActionsContextMenu (cognitive 27) frontend/src/components/editor/cell/cell-context-menu.tsx:51— cell-context-menu.CellActionsContextMenu has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (15 pts), boolean chains 6, ternaries 3 (5 pts), error handling 1 (nesting depth added 3). None of this is in the body itself: all 27 points belong to 12 function literals inside it that branch (lines 239, 113, 83, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
use-file-search.useFileSearch (cognitive 27) frontend/src/components/editor/file-tree/use-file-search.ts:26— use-file-search.useFileSearch has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 7, loops 2 (3 pts), error handling 1 (2 pts) (nesting depth added 8). Most of this is not in the body itself: 3 of the 27 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 59, 50, 109, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
grid-layout.GridLayoutRenderer (cognitive 27) frontend/src/components/editor/renderers/grid-layout/grid-layout.tsx:56— grid-layout.GridLayoutRenderer has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (15 pts), boolean chains 7, ternaries 4 (5 pts) (nesting depth added 2). Of this number, 15 points are the body's own statements and 12 belong to 7 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
storage-inspector.StorageInspector (cognitive 27) frontend/src/components/storage/storage-inspector.tsx:835— storage-inspector.StorageInspector has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 5, ternaries 2 (4 pts), loops 2, error handling 1 (nesting depth added 5). Most of this is not in the body itself: 4 of the 27 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 920, 868, 1051, …). 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.
traceback.getTracebackInfo (cognitive 27) frontend/src/utils/traceback.ts:64— traceback.getTracebackInfo has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (21 pts), boolean chains 6 (nesting depth added 14). 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.
target.resolve_target (cognitive 26) marimo/_cli/pair/target.py:29— target.resolve_target has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 5 (8 pts), boolean chains 7 (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.
CommentPreserver._apply_comments_to_source (cognitive 26) marimo/_convert/common/comment_preserver.py:118— CommentPreserver._apply_comments_to_source has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 3 (4 pts), boolean chains 2, ternaries 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.
from_ir._convert_output_to_ipynb (cognitive 26) marimo/_convert/ipynb/from_ir.py:317— from_ir._convert_output_to_ipynb has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 8, 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.
to_ir._strip_paragraph_tags (cognitive 26) marimo/_convert/ipynb/to_ir.py:55— to_ir._strip_paragraph_tags has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 7, 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.
local_wheels._metadata_wheel_dependencies_from_project (cognitive 26) marimo/_export/local_wheels.py:296— local_wheels._metadata_wheel_dependencies_from_project has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DisplayMathPreprocessor._pad_math_segments (cognitive 26) marimo/_output/md_extensions/display_math.py:184— DisplayMathPreprocessor._pad_math_segments has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 3 (7 pts), boolean chains 3, ternaries 1 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MCPClient._monitor_server_health (cognitive 26) marimo/_server/ai/mcp/client.py:662— MCPClient._monitor_server_health has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (19 pts), error handling 2 (4 pts), boolean chains 2, 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.
prompts.get_refactor_or_insert_notebook_cell_system_prompt (cognitive 26) marimo/_server/ai/prompts.py:106— prompts.get_refactor_or_insert_notebook_cell_system_prompt has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15 (22 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
translate._describe (cognitive 26) marimo/_server/host/translate.py:550— translate._describe has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15 (19 pts), ternaries 3 (7 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.
SessionManager.create_session (cognitive 26) marimo/_server/session_manager.py:218— SessionManager.create_session has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 5, ternaries 1 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
files.async_expand_file_patterns (cognitive 26) marimo/_utils/files.py:75— files.async_expand_file_patterns has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 3 (7 pts), boolean chains 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TreeElementsBuilder.createElements (cognitive 26) frontend/src/components/dependency-graph/elements.ts:317— TreeElementsBuilder.createElements has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 4 (7 pts), boolean chains 3, 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.
CellStatus.CellStatusComponent (cognitive 26) frontend/src/components/editor/cell/CellStatus.tsx:36— CellStatus.CellStatusComponent has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (15 pts), boolean chains 6, ternaries 3 (5 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
cell-editor.CellEditorInternal (cognitive 26) frontend/src/components/editor/cell/code/cell-editor.tsx:100— cell-editor.CellEditorInternal has cognitive complexity 26 (threshold 15). Drivers by points: if/else 18 (19 pts), boolean chains 5, loops 1, ternaries 1 (nesting depth added 1). Most of this is not in the body itself: 6 of the 26 points are its own statements and the rest belongs to 11 function literals inside it that branch (lines 139, 277, 437, …). 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.
draft.toChanges (cognitive 26) frontend/src/core/notebook/document/draft.ts:444— draft.toChanges has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 3, ternaries 1 (3 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EditNotebookTool.handler (cognitive 26) frontend/src/core/ai/tools/edit-notebook-tool.ts:86— EditNotebookTool.handler has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (23 pts), match/switch 2 (3 pts) (nesting depth added 14). 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.
hooks.useEnrichCellOutputs.<returned closure> (cognitive 26) frontend/src/core/export/hooks.ts:127— hooks.useEnrichCellOutputs.<returned closure> has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 3, loops 3, 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.
dedent._get_protected_lines (cognitive 25) marimo/_ast/dedent.py:38— dedent._get_protected_lines has cognitive complexity 25 (threshold 15). Drivers by points: if/else 4 (14 pts), loops 3 (8 pts), boolean chains 3 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Document.apply (cognitive 25) marimo/_core/document.py:274— Document.apply has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (19 pts), boolean chains 4, loops 1, 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.
get_datasets._get_databases_from_duckdb_internal (cognitive 25) marimo/_data/get_datasets.py:158— get_datasets._get_databases_from_duckdb_internal has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (20 pts), ternaries 1 (2 pts), boolean chains 1, 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.
DisplayMathPreprocessor._normalize_display_math_spacing (cognitive 25) marimo/_output/md_extensions/display_math.py:106— DisplayMathPreprocessor._normalize_display_math_spacing has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (20 pts), boolean chains 4, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_EditableTable._apply_positional_edit (cognitive 25) marimo/_plugins/ui/_impl/data_editor.py:329— _EditableTable._apply_positional_edit has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (16 pts), loops 2 (6 pts), boolean chains 2, ternaries 1 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
slider.__init__ (cognitive 25) marimo/_plugins/ui/_impl/input.py:231— slider.__init__ has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 3 (6 pts), boolean chains 5, error handling 2 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
plotly._extract_histogram_points_fallback (cognitive 25) marimo/_plugins/ui/_impl/plotly.py:1503— plotly._extract_histogram_points_fallback has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 3, loops 2 (3 pts), ternaries 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.
table._download (cognitive 25) marimo/_plugins/ui/_impl/table.py:1111— table._download has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 5, error handling 2 (4 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.
geometry_export._arrow_geometry_declaration (cognitive 25) marimo/_plugins/ui/_impl/tables/geometry_export.py:387— geometry_export._arrow_geometry_declaration has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 7, error handling 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, 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.
edges.get_referring_cells (cognitive 25) marimo/_runtime/dataflow/edges.py:44— edges.get_referring_cells has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 2 (5 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.
_micropip_streaming.stream_transaction_install (cognitive 25) marimo/_runtime/packages/_micropip_streaming.py:69— _micropip_streaming.stream_transaction_install has cognitive complexity 25 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 6 (8 pts), error handling 3 (6 pts), ternaries 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.
assets.index (cognitive 25) marimo/_server/api/endpoints/assets.py:326— assets.index has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (13 pts), error handling 2 (7 pts), boolean chains 3, 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.
AdbcConnectionCatalog.get_tables_in_schema (cognitive 25) marimo/_sql/engines/adbc.py:312— AdbcConnectionCatalog.get_tables_in_schema has cognitive complexity 25 (threshold 15). Drivers by points: if/else 4 (14 pts), loops 3 (6 pts), boolean chains 5 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_templates.notebook_page_template (cognitive 25) marimo/_templates.py:303— _templates.notebook_page_template has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 8, ternaries 3 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
inline_script_metadata._pyproject_toml_to_requirements_txt (cognitive 25) marimo/_utils/inline_script_metadata.py:130— inline_script_metadata._pyproject_toml_to_requirements_txt has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 3, 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.
startup-output.StartupOutput (cognitive 25) frontend/src/components/editor/alerts/startup-output.tsx:17— startup-output.StartupOutput has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 9, if/else 8 (9 pts), ternaries 6 (7 pts) (nesting depth added 2). Of this number, 13 points are the body's own statements and 12 belong to 6 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
extension.copilotBundle (cognitive 25) frontend/src/core/codemirror/copilot/extension.ts:45— extension.copilotBundle has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 3 (nesting depth added 9). Most of this is not in the body itself: 3 of the 25 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 56, 102, 157). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
Extractor.extract_from_code (cognitive 24) marimo/_ast/parse.py:151— Extractor.extract_from_code has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
parse.extract_offsets_post_colon (cognitive 24) marimo/_ast/parse.py:823— parse.extract_offsets_post_colon has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 5, loops 3, ternaries 1 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ExtractWithBlock.generic_visit (cognitive 24) marimo/_ast/transformers.py:209— ExtractWithBlock.generic_visit has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (12 pts), error handling 1 (4 pts), loops 2 (4 pts), ternaries 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.
AsyncCodeModeContext._dry_run_compile (cognitive 24) marimo/_code_mode/_context.py:1623— AsyncCodeModeContext._dry_run_compile has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 4 (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.
_plan._build_plan (cognitive 24) marimo/_code_mode/_plan.py:68— _plan._build_plan has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (23 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
media.io_to_data_url (cognitive 24) marimo/_plugins/core/media.py:49— media.io_to_data_url has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 5, 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.
plotly._extract_histogram_points_numpy (cognitive 24) marimo/_plugins/ui/_impl/plotly.py:1439— plotly._extract_histogram_points_numpy has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (14 pts), ternaries 3 (6 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.
plotly._extract_funnel_stages_fallback (cognitive 24) marimo/_plugins/ui/_impl/plotly.py:3571— plotly._extract_funnel_stages_fallback has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 6, 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.
kernel_lifecycle.listen_messages (cognitive 24) marimo/_runtime/kernel_lifecycle.py:280— kernel_lifecycle.listen_messages has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (11 pts), error handling 3 (9 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
config._get_key (cognitive 24) marimo/_server/ai/config.py:436— config._get_key has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (22 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.
terminal._read_from_pty (cognitive 24) marimo/_server/api/endpoints/terminal.py:216— terminal._read_from_pty has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (17 pts), error handling 3 (6 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SessionBackend._handle_notification (cognitive 24) marimo/_server/host/backend.py:522— SessionBackend._handle_notification has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (15 pts), loops 3 (6 pts), boolean chains 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, 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.
ai-model-dropdown.AIModelDropdown (cognitive 24) frontend/src/components/ai/ai-model-dropdown.tsx:52— ai-model-dropdown.AIModelDropdown has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 10 (17 pts), boolean chains 4, if/else 3 (nesting depth added 7). Of this number, 20 points are the body's own statements and 4 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
connection-notice.ConnectionNotice (cognitive 24) frontend/src/components/editor/alerts/connection-notice.tsx:20— connection-notice.ConnectionNotice has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 15, ternaries 5 (6 pts), if/else 3 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
clipboard.useCellClipboard.pasteAtCell (cognitive 24) frontend/src/components/editor/navigation/clipboard.ts:139— clipboard.useCellClipboard.pasteAtCell has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 3 (8 pts), error handling 2 (4 pts), loops 2 (4 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SQLCompletionStore.getConnectionSchema (cognitive 24) frontend/src/core/codemirror/language/languages/sql/completion-store.ts:44— SQLCompletionStore.getConnectionSchema has cognitive complexity 24 (threshold 15). Drivers by points: loops 7 (16 pts), if/else 4 (7 pts), boolean chains 1 (nesting depth added 12). Of this number, 23 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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.
cells.createTracebackInfoAtom (cognitive 24) frontend/src/core/cells/cells.ts:600— cells.createTracebackInfoAtom has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 4, loops 1 (3 pts), ternaries 1 (nesting depth added 10). None of this is in the body itself: all 24 points belong to one function literal inside it that branches (line 606). 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.
file-explorer.Node (cognitive 24) frontend/src/components/editor/file-tree/file-explorer.tsx:690— file-explorer.Node has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 14, ternaries 5 (6 pts), if/else 4 (nesting depth added 1). Of this number, 19 points are the body's own statements and 5 belong to 5 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
package-alert.PackageAlert (cognitive 24) frontend/src/components/editor/package-alert.tsx:106— package-alert.PackageAlert has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 14, ternaries 4 (6 pts), if/else 4 (nesting depth added 2). Of this number, 16 points are the body's own statements and 8 belong to 4 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
storage-inspector.StorageNamespaceSection (cognitive 24) frontend/src/components/storage/storage-inspector.tsx:603— storage-inspector.StorageNamespaceSection has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 14, if/else 8, ternaries 2. Of this number, 12 points are the body's own statements and 12 belong to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
analyzer.analyzeCacheSite (cognitive 24) frontend/src/core/codemirror/code-lens/analyzer.ts:178— analyzer.analyzeCacheSite has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 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.
CodeMirrorVimSync.broadcastModeChange (cognitive 24) frontend/src/core/codemirror/keymaps/vim.ts:383— CodeMirrorVimSync.broadcastModeChange has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (20 pts), match/switch 1 (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.
App.embed (cognitive 23) marimo/_ast/app.py:840— App.embed has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 5, loops 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Cell.__call__ (cognitive 23) marimo/_ast/cell.py:697— Cell.__call__ has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 5, ternaries 3 (5 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.
cli.run (cognitive 23) marimo/_cli/cli.py:1072— cli.run has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 5, loops 2, ternaries 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OpenCodeHarness.detect (cognitive 23) marimo/_cli/pair/harnesses/opencode.py:129— OpenCodeHarness.detect has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 6, error handling 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.
utils.resolve_token_password (cognitive 23) marimo/_cli/utils.py:55— utils.resolve_token_password has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (14 pts), error handling 4 (8 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.
ReusableDefinitionOrderRule._stable_provider_order (cognitive 23) marimo/_lint/rules/runtime/reusable_definition_order.py:189— ReusableDefinitionOrderRule._stable_provider_order has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 4 (6 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.
altair_chart._coerce_value (cognitive 23) REDACTED:379— altair_chart._coerce_value has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (17 pts), ternaries 1 (3 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.
_futures._wait_for_wasm_futures (cognitive 23) marimo/_runtime/_wasm/_concurrency/_futures.py:156— _futures._wait_for_wasm_futures has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 3 (5 pts), 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.
DirectedGraph.get_transitive_references (cognitive 23) marimo/_runtime/dataflow/graph.py:305— DirectedGraph.get_transitive_references has cognitive complexity 23 (threshold 15). Drivers by points: if/else 3 (12 pts), loops 4 (10 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.
Runner.resolve_state_updates (cognitive 23) marimo/_runtime/runner/cell_runner.py:338— Runner.resolve_state_updates has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 3 (6 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.
OpenAIClientMixin.get_openai_client (cognitive 23) marimo/_server/ai/providers.py:597— OpenAIClientMixin.get_openai_client has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 3, 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.
SessionBridge.adopt (cognitive 23) marimo/_server/host/bridge.py:776— SessionBridge.adopt has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (14 pts), error handling 2 (4 pts), ternaries 1 (3 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
snippets.read_snippets (cognitive 23) marimo/_snippets/snippets.py:33— snippets.read_snippets has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
datasources.DatasetTableItem (cognitive 23) frontend/src/components/datasources/datasources.tsx:817— datasources.DatasetTableItem has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 6, ternaries 3 (4 pts), match/switch 1 (nesting depth added 2). Most of this is not in the body itself: 3 of the 23 points are its own statements and the rest belongs to 5 function items inside it that branch (handleAddTable::getCode, a function literal at line 829, renderColumns, …). 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.
NotebookLanguageServerClient.textDocumentRename (cognitive 23) frontend/src/core/codemirror/lsp/notebook-lsp.ts:661— NotebookLanguageServerClient.textDocumentRename has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 2, loops 1 (nesting depth added 7). Of this number, 22 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
sandbox-controller.SandboxController (cognitive 23) frontend/src/components/editor/chrome/panels/sandbox-controller.tsx:19— sandbox-controller.SandboxController has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 8 (17 pts), boolean chains 6 (nesting depth added 9). 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.
backend-status.BackendConnectionStatus (cognitive 23) frontend/src/components/editor/chrome/wrapper/footer-items/backend-status.tsx:35— backend-status.BackendConnectionStatus has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (10 pts), ternaries 7 (10 pts), boolean chains 2, error handling 1 (nesting depth added 5). Most of this is not in the body itself: 2 of the 23 points are its own statements and the rest belongs to 3 function items inside it that branch (a function literal at line 40, getStatusIcon, getStatusInfo). 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.
storage-file-viewer.StorageFileViewer (cognitive 23) frontend/src/components/storage/storage-file-viewer.tsx:46— storage-file-viewer.StorageFileViewer has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12, boolean chains 6, ternaries 2 (4 pts), error handling 1 (nesting depth added 2). Most of this is not in the body itself: 10 of the 23 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 66, renderMetadata, a function literal at line 95, …). 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.
vim.applyVimCommands (cognitive 23) frontend/src/core/codemirror/keymaps/vim.ts:217— vim.applyVimCommands has cognitive complexity 23 (threshold 15). Drivers by points: if/else 19 (20 pts), boolean chains 2, loops 1 (nesting depth added 1). Most of this is not in the body itself: 7 of the 23 points are its own statements and the rest belongs to 4 function items inside it that branch (map, noremap, unmap, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
ServerSentEventStream.constructor (cognitive 23) packages/client/src/transport/sse.ts:12— ServerSentEventStream.constructor has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 4 (7 pts), boolean chains 2, error handling 1 (2 pts), loops 1 (nesting depth added 8). Of this number, 17 points are the body's own statements and 6 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.
discovery.discoverHosts (cognitive 23) packages/client/src/node/discovery.ts:32— discovery.discoverHosts has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 4, error handling 2 (3 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_convert.convert_to_openai_messages (cognitive 22) marimo/_ai/_convert.py:94— _convert.convert_to_openai_messages has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (13 pts), ternaries 1 (4 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cli._collect_marimo_files (cognitive 22) marimo/_cli/cli.py:832— cli._collect_marimo_files has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 2 (4 pts), 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.
commands.pdf (cognitive 22) marimo/_cli/export/commands.py:734— commands.pdf has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 4, error handling 2 (3 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.
_context._plan_to_document_ops (cognitive 22) marimo/_code_mode/_context.py:1976— _context._plan_to_document_ops has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 5, loops 4 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
plotly._build_box_sample_point (cognitive 22) marimo/_plugins/ui/_impl/plotly.py:3187— plotly._build_box_sample_point has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (12 pts), ternaries 2 (5 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. This shape REPEATS in the file: one other method here (plotly._build_violin_sample_point) 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.
plotly._build_violin_sample_point (cognitive 22) marimo/_plugins/ui/_impl/plotly.py:3333— plotly._build_violin_sample_point has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (12 pts), ternaries 2 (5 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. This shape REPEATS in the file: one other method here (plotly._build_box_sample_point) 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.
DefaultTableManager.calculate_top_k_rows (cognitive 22) marimo/_plugins/ui/_impl/tables/default_table.py:293— DefaultTableManager.calculate_top_k_rows has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 3 (8 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.
cell_runner._find_aliased_import (cognitive 22) marimo/_runtime/runner/cell_runner.py:81— cell_runner._find_aliased_import has cognitive complexity 22 (threshold 15). Drivers by points: if/else 3 (10 pts), loops 3 (7 pts), boolean chains 4, 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.
hooks_post_execution._broadcast_outputs (cognitive 22) marimo/_runtime/runner/hooks_post_execution.py:311— hooks_post_execution._broadcast_outputs has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 6 (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.
Kernel.set_user_config (cognitive 22) marimo/_runtime/runtime.py:2353— Kernel.set_user_config has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 4 (8 pts), ternaries 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.
record.discover_hosts (cognitive 22) marimo/_server/host/record.py:30— record.discover_hosts has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 6, error handling 2 (3 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.
inline_script_metadata.pin_pep723_dependencies_for_wasm (cognitive 22) marimo/_utils/inline_script_metadata.py:309— inline_script_metadata.pin_pep723_dependencies_for_wasm has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 2 (3 pts), error handling 2, 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.
model-discovery.ModelDiscovery (cognitive 22) frontend/src/components/app-config/model-discovery.tsx:30— model-discovery.ModelDiscovery has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 6, error handling 2 (3 pts), ternaries 2 (nesting depth added 3). Most of this is not in the body itself: 6 of the 22 points are its own statements and the rest belongs to 3 function items inside it that branch (load, a function literal at line 151, a function literal at line 176). 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.
sync.createDocumentSync.drain (cognitive 22) frontend/src/core/notebook/document/sync.ts:244— sync.createDocumentSync.drain has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 4, ternaries 1 (2 pts), 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.
lsp-status.LspStatus (cognitive 22) frontend/src/components/editor/chrome/wrapper/footer-items/lsp-status.tsx:25— lsp-status.LspStatus has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 5 (8 pts), if/else 7, match/switch 3, boolean chains 2, error handling 2 (nesting depth added 3). Most of this is not in the body itself: 4 of the 22 points are its own statements and the rest belongs to 6 function items inside it that branch (handleRestart, a function literal at line 29, getStatusIcon, …). 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.
actions.deleteCellsAtom (cognitive 22) frontend/src/core/cells/actions.ts:443— actions.deleteCellsAtom has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (9 pts), ternaries 6 (7 pts), loops 4, boolean chains 2 (nesting depth added 4). Most of this is not in the body itself: 7 of the 22 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 498, 454, 467, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
AnsiReducer.processText (cognitive 22) REDACTED:285— AnsiReducer.processText has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (20 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.
generate_llms_txt.extract_description (cognitive 21) docs/scripts/generate_llms_txt.py:126— generate_llms_txt.extract_description has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (20 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codegen.format_markdown (cognitive 21) marimo/_ast/codegen.py:208— codegen.format_markdown has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 4, ternaries 1 (3 pts), loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
type_inference.infer_annotations (cognitive 21) marimo/_ast/type_inference.py:82— type_inference.infer_annotations has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 3 (5 pts), ternaries 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.
client.execute (cognitive 21) marimo/_cli/pair/client.py:294— client.execute has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (9 pts), ternaries 2 (6 pts), boolean chains 3, error handling 2, 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.
_better_inspect.better_help (cognitive 21) marimo/_code_mode/_better_inspect.py:200— _better_inspect.better_help has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 3, error handling 1 (3 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.
schema_utils._prepare_mcp_config (cognitive 21) marimo/_config/schema_utils.py:34— schema_utils._prepare_mcp_config has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
RunLog.observe (cognitive 21) marimo/_core/run_log.py:63— RunLog.observe has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (16 pts), ternaries 1 (3 pts), boolean chains 1, match/switch 1 (nesting depth added 11). 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.
get_datasets._db_type_to_data_type (cognitive 21) marimo/_data/get_datasets.py:538— get_datasets._db_type_to_data_type has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13, 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.
FullFormatter.format (cognitive 21) marimo/_lint/formatters/full.py:20— FullFormatter.format has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 3, loops 2 (3 pts), ternaries 1 (3 pts), error handling 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Linter.fix (cognitive 21) marimo/_lint/linter.py:371— Linter.fix has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 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.
PrivateImportAliasRule.check (cognitive 21) marimo/_lint/rules/runtime/private_import_alias.py:97— PrivateImportAliasRule.check has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 4 (7 pts), error handling 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.
incompatible_packages._resolve_dep_tree (cognitive 21) REDACTED:124— incompatible_packages._resolve_dep_tree has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 3 (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.
NotebookDocument._apply_change (cognitive 21) marimo/_messaging/notebook/document.py:177— NotebookDocument._apply_change 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). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
accordion.__init__ (cognitive 21) marimo/_plugins/stateless/accordion.py:71— accordion.__init__ has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 3 (6 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
chat._handle_streaming_response (cognitive 21) marimo/_plugins/ui/_impl/chat/chat.py:316— chat._handle_streaming_response has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 2 (4 pts), error handling 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.
plotly._extract_waterfall_bars_numpy (cognitive 21) marimo/_plugins/ui/_impl/plotly.py:2169— plotly._extract_waterfall_bars_numpy has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (12 pts), ternaries 2 (4 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.
DefaultTableManager.select_cells (cognitive 21) marimo/_plugins/ui/_impl/tables/default_table.py:184— DefaultTableManager.select_cells has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 3 (6 pts), boolean chains 4, 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.
DefaultTableManager.sort_values (cognitive 21) marimo/_plugins/ui/_impl/tables/default_table.py:408— DefaultTableManager.sort_values has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (12 pts), error handling 2 (5 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
kernel_runner._defs_equal (cognitive 21) marimo/_runtime/app/kernel_runner.py:33— kernel_runner._defs_equal has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 2, 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.
autoreload.update_class (cognitive 21) marimo/_runtime/reload/autoreload.py:509— autoreload.update_class has cognitive complexity 21 (threshold 15). Drivers by points: error handling 5 (12 pts), if/else 3 (6 pts), loops 2, 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.
auth.validate_auth (cognitive 21) marimo/_server/api/auth.py:41— auth.validate_auth has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (17 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.
ProxyMiddleware.__call__ (cognitive 21) marimo/_server/api/middleware.py:558— ProxyMiddleware.__call__ has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (16 pts), error handling 2 (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.
document.apply_to_document (cognitive 21) marimo/_server/host/document.py:149— document.apply_to_document has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 1, loops 1, ternaries 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ai-config.AddModelForm (cognitive 21) frontend/src/components/app-config/ai-config.tsx:1675— ai-config.AddModelForm has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 14, ternaries 5 (6 pts), if/else 1 (nesting depth added 1). Of this number, 19 points are the body's own statements and 2 belong to 2 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
utils.detectSentinel (cognitive 21) frontend/src/components/data-table/utils.ts:186— utils.detectSentinel has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (20 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.
columns.generateColumns.columns (cognitive 21) frontend/src/components/data-table/columns.tsx:200— columns.generateColumns.columns has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 14, ternaries 4, if/else 3. Most of this is not in the body itself: 4 of the 21 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 209, 282, 283). 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.
terminal.TerminalComponent (cognitive 21) frontend/src/components/terminal/terminal.tsx:139— terminal.TerminalComponent has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 8, error handling 1, loops 1, ternaries 1 (nesting depth added 1). Most of this is not in the body itself: 1 of the 21 points is its own statement and the rest belongs to 10 function literals inside it that branch (lines 323, 213, 225, …). 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.
select-list.SelectList (cognitive 21) frontend/src/components/ui/select-core/select-list.tsx:66— select-list.SelectList has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 8 (9 pts), if/else 7 (8 pts), boolean chains 4 (nesting depth added 2). Most of this is not in the body itself: 3 of the 21 points are its own statements and the rest belongs to 8 function items inside it that branch (handleComboChange, renderTriggerValue, pinnedSeparator, …). 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.
freshness.freshnessOf (cognitive 21) frontend/src/core/executions/freshness.ts:75— freshness.freshnessOf has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 5, ternaries 3, loops 1 (nesting depth added 6). None of this is in the body itself: all 21 points belong to 4 function items inside it that branch (inputsChanged, sourceChanged, ofRecord, …). 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.
request.request (cognitive 21) packages/client/src/request.ts:271— request.request has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 3, loops 2 (3 pts), ternaries 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
python-ast.getPrefixLength (cognitive 21) packages/smart-cells/src/utils/python-ast.ts:173— python-ast.getPrefixLength 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.
Extractor.to_cell (cognitive 20) marimo/_ast/parse.py:406— Extractor.to_cell has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (18 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.
type_inference._dependency_order (cognitive 20) marimo/_ast/type_inference.py:203— type_inference._dependency_order has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 6 (9 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.
client.list_sessions (cognitive 20) marimo/_cli/pair/client.py:482— client.list_sessions has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 6, error handling 1, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
commands.list_notebooks (cognitive 20) marimo/_cli/pair/commands.py:692— commands.list_notebooks has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 2 (4 pts), error handling 2 (3 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
deprecations._deprecated_fields (cognitive 20) marimo/_config/deprecations.py:37— deprecations._deprecated_fields has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3 (7 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.
UnsafeCallVisitor.visit_Call (cognitive 20) marimo/_lint/rules/wasm/_unsafe_call_analysis.py:419— UnsafeCallVisitor.visit_Call has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 1 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
UnsafeCallVisitor._aliases_for_value (cognitive 20) marimo/_lint/rules/wasm/_unsafe_call_analysis.py:693— UnsafeCallVisitor._aliases_for_value has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (19 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.
structures._key_formatter (cognitive 20) marimo/_output/formatters/structures.py:33— structures._key_formatter has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (13 pts), error handling 2 (4 pts), ternaries 1 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
altair_chart.__init__ (cognitive 20) REDACTED:535— altair_chart.__init__ has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (13 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.
data_editor._convert_like (cognitive 20) marimo/_plugins/ui/_impl/data_editor.py:1009— data_editor._convert_like has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 3, 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.
plotly._append_bar_items_to_selection (cognitive 20) marimo/_plugins/ui/_impl/plotly.py:1658— plotly._append_bar_items_to_selection has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 2, 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.
geometry_export._prepare_geographic_export (cognitive 20) marimo/_plugins/ui/_impl/tables/geometry_export.py:575— geometry_export._prepare_geographic_export has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8, ternaries 4 (6 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.
Thread.run (cognitive 20) marimo/_runtime/threads.py:168— Thread.run has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 3, 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.
ToolManager._get_tool (cognitive 20) marimo/_server/ai/tools/tool_manager.py:90— ToolManager._get_tool has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (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.
assets.og_thumbnail (cognitive 20) marimo/_server/api/endpoints/assets.py:210— assets.og_thumbnail has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 3, error handling 1 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
roots.resolve_file_roots (cognitive 20) marimo/_server/files/roots.py:14— roots.resolve_file_roots has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (10 pts), error handling 2 (4 pts), ternaries 2 (3 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PythonTypeToOpenAPI.convert_dataclass (cognitive 20) marimo/_utils/dataclass_to_openapi.py:228— PythonTypeToOpenAPI.convert_dataclass has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (10 pts), ternaries 3 (7 pts), loops 2, boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
charts.TablePanel (cognitive 20) frontend/src/components/data-table/charts/charts.tsx:94— charts.TablePanel has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 4, ternaries 3 (nesting depth added 1). Most of this is not in the body itself: 8 of the 20 points are its own statements and the rest belongs to 6 function items inside it that branch (handleDeleteTab, saveTabChartType, handleAddTab, …). 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.
utils.sqlCode (cognitive 20) frontend/src/components/datasources/utils.ts:190— utils.sqlCode has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (15 pts), ternaries 1 (3 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.
packages-panel.DependencyTreeNode (cognitive 20) frontend/src/components/editor/chrome/panels/packages-panel.tsx:521— packages-panel.DependencyTreeNode has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (8 pts), ternaries 6 (7 pts), boolean chains 5 (nesting depth added 2). Of this number, 11 points are the body's own statements and 9 belong to 3 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.
useTheme.getHostTheme (cognitive 20) frontend/src/theme/useTheme.ts:24— useTheme.getHostTheme has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (7 pts), ternaries 2 (5 pts), boolean chains 4, loops 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.
SortableCellsProvider.SortableCellsProviderInternal (cognitive 20) frontend/src/components/sort/SortableCellsProvider.tsx:43— SortableCellsProvider.SortableCellsProviderInternal has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 5, ternaries 2 (nesting depth added 2). Most of this is not in the body itself: 1 of the 20 points is its own statement and the rest belongs to 5 function literals inside it that branch (lines 155, 92, 192, …). 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.
analyzer.findDeclarationSites (cognitive 20) frontend/src/core/codemirror/code-lens/analyzer.ts:23— analyzer.findDeclarationSites has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (11 pts), loops 4 (5 pts), boolean chains 4 (nesting depth added 3). Most of this is not in the body itself: 3 of the 20 points are its own statements and the rest belongs to 3 function items inside it that branch (collectTargetNames, collectAssignmentTargets, visit). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
utils.hasWildcards (cognitive 20) frontend/src/plugins/impl/data-explorer/queries/utils.ts:46— utils.hasWildcards has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 2, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MplInteractivePlugin.patchToolbarImages (cognitive 20) frontend/src/plugins/impl/mpl-interactive/MplInteractivePlugin.tsx:109— MplInteractivePlugin.patchToolbarImages has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 4 (8 pts), boolean chains 2 (nesting depth added 8). Most of this is not in the body itself: 1 of the 20 points is its own statement and the rest belongs to 2 function items inside it that branch (a function literal at line 140, patchImg). 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.
Literal.toCode (cognitive 20) frontend/src/utils/python-poet/poet.ts:55— Literal.toCode has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (17 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 6). Of this number, 18 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
sync-models.parseExistingModels (cognitive 20) packages/llm-info/src/sync-models.ts:84— sync-models.parseExistingModels has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 3 (6 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.
ScopedVisitor.visit_Name (cognitive 19) marimo/_ast/visitor.py:1024— ScopedVisitor.visit_Name has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cli.check (cognitive 19) marimo/_cli/cli.py:1481— cli.check has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (8 pts), ternaries 3 (7 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.
_common.collect_notebooks (cognitive 19) marimo/_cli/export/_common.py:26— _common.collect_notebooks has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 2 (4 pts), error handling 1 (3 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AsyncCodeModeContext.edit_cell (cognitive 19) marimo/_code_mode/_context.py:1181— AsyncCodeModeContext.edit_cell has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 3, error handling 1 (3 pts), ternaries 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
data_editor._validate_column_types (cognitive 19) marimo/_plugins/ui/_impl/data_editor.py:502— data_editor._validate_column_types has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (15 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.
geometry_export._validate_geoparquet (cognitive 19) marimo/_plugins/ui/_impl/tables/geometry_export.py:1102— geometry_export._validate_geoparquet has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (9 pts), error handling 3 (5 pts), boolean chains 4, 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.
complete._get_docstring (cognitive 19) marimo/_runtime/complete.py:239— complete._get_docstring has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 1 (3 pts), boolean chains 2, error handling 2 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Kernel.prepare_execution_requests (cognitive 19) marimo/_runtime/runtime.py:2034— Kernel.prepare_execution_requests has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 5, error handling 1 (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.
Kernel.function_call_request (cognitive 19) marimo/_runtime/runtime.py:2607— Kernel.function_call_request has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), error handling 2 (4 pts), loops 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Cache._convert_to_stub_if_needed (cognitive 19) marimo/_save/cache.py:427— Cache._convert_to_stub_if_needed has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 4, error handling 1 (2 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
LazyLoader.__init__ (cognitive 19) REDACTED:672— LazyLoader.__init__ has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (9 pts), ternaries 3 (7 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.
LazyLoader.save_cache (cognitive 19) REDACTED:1447— LazyLoader.save_cache has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 2, error handling 1, loops 1, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ClassStub.__init__ (cognitive 19) REDACTED:22— ClassStub.__init__ has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 2 (4 pts), boolean chains 2, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SessionEventStream.stream (cognitive 19) marimo/_server/host/session.py:141— SessionEventStream.stream has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (15 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.
RunTranslator._console (cognitive 19) marimo/_server/host/translate.py:270— RunTranslator._console has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 5, ternaries 2 (3 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CompositeLspServer.get_health (cognitive 19) marimo/_server/lsp.py:912— CompositeLspServer.get_health has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 2 (7 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.
utils.convert_to_output (cognitive 19) marimo/_sql/utils.py:245— utils.convert_to_output has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (17 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.
file_lock.file_lock (cognitive 19) marimo/_utils/file_lock.py:18— file_lock.file_lock has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), error handling 1 (3 pts), loops 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.
agent-panel.AgentPanel::renderBody (cognitive 19) frontend/src/components/chat/acp/agent-panel.tsx:1134— agent-panel.AgentPanel::renderBody has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 5 (11 pts), boolean chains 5, if/else 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.
column-summary.TableColumnSummary::renderStats (cognitive 19) frontend/src/components/data-table/column-summary/column-summary.tsx:75— column-summary.TableColumnSummary::renderStats has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (9 pts), ternaries 3 (8 pts), boolean chains 1, match/switch 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.
analyzer.isKeywordArgumentName (cognitive 19) frontend/src/core/codemirror/reactive-references/analyzer.ts:489— analyzer.isKeywordArgumentName has cognitive complexity 19 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 2 (6 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.
extensions.cellKeymaps (cognitive 19) frontend/src/core/codemirror/cells/extensions.ts:47— extensions.cellKeymaps has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (19 pts) (nesting depth added 7). Most of this is not in the body itself: 1 of the 19 points is its own statement and the rest belongs to 8 function literals inside it that branch (lines 182, 199, 280, …). 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.
signature-hint.isCursorInsideAnchoredCall (cognitive 19) frontend/src/core/codemirror/completion/signature-hint.ts:20— signature-hint.isCursorInsideAnchoredCall has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (11 pts), ternaries 2 (5 pts), loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
normalize-markdown-math.splitByInlineCodeSegments (cognitive 19) frontend/src/core/codemirror/lsp/normalize-markdown-math.ts:202— normalize-markdown-math.splitByInlineCodeSegments has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 2 (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.
actions.createCellAtom (cognitive 19) frontend/src/core/cells/actions.ts:99— actions.createCellAtom has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 4, ternaries 1 (2 pts) (nesting depth added 4). Of this number, 17 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
minimap.SlidesMinimap (cognitive 19) frontend/src/components/slides/minimap.tsx:221— minimap.SlidesMinimap has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (7 pts), ternaries 5 (6 pts), boolean chains 5, error handling 1 (nesting depth added 2). Most of this is not in the body itself: 3 of the 19 points are its own statements and the rest belongs to 7 function items inside it that branch (handleDragEnd, a function literal at line 363, a function literal at line 249, …). 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.
useNotebookSession.useNotebookSession.handleNotification (cognitive 19) frontend/src/core/session/useNotebookSession.tsx:127— useNotebookSession.useNotebookSession.handleNotification has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 4, ternaries 2 (4 pts), match/switch 1 (nesting depth added 7). Of this number, 15 points are the body's own statements and 4 belong to one function literal inside it that branches. The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
loader.vegaLoadData (cognitive 19) frontend/src/plugins/impl/vega/loader.ts:153— loader.vegaLoadData has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 4, error handling 1 (3 pts), 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.
urls.appendQueryParams (cognitive 19) frontend/src/utils/urls.ts:63— urls.appendQueryParams has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (8 pts), ternaries 4 (5 pts), boolean chains 3, loops 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.
DocsMarkdownConverter.convert_pre (cognitive 18) docs/scripts/html_to_markdown.py:27— DocsMarkdownConverter.convert_pre has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 2 (5 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.
type_inference.candidate_names (cognitive 18) marimo/_ast/type_inference.py:149— type_inference.candidate_names has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
commands.convert (cognitive 18) marimo/_cli/convert/commands.py:34— commands.convert has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), error handling 2 (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.
AgentMessageFiles.cleanup (cognitive 18) marimo/_cli/pair/artifacts.py:57— AgentMessageFiles.cleanup has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (9 pts), boolean chains 3, loops 2 (3 pts), error handling 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.
client.iter_sse (cognitive 18) marimo/_cli/pair/client.py:130— client.iter_sse has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (15 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.
_plan._validate_ops (cognitive 18) marimo/_code_mode/_plan.py:144— _plan._validate_ops 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.
schema_utils._retain_unknown_fields (cognitive 18) marimo/_config/schema_utils.py:57— schema_utils._retain_unknown_fields has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 3 (6 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
to_ir._resolve_pip_packages (cognitive 18) marimo/_convert/ipynb/to_ir.py:735— to_ir._resolve_pip_packages has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (3 pts), boolean chains 2, 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.
IncompatibleImportsRule._validate_graph (cognitive 18) marimo/_lint/rules/wasm/incompatible_imports.py:155— IncompatibleImportsRule._validate_graph has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (12 pts), loops 3 (6 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.
DisplayMathPreprocessor._reindent_list_continuations (cognitive 18) marimo/_output/md_extensions/display_math.py:146— DisplayMathPreprocessor._reindent_list_continuations has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 2 (3 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.
plotly._append_histogram_points_to_selection (cognitive 18) marimo/_plugins/ui/_impl/plotly.py:1362— plotly._append_histogram_points_to_selection has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 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.
NarwhalsTableManager._get_stats_internal (cognitive 18) marimo/_plugins/ui/_impl/tables/narwhals_table.py:547— NarwhalsTableManager._get_stats_internal 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.
utils.split_packages (cognitive 18) marimo/_runtime/packages/utils.py:250— utils.split_packages has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (15 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.
primitives.is_data_primitive (cognitive 18) marimo/_runtime/primitives.py:60— primitives.is_data_primitive has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 6, error handling 1 (2 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.
_cache_call._set_context (cognitive 18) marimo/_save/save.py:174— _cache_call._set_context has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 3, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
scratchpad.extract_result (cognitive 18) marimo/_server/scratchpad.py:359— scratchpad.extract_result has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 3, loops 2 (3 pts), ternaries 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AppHost._stream_receiver_loop (cognitive 18) REDACTED:111— AppHost._stream_receiver_loop has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), error handling 2 (4 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.
SQLAlchemyEngine._get_batched_table_details (cognitive 18) REDACTED:681— SQLAlchemyEngine._get_batched_table_details has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (7 pts), ternaries 5 (7 pts), error handling 3, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
utils.is_query_empty (cognitive 18) marimo/_sql/utils.py:362— utils.is_query_empty has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (5 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pair-with-agent-modal.PairWithAgentModal (cognitive 18) frontend/src/components/editor/actions/pair-with-agent-modal.tsx:50— pair-with-agent-modal.PairWithAgentModal has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 7 (8 pts), boolean chains 7, if/else 3 (nesting depth added 1). Of this number, 10 points are the body's own statements and 8 belong to 4 function literals inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
useDuplicateShortcuts.findDuplicateShortcuts (cognitive 18) frontend/src/hooks/useDuplicateShortcuts.ts:44— useDuplicateShortcuts.findDuplicateShortcuts has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3 (5 pts), boolean chains 2, 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.
column-header.DataTableColumnHeader (cognitive 18) frontend/src/components/data-table/column-header.tsx:47— column-header.DataTableColumnHeader has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 15, if/else 2, ternaries 1. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
charts.ChartPanel (cognitive 18) frontend/src/components/data-table/charts/charts.tsx:327— charts.ChartPanel has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9, boolean chains 5, ternaries 4. Most of this is not in the body itself: 5 of the 18 points are its own statements and the rest belongs to 3 function items inside it that branch (a function literal at line 355, a function literal at line 399, renderChartDisplay). 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.
renderers.DataTableBody (cognitive 18) frontend/src/components/data-table/renderers.tsx:90— renderers.DataTableBody has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 10, if/else 4, ternaries 4. Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to 5 function items inside it that branch (renderRow, a function literal at line 139, renderRows, …). 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.
useNotebookActions.useNotebookActions (cognitive 18) frontend/src/components/editor/actions/useNotebookActions.tsx:113— useNotebookActions.useNotebookActions has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 8, if/else 5, ternaries 4, loops 1. Most of this is not in the body itself: 8 of the 18 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 363, renderCheckboxElement, openExportDialog, …). 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.
getCodes.getTopologicalCellIds (cognitive 18) frontend/src/core/codemirror/copilot/getCodes.ts:71— getCodes.getTopologicalCellIds has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 4 (7 pts), boolean chains 2 (nesting depth added 8). Of this number, 13 points are the body's own statements and 5 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
sidebar.Sidebar (cognitive 18) frontend/src/components/editor/chrome/wrapper/sidebar.tsx:26— sidebar.Sidebar has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (14 pts), ternaries 2 (3 pts), boolean chains 1 (nesting depth added 5). None of this is in the body itself: all 18 points belong to 5 function items inside it that branch (handleReceive, a function literal at line 99, a function literal at line 145, …). 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.
package-alert.ExtrasSelector (cognitive 18) frontend/src/components/editor/package-alert.tsx:542— package-alert.ExtrasSelector has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (7 pts), ternaries 3 (6 pts), boolean chains 5 (nesting depth added 6). Of this number, 11 points are the body's own statements and 7 belong to 3 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
utils.getBulkActions (cognitive 18) frontend/src/components/ui/select-core/utils.ts:71— utils.getBulkActions has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 6). Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
data-source-connections.allTablesAtom::walkSchema (cognitive 18) frontend/src/core/datasets/data-source-connections.ts:424— data-source-connections.allTablesAtom::walkSchema has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 3, loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
useNotebookSession.useNotebookSession (cognitive 18) frontend/src/core/session/useNotebookSession.tsx:87— useNotebookSession.useNotebookSession has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 5, error handling 1, ternaries 1 (nesting depth added 2). None of this is in the body itself: all 18 points belong to 6 function literals inside it that branch (lines 452, 474, 392, …). 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.
FileUploadPlugin.FileUpload (cognitive 18) frontend/src/plugins/impl/FileUploadPlugin.tsx:120— FileUploadPlugin.FileUpload has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 6 (11 pts), boolean chains 6, if/else 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.
matplotlib-renderer.getResizeHandle (cognitive 18) frontend/src/plugins/impl/matplotlib/matplotlib-renderer.ts:95— matplotlib-renderer.getResizeHandle has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 10, if/else 8. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
openapi.adjustNode (cognitive 18) packages/host-protocol/src/internal/openapi.ts:67— openapi.adjustNode has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 7, 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, 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.
sync-models.formatCollections (cognitive 18) packages/llm-info/src/sync-models.ts:132— sync-models.formatCollections has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 2 (4 pts), ternaries 1 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
sync-models.updateDocument (cognitive 18) packages/llm-info/src/sync-models.ts:195— sync-models.updateDocument has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 3, loops 2 (3 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.
TopLevelStatus.update (cognitive 17) marimo/_ast/toplevel.py:114— TopLevelStatus.update has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13 (14 pts), error handling 1 (2 pts), boolean chains 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.
ColoredGroup.resolve_command (cognitive 17) marimo/_cli/help_formatter.py:100— ColoredGroup.resolve_command has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 3, 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.
Executions.restore (cognitive 17) marimo/_core/executions.py:123— Executions.restore has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
dependencies._version_check (cognitive 17) marimo/_dependencies/dependencies.py:175— dependencies._version_check has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 3, ternaries 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Exporter._iter_html_data_strings (cognitive 17) marimo/_export/exporter.py:212— Exporter._iter_html_data_strings has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (11 pts), loops 3 (6 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.
Linter._process_single_file (cognitive 17) marimo/_lint/linter.py:150— Linter._process_single_file has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (11 pts), error handling 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, 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.
tracebacks.write_traceback (cognitive 17) marimo/_messaging/tracebacks.py:73— tracebacks.write_traceback has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (7 pts), ternaries 3 (6 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.
structures._leaf_formatter (cognitive 17) marimo/_output/formatters/structures.py:95— structures._leaf_formatter has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (11 pts), error handling 3 (5 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
utils.from_chat_message_dict (cognitive 17) marimo/_plugins/ui/_impl/chat/utils.py:22— utils.from_chat_message_dict has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 2 (7 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.
plotly._extract_histogram_points_from_bins (cognitive 17) marimo/_plugins/ui/_impl/plotly.py:1556— plotly._extract_histogram_points_from_bins has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (14 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.
table._apply_filters_query_sort (cognitive 17) marimo/_plugins/ui/_impl/table.py:1538— table._apply_filters_query_sort has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 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.
AsyncProcess._has_process_owned_work (cognitive 17) marimo/_runtime/_wasm/_concurrency/_mp_process.py:224— AsyncProcess._has_process_owned_work has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 3, 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.
Kernel.__init__ (cognitive 17) marimo/_runtime/runtime.py:542— Kernel.__init__ has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 2 (3 pts), error handling 1 (2 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.
Kernel._read_inputs (cognitive 17) marimo/_runtime/runtime.py:1586— Kernel._read_inputs has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (6 pts), ternaries 3 (6 pts), boolean chains 4, 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.
Cache.update (cognitive 17) marimo/_save/cache.py:371— Cache.update has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 5 (6 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
lazy.to_item (cognitive 17) REDACTED:290— lazy.to_item has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14 (16 pts), boolean chains 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
terminal._write_to_pty (cognitive 17) marimo/_server/api/endpoints/terminal.py:304— terminal._write_to_pty has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), error handling 3 (5 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.
WorkspaceIndex._apply_scan (cognitive 17) marimo/_server/host/index.py:78— WorkspaceIndex._apply_scan has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), ternaries 4, boolean chains 2, 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.
ScratchCellListener.stream (cognitive 17) marimo/_server/scratchpad.py:200— ScratchCellListener.stream has cognitive complexity 17 (threshold 15). Drivers by points: loops 4 (11 pts), if/else 2 (6 pts) (nesting depth added 11). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
DuckDBEngine._load_table_details (cognitive 17) marimo/_sql/engines/duckdb.py:430— DuckDBEngine._load_table_details has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 2, boolean chains 1, error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
parse._parse_sql_duckdb (cognitive 17) marimo/_sql/parse.py:97— parse._parse_sql_duckdb has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (9 pts), loops 2 (3 pts), boolean chains 2, ternaries 2, error handling 1 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
LogFormatter.__init__ (cognitive 17) marimo/_utils/log_formatter.py:63— LogFormatter.__init__ has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 2 (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.
shortcuts.areKeysPressed (cognitive 17) frontend/src/core/hotkeys/shortcuts.ts:47— shortcuts.areKeysPressed has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 4, match/switch 1 (2 pts), loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pending-ai-cells.PendingAICells (cognitive 17) frontend/src/components/editor/chrome/wrapper/pending-ai-cells.tsx:24— pending-ai-cells.PendingAICells has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 6, if/else 6, ternaries 3, loops 2. Of this number, 9 points are the body's own statements and 8 belong to 3 function items inside it that branch. To reduce it, 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.
JsonOutput.JsonTree (cognitive 17) frontend/src/components/editor/output/JsonOutput.tsx:65— JsonOutput.JsonTree has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 11 (12 pts), boolean chains 3, if/else 2 (nesting depth added 1). Most of this is not in the body itself: 8 of the 17 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 157, 98, 108, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
TableBottomBar.TableBottomBar (cognitive 17) frontend/src/components/data-table/TableBottomBar.tsx:32— TableBottomBar.TableBottomBar has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 4, ternaries 1 (nesting depth added 1). Most of this is not in the body itself: 1 of the 17 points is its own statement and the rest belongs to 4 function items inside it that branch (renderTotal, handleSelectAllRows, a function literal at line 72, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
feature.applyFormat (cognitive 17) frontend/src/components/data-table/column-formatting/feature.ts:146— feature.applyFormat has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 5 (9 pts), ternaries 2 (6 pts), boolean chains 1, if/else 1 (nesting depth added 8). 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.
state.getExportFormatStatus (cognitive 17) frontend/src/components/editor/actions/export-dialog/state.ts:256— state.getExportFormatStatus has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 5, 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.
filename-input.FilenameInput (cognitive 17) frontend/src/components/editor/header/filename-input.tsx:40— filename-input.FilenameInput has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 10, if/else 5, ternaries 2. Of this number, 12 points are the body's own statements and 5 belong to 6 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
ConsoleOutput.ConsoleOutputInternal (cognitive 17) frontend/src/components/editor/output/console/ConsoleOutput.tsx:92— ConsoleOutput.ConsoleOutputInternal has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 7, if/else 6 (7 pts), ternaries 3 (nesting depth added 1). Of this number, 9 points are the body's own statements and 8 belong to 3 function literals inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
form-utils.getDefaults (cognitive 17) frontend/src/components/forms/form-utils.ts:17— form-utils.getDefaults has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (14 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 3). Most of this is not in the body itself: 8 of the 17 points are its own statements and the rest belongs to one function item inside it that branches (getDefaultValue). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
storage-inspector.StorageEntryRow (cognitive 17) frontend/src/components/storage/storage-inspector.tsx:407— storage-inspector.StorageEntryRow has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 9, if/else 5, ternaries 2, error handling 1. Of this number, 11 points are the body's own statements and 6 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.
AIContextRegistry.resolveItems (cognitive 17) frontend/src/core/ai/context/registry.ts:170— AIContextRegistry.resolveItems has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 5 (8 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.
vimrc.parseCommand (cognitive 17) frontend/src/core/codemirror/keymaps/vimrc.ts:109— vimrc.parseCommand has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 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.
copilot-config.CopilotConfig (cognitive 17) frontend/src/core/codemirror/copilot/copilot-config.tsx:15— copilot-config.CopilotConfig has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (9 pts), ternaries 2 (4 pts), boolean chains 2, error handling 1, match/switch 1 (nesting depth added 3). None of this is in the body itself: all 17 points belong to 4 function items inside it that branch (trySignIn, tryFinishSignIn, renderBody, …). 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.
ui-element.initializeUIElement (cognitive 17) frontend/src/core/dom/ui-element.ts:25— ui-element.initializeUIElement has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (15 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.
MplInteractivePlugin.MplInteractiveSlot (cognitive 17) frontend/src/plugins/impl/mpl-interactive/MplInteractivePlugin.tsx:172— MplInteractivePlugin.MplInteractiveSlot has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, boolean chains 4, error handling 1. None of this is in the body itself: all 17 points belong to 8 function literals inside it that branch (lines 232, 202, 293, …). 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.
make-selectable.removeSpecificParamsFromNestedSpecs (cognitive 17) frontend/src/plugins/impl/vega/make-selectable.ts:184— make-selectable.removeSpecificParamsFromNestedSpecs has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 4, 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.
StatPlugin.StatComponent (cognitive 17) frontend/src/plugins/layout/StatPlugin.tsx:45— StatPlugin.StatComponent has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (7 pts), boolean chains 6, ternaries 3 (4 pts) (nesting depth added 2). Most of this is not in the body itself: 8 of the 17 points are its own statements and the rest belongs to 2 function items inside it that branch (renderPrettyValue, renderSlot). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
pathUtils.getProtocolAndParentDirectories (cognitive 17) frontend/src/utils/pathUtils.ts:8— pathUtils.getProtocolAndParentDirectories has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (6 pts), ternaries 4 (6 pts), loops 2 (4 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.
sse.sse.<returned closure> (cognitive 17) packages/client/src/transport/sse.ts:104— sse.sse.<returned closure> has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 3, error handling 1, loops 1, ternaries 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_convert.get_google_messages_from_parts (cognitive 16) marimo/_ai/_convert.py:368— _convert.get_google_messages_from_parts has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 3 (9 pts), if/else 2 (5 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.
parse.parse_notebook (cognitive 16) marimo/_ast/parse.py:1083— parse.parse_notebook has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (12 pts), ternaries 1 (3 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.
pytest.build_test_class (cognitive 16) REDACTED:338— pytest.build_test_class has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (3 pts), error handling 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TopLevelExtraction.__init__ (cognitive 16) marimo/_ast/toplevel.py:235— TopLevelExtraction.__init__ has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 4, 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.
commands._failure_guidance (cognitive 16) marimo/_cli/pair/commands.py:421— commands._failure_guidance has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 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.
schema_utils.config_leaf_types (cognitive 16) marimo/_config/schema_utils.py:169— schema_utils.config_leaf_types has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (7 pts), loops 2 (4 pts), ternaries 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.
_MystmdMarkdownImportDialect.preprocess (cognitive 16) marimo/_convert/markdown/flavor/mystmd.py:70— _MystmdMarkdownImportDialect.preprocess has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (15 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.
_session_cache.is_session_snapshot_stale (cognitive 16) marimo/_export/_session_cache.py:94— _session_cache.is_session_snapshot_stale has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 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.
local_modules.resolve_local_modules (cognitive 16) marimo/_export/local_modules.py:58— local_modules.resolve_local_modules has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (11 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.
Linter._pipe_file_status (cognitive 16) marimo/_lint/linter.py:265— Linter._pipe_file_status has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), loops 3 (5 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.
IncompatiblePackagesRule.check (cognitive 16) REDACTED:237— IncompatiblePackagesRule.check has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 2, 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.
CellNotificationUtils.broadcast_error (cognitive 16) marimo/_messaging/notification_utils.py:218— CellNotificationUtils.broadcast_error has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), boolean chains 2, error handling 1 (2 pts), loops 1 (2 pts), ternaries 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
opengraph._load_generator_from_notebook_source (cognitive 16) REDACTED:302— opengraph._load_generator_from_notebook_source has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), error handling 3, 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.
inspect._get_filtered_attributes (cognitive 16) marimo/_plugins/stateless/inspect.py:266— inspect._get_filtered_attributes has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), error handling 2 (3 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.
file_browser._has_files_recursive (cognitive 16) marimo/_plugins/ui/_impl/file_browser.py:491— file_browser._has_files_recursive has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 2, 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.
plotly._is_orderable_axis (cognitive 16) marimo/_plugins/ui/_impl/plotly.py:88— plotly._is_orderable_axis has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), error handling 1 (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.
_micropip_streaming._split_packages (cognitive 16) marimo/_runtime/packages/_micropip_streaming.py:25— _micropip_streaming._split_packages 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.
import_error_extractors.extract_packages_from_pip_install_suggestion (cognitive 16) marimo/_runtime/packages/import_error_extractors.py:33— import_error_extractors.extract_packages_from_pip_install_suggestion has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 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.
SessionBridge.save (cognitive 16) marimo/_server/host/bridge.py:257— SessionBridge.save has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 2, 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.
HostApiMiddleware.__call__ (cognitive 16) marimo/_server/host/middleware.py:48— HostApiMiddleware.__call__ has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), error handling 2 (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.
record.host_url (cognitive 16) marimo/_server/host/record.py:104— record.host_url has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (7 pts), ternaries 2 (6 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.
IbisEngine.get_schemas (cognitive 16) marimo/_sql/engines/ibis.py:196— IbisEngine.get_schemas has cognitive complexity 16 (threshold 15). Drivers by points: error handling 4 (5 pts), if/else 3 (5 pts), ternaries 1 (3 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.
flatten._flatten (cognitive 16) marimo/_utils/flatten.py:134— flatten._flatten has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 4, 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.
generate.event_adapters (cognitive 16) REDACTED:100— generate.event_adapters has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 3, 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.
use-toast.reducer (cognitive 16) frontend/src/components/ui/use-toast.ts:81— use-toast.reducer has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (7 pts), ternaries 3 (7 pts), boolean chains 1, match/switch 1 (nesting depth added 7). Of this number, 8 points are the body's own statements and 8 belong to 3 function literals inside it that branch. The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
chat-display.renderUIMessage::renderPart (cognitive 16) frontend/src/components/chat/chat-display.tsx:81— chat-display.renderUIMessage::renderPart has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 5 (10 pts), if/else 3 (4 pts), boolean chains 1, match/switch 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.
formatting.formatPython::format (cognitive 16) frontend/src/components/editor/output/json-output/formatting.ts:119— formatting.formatPython::format has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 4 (8 pts), if/else 4 (7 pts), match/switch 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.
context-menu.buildCellFilter (cognitive 16) frontend/src/components/data-table/context-menu.tsx:42— context-menu.buildCellFilter has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), ternaries 3 (6 pts), match/switch 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.
minimap-content.SelectedCell (cognitive 16) frontend/src/components/dependency-graph/minimap-content.tsx:165— minimap-content.SelectedCell has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 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.
startup-progress.StartupProgress (cognitive 16) frontend/src/components/editor/alerts/startup-progress.tsx:98— startup-progress.StartupProgress has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 7 (11 pts), boolean chains 5 (nesting depth added 4). Most of this is not in the body itself: 3 of the 16 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 104, 103). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
renderers.renderTableInfo (cognitive 16) frontend/src/core/codemirror/language/languages/sql/renderers.tsx:131— renderers.renderTableInfo has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 14, ternaries 2. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
cell-code.prepareCellCodeUpdate (cognitive 16) frontend/src/core/codemirror/language/cell-code.ts:57— cell-code.prepareCellCodeUpdate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 3, 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.
RequestingTree.reveal (cognitive 16) frontend/src/components/editor/file-tree/requesting-tree.tsx:156— RequestingTree.reveal has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (15 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.
copilot-status.GitHubCopilotStatus (cognitive 16) frontend/src/components/editor/chrome/wrapper/footer-items/copilot-status.tsx:42— copilot-status.GitHubCopilotStatus has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (6 pts), ternaries 5 (6 pts), boolean chains 3, error handling 1 (nesting depth added 2). Of this number, 10 points are the body's own statements and 6 belong 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.
runtime-settings.RuntimeSettings (cognitive 16) frontend/src/components/editor/chrome/wrapper/footer-items/runtime-settings.tsx:29— runtime-settings.RuntimeSettings has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 11, ternaries 5. Of this number, 15 points are the body's own statements and 1 belongs to one function item 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.
swiper-component.SlidesComponent (cognitive 16) frontend/src/components/slides/swiper-component.tsx:30— swiper-component.SlidesComponent has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 5, ternaries 3 (nesting depth added 1). Most of this is not in the body itself: 5 of the 16 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 43, 53, 105, …). 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.
TableContextProvider.formatContext (cognitive 16) frontend/src/core/ai/context/providers/tables.ts:39— TableContextProvider.formatContext has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (6 pts), ternaries 3 (6 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 6). Of this number, 12 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
analyzer.findStaticCacheName (cognitive 16) frontend/src/core/codemirror/code-lens/analyzer.ts:127— analyzer.findStaticCacheName has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 5, loops 1 (nesting depth added 4). Of this number, 15 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.
resolve-widget.getInvalidAnyWidgetModuleError (cognitive 16) frontend/src/plugins/impl/anywidget/resolve-widget.ts:91— resolve-widget.getInvalidAnyWidgetModuleError has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 5 (10 pts), boolean chains 4, if/else 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DataFramePlugin.DataFrameComponent (cognitive 16) frontend/src/plugins/impl/data-frames/DataFramePlugin.tsx:193— DataFramePlugin.DataFrameComponent has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 13, if/else 3. Of this number, 12 points are the body's own statements and 4 belong to 3 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
edit-distance.editDistanceGeneral (cognitive 16) frontend/src/utils/edit-distance.ts:22— edit-distance.editDistanceGeneral has cognitive complexity 16 (threshold 15). Drivers by points: loops 5 (6 pts), boolean chains 5, if/else 4 (5 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.
models-dev.parseModelsDev (cognitive 16) packages/llm-info/src/sources/models-dev.ts:42— models-dev.parseModelsDev has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 3, 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.
createOnce::check (cognitive 16) frontend/lint/replica-imports.js:19— createOnce::check has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 2 (4 pts), boolean chains 3, other 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.
Change coupling clique: ai-provider-icon.tsx, config.py, config.py frontend/src/components/ai/ai-provider-icon.tsx— 3 files — `frontend/src/components/ai/ai-provider-icon.tsx`, `marimo/_config/config.py`, `marimo/_server/ai/config.py` — all change together with no explicit dependency: a fully-connected co-change clique, not 3 separate couplings. They share one concern (thin parallel siblings over a common abstraction), so extract the shared part into ONE unit and the whole clique's coupling clears at once — you do not need to break each pair individually.
Near-duplicate member pair (50 shared lines) frontend/e2e-tests/py/components.py:114— frontend/e2e-tests/py/components.py:114-192 | marimo/_tutorials/ui.py:413-501 — These two members are variants of one another: 50 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 (9 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (9 members, 50+ identical tokens) marimo/_output/builder.py:8— marimo/_output/builder.py:8-21 | marimo/_output/builder.py:159-172 | marimo/_output/builder.py:178-191 | marimo/_output/builder.py:195-208 | marimo/_output/builder.py:212-225 | marimo/_output/builder.py:229-242 | marimo/_output/builder.py:246-259 | marimo/_output/builder.py:263-276 | marimo/_output/builder.py:280-293 — These 9 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 9 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 9 times.
D4 · Code Duplication· Members sharing a duplicated core (8 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (8 members, 50+ identical tokens) marimo/_plugins/ui/_impl/plotly.py:645— marimo/_plugins/ui/_impl/plotly.py:645-722 | marimo/_plugins/ui/_impl/plotly.py:1295-1359 | marimo/_plugins/ui/_impl/plotly.py:1744-1846 | marimo/_plugins/ui/_impl/plotly.py:1856-1935 | marimo/_plugins/ui/_impl/plotly.py:2176-2241 | marimo/_plugins/ui/_impl/plotly.py:2251-2306 | marimo/_plugins/ui/_impl/plotly.py:3500-3568 | marimo/_plugins/ui/_impl/plotly.py:3578-3625 — These 8 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 8 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 8 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) marimo/_plugins/ui/_impl/dates.py:142— marimo/_plugins/ui/_impl/dates.py:142-167 | marimo/_plugins/ui/_impl/dates.py:305-330 | marimo/_plugins/ui/_impl/dates.py:477-502 | marimo/_plugins/ui/_impl/input.py:134-150 | marimo/_plugins/ui/_impl/input.py:364-380 | marimo/_plugins/ui/_impl/input.py:577-593 — 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· Members sharing a duplicated core (5 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (5 members, 50+ identical tokens) marimo/_plugins/ui/_impl/plotly.py:1661— marimo/_plugins/ui/_impl/plotly.py:1661-1714 | marimo/_plugins/ui/_impl/plotly.py:2072-2147 | marimo/_plugins/ui/_impl/plotly.py:2381-2560 | marimo/_plugins/ui/_impl/plotly.py:2732-2915 | marimo/_plugins/ui/_impl/plotly.py:3389-3467 — 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 (109 corresponding lines) · ×1
Edited copy of a member (109 corresponding lines) marimo/_plugins/ui/_impl/input.py:248— marimo/_plugins/ui/_impl/input.py:248-360 | marimo/_plugins/ui/_impl/input.py:465-573 — These two members are one piece of code written twice and then edited apart: 109 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 (77 corresponding lines) · ×1
Edited copy of a member (77 corresponding lines) marimo/_server/api/dependency_tree.py:15— marimo/_server/api/dependency_tree.py:15-92 | marimo/_utils/uv_tree.py:70-146 — These two members are one piece of code written twice and then edited apart: 77 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 (50 corresponding lines) · ×1
Edited copy of a member (50 corresponding lines) marimo/_data/_external_storage/huggingface.py:209— marimo/_data/_external_storage/huggingface.py:209-258 | marimo/_data/_external_storage/huggingface.py:263-313 — These two members are one piece of code written twice and then edited apart: 50 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 (41 corresponding lines) · ×1
Edited copy of a member (41 corresponding lines) marimo/_runtime/packages/_micropip_streaming.py:26— marimo/_runtime/packages/_micropip_streaming.py:26-66 | marimo/_runtime/packages/utils.py:251-302 — These two members are one piece of code written twice and then edited apart: 41 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, 54+ corresponding lines) · ×1
Edited copies of one member (3 members, 54+ corresponding lines) marimo/_runtime/callbacks/datasets.py:168— marimo/_runtime/callbacks/datasets.py:168-229 | marimo/_runtime/callbacks/datasets.py:235-291 | marimo/_runtime/callbacks/datasets.py:297-350 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 54 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) marimo/_sql/utils.py:117— marimo/_sql/utils.py:117-162 | marimo/_sql/utils.py:170-218 — 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 copy of a member (43 corresponding lines) · ×1
Edited copy of a member (43 corresponding lines) marimo/_sql/engines/adbc.py:456— marimo/_sql/engines/adbc.py:456-508 | marimo/_sql/engines/dbapi.py:96-138 — 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 copies of one member (3 members, 34+ corresponding lines) · ×1
Edited copies of one member (3 members, 34+ corresponding lines) marimo/_snippets/data/polars-11.py:27— marimo/_snippets/data/polars-11.py:27-69 | marimo/_snippets/data/polars-12.py:26-59 | marimo/_snippets/data/polars-5.py:27-60 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 34 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, 22+ corresponding lines) · ×1
Edited copies of one member (4 members, 22+ corresponding lines) marimo/_server/api/endpoints/file_explorer.py:279— marimo/_server/api/endpoints/file_explorer.py:279-300 | marimo/_server/api/endpoints/file_explorer.py:309-330 | marimo/_server/api/endpoints/file_explorer.py:339-360 | marimo/_server/api/endpoints/file_explorer.py:405-426 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 22 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 copy of a member (26 corresponding lines) · ×1
Edited copy of a member (26 corresponding lines) marimo/_session/notebook/file_manager.py:661— marimo/_session/notebook/file_manager.py:661-686 | marimo/_session/notebook/storage.py:210-237 — 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 (20 corresponding lines) · ×1
Edited copy of a member (20 corresponding lines) marimo/_snippets/data/pandas-20.py:20— marimo/_snippets/data/pandas-20.py:20-39 | marimo/_snippets/data/pandas-21.py:20-39 — 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, 10+ corresponding lines) · ×1
Edited copies of one member (3 members, 10+ corresponding lines) marimo/_runtime/_wasm/_concurrency/_process_install.py:450— marimo/_runtime/_wasm/_concurrency/_process_install.py:450-459 | marimo/_runtime/_wasm/_concurrency/_process_install.py:468-477 | marimo/_runtime/_wasm/_concurrency/_process_install.py:486-495 — 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 copies of one member (3 members, 11+ corresponding lines) · ×1
Edited copies of one member (3 members, 11+ corresponding lines) marimo/_snippets/data/altair-1.py:23— marimo/_snippets/data/altair-1.py:23-33 | marimo/_snippets/data/altair-2.py:24-35 | marimo/_snippets/data/altair-3.py:24-34 — 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· Edited copy of a member (16 corresponding lines) · ×1
Edited copy of a member (16 corresponding lines) marimo/_snippets/data/pandas-5.py:20— marimo/_snippets/data/pandas-5.py:20-35 | marimo/_snippets/data/pandas-6.py:20-38 — 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· Edited copies of one member (3 members, 6+ corresponding lines) · ×1
Edited copies of one member (3 members, 6+ corresponding lines) marimo/_convert/markdown/flavor/base.py:15— marimo/_convert/markdown/flavor/base.py:15-20 | REDACTED:520-526 | marimo/_secrets/load_dotenv.py:209-220 — 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.
Duplicated block (63–64 lines × 2) marimo/_plugins/ui/_impl/plotly.py:2395— marimo/_plugins/ui/_impl/plotly.py:2395-2457 | marimo/_plugins/ui/_impl/plotly.py:2749-2812 — both copies are in the same file, so extract the 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 (48–54 lines × 2) marimo/_plugins/ui/_impl/plotly.py:2605— marimo/_plugins/ui/_impl/plotly.py:2605-2652 | marimo/_plugins/ui/_impl/plotly.py:2999-3052 — both copies are in the same file, so extract the 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 (47–48 lines × 2) marimo/_plugins/ui/_impl/plotly.py:3190— marimo/_plugins/ui/_impl/plotly.py:3190-3236 | marimo/_plugins/ui/_impl/plotly.py:3336-3383 — both copies are in the same file, so extract the 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 (45–46 lines × 2) marimo/_plugins/ui/_impl/plotly.py:2479— marimo/_plugins/ui/_impl/plotly.py:2479-2523 | marimo/_plugins/ui/_impl/plotly.py:2836-2881 — both copies are in the same file, so extract the 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 (40 lines × 2) marimo/_server/api/dependency_tree.py:30— marimo/_server/api/dependency_tree.py:30-69 | marimo/_utils/uv_tree.py:85-124 — before extracting anything, compare `marimo/_server/api/dependency_tree.py` and `marimo/_utils/uv_tree.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 70 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 `marimo/_server/api/dependency_tree.py:30` 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, `marimo/_utils/uv_tree.py:84` calls `skip_line` and `marimo/_server/api/dependency_tree.py:29` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (36 lines × 2) marimo/_server/api/endpoints/export.py:547— marimo/_server/api/endpoints/export.py:547-582 | marimo/_server/api/endpoints/export.py:622-657 — both copies are in the same file, so extract the 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 (34–35 lines × 3) marimo/_plugins/ui/_impl/plotly.py:1676— marimo/_plugins/ui/_impl/plotly.py:1676-1710 | marimo/_plugins/ui/_impl/plotly.py:2087-2120 | marimo/_plugins/ui/_impl/plotly.py:3406-3439 — 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 `marimo/_plugins/ui/_impl/plotly.py:2087` 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, `marimo/_plugins/ui/_impl/plotly.py:1673` calls `cast`, `get`, `any` and `marimo/_plugins/ui/_impl/plotly.py:2087` 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 × 3) marimo/_plugins/ui/_impl/dataframes/transforms/print_code.py:235— marimo/_plugins/ui/_impl/dataframes/transforms/print_code.py:235-268 | marimo/_plugins/ui/_impl/dataframes/transforms/print_code.py:513-546 | marimo/_plugins/ui/_impl/dataframes/transforms/print_code.py:721-754 — 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 `marimo/_plugins/ui/_impl/dataframes/transforms/print_code.py:235` 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 (28–30 lines × 2) marimo/_plugins/ui/_impl/plotly.py:2181— marimo/_plugins/ui/_impl/plotly.py:2181-2210 | marimo/_plugins/ui/_impl/plotly.py:2254-2281 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (19–26 lines × 3) marimo/_plugins/ui/_impl/plotly.py:1365— marimo/_plugins/ui/_impl/plotly.py:1365-1383 | marimo/_plugins/ui/_impl/plotly.py:2381-2403 | marimo/_plugins/ui/_impl/plotly.py:2732-2757 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (22–26 lines × 2) marimo/_data/charts.py:92— marimo/_data/charts.py:92-117 | marimo/_data/charts.py:705-726 — both copies are in the same file, so extract the 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 (23–25 lines × 2) marimo/_server/recents.py:38— marimo/_server/recents.py:38-62 | marimo/_server/recents.py:66-88 — both copies are in the same file, so extract the 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–23 lines × 2) marimo/_sql/engines/adbc.py:268— marimo/_sql/engines/adbc.py:268-290 | marimo/_sql/engines/adbc.py:348-368 — both copies are in the same file, so extract the 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 `marimo/_sql/engines/adbc.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.
Duplicated block (16–22 lines × 2) marimo/_plugins/ui/_impl/plotly.py:676— marimo/_plugins/ui/_impl/plotly.py:676-691 | marimo/_plugins/ui/_impl/plotly.py:1789-1810 — both copies are in the same file, so extract the 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 `marimo/_plugins/ui/_impl/plotly.py:676` 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 (22 lines × 2) marimo/_server/api/endpoints/packages.py:109— marimo/_server/api/endpoints/packages.py:109-130 | marimo/_server/api/endpoints/packages.py:180-201 — both copies are in the same file, so extract the 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 `marimo/_server/api/endpoints/packages.py:109` 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 (17–21 lines × 2) marimo/_plugins/ui/_impl/plotly.py:2980— marimo/_plugins/ui/_impl/plotly.py:2980-3000 | marimo/_plugins/ui/_impl/plotly.py:3098-3114 — both copies are in the same file, so extract the 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 (18–20 lines × 4) marimo/_plugins/ui/_impl/plotly.py:2598— marimo/_plugins/ui/_impl/plotly.py:2598-2615 | marimo/_plugins/ui/_impl/plotly.py:2990-3009 | marimo/_plugins/ui/_impl/plotly.py:3106-3123 | marimo/_plugins/ui/_impl/plotly.py:3253-3270 — 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. 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, `marimo/_plugins/ui/_impl/plotly.py:2988` calls `_build_global_category_order` and `marimo/_plugins/ui/_impl/plotly.py:2596` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (13–20 lines × 2) marimo/_runtime/executor/evaluator.py:39— marimo/_runtime/executor/evaluator.py:39-58 | marimo/_runtime/executor/evaluator.py:69-81 — both copies are in the same file, so extract the 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–18 lines × 2) marimo/_mcp/code_server/lifespan.py:23— marimo/_mcp/code_server/lifespan.py:23-39 | marimo/_mcp/server/lifespan.py:23-40 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (17 lines × 3) marimo/_plugins/ui/_impl/dataframes/transforms/print_code.py:74— marimo/_plugins/ui/_impl/dataframes/transforms/print_code.py:74-90 | marimo/_plugins/ui/_impl/dataframes/transforms/print_code.py:346-362 | marimo/_plugins/ui/_impl/dataframes/transforms/print_code.py:617-633 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `marimo/_plugins/ui/_impl/dataframes/transforms/print_code.py:74` 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–17 lines × 3) marimo/_plugins/ui/_impl/plotly.py:2127— marimo/_plugins/ui/_impl/plotly.py:2127-2142 | marimo/_plugins/ui/_impl/plotly.py:3446-3462 | marimo/_plugins/ui/_impl/plotly.py:3679-3695 — 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 (11–17 lines × 2) marimo/_plugins/ui/_impl/plotly.py:2660— marimo/_plugins/ui/_impl/plotly.py:2660-2670 | marimo/_plugins/ui/_impl/plotly.py:3054-3070 — both copies are in the same file, so extract the 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–16 lines × 4) marimo/_plugins/ui/_impl/plotly.py:621— marimo/_plugins/ui/_impl/plotly.py:621-632 | marimo/_plugins/ui/_impl/plotly.py:1720-1731 | marimo/_plugins/ui/_impl/plotly.py:2153-2162 | marimo/_plugins/ui/_impl/plotly.py:3473-3488 — 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. 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–16 lines × 2) frontend/e2e-tests/py/components.py:179— frontend/e2e-tests/py/components.py:179-192 | marimo/_tutorials/ui.py:486-501 — before extracting anything, compare `frontend/e2e-tests/py/components.py` and `marimo/_tutorials/ui.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 55 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 `frontend/e2e-tests/py/components.py:179` 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 × 3) marimo/_plugins/ui/_impl/input.py:134— marimo/_plugins/ui/_impl/input.py:134-148 | marimo/_plugins/ui/_impl/input.py:364-378 | marimo/_plugins/ui/_impl/input.py:577-591 — 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 (14–15 lines × 2) marimo/_mcp/code_server/main.py:151— marimo/_mcp/code_server/main.py:151-164 | marimo/_mcp/server/main.py:71-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 `marimo/_mcp/code_server/main.py:151` 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 (14 lines × 9) marimo/_output/builder.py:8— marimo/_output/builder.py:8-21 | marimo/_output/builder.py:159-172 | marimo/_output/builder.py:178-191 | marimo/_output/builder.py:195-208 | marimo/_output/builder.py:212-225 | marimo/_output/builder.py:229-242 | marimo/_output/builder.py:246-259 | marimo/_output/builder.py:263-276 | marimo/_output/builder.py:280-293 — all 9 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 (14 lines × 4) marimo/_plugins/ui/_impl/plotly.py:1701— marimo/_plugins/ui/_impl/plotly.py:1701-1714 | marimo/_plugins/ui/_impl/plotly.py:2111-2124 | marimo/_plugins/ui/_impl/plotly.py:2833-2846 | marimo/_plugins/ui/_impl/plotly.py:3430-3443 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `marimo/_plugins/ui/_impl/plotly.py:1701` 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 (23–26 lines × 3) marimo/_plugins/ui/_impl/plotly.py:903— marimo/_plugins/ui/_impl/plotly.py:903-928 | marimo/_plugins/ui/_impl/plotly.py:1030-1055 | marimo/_plugins/ui/_impl/plotly.py:1199-1221 — 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 (11–14 lines × 2) frontend/e2e-tests/py/components.py:115— frontend/e2e-tests/py/components.py:115-125 | marimo/_tutorials/ui.py:414-427 — before extracting anything, compare `frontend/e2e-tests/py/components.py` and `marimo/_tutorials/ui.py` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 55 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 `frontend/e2e-tests/py/components.py:115` 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.
Duplicated block (13–14 lines × 2) marimo/_messaging/streams.py:469— marimo/_messaging/streams.py:469-482 | marimo/_pyodide/streams.py:186-198 — `marimo/_messaging/streams.py` and `marimo/_pyodide/streams.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 3 separate duplicated blocks between them, totalling at least 36 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 (12 lines × 6) marimo/_plugins/ui/_impl/dates.py:155— marimo/_plugins/ui/_impl/dates.py:155-166 | marimo/_plugins/ui/_impl/dates.py:318-329 | marimo/_plugins/ui/_impl/dates.py:490-501 | marimo/_plugins/ui/_impl/input.py:138-149 | marimo/_plugins/ui/_impl/input.py:368-379 | marimo/_plugins/ui/_impl/input.py:581-592 — there are 6 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 6 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (8–12 lines × 4) marimo/_plugins/ui/_impl/plotly.py:1749— marimo/_plugins/ui/_impl/plotly.py:1749-1760 | marimo/_plugins/ui/_impl/plotly.py:1859-1870 | marimo/_plugins/ui/_impl/plotly.py:3505-3512 | marimo/_plugins/ui/_impl/plotly.py:3581-3588 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (12 lines × 4) marimo/_plugins/ui/_impl/plotly.py:2114— marimo/_plugins/ui/_impl/plotly.py:2114-2125 | marimo/_plugins/ui/_impl/plotly.py:2479-2490 | marimo/_plugins/ui/_impl/plotly.py:2836-2847 | marimo/_plugins/ui/_impl/plotly.py:3433-3444 — 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. 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–12 lines × 2) marimo/_messaging/streams.py:408— marimo/_messaging/streams.py:408-418 | marimo/_messaging/streams.py:468-479 — both copies are in the same file, so extract the 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 `marimo/_messaging/streams.py:408` 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–11 lines × 6) marimo/_plugins/ui/_impl/plotly.py:1747— marimo/_plugins/ui/_impl/plotly.py:1747-1757 | marimo/_plugins/ui/_impl/plotly.py:1857-1867 | marimo/_plugins/ui/_impl/plotly.py:2179-2188 | marimo/_plugins/ui/_impl/plotly.py:2252-2261 | marimo/_plugins/ui/_impl/plotly.py:3503-3512 | marimo/_plugins/ui/_impl/plotly.py:3579-3588 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. 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–10 lines × 2) marimo/_lint/context.py:128— marimo/_lint/context.py:128-137 | marimo/_lint/context.py:152-159 — both copies are in the same file, so extract the 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 × 4) marimo/_plugins/ui/_impl/plotly.py:1295— marimo/_plugins/ui/_impl/plotly.py:1295-1304 | marimo/_plugins/ui/_impl/plotly.py:1856-1864 | marimo/_plugins/ui/_impl/plotly.py:2251-2259 | marimo/_plugins/ui/_impl/plotly.py:3578-3586 — 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. 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) examples/ui/layout.py:90— examples/ui/layout.py:90-97 | marimo/_smoke_tests/grid.py:63-70 | marimo/_smoke_tests/layout.py:63-70 | marimo/_tutorials/layout.py:128-135 — before extracting anything, compare `examples/ui/layout.py` and `marimo/_smoke_tests/grid.py` as WHOLE FILES: 87% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 3 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7–8 lines × 2) marimo/_messaging/notebook/document.py:188— marimo/_messaging/notebook/document.py:188-195 | marimo/_messaging/notebook/document.py:205-211 — both copies are in the same file, so extract the 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 `marimo/_messaging/notebook/document.py:188` 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 (31 lines × 3) marimo/_snippets/data/duckdb-1.py:11— marimo/_snippets/data/duckdb-1.py:11-41 | marimo/_snippets/data/duckdb-7.py:11-41 | marimo/_snippets/data/duckdb-8.py:11-41 — 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 (7 lines × 4) examples/ui/layout.py:62— examples/ui/layout.py:62-68 | marimo/_smoke_tests/grid.py:35-41 | marimo/_smoke_tests/layout.py:35-41 | marimo/_tutorials/layout.py:107-113 — before extracting anything, compare `examples/ui/layout.py` and `marimo/_smoke_tests/grid.py` as WHOLE FILES: 87% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 3 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. 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.
D4 · Code Duplication· Members sharing a duplicated core (20 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (20 members, 50+ identical tokens) marimo/_smoke_tests/editor_code_lens_stress.py:546— marimo/_smoke_tests/editor_code_lens_stress.py:546-567 | marimo/_smoke_tests/editor_code_lens_stress.py:573-594 | marimo/_smoke_tests/editor_code_lens_stress.py:600-621 | marimo/_smoke_tests/editor_code_lens_stress.py:627-648 | marimo/_smoke_tests/editor_code_lens_stress.py:654-675 | marimo/_smoke_tests/editor_code_lens_stress.py:681-702 | marimo/_smoke_tests/editor_code_lens_stress.py:708-729 | marimo/_smoke_tests/editor_code_lens_stress.py:735-756 | marimo/_smoke_tests/editor_code_lens_stress.py:762-783 | marimo/_smoke_tests/editor_code_lens_stress.py:789-810 | marimo/_smoke_tests/editor_code_lens_stress.py:816-837 | marimo/_smoke_tests/editor_code_lens_stress.py:843-864 | marimo/_smoke_tests/editor_code_lens_stress.py:870-891 | marimo/_smoke_tests/editor_code_lens_stress.py:897-918 | marimo/_smoke_tests/editor_code_lens_stress.py:924-945 | marimo/_smoke_tests/editor_code_lens_stress.py:951-972 | marimo/_smoke_tests/editor_code_lens_stress.py:978-999 | marimo/_smoke_tests/editor_code_lens_stress.py:1005-1026 | marimo/_smoke_tests/editor_code_lens_stress.py:1032-1053 | marimo/_smoke_tests/editor_code_lens_stress.py:1059-1080 — These 20 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 20 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 20 times.
D4 · Code Duplication· Edited copy of a member (40 corresponding lines) · ×1
Edited copy of a member (40 corresponding lines) marimo/_smoke_tests/altair_examples/text_selection.py:107— marimo/_smoke_tests/altair_examples/text_selection.py:107-150 | marimo/_smoke_tests/issues/altair_bug.py:20-59 — 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 copy of a member (60 corresponding lines) · ×1
Edited copy of a member (60 corresponding lines) marimo/_smoke_tests/process_isolation/app1.py:91— marimo/_smoke_tests/process_isolation/app1.py:91-150 | marimo/_smoke_tests/process_isolation/app2.py:90-149 — These two members are one piece of code written twice and then edited apart: 60 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 (6 members, 16+ corresponding lines) · ×1
Edited copies of one member (6 members, 16+ corresponding lines) marimo/_smoke_tests/altair_examples/binning.py:100— marimo/_smoke_tests/altair_examples/binning.py:100-116 | marimo/_smoke_tests/altair_examples/binning.py:166-185 | marimo/_smoke_tests/altair_examples/binning.py:203-222 | marimo/_smoke_tests/altair_examples/binning.py:240-260 | marimo/_smoke_tests/altair_examples/binning.py:278-293 | marimo/_smoke_tests/altair_examples/binning.py:344-362 — These 6 members are one piece of code written 6 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 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 19+ corresponding lines) · ×1
Edited copies of one member (5 members, 19+ corresponding lines) marimo/_smoke_tests/altair_examples/hconcat_vconcat.py:37— marimo/_smoke_tests/altair_examples/hconcat_vconcat.py:37-55 | marimo/_smoke_tests/altair_examples/hconcat_vconcat.py:77-97 | marimo/_smoke_tests/altair_examples/hconcat_vconcat.py:114-134 | marimo/_smoke_tests/altair_examples/hconcat_vconcat.py:151-171 | marimo/_smoke_tests/altair_examples/hconcat_vconcat.py:188-215 — These 5 members are one piece of code written 5 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 5 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) examples/sql/read_csv.py:30— examples/sql/read_csv.py:30-34 | examples/sql/read_json.py:30-34 | examples/sql/read_parquet.py:30-34 — 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.
Duplicated block (45 lines × 2) marimo/_smoke_tests/process_isolation/app1.py:37— marimo/_smoke_tests/process_isolation/app1.py:37-81 | marimo/_smoke_tests/process_isolation/app2.py:37-81 — before extracting anything, compare `marimo/_smoke_tests/process_isolation/app1.py` and `marimo/_smoke_tests/process_isolation/app2.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 104 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 (43 lines × 2) marimo/_smoke_tests/process_isolation/app1.py:108— marimo/_smoke_tests/process_isolation/app1.py:108-150 | marimo/_smoke_tests/process_isolation/app2.py:107-149 — before extracting anything, compare `marimo/_smoke_tests/process_isolation/app1.py` and `marimo/_smoke_tests/process_isolation/app2.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 104 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 (30 lines × 2) examples/ai/tools/chat_with_tools.py:116— examples/ai/tools/chat_with_tools.py:116-145 | examples/ai/tools/code_interpreter.py:104-133 — 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 (27 lines × 2) examples/ai/chat/dagger_code_interpreter.py:65— examples/ai/chat/dagger_code_interpreter.py:65-91 | examples/ai/tools/code_interpreter.py:71-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.
Duplicated block (22 lines × 20) marimo/_smoke_tests/editor_code_lens_stress.py:546— marimo/_smoke_tests/editor_code_lens_stress.py:546-567 | marimo/_smoke_tests/editor_code_lens_stress.py:573-594 | marimo/_smoke_tests/editor_code_lens_stress.py:600-621 | marimo/_smoke_tests/editor_code_lens_stress.py:627-648 | marimo/_smoke_tests/editor_code_lens_stress.py:654-675 | marimo/_smoke_tests/editor_code_lens_stress.py:681-702 | marimo/_smoke_tests/editor_code_lens_stress.py:708-729 | marimo/_smoke_tests/editor_code_lens_stress.py:735-756 | marimo/_smoke_tests/editor_code_lens_stress.py:762-783 | marimo/_smoke_tests/editor_code_lens_stress.py:789-810 | marimo/_smoke_tests/editor_code_lens_stress.py:816-837 | marimo/_smoke_tests/editor_code_lens_stress.py:843-864 | marimo/_smoke_tests/editor_code_lens_stress.py:870-891 | marimo/_smoke_tests/editor_code_lens_stress.py:897-918 | marimo/_smoke_tests/editor_code_lens_stress.py:924-945 | marimo/_smoke_tests/editor_code_lens_stress.py:951-972 | marimo/_smoke_tests/editor_code_lens_stress.py:978-999 | marimo/_smoke_tests/editor_code_lens_stress.py:1005-1026 | marimo/_smoke_tests/editor_code_lens_stress.py:1032-1053 | marimo/_smoke_tests/editor_code_lens_stress.py:1059-1080 — all 20 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 (19–20 lines × 2) marimo/_smoke_tests/altair_examples/text_selection.py:107— marimo/_smoke_tests/altair_examples/text_selection.py:107-126 | marimo/_smoke_tests/issues/altair_bug.py:20-38 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `marimo/_smoke_tests/altair_examples/text_selection.py:107` 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 (20 lines × 2) scripts/generate.py:77— scripts/generate.py:77-96 | scripts/generate_schemas.py:146-165 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (10–11 lines × 2) frontend/e2e-tests/py/output.py:20— frontend/e2e-tests/py/output.py:20-29 | marimo/_smoke_tests/output.py:25-35 — 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 × 3) examples/ui/layout.py:30— examples/ui/layout.py:30-39 | marimo/_smoke_tests/grid.py:11-20 | marimo/_smoke_tests/layout.py:11-20 — before extracting anything, compare `examples/ui/layout.py` and `marimo/_smoke_tests/grid.py` as WHOLE FILES: 87% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 3 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. 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 (31 lines × 6) examples/markdown/admonitions.py:9— examples/markdown/admonitions.py:9-41 | examples/markdown/details.py:9-87 | frontend/e2e-tests/py/layout_grid_with_sidebar.py:14-58 | marimo/_smoke_tests/markdown/latex_display_math.py:9-39 | marimo/_smoke_tests/markdown/latex_outline.py:9-71 | marimo/_smoke_tests/markdown/sane_lists.py:9-133 — before extracting anything, compare `examples/markdown/admonitions.py` and `examples/markdown/details.py` as WHOLE FILES: 83% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. 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 `examples/markdown/admonitions.py:9` 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 (79 lines × 2) examples/markdown/details.py:9— examples/markdown/details.py:9-87 | marimo/_smoke_tests/markdown/sane_lists.py:9-133 — before extracting anything, compare `examples/markdown/details.py` and `marimo/_smoke_tests/markdown/sane_lists.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 375 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 `examples/markdown/details.py:9` 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 (35 lines × 2) examples/running_cells/in_memory_cache.py:9— examples/running_cells/in_memory_cache.py:9-43 | examples/running_cells/persistent_cache.py:9-43 — before extracting anything, compare `examples/running_cells/in_memory_cache.py` and `examples/running_cells/persistent_cache.py` as WHOLE FILES: 93% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. 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 `examples/running_cells/in_memory_cache.py:9` 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 (52 lines × 5) marimo/_smoke_tests/latex/latex.py:11— marimo/_smoke_tests/latex/latex.py:11-350 | marimo/_smoke_tests/markdown/anchor_links.py:18-72 | marimo/_smoke_tests/markdown/markdown_pymdownx.py:9-229 | marimo/_smoke_tests/markdown/markdown_quotes.py:11-62 | marimo/_smoke_tests/md.py:17-87 — before extracting anything, compare `marimo/_smoke_tests/latex/latex.py` and `marimo/_smoke_tests/markdown/markdown_pymdownx.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 1020 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 `marimo/_smoke_tests/latex/latex.py:11` 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 (63 lines × 3) examples/markdown/details.py:9— examples/markdown/details.py:9-87 | marimo/_smoke_tests/markdown/latex_outline.py:9-71 | marimo/_smoke_tests/markdown/sane_lists.py:9-133 — before extracting anything, compare `examples/markdown/details.py` and `marimo/_smoke_tests/markdown/sane_lists.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 375 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 `examples/markdown/details.py:9` 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 (221 lines × 2) marimo/_smoke_tests/latex/latex.py:11— marimo/_smoke_tests/latex/latex.py:11-350 | marimo/_smoke_tests/markdown/markdown_pymdownx.py:9-229 — before extracting anything, compare `marimo/_smoke_tests/latex/latex.py` and `marimo/_smoke_tests/markdown/markdown_pymdownx.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 1020 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 `marimo/_smoke_tests/latex/latex.py:11` 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 (52 lines × 4) marimo/_smoke_tests/latex/latex.py:11— marimo/_smoke_tests/latex/latex.py:11-350 | marimo/_smoke_tests/markdown/markdown_pymdownx.py:9-229 | marimo/_smoke_tests/markdown/markdown_quotes.py:11-62 | marimo/_smoke_tests/md.py:17-87 — before extracting anything, compare `marimo/_smoke_tests/latex/latex.py` and `marimo/_smoke_tests/markdown/markdown_pymdownx.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 1020 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 `marimo/_smoke_tests/latex/latex.py:11` 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 × 7) examples/ai/chat/anthropic_example.py:33— examples/ai/chat/anthropic_example.py:33-38 | examples/ai/chat/deepseek_example.py:48-53 | examples/ai/chat/gemini.py:33-38 | examples/ai/chat/groq_example.py:49-54 | examples/ai/chat/openai_example.py:33-38 | examples/ai/tools/dataset_analysis.py:48-53 | marimo/_smoke_tests/chat/chatbot.py:104-109 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 7 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 7 times. 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.
P12 · CI test-gate honesty· Tests run only outside the merge gate · ×1
Tests run only outside the merge gate .github/workflows/sync-llm-info.yml:60— `pnpm --dir packages/llm-info test` is the only CI command that runs 74 test(s) in 5 file(s) (e.g. `packages/llm-info/src/__tests__/cli.test.ts`, `packages/llm-info/src/__tests__/json-structure.test.ts`), and the workflow runs only on a schedule — a failure there is found after the change merged, when the only remedy is a revert. Run them on pull requests (or in the merge queue).
P12 · CI test-gate honesty· Coverage reaches no merge · ×1
Coverage reaches no merge .github/workflows/test_be.yaml:239— `codecov/codecov-action` uploads coverage, but its condition requires `github.event_name == 'push'`: no pull request ever reports coverage for `.`, and nothing that runs on one enforces a floor — the number can fall and every change still merges. Upload (or enforce the floor) on pull requests too.
Duplication concentrated across 13 sibling directories (18 clone groups) frontend/src/components/data-table/filter-pill-editor.tsx:282— 18 duplicated blocks under frontend/src/components/ have copies in at least two of the sibling directories app-config, chat, data-table, datasources, dependency-graph, editor (+7 more sibling(s) not listed) — 5 of them are reported below, and 13 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 18 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 18 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 18 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
Duplication concentrated across 4 sibling directories (17 clone groups) frontend/src/components/editor/file-tree/upload.tsx:58— 17 duplicated blocks under frontend/src/ have copies in at least two of the sibling directories components, core, plugins, utils — 8 of them are reported below, and 9 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 17 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 17 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 17 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
Duplication concentrated across 8 sibling directories (10 clone groups) frontend/src/core/ai/context/providers/cell-output.ts:130— 10 duplicated blocks under frontend/src/core/ have copies in at least two of the sibling directories ai, codemirror, datasets, islands, saving, session (+2 more sibling(s) not listed) — 7 of them are reported below, and 3 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 10 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 10 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 10 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication· Duplicated block with local edits (146 matched lines × 2 locations) · ×1
Duplicated block with local edits (146 matched lines × 2 locations) frontend/src/components/ui/context-menu.tsx:29— frontend/src/components/ui/context-menu.tsx:29 · frontend/src/components/ui/dropdown-menu.tsx:25 — the two spans are one implementation copied and then locally edited — 887 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (119 matched lines × 2 locations) · ×1
Duplicated block with local edits (119 matched lines × 2 locations) frontend/src/components/editor/notebook-cell.tsx:411— frontend/src/components/editor/notebook-cell.tsx:411 · frontend/src/components/editor/notebook-cell.tsx:1064 — the two spans are one implementation copied and then locally edited — 606 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (76 matched lines × 2 locations) · ×1
Duplicated block with local edits (76 matched lines × 2 locations) frontend/src/core/network/requests-network.ts:159— frontend/src/core/network/requests-network.ts:159 · frontend/src/core/network/requests-network.ts:263 — the two spans are one implementation copied and then locally edited — 341 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (48 matched lines × 2 locations) · ×1
Duplicated block with local edits (48 matched lines × 2 locations) frontend/src/components/editor/cell/CellStatus.tsx:60— frontend/src/components/editor/cell/CellStatus.tsx:60 · frontend/src/components/editor/cell/CellStatus.tsx:137 — the two spans are one implementation copied and then locally edited — 175 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (47 matched lines × 2 locations) · ×1
Duplicated block with local edits (47 matched lines × 2 locations) frontend/src/core/codemirror/go-to-definition/commands.ts:280— frontend/src/core/codemirror/go-to-definition/commands.ts:280 · frontend/src/core/codemirror/reactive-references/analyzer.ts:209 — the two spans are one implementation copied and then locally edited — 219 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (46 matched lines × 2 locations) · ×1
Duplicated block with local edits (46 matched lines × 2 locations) frontend/src/components/editor/actions/useConfigActions.tsx:39— frontend/src/components/editor/actions/useConfigActions.tsx:39 · frontend/src/components/editor/actions/useConfigActions.tsx:86 — the two spans are one implementation copied and then locally edited — 158 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.
Duplicated block (44 lines × 2 locations) frontend/src/components/ui/input.tsx:49— frontend/src/components/ui/input.tsx:49 · frontend/src/components/ui/textarea.tsx:24 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
R10 · Code Duplication· Duplicated block with local edits (38 matched lines × 2 locations) · ×1
Duplicated block with local edits (38 matched lines × 2 locations) frontend/src/plugins/impl/DatePickerPlugin.tsx:10— frontend/src/plugins/impl/DatePickerPlugin.tsx:10 · frontend/src/plugins/impl/DateTimePickerPlugin.tsx:10 — the two spans are one implementation copied and then locally edited — 234 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (36 matched lines × 2 locations) · ×1
Duplicated block with local edits (36 matched lines × 2 locations) frontend/src/components/editor/KernelStartupErrorModal.tsx:31— frontend/src/components/editor/KernelStartupErrorModal.tsx:31 · frontend/src/components/editor/errors/traceback-modal.tsx:37 — the two spans are one implementation copied and then locally edited — 154 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (35 matched lines × 2 locations) · ×1
Duplicated block with local edits (35 matched lines × 2 locations) frontend/src/components/data-table/range-focus/atoms.ts:103— frontend/src/components/data-table/range-focus/atoms.ts:103 · frontend/src/components/data-table/range-focus/atoms.ts:249 — the two spans are one implementation copied and then locally edited — 129 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.
Duplicated block (34 lines × 2 locations) frontend/src/core/codemirror/cells/debugger-decorations.ts:41— frontend/src/core/codemirror/cells/debugger-decorations.ts:41 · frontend/src/core/codemirror/cells/line-timing-decorations.ts:105 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication· Duplicated block with local edits (34 matched lines × 2 locations) · ×1
Duplicated block with local edits (34 matched lines × 2 locations) frontend/src/plugins/impl/RangeSliderPlugin.tsx:35— frontend/src/plugins/impl/RangeSliderPlugin.tsx:35 · frontend/src/plugins/impl/SliderPlugin.tsx:41 — the two spans are one implementation copied and then locally edited — 208 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block (33 lines × 2 locations) frontend/src/components/editor/chrome/wrapper/app-chrome.tsx:140— frontend/src/components/editor/chrome/wrapper/app-chrome.tsx:140 · frontend/src/components/editor/chrome/wrapper/sidebar.tsx:54 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (33 lines × 3 locations) frontend/src/components/ui/alert-dialog.tsx:64— frontend/src/components/ui/alert-dialog.tsx:64 · frontend/src/components/ui/dialog.tsx:89 · frontend/src/components/ui/sheet.tsx:78 — the 3 copies are spread across 3 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication· Duplicated block with local edits (32 matched lines × 2 locations) · ×1
Duplicated block with local edits (32 matched lines × 2 locations) frontend/src/components/editor/chrome/wrapper/footer-items/machine-stats.tsx:62— frontend/src/components/editor/chrome/wrapper/footer-items/machine-stats.tsx:62 · frontend/src/components/editor/chrome/wrapper/footer-items/machine-stats.tsx:146 — the two spans are one implementation copied and then locally edited — 172 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (29 matched lines × 2 locations) · ×1
Duplicated block with local edits (29 matched lines × 2 locations) frontend/src/components/app-config/user-config-form.tsx:209— frontend/src/components/app-config/user-config-form.tsx:209 · frontend/src/components/app-config/user-config-form.tsx:340 — the two spans are one implementation copied and then locally edited — 148 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.
Duplicated block (29 lines × 2 locations) frontend/src/components/ui/calendar.tsx:156— frontend/src/components/ui/calendar.tsx:156 · frontend/src/components/ui/calendar.tsx:192 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
R10 · Code Duplication· Duplicated block with local edits (27 matched lines × 2 locations) · ×1
Duplicated block with local edits (27 matched lines × 2 locations) frontend/src/core/codemirror/lsp/notebook-lsp.ts:518— frontend/src/core/codemirror/lsp/notebook-lsp.ts:518 · frontend/src/core/codemirror/lsp/notebook-lsp.ts:823 — the two spans are one implementation copied and then locally edited — 183 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.
Duplicated block (27 lines × 2 locations) frontend/src/core/packages/toast-components.tsx:82— frontend/src/core/packages/toast-components.tsx:82 · frontend/src/core/packages/toast-components.tsx:110 — both copies are in the same file, so extract the 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 (26 lines × 4 locations) frontend/src/components/app-config/user-config-form.tsx:637— frontend/src/components/app-config/user-config-form.tsx:637 · frontend/src/components/app-config/user-config-form.tsx:677 · frontend/src/components/app-config/user-config-form.tsx:717 · frontend/src/components/app-config/user-config-form.tsx:756 — 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.
Duplicated block (25 lines × 3 locations) frontend/src/components/app-config/data-form.tsx:119— frontend/src/components/app-config/data-form.tsx:119 · frontend/src/components/app-config/data-form.tsx:154 · frontend/src/components/app-config/user-config-form.tsx:375 — the 3 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
Duplicated block (22 lines × 2 locations) frontend/src/core/codemirror/language/embedded/latex.ts:131— frontend/src/core/codemirror/language/embedded/latex.ts:131 · frontend/src/core/codemirror/language/embedded/latex.ts:155 — 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.
Complex function collectDeclarations (cyclomatic 87, cognitive 171) frontend/src/core/codemirror/reactive-references/analyzer.ts:67— collectDeclarations has cyclomatic complexity 87 and cognitive complexity 171; 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.
Complex function (anonymous) (cyclomatic 63, cognitive 55) frontend/src/components/data-table/export-actions.tsx:756— (anonymous) has cyclomatic complexity 63 and cognitive complexity 55; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function handleNotification (cyclomatic 54, cognitive 17) frontend/src/core/session/useNotebookSession.tsx:127— handleNotification has cyclomatic complexity 54 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 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.
Complex function EditableCellComponent (cyclomatic 42, cognitive 32) frontend/src/components/editor/notebook-cell.tsx:399— EditableCellComponent has cyclomatic complexity 42 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 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.
Complex function collectMatchingDeclarations (cyclomatic 41, cognitive 56) frontend/src/core/codemirror/go-to-definition/commands.ts:210— collectMatchingDeclarations has cyclomatic complexity 41 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.
Complex function formatValue (cyclomatic 41, cognitive 26) frontend/src/components/data-table/filters/format.ts:19— formatValue has cyclomatic complexity 41 and cognitive complexity 26; 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.
Complex function filterToFilterCondition (cyclomatic 36, cognitive 13) frontend/src/components/data-table/filters/serialize.ts:18— filterToFilterCondition has cyclomatic complexity 36 and cognitive complexity 13; 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.
Complex function ConnectionNotice (cyclomatic 35, cognitive 28) frontend/src/components/editor/alerts/connection-notice.tsx:20— ConnectionNotice has cyclomatic complexity 35 and cognitive complexity 28; 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.
Complex function renderZodSchema (cyclomatic 33, cognitive 43) frontend/src/components/forms/form.tsx:91— renderZodSchema has cyclomatic complexity 33 and cognitive complexity 43; 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.
Complex function renderMessages (cyclomatic 32, cognitive 32) frontend/src/components/editor/output/MarimoErrorOutput.tsx:232— renderMessages has cyclomatic complexity 32 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.
Complex function parseSQLStatement (cyclomatic 31, cognitive 58) packages/smart-cells/src/parsers/sql-parser.ts:173— parseSQLStatement has cyclomatic complexity 31 and cognitive complexity 58; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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.
Complex function apply (cyclomatic 30, cognitive 53) frontend/src/core/notebook/document/__tests__/test-host.ts:71— apply has cyclomatic complexity 30 and cognitive complexity 53; 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.
Complex function applyFormat (cyclomatic 30, cognitive 17) frontend/src/components/data-table/column-formatting/feature.ts:146— applyFormat has cyclomatic complexity 30 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 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.
Complex function (anonymous) (cyclomatic 30, cognitive 9) frontend/src/components/editor/Output.tsx:78— (anonymous) has cyclomatic complexity 30 and cognitive complexity 9; 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.
Complex function renderCellValue (cyclomatic 29, cognitive 37) frontend/src/components/data-table/columns.tsx:612— renderCellValue has cyclomatic complexity 29 and cognitive complexity 37; 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.
Complex function getTooltips (cyclomatic 28, cognitive 36) frontend/src/components/data-table/charts/chart-spec/tooltips.ts:31— getTooltips has cyclomatic complexity 28 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.
Complex function Chatbot (cyclomatic 28, cognitive 21) frontend/src/plugins/impl/chat/chat-ui.tsx:141— Chatbot has cyclomatic complexity 28 and cognitive complexity 21; 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.
Complex function (anonymous) (cyclomatic 27, cognitive 43) frontend/src/plugins/impl/data-editor/glide-utils.ts:137— (anonymous) has cyclomatic complexity 27 and cognitive complexity 43; 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.
Complex function RevealSlidesComponent (cyclomatic 27, cognitive 26) frontend/src/components/slides/reveal-component.tsx:472— RevealSlidesComponent has cyclomatic complexity 27 and cognitive complexity 26; 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.
Complex function FileViewer (cyclomatic 27, cognitive 24) frontend/src/components/editor/file-tree/file-viewer.tsx:42— FileViewer has cyclomatic complexity 27 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.
Complex function Node (cyclomatic 27, cognitive 18) frontend/src/components/editor/file-tree/file-explorer.tsx:690— Node has cyclomatic complexity 27 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 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.
Complex function generateAltairChart (cyclomatic 26, cognitive 43) frontend/src/components/data-table/charts/chart-spec/altair-generator.ts:16— generateAltairChart has cyclomatic complexity 26 and cognitive complexity 43; 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.
Complex function startApps (cyclomatic 26, cognitive 41) frontend/src/core/islands/bridge.ts:195— startApps has cyclomatic complexity 26 and cognitive complexity 41; 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.
Complex function handleTreeKeyDown (cyclomatic 26, cognitive 31) frontend/src/components/editor/file-tree/file-explorer.tsx:247— handleTreeKeyDown has cyclomatic complexity 26 and cognitive complexity 31; 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.
Complex function CellStatusComponent (cyclomatic 26, cognitive 27) frontend/src/components/editor/cell/CellStatus.tsx:36— CellStatusComponent has cyclomatic complexity 26 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.
Complex function (anonymous) (cyclomatic 25, cognitive 38) frontend/src/plugins/impl/matplotlib/matplotlib-renderer.ts:723— (anonymous) has cyclomatic complexity 25 and cognitive complexity 38; 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.
Complex function (anonymous) (cyclomatic 25, cognitive 35) frontend/src/core/network/connection-notice.ts:22— (anonymous) has cyclomatic complexity 25 and cognitive complexity 35; 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.
Complex function getStringContent (cyclomatic 25, cognitive 35) packages/smart-cells/src/utils/python-ast.ts:113— getStringContent has cyclomatic complexity 25 and cognitive complexity 35; 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.
Complex function (anonymous) (cyclomatic 25, cognitive 24) frontend/src/components/data-table/data-table.tsx:137— (anonymous) 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.
Complex function parsePayloadBackedApps (cyclomatic 24, cognitive 44) frontend/src/core/islands/parse.ts:161— parsePayloadBackedApps has cyclomatic complexity 24 and cognitive complexity 44; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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.
Complex function (anonymous) (cyclomatic 24, cognitive 20) frontend/src/plugins/impl/SliderPlugin.tsx:156— (anonymous) has cyclomatic complexity 24 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 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.
Complex function applyEditorEdits (cyclomatic 23, cognitive 36) frontend/src/plugins/impl/data-editor/editor-state.ts:19— applyEditorEdits has cyclomatic complexity 23 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.
Complex function FeedbackModal (cyclomatic 23, cognitive 21) frontend/src/components/editor/chrome/components/feedback-button.tsx:109— FeedbackModal has cyclomatic complexity 23 and cognitive complexity 21; 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.
Complex function operationsModule (cyclomatic 22, cognitive 45) packages/client/scripts/generate-protocol.ts:67— operationsModule has cyclomatic complexity 22 and cognitive complexity 45; 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.
Complex function (anonymous) (cyclomatic 22, cognitive 27) frontend/src/core/cells/runs.ts:46— (anonymous) has cyclomatic complexity 22 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.
Complex function getPrefixLength (cyclomatic 22, cognitive 21) packages/smart-cells/src/utils/python-ast.ts:173— getPrefixLength has cyclomatic complexity 22 and cognitive complexity 21; 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.
Complex function AiCompletionEditor (cyclomatic 22, cognitive 19) frontend/src/components/editor/ai/ai-completion-editor.tsx:85— AiCompletionEditor has cyclomatic complexity 22 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 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.
Complex function mergeModels (cyclomatic 21, cognitive 37) packages/llm-info/src/sources/merge.ts:277— mergeModels has cyclomatic complexity 21 and cognitive complexity 37; 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.
Complex function (anonymous) (cyclomatic 21, cognitive 20) frontend/src/stories/runtime-story.tsx:226— (anonymous) has cyclomatic complexity 21 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 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.
Complex function PackageAlert (cyclomatic 21, cognitive 19) frontend/src/components/editor/package-alert.tsx:106— PackageAlert has cyclomatic complexity 21 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 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.
R3 · Large Files· frontend/src/components/app-config/ai-config.tsx · ×1
frontend/src/components/app-config/ai-config.tsx: 1940 lines of code frontend/src/components/app-config/ai-config.tsx:1— frontend/src/components/app-config/ai-config.tsx has 1940 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· frontend/src/components/app-config/user-config-form.tsx · ×1
frontend/src/components/app-config/user-config-form.tsx: 1335 lines of code frontend/src/components/app-config/user-config-form.tsx:1— frontend/src/components/app-config/user-config-form.tsx has 1335 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· frontend/src/components/editor/notebook-cell.tsx · ×1
frontend/src/components/editor/notebook-cell.tsx: 1242 lines of code frontend/src/components/editor/notebook-cell.tsx:1— frontend/src/components/editor/notebook-cell.tsx has 1242 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· frontend/src/plugins/impl/DataTablePlugin.tsx · ×1
frontend/src/plugins/impl/DataTablePlugin.tsx: 1196 lines of code frontend/src/plugins/impl/DataTablePlugin.tsx:1— frontend/src/plugins/impl/DataTablePlugin.tsx has 1196 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· frontend/src/components/chat/acp/agent-panel.tsx · ×1
frontend/src/components/chat/acp/agent-panel.tsx: 1187 lines of code frontend/src/components/chat/acp/agent-panel.tsx:1— frontend/src/components/chat/acp/agent-panel.tsx has 1187 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· frontend/src/components/data-table/export-actions.tsx · ×1
frontend/src/components/data-table/export-actions.tsx: 1147 lines of code frontend/src/components/data-table/export-actions.tsx:1— frontend/src/components/data-table/export-actions.tsx has 1147 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· frontend/src/components/editor/file-tree/file-explorer.tsx · ×1
frontend/src/components/editor/file-tree/file-explorer.tsx: 1055 lines of code frontend/src/components/editor/file-tree/file-explorer.tsx:1— frontend/src/components/editor/file-tree/file-explorer.tsx has 1055 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· frontend/src/components/storage/storage-inspector.tsx · ×1
frontend/src/components/storage/storage-inspector.tsx: 1046 lines of code frontend/src/components/storage/storage-inspector.tsx:1— frontend/src/components/storage/storage-inspector.tsx has 1046 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· frontend/src/components/datasources/datasources.tsx · ×1
frontend/src/components/datasources/datasources.tsx: 1017 lines of code frontend/src/components/datasources/datasources.tsx:1— frontend/src/components/datasources/datasources.tsx has 1017 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· frontend/src/components/chat/chat-panel.tsx · ×1
frontend/src/components/chat/chat-panel.tsx: 981 lines of code frontend/src/components/chat/chat-panel.tsx:1— frontend/src/components/chat/chat-panel.tsx has 981 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· scripts/generate-design-md.ts · ×1
scripts/generate-design-md.ts: 947 lines of code scripts/generate-design-md.ts:1— scripts/generate-design-md.ts has 947 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· frontend/src/components/editor/connections/database/as-code.ts · ×1
frontend/src/components/editor/connections/database/as-code.ts: 931 lines of code frontend/src/components/editor/connections/database/as-code.ts:1— frontend/src/components/editor/connections/database/as-code.ts has 931 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· frontend/src/components/slides/reveal-component.tsx · ×1
frontend/src/components/slides/reveal-component.tsx: 931 lines of code frontend/src/components/slides/reveal-component.tsx:1— frontend/src/components/slides/reveal-component.tsx has 931 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· frontend/src/core/codemirror/lsp/notebook-lsp.ts · ×1
frontend/src/core/codemirror/lsp/notebook-lsp.ts: 921 lines of code frontend/src/core/codemirror/lsp/notebook-lsp.ts:1— frontend/src/core/codemirror/lsp/notebook-lsp.ts has 921 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· frontend/src/plugins/impl/chat/chat-ui.tsx · ×1
frontend/src/plugins/impl/chat/chat-ui.tsx: 879 lines of code frontend/src/plugins/impl/chat/chat-ui.tsx:1— frontend/src/plugins/impl/chat/chat-ui.tsx has 879 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· frontend/src/components/data-table/charts/components/form-fields.tsx · ×1
frontend/src/components/data-table/charts/components/form-fields.tsx: 832 lines of code frontend/src/components/data-table/charts/components/form-fields.tsx:1— frontend/src/components/data-table/charts/components/form-fields.tsx has 832 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· frontend/src/components/forms/form.tsx · ×1
frontend/src/components/forms/form.tsx: 823 lines of code frontend/src/components/forms/form.tsx:1— frontend/src/components/forms/form.tsx has 823 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· frontend/src/components/data-table/column-summary/chart-spec-model.tsx · ×1
frontend/src/components/data-table/column-summary/chart-spec-model.tsx: 801 lines of code frontend/src/components/data-table/column-summary/chart-spec-model.tsx:1— frontend/src/components/data-table/column-summary/chart-spec-model.tsx has 801 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· frontend/src/plugins/impl/matplotlib/matplotlib-renderer.ts · ×1
frontend/src/plugins/impl/matplotlib/matplotlib-renderer.ts: 778 lines of code frontend/src/plugins/impl/matplotlib/matplotlib-renderer.ts:1— frontend/src/plugins/impl/matplotlib/matplotlib-renderer.ts has 778 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· frontend/src/components/data-table/columns.tsx · ×1
frontend/src/components/data-table/columns.tsx: 767 lines of code frontend/src/components/data-table/columns.tsx:1— frontend/src/components/data-table/columns.tsx has 767 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· frontend/src/components/slides/minimap.tsx · ×1
frontend/src/components/slides/minimap.tsx: 763 lines of code frontend/src/components/slides/minimap.tsx:1— frontend/src/components/slides/minimap.tsx has 763 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· frontend/src/components/editor/navigation/navigation.ts · ×1
frontend/src/components/editor/navigation/navigation.ts: 756 lines of code frontend/src/components/editor/navigation/navigation.ts:1— frontend/src/components/editor/navigation/navigation.ts has 756 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· frontend/src/components/editor/output/MarimoErrorOutput.tsx · ×1
frontend/src/components/editor/output/MarimoErrorOutput.tsx: 745 lines of code frontend/src/components/editor/output/MarimoErrorOutput.tsx:1— frontend/src/components/editor/output/MarimoErrorOutput.tsx has 745 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· frontend/src/core/wasm/bridge.ts · ×1
frontend/src/core/wasm/bridge.ts: 744 lines of code frontend/src/core/wasm/bridge.ts:1— frontend/src/core/wasm/bridge.ts has 744 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· frontend/src/components/editor/package-alert.tsx · ×1
frontend/src/components/editor/package-alert.tsx: 734 lines of code frontend/src/components/editor/package-alert.tsx:1— frontend/src/components/editor/package-alert.tsx has 734 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· frontend/src/components/chat/acp/blocks.tsx · ×1
frontend/src/components/chat/acp/blocks.tsx: 722 lines of code frontend/src/components/chat/acp/blocks.tsx:1— frontend/src/components/chat/acp/blocks.tsx has 722 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· frontend/src/components/editor/actions/useNotebookActions.tsx · ×1
frontend/src/components/editor/actions/useNotebookActions.tsx: 719 lines of code frontend/src/components/editor/actions/useNotebookActions.tsx:1— frontend/src/components/editor/actions/useNotebookActions.tsx has 719 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· frontend/src/core/codemirror/language/languages/sql/sql.ts · ×1
frontend/src/core/codemirror/language/languages/sql/sql.ts: 686 lines of code frontend/src/core/codemirror/language/languages/sql/sql.ts:1— frontend/src/core/codemirror/language/languages/sql/sql.ts has 686 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· frontend/src/components/data-table/filter-pill-editor.tsx · ×1
frontend/src/components/data-table/filter-pill-editor.tsx: 671 lines of code frontend/src/components/data-table/filter-pill-editor.tsx:1— frontend/src/components/data-table/filter-pill-editor.tsx has 671 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· frontend/src/components/pages/home-page.tsx · ×1
frontend/src/components/pages/home-page.tsx: 660 lines of code frontend/src/components/pages/home-page.tsx:1— frontend/src/components/pages/home-page.tsx has 660 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· frontend/src/core/cells/actions.ts · ×1
frontend/src/core/cells/actions.ts: 658 lines of code frontend/src/core/cells/actions.ts:1— frontend/src/core/cells/actions.ts has 658 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· frontend/src/components/editor/renderers/grid-layout/grid-layout.tsx · ×1
frontend/src/components/editor/renderers/grid-layout/grid-layout.tsx: 654 lines of code frontend/src/components/editor/renderers/grid-layout/grid-layout.tsx:1— frontend/src/components/editor/renderers/grid-layout/grid-layout.tsx has 654 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· frontend/src/components/editor/chrome/panels/packages-panel.tsx · ×1
frontend/src/components/editor/chrome/panels/packages-panel.tsx: 634 lines of code frontend/src/components/editor/chrome/panels/packages-panel.tsx:1— frontend/src/components/editor/chrome/panels/packages-panel.tsx has 634 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· frontend/src/core/cells/cells.ts · ×1
frontend/src/core/cells/cells.ts: 618 lines of code frontend/src/core/cells/cells.ts:1— frontend/src/core/cells/cells.ts has 618 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· frontend/src/components/editor/chrome/wrapper/app-chrome.tsx · ×1
frontend/src/components/editor/chrome/wrapper/app-chrome.tsx: 598 lines of code frontend/src/components/editor/chrome/wrapper/app-chrome.tsx:1— frontend/src/components/editor/chrome/wrapper/app-chrome.tsx has 598 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· frontend/src/plugins/core/registerReactComponent.tsx · ×1
frontend/src/plugins/core/registerReactComponent.tsx: 596 lines of code frontend/src/plugins/core/registerReactComponent.tsx:1— frontend/src/plugins/core/registerReactComponent.tsx has 596 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· frontend/src/core/hotkeys/hotkeys.ts · ×1
frontend/src/core/hotkeys/hotkeys.ts: 591 lines of code frontend/src/core/hotkeys/hotkeys.ts:1— frontend/src/core/hotkeys/hotkeys.ts has 591 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· frontend/src/plugins/impl/FileBrowserPlugin.tsx · ×1
frontend/src/plugins/impl/FileBrowserPlugin.tsx: 591 lines of code frontend/src/plugins/impl/FileBrowserPlugin.tsx:1— frontend/src/plugins/impl/FileBrowserPlugin.tsx has 591 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· frontend/src/core/codemirror/language/languages/sql/renderers.tsx · ×1
frontend/src/core/codemirror/language/languages/sql/renderers.tsx: 586 lines of code frontend/src/core/codemirror/language/languages/sql/renderers.tsx:1— frontend/src/core/codemirror/language/languages/sql/renderers.tsx has 586 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· frontend/src/components/data-table/charts/charts.tsx · ×1
frontend/src/components/data-table/charts/charts.tsx: 569 lines of code frontend/src/components/data-table/charts/charts.tsx:1— frontend/src/components/data-table/charts/charts.tsx has 569 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
Dead file (~345 LoC) frontend/lint/marimo-plugin.js— no import path from any entry point (1874 application, 22 tooling, 736 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~5 LoC) packages/smart-cells/src/parsers/index.ts— no import path from any entry point (1874 application, 22 tooling, 736 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Unused dependency '@typescript/native-preview' package.json:14— Declared in the root package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
Unused dependency '@lezer/lr' frontend/package.json:53— Declared in frontend/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
Unused dependency 'htm' frontend/package.json:104— Declared in frontend/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
Unused dependency 'js-cookie' frontend/package.json:111— Declared in frontend/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
Unused dependency 'react-markdown' frontend/package.json:132— Declared in frontend/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
Unused dependency 'remark-gfm' frontend/package.json:139— Declared in frontend/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
Unused dependency 'vscode-jsonrpc' frontend/package.json:158— Declared in frontend/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
Unused dependency 'yaml' packages/client/package.json:33— Declared in packages/client/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
Third-party script without Subresource Integrity frontend/islands/__demo__/index.html:11— `https://cdn.jsdelivr.net/npm/@marimo-team/islands@0.13.14/dist/main.js` is executed by this page with no Subresource Integrity. Whoever can answer that request — the CDN, anyone who compromises it, anyone on the network path — runs arbitrary script in this page's origin, with its session. 3 such include(s) across the repository's markup.
redundant comment frontend/e2e-tests/helper.ts:146— "Take screenshot of code" repeats the code it sits on: 3 of its 3 words (take, screenshot, code) are already in `await takeScreenshot(exportPage, `code-${exportPath}`);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment frontend/src/__tests__/chat-history.test.ts:45— "Check Today group" repeats the code it sits on: 3 of its 3 words (check, today, group) are already in `const todayGroup = result.find((g) => g.label === "Today");`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment frontend/src/__tests__/chat-history.test.ts:50— "Check Yesterday group" repeats the code it sits on: 3 of its 3 words (check, yesterday, group) are already in `const yesterdayGroup = result.find((g) => g.label === "Yesterday");`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment frontend/src/__tests__/chat-history.test.ts:55— "Check 2d ago group" repeats the code it sits on: 3 of its 3 words (check, ago, group) are already in `const twoDaysGroup = result.find((g) => g.label === "2d ago");`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment frontend/src/__tests__/chat-history.test.ts:60— "Check 3d ago group" repeats the code it sits on: 3 of its 3 words (check, ago, group) are already in `const threeDaysGroup = result.find((g) => g.label === "3d ago");`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment frontend/src/__tests__/mount.test.ts:15— "Mock React DOM" repeats the code it sits on: 3 of its 3 words (mock, react, dom) are already in `vi.mock("react-dom/client", () => ({`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment frontend/src/__tests__/mount.test.ts:22— "Mock static state" repeats the code it sits on: 3 of its 3 words (mock, static, state) are already in `vi.mock("@/core/static/static-state", () => ({`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment frontend/src/__tests__/mount.test.ts:46— "Mock preloadPage" repeats the code it sits on: 3 of its 3 words (mock, preload, page) are already in `vi.mock("@/core/MarimoApp", () => ({`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment frontend/src/components/chat/acp/agent-panel.tsx:1081— "Call agent.setSessionModel to notify the agent" repeats the code it sits on: 5 of its 6 words (call, agent, set, session, model) are already in `void agent.setSessionModel?.({`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment frontend/src/components/chat/acp/types.ts:44— "Session notification events" repeats the code it sits on: 3 of its 3 words (session, notification, events) are already in `export type SessionNotificationEventData =`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment frontend/src/components/chat/chat-utils.ts:116— "Invoke the frontend tool" repeats the code it sits on: 3 of its 3 words (invoke, frontend, tool) are already in `const response = await FRONTEND_TOOL_REGISTRY.invoke({`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment frontend/src/components/data-table/__tests__/chart-spec-model.test.ts:13— "Mock the runtime config" repeats the code it sits on: 3 of its 3 words (mock, runtime, config) are already in `vi.mock("@/core/runtime/config", () => ({`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment frontend/src/components/data-table/charts/chart-spec/tooltips.ts:107— "Selected tooltips from the form." repeats the code it sits on: 3 of its 3 words (selected, tooltips, form) are already in `const selectedTooltips = formValues.tooltips.fields ?? [];`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment frontend/src/components/data-table/column-formatting/feature.ts:75— "apply column formatting" repeats the code it sits on: 3 of its 3 words (apply, column, formatting) are already in `column.applyColumnFormatting = (value) =>`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment frontend/src/components/data-table/column-summary/chart-spec-model.tsx:708— "Calculate xStart and xEnd for each value count" repeats the code it sits on: 4 of its 5 words (start, end, value, count) are already in `const newValueCounts: {`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment frontend/src/components/data-table/range-focus/__tests__/atoms.test.ts:445— "Set text selection" repeats the code it sits on: 3 of its 3 words (set, text, selection) are already in `window.getSelection = vi.fn().mockReturnValue({`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment frontend/src/components/debugger/__tests__/debugger-code.test.tsx:17— "Mock useInputHistory hook" repeats the code it sits on: 5 of its 5 words (mock, use, input, history, hook) are already in `vi.mock("@/hooks/useInputHistory");`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment frontend/src/components/editor/Output.tsx:280— "Filter out metadata from the mime entries and type narrow" repeats the code it sits on: 5 of its 6 words (filter, metadata, mime, entries, type) are already in `const rawEntries = Objects.entries(mimebundle as Record<string, unknown>)`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment frontend/src/components/editor/SortableCell.tsx:30— "Slot for drag handle" repeats the code it sits on: 3 of its 3 words (slot, drag, handle) are already in `return use(DragHandleSlot);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment frontend/src/components/editor/__tests__/dynamic-favicon.test.tsx:51— "Mock document.hasFocus" repeats the code it sits on: 3 of its 3 words (mock, document, focus) are already in `vi.spyOn(document, "hasFocus").mockReturnValue(true);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment frontend/src/components/editor/cell/code/cell-editor.tsx:271— "Set the language adapter" repeats the code it sits on: 3 of its 3 words (set, language, adapter) are already in `setLanguageAdapter(languageAdapter.type);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment frontend/src/components/editor/cell/code/cell-editor.tsx:330— "Create a new editor" repeats the code it sits on: 3 of its 3 words (create, new, editor) are already in `const ev = new EditorView({`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment frontend/src/components/editor/chrome/wrapper/footer-items/runtime-settings.tsx:75— "Check if all reactivity is disabled" repeats the code it sits on: 3 of its 3 words (check, reactivity, disabled) are already in `const allReactivityDisabled =`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment frontend/src/components/editor/header/__tests__/filename-form.test.tsx:60— "Setup: updateFilename resolves with the new filename" repeats the code it sits on: 4 of its 5 words (update, filename, resolves, new) are already in `mockUpdateFilename.mockResolvedValue("/path/to/new-file.py");`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
redundant comment frontend/src/components/editor/navigation/__tests__/navigation.test.ts:193— "Set the request client in the store" repeats the code it sits on: 4 of its 4 words (set, request, client, store) are already in `store.set(requestClientAtom, mockRequestClient);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
Mock-dominated test: tells subscribers why it stopped, unless they left or closed it packages/client/src/__tests__/notebook-events.test.ts:413— This test sets up 4 test doubles (for example `vi.fn`) against 3 real object(s) of its own, and its only verification is 4 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: owns each registration of a shared error callback packages/client/src/__tests__/notebook-events.test.ts:458— This test sets up 4 test doubles (for example `vi.fn`) against 2 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: honors unsubscribe during terminal %s delivery packages/client/src/__tests__/notebook-events.test.ts:472— This test sets up 5 test doubles (for example `vi.fn`) against 2 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: reports a throwing error callback and still notifies other subscribers packages/client/src/__tests__/notebook-events.test.ts:499— This test sets up 4 test doubles (for example `vi.fn`) against 3 real object(s) of its own, and its only verification is 3 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: decodes raw data before stop and delivery, retaining text on parse errors packages/client/src/__tests__/notebook-events.test.ts:661— This test sets up 3 test doubles (for example `vi.fn`) against 1 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: uses image/png on Safari frontend/src/utils/__tests__/copy.test.ts:103— This test sets up 4 test doubles (for example `vi.spyOn`) against 2 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: should use prepare function when provided frontend/src/utils/__tests__/download.test.tsx:409— This test sets up 3 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: should show error toast if element not found frontend/src/utils/__tests__/download.test.tsx:509— This test sets up 3 test doubles (for example `vi.mock/jest.mock of an imported module`) against 0 real object(s) of its own, and its only verification is 3 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: preserves the page origin for hosted CDN workers frontend/src/utils/__tests__/worker.test.ts:36— This test sets up 3 test doubles (for example `vi.fn`) against 1 real object(s) of its own, and its only verification is 3 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: detaches the previous model's listener on each rerun (no buildup) frontend/src/plugins/impl/mpl-interactive/__tests__/MplInteractivePlugin.test.tsx:271— This test sets up 6 test doubles (for example `vi.spyOn`) against 0 real object(s) of its own, and its only verification is 6 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: should handle clipboard read error frontend/src/plugins/impl/data-editor/__tests__/glide-utils.test.ts:451— This test sets up 3 test doubles (for example `vi.fn`) against 1 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: records the spec from an open message frontend/src/plugins/impl/anywidget/__tests__/registry.test.ts:398— This test sets up 3 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: destroys the generation on a close message frontend/src/plugins/impl/anywidget/__tests__/registry.test.ts:508— This test sets up 4 test doubles (for example `vi.fn`) against 1 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: emits custom messages arriving before getWidget resolves frontend/src/plugins/impl/anywidget/__tests__/registry.test.ts:839— This test sets up 4 test doubles (for example `vi.fn`) against 2 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: should auto-clear initialize listeners on destroy frontend/src/plugins/impl/anywidget/__tests__/widget-binding.test.ts:597— This test sets up 3 test doubles (for example `vi.fn`) against 1 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: fire only for changes after mount, never for pre-existing state frontend/src/plugins/impl/anywidget/__tests__/widget-binding.test.ts:618— This test sets up 3 test doubles (for example `vi.fn`) against 2 real object(s) of its own, and its only verification is 4 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: clears inputs on submission when clearOnSubmit is true frontend/src/plugins/impl/__tests__/FormPlugin.test.tsx:80— This test sets up 3 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: preserves the base URL of a $name frontend/src/plugins/core/__test__/registerReactComponent.test.ts:44— This test sets up 4 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: should attach event listener to document frontend/src/hooks/__tests__/useEventListener.test.tsx:80— This test sets up 3 test doubles (for example `vi.fn`) against 1 real object(s) of its own, and its only verification is 3 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: should call observe when ref is provided frontend/src/hooks/__tests__/useResizeObserver.test.tsx:16— This test sets up 3 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: should not call observe when ref is not provided frontend/src/hooks/__tests__/useResizeObserver.test.tsx:33— This test sets up 3 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: should not call observe when skipped frontend/src/hooks/__tests__/useResizeObserver.test.tsx:50— This test sets up 3 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: disconnect should be called once unmounted frontend/src/hooks/__tests__/useResizeObserver.test.tsx:68— This test sets up 3 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: accepts parent paste with text %j frontend/src/core/vscode/__tests__/vscode-bindings.test.ts:84— This test sets up 3 test doubles (for example `a double assigned in a shared setup`) against 0 real object(s) of its own, and its only verification is 3 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Mock-dominated test: ignores malformed parent messages without errors: %j frontend/src/core/vscode/__tests__/vscode-bindings.test.ts:105— This test sets up 3 test doubles (for example `a double assigned in a shared setup`) against 0 real object(s) of its own, and its only verification is 3 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
Duplicated predicate frontend/src/plugins/impl/RangeSliderPlugin.tsx:127— `!fullWidth && "data-[orientation=horizontal]:w-36 "` appears character-identically in 2 files — frontend/src/plugins/impl/RangeSliderPlugin.tsx, frontend/src/plugins/impl/SliderPlugin.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate frontend/src/components/editor/cell/cell-actions.tsx:143— `action.hotkey && renderMinimalShortcut(action.hotkey)` appears character-identically in 2 files — frontend/src/components/editor/cell/cell-actions.tsx, frontend/src/components/editor/cell/cell-context-menu.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate frontend/src/components/chat/chat-panel.tsx:269— `ai?.models?.chat_model || DEFAULT_AI_MODEL` appears character-identically in 2 files — frontend/src/components/chat/chat-panel.tsx, frontend/src/components/editor/chrome/wrapper/footer-items/ai-status.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate frontend/src/components/data-table/range-focus/use-cell-range-selection.ts:58— `e.defaultPrevented || isInteractiveTarget(e)` appears character-identically in 2 files — frontend/src/components/data-table/range-focus/use-cell-range-selection.ts, frontend/src/components/data-table/row-viewer-panel/row-viewer.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate frontend/src/plugins/impl/DataEditorPlugin.tsx:152— `error.message || "An unknown error occurred"` appears character-identically in 2 files — frontend/src/plugins/impl/DataEditorPlugin.tsx, frontend/src/plugins/impl/DataTablePlugin.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate frontend/src/components/editor/output/json-output/renderers.tsx:35— `event.key === "Enter" || event.key === " "` appears character-identically in 2 files — frontend/src/components/editor/output/json-output/renderers.tsx, frontend/src/core/codemirror/code-lens/extension.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate frontend/src/components/editor/actions/export-dialog/state.ts:264— `format === "script" && options.script.type === "source"` appears character-identically in 2 files — frontend/src/components/editor/actions/export-dialog/state.ts, frontend/src/components/editor/actions/export-dialog/use-export-dialog.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate REDACTED:147— `href.startsWith("http://") || href.startsWith("https://")` appears character-identically in 2 files — REDACTED, frontend/src/utils/urls.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate frontend/src/components/chat/chat-markdown.tsx:12— `mode !== "agent" && mode !== "code_mode"` appears character-identically in 2 files — frontend/src/components/chat/chat-markdown.tsx, frontend/src/components/editor/chrome/wrapper/useAskAiAboutCell.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate frontend/src/plugins/impl/RangeSliderPlugin.tsx:118— `orientation === "vertical" && "items-end inline-flex justify-center self-center mx-2"` appears character-identically in 2 files — frontend/src/plugins/impl/RangeSliderPlugin.tsx, frontend/src/plugins/impl/SliderPlugin.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate frontend/src/components/editor/alerts/stdin-blocking-alert.tsx:22— `output.channel === "stdin" && output.response === undefined` appears character-identically in 2 files — frontend/src/components/editor/alerts/stdin-blocking-alert.tsx, frontend/src/components/editor/stdin-blocking-alert.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate frontend/src/components/editor/cell/code/cell-editor.tsx:145— `pendingDeleteService.idle && userConfig.keymap.destructive_delete` appears character-identically in 2 files — frontend/src/components/editor/cell/code/cell-editor.tsx, frontend/src/components/editor/navigation/multi-cell-action-toolbar.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate frontend/src/plugins/impl/TextAreaPlugin.tsx:83— `props.minLength != null && props.minLength > 0` appears character-identically in 2 files — frontend/src/plugins/impl/TextAreaPlugin.tsx, frontend/src/plugins/impl/TextInputPlugin.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate packages/llm-info/src/sources/merge.ts:288— `providerFilter && !providerFilter.has(provider)` appears character-identically in 2 files — packages/llm-info/src/sources/merge.ts, packages/llm-info/src/sync-models.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate frontend/src/components/data-table/row-viewer-panel/row-viewer.tsx:83— `rowIdx < 0 || (typeof totalRows === "number" && rowIdx >= totalRows)` appears character-identically in 2 files — frontend/src/components/data-table/row-viewer-panel/row-viewer.tsx, frontend/src/plugins/impl/DataTablePlugin.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate frontend/src/components/data-table/TableBottomBar.tsx:100— `selection === "single-cell" || selection === "multi-cell"` appears character-identically in 2 files — frontend/src/components/data-table/TableBottomBar.tsx, frontend/src/components/data-table/data-table.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate frontend/src/core/codemirror/copilot/copilot-config.tsx:311— `status === "SignedIn" || status === "AlreadySignedIn" || status === "OK"` appears character-identically in 2 files — frontend/src/core/codemirror/copilot/copilot-config.tsx, frontend/src/core/codemirror/copilot/language-server.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate frontend/src/components/editor/cell/DeleteButton.tsx:22— `status === "running" || status === "queued"` appears character-identically in 6 files — frontend/src/components/editor/cell/DeleteButton.tsx, frontend/src/components/editor/cell/RunButton.tsx, frontend/src/components/editor/cell/code/cell-editor.tsx, frontend/src/components/editor/navigation/navigation.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate frontend/src/components/chat/use-chat-generation.ts:9— `status === "submitted" || status === "streaming"` appears character-identically in 3 files — frontend/src/components/chat/use-chat-generation.ts, frontend/src/components/editor/ai/ai-completion-editor.tsx, frontend/src/plugins/impl/chat/chat-ui.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate frontend/src/plugins/impl/DictPlugin.tsx:54— `target === null || !(target instanceof Node)` appears character-identically in 2 files — frontend/src/plugins/impl/DictPlugin.tsx, frontend/src/plugins/impl/FormPlugin.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate frontend/src/components/editor/errors/traceback-modal.tsx:35— `tempDiv.textContent || tempDiv.innerText || ""` appears character-identically in 2 files — frontend/src/components/editor/errors/traceback-modal.tsx, frontend/src/utils/dom.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate frontend/src/components/data-table/column-summary/chart-spec-model.tsx:437— `typeof value === "number" && Number.isFinite(value)` appears character-identically in 3 files — frontend/src/components/data-table/column-summary/chart-spec-model.tsx, frontend/src/plugins/impl/data-editor/column-types.ts, frontend/src/plugins/impl/plotly/selection.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate frontend/src/plugins/impl/data-editor/column-types.ts:48— `typeof value === "number" || typeof value === "bigint"` appears character-identically in 2 files — frontend/src/plugins/impl/data-editor/column-types.ts, frontend/src/utils/numbers.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate frontend/src/components/chat/tool-call/tool-labels.ts:171— `typeof value === "object" && value !== null` appears character-identically in 4 files — frontend/src/components/chat/tool-call/tool-labels.ts, frontend/src/components/data-table/utils.ts, frontend/src/core/ai/context/utils.ts, frontend/src/plugins/impl/panel/utils.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate frontend/src/components/editor/chrome/panels/dependency-graph-panel.tsx:31— `value === "minimap" || value === "graph"` appears character-identically in 2 files — frontend/src/components/editor/chrome/panels/dependency-graph-panel.tsx, frontend/src/components/editor/chrome/wrapper/app-chrome.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Orphaned file marimo/_ai/_tools/tools/cells.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 frontend/src/components/icons/marimo-icons.tsx:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file frontend/src/core/codemirror/lsp/normalize-markdown-math.ts:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file marimo/_ai/_tools/tools/dependency_graph.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 marimo/_smoke_tests/issues/1033.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 marimo/_session/kernel_exit.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 frontend/src/components/sort/SortableCellsProvider.tsx:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file frontend/src/plugins/impl/plotly/Plot.tsx:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file marimo/_ai/_tools/tools/lint.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 marimo/_smoke_tests/sql/ibis_backend_catalog.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 marimo/_smoke_tests/ibis_formatting.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 frontend/src/components/data-table/cell-selection/feature.ts:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file frontend/src/hooks/useInputHistory.ts:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file marimo/_mcp/server/exceptions.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 marimo/_ai/_tools/utils/output_cleaning.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 frontend/src/core/codemirror/keymaps/vimrc.ts:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file marimo/_smoke_tests/dropdowns.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 frontend/src/components/editor/errors/traceback-modal.tsx:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file marimo/_mcp/server/_prompts/prompts/errors.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.
Silent fallback default in catch marimo/_ast/cell.py:264— `_get_sqls` 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 marimo/_code_mode/screenshot.py:384— `_list_cell_ids` 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 marimo/_config/packages.py:67— `infer_package_manager` swallows every exception into `return 'pip'` — 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 marimo/_messaging/variables.py:189— `_stringify_variable_value` swallows every exception into `return '<UNKNOWN>'` — 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 marimo/_plugins/ui/_impl/tables/narwhals_table.py:931— `get_sample_values` 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:591— `_duckdb_catalog_names` 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 marimo/_runtime/callbacks/packages.py:74— `_notebook_index_urls` 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 marimo/_runtime/complete.py:288— `_get_type_hint` 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 marimo/_runtime/runtime.py:493— `_get_attached_catalogs` swallows every exception into `return set()` — 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 marimo/_smoke_tests/issues/846.py:45— `get_config` (in `_`) swallows every exception into `return 'none'` — 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 marimo/_templates.py:265— `opengraph_metadata_template` 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 marimo/_utils/diagnostics.py:75— `get_default_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 frontend/e2e-tests/global-teardown.ts:37— `getCommand` 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 frontend/src/core/cells/logs.ts:179— `formatLogTimestamp` 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 frontend/src/components/tracing/utils.ts:19— `formatChartTime` 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 frontend/src/utils/json/json-parser.ts:67— `jsonParseWithSpecialChar` 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.
P2 · Observability· Console output used as the logging channel · ×11
Console output used as the logging channel frontend/src/utils/tracer.ts:93— `frontend/src/utils/tracer.ts` reports through `console.*` at line 93 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel frontend/src/core/islands/bridge.ts:58— `frontend/src/core/islands/bridge.ts` reports through `console.*` at line 58 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel frontend/src/core/cells/logs.ts:159— `frontend/src/core/cells/logs.ts` reports through `console.*` at line 159 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel frontend/e2e-tests/global-teardown.ts:86— `frontend/e2e-tests/global-teardown.ts` reports through `console.*` at line 86 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel frontend/e2e-tests/global-teardown.ts:91— `frontend/e2e-tests/global-teardown.ts` reports through `console.*` at line 91 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel frontend/e2e-tests/global-teardown.ts:96— `frontend/e2e-tests/global-teardown.ts` reports through `console.*` at line 96 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel frontend/e2e-tests/global-teardown.ts:98— `frontend/e2e-tests/global-teardown.ts` reports through `console.*` at line 98 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/llm-info/src/simple_logger.ts:28— `packages/llm-info/src/simple_logger.ts` reports through `console.*` at line 28 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/llm-info/src/simple_logger.ts:31— `packages/llm-info/src/simple_logger.ts` reports through `console.*` at line 31 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/llm-info/src/simple_logger.ts:34— `packages/llm-info/src/simple_logger.ts` reports through `console.*` at line 34 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Console output used as the logging channel packages/llm-info/src/simple_logger.ts:37— `packages/llm-info/src/simple_logger.ts` reports through `console.*` at line 37 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
Interpolated log message defeats structured logging marimo/_loggers.py:171— `debug` at line 171 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 marimo/_server/asgi.py:114— `debug` at line 114 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 marimo/_server/asgi.py:135— `debug` at line 135 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 marimo/_server/asgi.py:246— `debug` at line 246 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 marimo/_server/asgi.py:263— `debug` at line 263 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 marimo/_server/asgi.py:269— `debug` at line 269 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 marimo/_server/asgi.py:276— `debug` at line 276 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 marimo/_server/asgi.py:301— `debug` at line 301 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 marimo/_server/asgi.py:324— `debug` at line 324 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 marimo/_server/asgi.py:339— `debug` at line 339 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 marimo/_server/asgi.py:343— `debug` at line 343 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.
Silent fallback default on parse failure marimo/_ast/sql_visitor.py:551— `find_sql_refs` returns `set()` when `ParseError` 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 marimo/_environments/sandbox.py:576— `_declared_dependencies` 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 marimo/_output/formatters/flax_formatters.py:97— `_param_leaves` 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 marimo/_runtime/packages/conda_package_manager.py:66— `list_packages` returns `[]` when `(subprocess.CalledProcessError, 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 marimo/_runtime/packages/pypi_package_manager.py:133— `_list_packages_from_cmd` returns `[]` when `json.JSONDecodeError` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default on parse failure REDACTED:320— `extract_marimo_style_arguments` (in `patch_jedi_parameter_completion`) 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 REDACTED:349— `extract_docstring_to_markdown_arguments` (in `patch_jedi_parameter_completion`) 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 marimo/_server/ai/config.py:393— `_get_tools` 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 marimo/_server/api/endpoints/health.py:595— `_amd_smi_bytes` 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 marimo/_sql/engines/dbapi.py:38— `dialect` returns `'sql'` when `AttributeError` 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· Pending state with no failure state · ×7
Pending state with no failure state frontend/src/core/islands/components/output-wrapper.tsx:124— The view draws `<DelayRender>` under `status === "running"`, but `status` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
Pending state with no failure state frontend/src/components/editor/chrome/wrapper/footer-items/backend-status.tsx:101— The view draws `<Spinner size="small"/>` under `isFetching || isAppConnecting ( connection )`, but `isFetching` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
Pending state with no failure state frontend/src/components/editor/chrome/wrapper/footer-items/lsp-status.tsx:91— The view draws `<Spinner size="small"/>` under `isFetching`, but `isFetching` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
Pending state with no failure state frontend/src/components/editor/chrome/panels/cache-panel.tsx:55— The view draws `<Spinner size="medium" centered= />` under `isPending && ! cacheInfo`, but `isPending` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
Pending state with no failure state frontend/src/components/editor/chrome/panels/cache-panel.tsx:61— The view draws `<Spinner size="small" class="w-4 h-4 mr-2"/>` under `isFetching`, but `isFetching` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
Pending state with no failure state frontend/src/components/editor/chrome/panels/cache-panel.tsx:188— The view draws `<Spinner size="small" class="w-3 h-3 mr-2"/>` under `purging`, but `purging` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
Pending state with no failure state frontend/src/components/editor/actions/export-dialog/export-dialog.tsx:192— The view draws `<Spinner size="small" class="mr-2" aria-hidden= />` under `isExporting`, but `isExporting` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 48 significant file(s) lose their only recent owner: marimo/_save/cache_dirs.py, marimo/_server/host/bridge.py, marimo/_core/executions.py, marimo/_environments/script_metadata.py, marimo/_server/host/translate.py, marimo/_environments/backends.py, marimo/_server/host/backend.py, marimo/_save/signing.py (+40 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 35 significant file(s) lose their only recent owner: frontend/src/components/storage/storage-inspector.tsx, marimo/_smoke_tests/sql/catalog_children.py, frontend/src/components/slides/slide-form.tsx, scripts/check_ai_sdk_compatibility.py, packages/llm-info/src/sync-models.ts, marimo/_smoke_tests/sql/duckdb_discovery.py, frontend/src/components/data-table/charts/components/chart-items.tsx, marimo/_sql/parse.py (+27 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #3 — If anonymized user #3 becomes unavailable, 15 significant file(s) lose their only recent owner: frontend/src/plugins/impl/vega/make-selectable.ts, frontend/src/core/codemirror/copilot/language-server.ts, frontend/src/core/lsp/transport.ts, marimo/_smoke_tests/custom_server/my_server.py, frontend/src/components/editor/controls/command-palette.tsx, marimo/_runtime/runner/hooks.py, frontend/src/plugins/impl/plotly/usePlotlyLayout.ts, frontend/src/__mocks__/common.ts (+7 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #4 — If anonymized user #4 becomes unavailable, 10 significant file(s) lose their only recent owner: marimo/_plugins/ui/_impl/tables/geometry_export.py, frontend/src/components/data-table/filter-pill-editor.tsx, marimo/_smoke_tests/tables/whitespace_sentinel_rendering.py, marimo/_plugins/ui/_impl/tables/geometry.py, frontend/src/components/ui/use-toast.ts, marimo/_messaging/notebook/reconcile.py, frontend/src/core/diagnostics/issue-details.ts, frontend/src/components/data-table/hooks/use-column-visibility.ts (+2 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #5 — If anonymized user #5 becomes unavailable, 5 significant file(s) lose their only recent owner: marimo/_export/offline.py, frontend/src/components/editor/actions/export-dialog/state.ts, marimo/_runtime/_wasm/_duckdb/sources.py, frontend/src/components/editor/actions/export-dialog/format-notice.tsx, marimo/_export/dependencies.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 · ×5
Diagnostic log message is built whether or not it is wanted REDACTED:473— `debug` at line 473 is called with an argument built by `"…".join(cmd)` (line 473), 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 REDACTED:179— `debug` at line 179 is called with an argument built by `"…".join(cmd)` (line 179), 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 marimo/_ast/load.py:147— `debug` at line 147 is called with an argument built by `"…".join(map(repr, notebook.violations))` (line 149), 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 frontend/src/utils/maps.ts:25— `trace` at line 25 is called with an argument built by `join(", ")` (line 25), whose cost grows with the collection it walks. JavaScript 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 trace is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch.
Diagnostic log message is built whether or not it is wanted frontend/src/core/islands/bridge.ts:198— `debug` at line 198 is called with an argument built by `apps.map((a) => `${ a.id } (${ a.cells.length } cells)`)` (line 200), whose cost grows with the collection it walks. JavaScript 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 `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch.
Fat interface: EditRequests (64 required operations) frontend/src/core/network/types.ts:157— `EditRequests` declares 64 required operations: `sendRename`, `saveLayout`, `sendCopy`, `sendRunScratchpad`, `sendShutdown`, `sendFormat`, `sendCodeCompletionRequest`, `saveUserConfig`, `saveAppConfig`, `sendRestart`, `sendInstallMissingPackages`, `readCode`, `readSnippets`, `previewDatasetColumn`, `previewSQLTable`, `previewSQLTableList`, `previewSQLSchemaList`, `previewDataSourceConnection`, `discoverDataSources`, `validateSQL`, `openFile`, `getUsageStats`, `getEnvironmentInfo`, `sendPdb`, `sendSetBreakpoints`, `getFileRoots`, `sendListFiles`, `sendSearchFiles`, `sendCreateFileOrFolder`, `sendDeleteFileOrFolder`, `sendCopyFileOrFolder`, `sendRenameFileOrFolder`, `sendUpdateFile`, `sendFileDetails`, `openTutorial`, `getRecentFiles`, `getWorkspaceFiles`, `getRunningNotebooks`, `shutdownSession`, `getExportAvailability`, and 24 more. Counted over its REQUIRED operations — a method signature or a function-typed property with no `?`, once per signature; optional members and data properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
Fat interface: RawBridge (25 required operations) frontend/src/core/wasm/worker/types.ts:73— `RawBridge` declares 25 required operations: `put_control_request`, `code_complete`, `read_code`, `read_snippets`, `get_environment_info`, `format`, `copy`, `save_app_config`, `save_user_config`, `rename_file`, `list_files`, `file_roots`, `search_files`, `file_details`, `create_file_or_directory`, `delete_file_or_directory`, `copy_file_or_directory`, `move_file_or_directory`, `update_file`, `load_packages`, `read_file`, `set_interrupt_buffer`, `export_html`, `export_markdown`, `export_script`. Counted over its REQUIRED operations — a method signature or a function-typed property with no `?`, once per signature; optional members and data properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
Fat interface: TableManager (22 abstract methods) marimo/_plugins/ui/_impl/tables/table_manager.py:70— `TableManager` declares 22 abstract methods: `apply_formatting`, `supports_filters`, `sort_values`, `to_csv_str`, `to_json_str`, `to_parquet`, `select_rows`, `select_columns`, `select_cells`, `drop_columns`, `get_row_headers`, `get_field_type`, `take`, `search`, `get_stats`, `get_bin_values`, `get_num_rows`, `get_num_columns`, `get_column_names`, `get_unique_column_values`, `get_sample_values`, `calculate_top_k_rows`. Counted over its `@abstractmethod`s (and abstract properties), once per name; concrete methods are helpers an implementer inherits, not a burden, and `_`-prefixed members are not counted. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
Fat interface: Session (18 protocol members) marimo/_session/types.py:132— `Session` declares 18 protocol members: `stable_id`, `notebook_sandbox`, `document`, `kernel_state`, `kernel_pid`, `kernel_exit_info`, `try_interrupt`, `rename_path`, `put_control_request`, `reply_input`, `disconnect_consumer`, `disconnect_main_consumer`, `connect_consumer`, `connection_state`, `notify`, `instantiate`, `scoped`, `close`. Counted over its public methods and properties, once per name — a `typing.Protocol` is satisfied structurally, so every one of them is an operation each implementer must provide and each consumer depends on; `_`-prefixed members, static methods and data attributes are not counted, and an `@overload` family is one operation. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
Hand-rolled JSON/XML parsing via regex marimo/_output/md_extensions/display_math.py:36— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Python code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex marimo/_convert/ipynb/to_ir.py:52— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Python code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex frontend/src/core/codemirror/lsp/normalize-markdown-math.ts:147— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×2
Projects may be oversized for their cohesion package.json:1— `(repository root)` (222092 LoC, 3033 module-visible types across 222 directories) overshoots its size bounds. 2 of 11 build unit(s) (Python, npm) overshoot their size bounds, lowering Project Cohesion to 6.4/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 frontend/package.json:1— `frontend` (164284 LoC, 1616 module-visible types across 206 directories) overshoots its size bounds. 2 of 11 build unit(s) (Python, npm) overshoot their size bounds, lowering Project Cohesion to 6.4/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.
D16 · Bus Factor· Further sole-owners (lower concentration) · ×1
Further sole-owners (lower concentration) — 2 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 (116 single-owned of 1280 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; 1280 of the 2630 production source files in this repository met that bar). They are anonymized user #6 (2 file(s)), anonymized user #7 (1 file(s)) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: marimo/_cli/config/utils.py, marimo/_config/resolver.py, frontend/src/core/codemirror/language/embedded/embedded-python.ts.
Documentation: no build, run or usage example packages/smart-cells/README.md:1— `smart-cells` is a published package (`package.json` without `"private": true`) and neither `packages/smart-cells/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
No ADRs found REDACTED:78— 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 78).
D21 · Naming Consistency· `do_GET` spells `GET` where 639 names in the project spell it `get` · ×1
`do_GET` spells `GET` where 639 names in the project spell it `get` marimo/_export/_html_asset_server.py:17— 639 of 640 names in project marimo spell the token `get` (639 of 640; unit: names in project marimo containing `get`). Peers: mlx_chat._(get_model_path) (examples/ai/chat/mlx_chat.py:102); pydantic-ai-chat.get_model (examples/ai/chat/pydantic-ai-chat.py:96); simplemind_example._(get_logs) (examples/ai/chat/simplemind_example.py:99); data_labeler._(get_index) (examples/ai/data/data_labeler.py:47); model_comparison._(get_index) (examples/ai/data/model_comparison.py:49). Rename to `do_get`. [rule N6]
D21 · Naming Consistency· `do_OPTIONS` spells `OPTIONS` where 56 names in the project spell it `options` · ×1
`do_OPTIONS` spells `OPTIONS` where 56 names in the project spell it `options` pyodide/build_and_serve.py:29— 56 of 57 names in project marimo spell the token `options` (56 of 57; unit: names in project marimo containing `options`). Peers: filterable_table._(cylinder_options) (examples/misc/filterable_table.py:41); filterable_table._(manufacturer_options) (examples/misc/filterable_table.py:41); app._(component_options) (examples/third_party/cvxpy/signals/app.py:63); text-to-image._(example_options) (examples/third_party/huggingface/text-to-image.py:153); surfaces._(function_options) (examples/third_party/matplotlib/surfaces.py:105). Rename to `do_options`. [rule N6]
D21 · Naming Consistency· `groupFileTypesByMIMEType` spells `MIME` where 13 names in the project spell it `Mime` · ×1
`groupFileTypesByMIMEType` spells `MIME` where 13 names in the project spell it `Mime` frontend/src/plugins/impl/FileUploadPlugin.tsx:72— 13 of 14 names in project repository spell the token `Mime` (13 of 14; unit: names in project repository containing `Mime`). Peers: mime-cell.isMimeValue (frontend/src/components/data-table/mime-cell.tsx:31); mime-cell.getMimeValues (frontend/src/components/data-table/mime-cell.tsx:40); renderers.isMediaMime (frontend/src/components/editor/file-tree/renderers.tsx:23); renderers.tryRenderMimeLeaf (frontend/src/components/editor/output/json-output/renderers.tsx:81); renderMimeIcon.renderMimeIcon (frontend/src/components/editor/renderMimeIcon.tsx:2). Rename to `groupFileTypesByMimeType`. [rule N6]
D34 · Knowledge Freshness· Orphaned files with no living knowledge · ×1
Orphaned files with no living knowledge — 19 of 1280 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; 1280 of the 2630 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: marimo/_ai/_tools/tools/cells.py, frontend/src/components/icons/marimo-icons.tsx, frontend/src/core/codemirror/lsp/normalize-markdown-math.ts, marimo/_ai/_tools/tools/dependency_graph.py, marimo/_smoke_tests/issues/1033.py, marimo/_session/kernel_exit.py, frontend/src/components/sort/SortableCellsProvider.tsx, frontend/src/plugins/impl/plotly/Plot.tsx (and 11 more). Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
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.
README/code drift docs/guides/deploying/deploying_kubernetes.md:16— docs/guides/deploying/deploying_kubernetes.md names Python 3.9 or later, but REDACTED:5 requires `requires-python = ">=3.11"` (the lowest of 2 declarations): the package does not install on Python 3.9. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
Logging is not universal — Only 5/6 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `docs`.
No SAST .github/workflows/cla.yml:5— 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 32 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.
No changelog — No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)
R7 · Dead Code· Unused export 'isTripleQuote' · ×1
Unused export 'isTripleQuote' packages/smart-cells/src/utils/quote-parser.ts:30— Nothing ultimately consumes this binding: its only referrer is the re-export in packages/smart-cells/src/utils/index.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in packages/smart-cells/src/utils/index.ts in the same commit, or the barrel will import a name that no longer exists.
R7 · Dead Code· Unused export 'getClosingQuote' · ×1
Unused export 'getClosingQuote' packages/smart-cells/src/utils/quote-parser.ts:37— Nothing ultimately consumes this binding: its only referrer is the re-export in packages/smart-cells/src/utils/index.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in packages/smart-cells/src/utils/index.ts in the same commit, or the barrel will import a name that no longer exists.
Unused export 'escapeQuotes' packages/smart-cells/src/utils/string-escaper.ts:12— Nothing ultimately consumes this binding: its only referrer is the re-export in packages/smart-cells/src/utils/index.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in packages/smart-cells/src/utils/index.ts in the same commit, or the barrel will import a name that no longer exists.
R7 · Dead Code· Unused module-local declaration 'DataTableColumnHeaderProps' · ×1
Unused module-local declaration 'DataTableColumnHeaderProps' frontend/src/components/data-table/column-header.tsx:30— This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code· Unused module-local declaration 'Props' · ×1
Unused module-local declaration 'Props' frontend/src/components/data-table/filter-by-values-picker.tsx:32— This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R7 · Dead Code· Unused module-local declaration 'ValueSlotProps' · ×1
Unused module-local declaration 'ValueSlotProps' frontend/src/components/data-table/filter-pill-editor.tsx:367— This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
R8 · Dependency Hygiene· Type-only dependency '@anywidget/types' in production deps · ×1
Type-only dependency '@anywidget/types' in production deps frontend/src/plugins/impl/anywidget/__tests__/widget-binding.test.ts:4— Every import is type-only — move it to devDependencies.
R8 · Dependency Hygiene· Type-only dependency '@zed-industries/agent-client-protocol' in production deps · ×1
Type-only dependency '@zed-industries/agent-client-protocol' in production deps frontend/src/components/chat/acp/agent-panel.tsx:46— Every import is type-only — move it to devDependencies.
R8 · Dependency Hygiene· Type-only dependency 'dnd-core' in production deps · ×1
Type-only dependency 'dnd-core' in production deps frontend/src/components/editor/file-tree/dnd-wrapper.tsx:3— Every import is type-only — move it to devDependencies.
R8 · Dependency Hygiene· Type-only dependency '@lezer/common' in production deps · ×1
Type-only dependency '@lezer/common' in production deps packages/smart-cells/src/__tests__/python-ast.test.ts:3— Every import is type-only — move it to devDependencies.
R8 · Dependency Hygiene· Test-only dependency 'vega-parser' in production deps · ×1
Test-only dependency 'vega-parser' in production deps frontend/package.json:156— Only test files import it (first: frontend/src/plugins/impl/vega/__tests__/make-selectable.test.ts:4) — move it to devDependencies.
No security response headers detected docs/vercel.json:1— None of the 11 security response headers the OWASP Secure Headers Project recommends (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options, …) is configured — defense in depth, even when a reverse proxy could set them. This is reported because `vercel.json` configures this repository's static hosting, including its response headers, so the configuration that would carry these headers is in this repository and was read in full. (−2.0 on this card.)
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 5/12 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.
Null assertions (`!`) override strict null checking — ~0.1 `!` null assertions per 1k TypeScript source lines — 13 assertion(s) across the 179837 source line(s) of the 1204 TypeScript file(s) read, which is the only code the operator asserts anything in (a `!` in a `.js` file is not this operator and was not counted, and one in a file whose null checking is off silences nothing). Densest: frontend/src/core/wasm/worker/bootstrap.ts (4), frontend/src/utils/Deferred.ts (2), frontend/src/core/codemirror/facet.ts (1). Each one tells the compiler to trust the author about null, suppressing the very diagnostic `strictNullChecks` exists to produce. Many are correct: each is a claim the checker could not verify, and it is wrong only where the value can in fact be missing, so review the densest places first.
Skipped (documented): returns true for contentEditable frontend/src/utils/__tests__/events.test.ts:182— Skipped with a documented reason — a deferral, not lazy debt: declared test.fails — the body is expected to fail, so its failure is not reported
Skipped (documented): should handle arrow files frontend/src/plugins/impl/vega/__tests__/vega.test.ts:510— Skipped with a documented reason — a deferral, not lazy debt: declared it.fails — the body is expected to fail, so its failure is not reported
Skipped (documented): should extract ArrayBuffer and replace with id frontend/src/plugins/impl/panel/__tests__/utils.test.ts:23— Skipped with a documented reason — a deferral, not lazy debt: declared it.fails — the body is expected to fail, so its failure is not reported
Skipped (documented): should handle nested objects and arrays frontend/src/plugins/impl/panel/__tests__/utils.test.ts:34— Skipped with a documented reason — a deferral, not lazy debt: declared it.fails — the body is expected to fail, so its failure is not reported
Skipped (documented): should handle Map objects frontend/src/plugins/impl/panel/__tests__/utils.test.ts:54— Skipped with a documented reason — a deferral, not lazy debt: declared it.fails — the body is expected to fail, so its failure is not reported
Skipped (documented): handles markdown with variables frontend/src/core/codemirror/language/__tests__/utils.test.ts:336— Skipped with a documented reason — a deferral, not lazy debt: declared it.fails — the body is expected to fail, so its failure is not reported
Skipped (documented): prevents event propagation on link clicks frontend/src/components/data-table/__tests__/url-detector.test.tsx:102— Skipped with a documented reason — a deferral, not lazy debt: declared it.fails — the body is expected to fail, so its failure is not reported
Skipped (documented): returns true for bold text frontend/src/components/data-table/__tests__/url-detector.test.tsx:124— Skipped with a documented reason — a deferral, not lazy debt: declared it.fails — the body is expected to fail, so its failure is not reported
Skipped (documented): returns true for italic text frontend/src/components/data-table/__tests__/url-detector.test.tsx:129— Skipped with a documented reason — a deferral, not lazy debt: declared it.fails — the body is expected to fail, so its failure is not reported
Skipped (documented): returns true for escaped characters frontend/src/components/data-table/__tests__/url-detector.test.tsx:172— Skipped with a documented reason — a deferral, not lazy debt: declared it.fails — the body is expected to fail, so its failure is not reported
Skipped (documented): returns true for mixed markdown and plain text frontend/src/components/data-table/__tests__/url-detector.test.tsx:195— Skipped with a documented reason — a deferral, not lazy debt: declared it.fails — the body is expected to fail, so its failure is not reported
Skipped (documented): returns true for markdown with URLs frontend/src/components/data-table/__tests__/url-detector.test.tsx:200— Skipped with a documented reason — a deferral, not lazy debt: declared it.fails — the body is expected to fail, so its failure is not reported
Outdated: python-jsonpath — `python-jsonpath` is pinned to 2.2.1, but 2.2.2 is the current stable release on PyPI. An exact pin never moves on its own, so this repository installs 2.2.1 until the declaration is edited.
doc comments repeat the names frontend/src/components/data-table/utils.ts:123— 5 of 175 documented parameters and 57 of 2125 summaries in `@marimo-team/frontend` only repeat the member or parameter name (e.g. "The current page index" for `currentPageIndex`). Delete the restating tags, or add what the name does not say.
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.
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 55 file(s) — `frontend/.storybook/main.ts`, `frontend/playwright.config.ts`, `frontend/scripts/check-ai-sdk-compatibility.ts`, `frontend/src/components/app-config/get-dirty-values.ts`, `frontend/src/components/chat/notebook-access-selector.stories.tsx`, … (+50 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.
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.
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.
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.
Run 01a1e9bf-1a1e-7e83-b63f-f1c0d60ff47b · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 91 · Warnings: 1981 · Recommendations: 349 · Info: 14 — Appendix A · all findings · full markdown report.
Generated by the Canine Code Analyzer: deterministic code-health analysis. 17-11-2026 @ 13:42 UTC.
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.